From 3076e0d148a606a39d474cc6c3502000e900b682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E8=BF=AA?= <2596750866@qq.com> Date: Thu, 5 Dec 2024 10:02:24 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E5=94=AE=E5=90=8E=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87=E5=88=97=E8=A1=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=90=9C=E7=B4=A2=E6=A0=8F=E5=AD=97=E6=AE=B5=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F=EF=BC=8C=E4=BF=AE=E6=94=B9=E8=A1=A8=E6=A0=BC=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=EF=BC=8C=E8=A1=A5=E5=85=85=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=BA=E5=BA=8F=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=88=97=E5=B1=85=E4=B8=AD=E6=A0=B7=E5=BC=8F=EF=BC=9B=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E8=BE=91=E5=87=BA=E8=B4=A7=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E9=A1=B5=E9=9D=A2=EF=BC=8C=E4=BF=AE=E6=94=B9=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E5=AD=97=E6=AE=B5=EF=BC=8C=E6=96=B0=E5=A2=9E=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=88=97=E8=A1=A8=E8=A1=A8=E6=A0=BC=E5=8F=8A=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=AF=BC=E5=85=A5=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=8F=8A=E5=AF=BC=E5=85=A5=E5=A4=84=E7=90=86=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=9B=20=E4=BF=AE=E6=94=B9=E5=87=BA=E8=B4=A7?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A1=A8=E5=8D=95=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=97=AE=E9=A2=98=E5=88=97=E8=A1=A8=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E6=98=BE=E7=A4=BA=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aftersales/shippingDevice/detail.html | 165 +++++++---- .../aftersales/shippingDevice/edit.html | 261 ++++++++++++++---- .../shippingDevice/shippingDevice.html | 173 +++++++----- 3 files changed, 428 insertions(+), 171 deletions(-) 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', }, {