diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/shippingDevice/detail.html b/ruoyi-admin/src/main/resources/templates/aftersales/shippingDevice/detail.html index 95e74f4f..280e5c7c 100644 --- a/ruoyi-admin/src/main/resources/templates/aftersales/shippingDevice/detail.html +++ b/ruoyi-admin/src/main/resources/templates/aftersales/shippingDevice/detail.html @@ -4,6 +4,24 @@ +
@@ -41,13 +59,20 @@
- +
- +
- +
@@ -75,7 +100,7 @@
- +
@@ -86,30 +111,6 @@
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
@@ -120,27 +121,50 @@
- +
- +
- + +
+
+
+ +
+
+ + +
+
+
+
+ +
+
+ + +
- +
- +
+
+
+
+
+
@@ -238,28 +262,59 @@ focusCleanup: true }); - function submitHandler() { - if ($.validate.form()) { - - // 获取表单数据 - const shippingDeviceData = $("#form-shippingDevice-edit").serializeArray(); - console.log(shippingDeviceData); - const customerData = $("#form-customer-edit").serializeArray(); - const makeOrderData= $("#form-makeOrderDto-edit").serializeArray(); - - const warehouseAndAfterSalesData= $("#form-warehouseAndAfterSalesDto-edit").serializeArray(); - - // 合并表单数据为一个 JSON 对象 - const combinedData = shippingDeviceData.concat(customerData, makeOrderData,warehouseAndAfterSalesData).reduce((acc, curr) => { - acc[curr.name] = curr.value; - return acc; - }, {}); - // 使用 JSON.stringify() 序列化数据 - const jsonData = JSON.stringify(combinedData); - // 发送 AJAX 请求到后端接口 - $.operate.saveJson(prefix + "/detail", jsonData); - } - } + $(function() { + var options = { + id: "bootstrap-processRecord-table", + url: prefix + "/showRecords", + importTemplateUrl: prefix + "/importTemplate", + modalName: "工序问题记录", + pagination: false, + showSearch: false, + showRefresh: false, + showToggle: false, + showColumns: false, + height: 40, + queryParams: { + shippingDeviceId: $("#shippingDeviceId").val(), + serialNo: $("#deviceRunningNumber").val() + }, + columns: [ + { + field: 'process', + title: '工序', + }, + { + field: 'abnormalTime', + title: '异常时间' + }, + { + field: 'questionDescribe', + title: '问题描述' + }, + { + field: 'solution', + title: '解决办法' + }, + { + field: 'resolveTime', + title: '解决时间' + }, + { + field: 'createBy', + title: '记录人' + }, + { + field: 'approveBy', + title: '审核人' + }, + { + field: 'remark', + title: '备注' + }, + ] + }; + $.table.init(options); + }); $("input[name='factoryDate']").datetimepicker({ format: "yyyy-mm-dd", diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/shippingDevice/edit.html b/ruoyi-admin/src/main/resources/templates/aftersales/shippingDevice/edit.html index d1f3c3fa..da451687 100644 --- a/ruoyi-admin/src/main/resources/templates/aftersales/shippingDevice/edit.html +++ b/ruoyi-admin/src/main/resources/templates/aftersales/shippingDevice/edit.html @@ -4,6 +4,24 @@ +
@@ -11,61 +29,68 @@
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
@@ -75,70 +100,75 @@
- +
- +
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- +
+
-

生产信息

+
+ 生产信息 + + 上传问题记录 + +

- + +
+
+
+ +
+ +
+
+
+ +
+
+ + +
- +
- +
+ + +
- +
- +
- + +
+
+
+
+
@@ -152,13 +182,13 @@
- +
- +
@@ -236,6 +266,60 @@ focusCleanup: true }); + $(function() { + var options = { + id: "bootstrap-processRecord-table", + url: prefix + "/showRecords", + importTemplateUrl: prefix + "/importTemplate", + modalName: "工序问题记录", + pagination: false, + showSearch: false, + showRefresh: false, + showToggle: false, + showColumns: false, + height: 40, + queryParams: { + shippingDeviceId: $("#shippingDeviceId").val(), + serialNo: $("#deviceRunningNumber").val() + }, + columns: [ + { + field: 'process', + title: '工序', + }, + { + field: 'abnormalTime', + title: '异常时间' + }, + { + field: 'questionDescribe', + title: '问题描述' + }, + { + field: 'solution', + title: '解决办法' + }, + { + field: 'resolveTime', + title: '解决时间' + }, + { + field: 'createBy', + title: '记录人' + }, + { + field: 'approveBy', + title: '审核人' + }, + { + field: 'remark', + title: '备注' + }, + ] + }; + $.table.init(options); + }); + function submitHandler() { if ($.validate.form()) { @@ -246,19 +330,81 @@ const makeOrderData= $("#form-makeOrderDto-edit").serializeArray(); const warehouseAndAfterSalesData= $("#form-warehouseAndAfterSalesDto-edit").serializeArray(); - - // 合并表单数据为一个 JSON 对象 const combinedData = shippingDeviceData.concat(customerData, makeOrderData,warehouseAndAfterSalesData).reduce((acc, curr) => { acc[curr.name] = curr.value; return acc; }, {}); - // 使用 JSON.stringify() 序列化数据 + + var processRecords = $("#bootstrap-processRecord-table").bootstrapTable('getData'); + combinedData.processIssueRecordList = processRecords; + const jsonData = JSON.stringify(combinedData); - // 发送 AJAX 请求到后端接口 $.operate.saveJson(prefix + "/edit", jsonData); } } + //导入问题记录 + function importProcessIssueRecord() { + table.set(); + layer.open({ + type: 1, + area: ['400px', '230px'], + fix: false, + // 不固定 + maxmin: true, + shade: 0.3, + title: '导入' + table.options.modalName + '数据', + content: $('#importTpl').html(), + btn: [' 导入', ' 取消'], + // 弹层外区域关闭 + shadeClose: true, + btn1: function(index, layero){ + var file = layero.find('#file').val(); + if (file == '' || (!$.common.endWith(file, '.xls') && !$.common.endWith(file, '.xlsx'))) { + $.modal.msgWarning("请选择后缀为 “xls”或“xlsx”的文件。"); + return false; + } + var index = layer.load(2, {shade: false}); + $.modal.disable(); + var formData = new FormData(layero.find('form')[0]); + + $.ajax({ + url: prefix + "/importRecords", + data: formData, + cache: false, + contentType: false, + processData: false, + type: 'POST', + success: function (result) { + $.modal.closeAll(); + var rowData = result.rows; + if(result.total <= 0){ + $.modal.alertWarning("导入问题记录文件解析为空,请检查!") + }else{ + updateProcessTable(rowData); + } + $.modal.enable(); + } + }); + } + }); + } + + function updateProcessTable(rowData){ + rowData.forEach(function (item){ + var newRow = { + process: item.process, + abnormalTime: item.abnormalTime, + questionDescribe: item.questionDescribe, + solution: item.solution, + resolveTime: item.resolveTime, + createBy: item.createBy, + approveBy: item.approveBy, + remark: item.remark, + } + $("#bootstrap-processRecord-table").bootstrapTable('append',newRow); + }) + } $("input[name='factoryDate']").datetimepicker({ format: "yyyy-mm-dd", minView: "month", @@ -290,4 +436,17 @@ }); + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/shippingDevice/shippingDevice.html b/ruoyi-admin/src/main/resources/templates/aftersales/shippingDevice/shippingDevice.html index 2b2624e3..fbdadd8e 100644 --- a/ruoyi-admin/src/main/resources/templates/aftersales/shippingDevice/shippingDevice.html +++ b/ruoyi-admin/src/main/resources/templates/aftersales/shippingDevice/shippingDevice.html @@ -42,30 +42,6 @@ -
  • - - - - - -
  • -
  • - - - - - -
  • -
  • - - - - - -
  • -
  • - - - - - -
  • - -
  • -
  • - - - - - -
  • - -
  • - -
  • +
  • + + + - + +
  • +
  • + + + - + +
  • +
  • + + + - + +
  • +
  • + + + - + +
  • +
  • + + + - + +
  •  搜索  重置 @@ -123,6 +123,7 @@ var guaranteePeriodFlagDatas = [[${@dict.getType('guarantee_period_flag')}]]; var lockDateFlagDatas = [[${@dict.getType('lock_date_flag')}]]; var wastageExpireFlagDatas = [[${@dict.getType('wastage_expire_flag')}]]; + var materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; var componentGuaranteeFlagDatas = [[${@dict.getType('component_guarantee_flag')}]]; var prefix = ctx + "aftersales/shippingDevice"; @@ -135,6 +136,8 @@ cancelUrl: prefix + "/cancel/{id}", restoreUrl: prefix + "/restore/{id}", exportUrl: prefix + "/export", + fixedColumns: true, // 启用冻结列 + fixedRightNumber: 1, // 冻结右列个数 modalName: "出货设备", columns: [{ checkbox: true @@ -147,100 +150,132 @@ { title: '出货设备ID', field: 'shippingDeviceId', + align: 'center', }, { title: '关联单号', + align: 'center', field: 'makeNo', }, { - title: '料号', - field: 'materialNo', + title: 'SN号', + align: 'center', + field: 'snCode', }, { - title: '图片', - field: 'materialPhotourl', + title: '料号', + align: 'center', + field: 'materialNo', }, { title: '物料名称', + align: 'center', field: 'materialName', }, + { + title: '图片', + align: 'center', + field: 'materialPhotourl', + }, { title: '物料类型', + align: 'center', field: 'materialType', + formatter: function(value, row, index) { + return $.table.selectCategoryLabel(materialTypeDatas, value); + } + }, + { + title: '型号', + align: 'center', + field: 'materialModelCode', }, - // { - // title: '物料类别', - // field: 'materialClass', - // }, - // { - // title: '物料型号', - // field: 'materialModelCode', - // }, { title: '单位', + align: 'center', field: 'materialUnit', }, { title: '品牌', + align: 'center', field: 'materialBrand', }, { title: '描述', + align: 'center', field: 'materialDescribe', }, { title: '设备型号', + align: 'center', field: 'deviceModelCode', }, { - title: '流水号', + title: '追踪码', + align: 'center', field: 'deviceRunningNumber', }, { - title: '生产图片', - field: 'makePhotourl', + title: '生产开始时间', + align: 'center', + field: 'startMakeTime', }, { - title: 'SN号', - field: 'snCode', + title: '生产结束时间', + align: 'center', + field: 'endMakeTime', }, + { + title: '生产图片', + align: 'center', + field: 'makePhotourl', + }, + { title: '售后图片', + align: 'center', field: 'aftersalesPhotourl', }, { title: '出厂日期', + align: 'center', field: 'factoryDate', }, { title: '保修期', + align: 'center', field: 'guaranteePeriod', }, { title: '是否过保修期', + align: 'center', field: 'guaranteePeriodFlag', formatter: function(value, row, index) { return $.table.selectDictLabel(guaranteePeriodFlagDatas, value); } }, { - title: '是否有锁机时间', - field: 'lockDateFlag', - formatter: function(value, row, index) { - return $.table.selectDictLabel(lockDateFlagDatas, value); + title: '是否有锁机时间', + align: 'center', + field: 'lockDateFlag', + formatter: function(value, row, index) { + return $.table.selectDictLabel(lockDateFlagDatas, value); } }, { title: '锁机时间', + align: 'center', field: 'lockDate', }, { title: '损耗品到期时间', + align: 'center', field: 'wastageExpireDate', }, { title: '是否过损耗品到期时间', + align: 'center', field: 'wastageExpireFlag', formatter: function(value, row, index) { return $.table.selectDictLabel(wastageExpireFlagDatas, value); @@ -248,25 +283,30 @@ }, { title: '二次维修后部件质保时间', + align: 'center', field: 'componentGuaranteeDate', }, { title: '是否过二次维修后部件质保日期', + align: 'center', field: 'componentGuaranteeFlag', formatter: function(value, row, index) { return $.table.selectDictLabel(componentGuaranteeFlagDatas, value); } }, - { - title: '客户ID', - field: 'customerId', - }, - { - title: '客户名称', - field: 'customerName', - }, + { + title: '客户ID', + align: 'center', + field: 'customerId', + }, + { + title: '客户名称', + align: 'center', + field: 'customerName', + }, { title: '工程员', + align: 'center', field: 'engineerName', }, // { @@ -283,14 +323,17 @@ // }, { title: '录入时间', + align: 'center', field: 'createTime', }, { title: '更新人', + align: 'center', field: 'updateBy', }, { title: '上次更新时间', + align: 'center', field: 'updateTime', }, {