From a27acfa8535dc1711c4a27d27e120365971fe4d1 Mon Sep 17 00:00:00 2001 From: hayu <1604366271@qq.com> Date: Tue, 15 Jul 2025 18:14:12 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/car_demand_plan/arrival_confirm_list.js | 44 ++++++++++----- .../child/arrival_confirm_detail.js | 54 +++++++++++++++---- js/openIframe.js | 3 ++ .../car_demand_plan/arrival_confirm_list.html | 2 +- 4 files changed, 81 insertions(+), 22 deletions(-) diff --git a/js/car_demand_plan/arrival_confirm_list.js b/js/car_demand_plan/arrival_confirm_list.js index 7a97d39..0df60b8 100644 --- a/js/car_demand_plan/arrival_confirm_list.js +++ b/js/car_demand_plan/arrival_confirm_list.js @@ -83,13 +83,37 @@ function initTable() { cols: [ [ { - width: '5.9%', + width: '4%', title: "序号", align: "center", templet: function (d) { return d.LAY_NUM; }, }, + { + field: "proName", + width: '12%', + title: "工程", + unresize: true, + align: "center", + }, + { + field: "type", + width: '4%', + title: "类型", + unresize: true, + align: "center", + templet: function (d) { + if (d.type===1){ + return "车辆"; + } else if (d.type===2) { + return "吊车"; + } else { + return ""; + } + + }, + }, { field: "code", width: '10%', @@ -103,15 +127,14 @@ function initTable() { }, { field: "userName", - width: '10%', + width: '7.1%', title: "申请人", unresize: true, align: "center", - sort:true, }, { field: "appLyTime", - width: '10%', + width: '12%', title: "申请时间", unresize: true, align: "center", @@ -138,9 +161,8 @@ function initTable() { }, { field: "statusName", - width: '10%', + width: '7%', title: "派车状态", - sort:true, unresize: true, align: "center", templet: function (d) { @@ -149,15 +171,14 @@ function initTable() { }, { field: "dispatchNum", - width: '10%', + width: '6%', title: "派车数量", unresize: true, align: "center", - sort:true, }, { field: "outTime", - width: '10%', + width: '8%', title: "派车日期", unresize: true, align: "center", @@ -165,10 +186,9 @@ function initTable() { }, { field: "auditStatus", - width: '10%', + width: '7%', title: "到货确认单", unresize: true, - sort:true, align: "center", templet: function (d) { return setIsUpload(d.fileNum); @@ -176,7 +196,7 @@ function initTable() { }, { title: "操作", - width: '9%', + width: '8%', align: "center", unresize: true, templet: function (d) { diff --git a/js/car_demand_plan/child/arrival_confirm_detail.js b/js/car_demand_plan/child/arrival_confirm_detail.js index 47345e4..952e5a2 100644 --- a/js/car_demand_plan/child/arrival_confirm_detail.js +++ b/js/car_demand_plan/child/arrival_confirm_detail.js @@ -100,22 +100,30 @@ function getDispatchCarData(id) { let html = ''; if (fileList && fileList.length > 0) { $.each(fileList, function (index, item) { + // 构建操作列 + let actions = '预览' + + '下载'; + + // 如果是 "到货确认单",增加删除按钮 + if (item.type === '到货确认单') { + actions += '下载'; + } + html += '' + '' + handleFileType(item.fileName) + item.fileName + '' + - '' + (item.type) + '' + - '' + item.createName + '' + + '' + item.type + '' + + ' ' + item.createName + '' + '' + item.createTime + '' + - '预览' + - '下载' + - '' + + '' + actions + '' + ''; - }) + }); } else { html = '暂无数据'; } - $('#file-table tbody').after(html); + $('#file-table tbody').html(html); } + // 处理文件类型 function handleFileType(value) { value = value.toLowerCase(); @@ -257,6 +265,33 @@ function downLoadFile(obj) { downLoadFileUtil(url, obj.fileName, null); } +function deleteFile(item) { + layer.confirm("确定要删除文件吗?", { 'title': '操作提示', move: false }, function () { + let loadingMsg = layer.msg('数据删除中,请稍候...', { icon: 16, scrollbar: false, time: 0 }); + let url = dataUrl + "backstage/supDispatchCar/deleteFile" + let obj = { + 'delFileId': 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 }) + getDispatchCarListData(objParam.id); + getDispatchCarData(objParam.id); + } else { + layer.msg(result.msg, { icon: 2 }) + } + }, function (xhr) { + layer.close(loadingMsg); // 关闭提示层 + error(xhr) + }); + }) +} + // 查看附件 function viewFileDetail(obj, type) { let title = '行驶证/挂靠协议驾驶证/身份证/导航图' @@ -312,6 +347,7 @@ function reloadAuditData() { // 关闭页面 function closePage(type) { - let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引 - parent.layer.close(index); // 再执行关闭 + let index = parent.layer.getFrameIndex(window.name); // 获取当前 iframe 层的索引 + parent.initTable(); // 刷新上级页面的表格数据 + parent.layer.close(index); // 关闭弹出层 } \ No newline at end of file diff --git a/js/openIframe.js b/js/openIframe.js index a35818c..df64d60 100644 --- a/js/openIframe.js +++ b/js/openIframe.js @@ -58,6 +58,9 @@ function openIframeByParamObj(id, title, content, width, height, paramsObj, isCa // 采购发货刷新一级页面 reloadData(); } + if (id==='arrivalConfirmDetail'){ + initTable(); + } }, end: function () { } }); diff --git a/page/car_demand_plan/arrival_confirm_list.html b/page/car_demand_plan/arrival_confirm_list.html index bd2bfd7..81d5b4c 100644 --- a/page/car_demand_plan/arrival_confirm_list.html +++ b/page/car_demand_plan/arrival_confirm_list.html @@ -23,7 +23,7 @@
+ class="layui-input" lay-affix="clear" placeholder="输入关键字" maxlength="30">