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 @@
});
+
+