diff --git a/js/car_demand_plan/arrival_confirm_list.js b/js/car_demand_plan/arrival_confirm_list.js index 0df60b8..e1c7e43 100644 --- a/js/car_demand_plan/arrival_confirm_list.js +++ b/js/car_demand_plan/arrival_confirm_list.js @@ -92,7 +92,7 @@ function initTable() { }, { field: "proName", - width: '12%', + width: '11%', title: "工程", unresize: true, align: "center", @@ -116,11 +116,10 @@ function initTable() { }, { field: "code", - width: '10%', + width: '8.5%', title: "需求计划编号", unresize: true, align: "center", - sort:true, templet: function (d) { return "" + d.code + ""; }, @@ -134,7 +133,7 @@ function initTable() { }, { field: "appLyTime", - width: '12%', + width: '10%', title: "申请时间", unresize: true, align: "center", @@ -142,10 +141,9 @@ function initTable() { }, { field: "remark", - width: '15%', + width: '10.5%', title: "备注", unresize: true, - sort:true, align: "center", templet: function (d) { if (d.remark) { @@ -161,7 +159,7 @@ function initTable() { }, { field: "statusName", - width: '7%', + width: '6%', title: "派车状态", unresize: true, align: "center", @@ -182,7 +180,6 @@ function initTable() { title: "派车日期", unresize: true, align: "center", - sort:true, }, { field: "auditStatus", @@ -194,16 +191,57 @@ function initTable() { return setIsUpload(d.fileNum); }, }, + { + field: "fileStatus", + width: '6%', + title: "状态", + unresize: true, + align: "center", + templet: function(d) { + let statusText = d.fileStatus; + let colorClass = ''; + + switch (statusText) { + case '待上传': + colorClass = 'layui-bg-red'; // 红色 + break; + case '待审核': + colorClass = 'layui-bg-orange'; // 橙色 + break; + case '审核通过': + colorClass = 'layui-bg-green'; // 绿色 + break; + case '审核驳回': + colorClass = 'layui-bg-red'; // 红色 + break; + default: + colorClass = 'layui-bg-gray'; // 默认灰色 + break; + } + + return `${statusText}`; + } + }, { title: "操作", - width: '8%', + width: '11.5%', align: "center", unresize: true, templet: function (d) { let html = ""; html += "详情"; - if(d.fileNum === 0){ + // if(d.fileNum === 0){ + // html += "
|
上传"; + // } else { + // html += "
|
审核"; + // } + if (d.fileStatus==='待上传'){ html += "
|
上传"; + } else if (d.fileStatus==='待审核'){ + html += "
|
审核"; + } else if (d.fileStatus==='审核驳回'){ + html += "
|
上传"; + html += "
|
提交审核"; } return html; }, @@ -230,8 +268,81 @@ function exportExcel() { exportExcelUtil(url, '到货确认单', JSON.stringify(params)); } +function toCheck(item) { + layer.confirm("确定要提交审核吗?", { 'title': '操作提示', move: false }, function () { + let loadingMsg = layer.msg('数据提交中,请稍候...', { icon: 16, scrollbar: false, time: 0 }); + let url = dataUrl + "backstage/supDispatchCar/toCheck" + let obj = { + id: item.id + }; + let params = { + encryptedData: JSON.stringify(obj) + } + ajaxRequest(url, "POST", params, true, function () { + }, function (result) { + layer.close(loadingMsg); // 关闭提示层 + if (result.code === 200) { + layer.msg(result.msg, { icon: 1 }) + initTable(); + } else { + layer.msg(result.msg, { icon: 2 }) + } + }, function (xhr) { + layer.close(loadingMsg); // 关闭提示层 + error(xhr) + }); + }) +} +function examine(item) { + // 创建自定义的 layer 弹窗 + const index = layer.confirm( + '请选择审核结果:', + { + title: '审核操作', + move: false, + btn: ['不通过', '通过'] // 按钮顺序:左 -> 不通过,右 -> 通过 + }, + function () { + // 点击 "不通过" 的回调函数(左侧按钮) + submitExamineStatus(item, 2); + }, + function () { + // 点击 "通过" 的回调函数(右侧按钮) + submitExamineStatus(item, 1); + } + ); +} + +// 提交审核状态的方法 +function submitExamineStatus(item, status) { + let loadingMsg = layer.msg('提交中,请稍候...', { icon: 16, scrollbar: false, time: 0 }); + let url = dataUrl + "backstage/supDispatchCar/examine"; // 假设这是你的审核接口 + let obj = { + id: item.id, + status: status // 1: 通过,0: 不通过 + }; + let params = { + encryptedData: JSON.stringify(obj) + }; + + ajaxRequest(url, "POST", params, true, function () { + // 请求开始 + }, function (result) { + layer.close(loadingMsg); // 关闭提示层 + if (result.code === 200) { + layer.msg(result.msg, { icon: 1 }); + initTable(); + } else { + layer.msg(result.msg, { icon: 2 }); + } + }, function (xhr) { + layer.close(loadingMsg); // 关闭提示层 + error(xhr); + }); +} + //审核状态 function setIsUpload(value) { if (value > 0) { diff --git a/js/car_demand_plan/child/arrival_confirm_detail.js b/js/car_demand_plan/child/arrival_confirm_detail.js index 952e5a2..0d9c943 100644 --- a/js/car_demand_plan/child/arrival_confirm_detail.js +++ b/js/car_demand_plan/child/arrival_confirm_detail.js @@ -105,8 +105,8 @@ function getDispatchCarData(id) { '下载'; // 如果是 "到货确认单",增加删除按钮 - if (item.type === '到货确认单') { - actions += '下载'; + if (item.type === '到货确认单' && item.status!=='1') { + actions += '删除'; } html += '' +