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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 @@
+
-
生产信息
+
@@ -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 @@
});
+
+