From 160861d3e37cb58e23fdffd7746f1e9655c6a67a Mon Sep 17 00:00:00 2001 From: hayu <1604366271@qq.com> Date: Thu, 29 Jan 2026 15:24:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E9=A2=86=E9=80=80=E5=8F=B0?= =?UTF-8?q?=E8=B4=A6=E6=95=B0=E6=8D=AE=E7=A9=BF=E9=80=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/aq_inventory/child/project_ck_details.js | 311 ++++++++++++++++++ js/aq_inventory/child/project_lk_details.js | 291 ++++++++++++++++ js/aq_inventory/child/project_tk_details.js | 298 +++++++++++++++++ .../project_material_statistics.js | 38 ++- .../child/project_ck_details.html | 57 ++++ .../child/project_lk_details.html | 57 ++++ .../child/project_tk_details.html | 57 ++++ 7 files changed, 1096 insertions(+), 13 deletions(-) create mode 100644 js/aq_inventory/child/project_ck_details.js create mode 100644 js/aq_inventory/child/project_lk_details.js create mode 100644 js/aq_inventory/child/project_tk_details.js create mode 100644 page/aq_inventory/child/project_ck_details.html create mode 100644 page/aq_inventory/child/project_lk_details.html create mode 100644 page/aq_inventory/child/project_tk_details.html diff --git a/js/aq_inventory/child/project_ck_details.js b/js/aq_inventory/child/project_ck_details.js new file mode 100644 index 0000000..cbb70de --- /dev/null +++ b/js/aq_inventory/child/project_ck_details.js @@ -0,0 +1,311 @@ +let objParam; +let form, table, tableIns, layer, element; +let pageNum = 1; + +function setParams(params) { + objParam = JSON.parse(params); + console.error(objParam); + $('#proName').html(objParam.proName); + layui.use(["form", "table", 'layer', 'element'], function () { + form = layui.form; + table = layui.table; + element = layui.element; + layer = layui.layer; + // getProDetails(); + initTable(); + }); +} + +// 数据概览 +function getProDetails() { + let params = { + encryptedData: JSON.stringify({ + 'proId': objParam.proId + }) + }; + let url = dataUrl + 'backstage/purchase/getProDetails'; + ajaxRequest(url, "POST", params, true, function () { + }, function (result) { + if (result.code === 200) { + setNum(result.data); + } + }, function (xhr, status, error) { + errorFn(xhr, status, error) + }, null); + + // 数据概览赋值 + function setNum(obj) { + $('#planNum').html(obj.planNum); + $('#lkNum').html(obj.lkNum); + $('#cgNum').html(obj.cgNum); + $('#money').html(' ¥ ' + (obj.money ? obj.money : 0)); + $('#bmname').html(obj.bmname); + $('.layui-progress').remove(); + console.log(obj) + var color = "layui-bg-orange"; + if (obj.process < 100) { + color = "layui-bg-orange"; + } else if (obj.process == 100) { + color = "layui-bg-primary"; + } else if (obj.process > 100) { + color = "layui-bg-red"; + } + $("#progress").after(` +
+
+
+ `); + element.render(); + } + +} + +// 查询/重置 +function queryTable(type) { + if (type === 1) { + let planCode = $('#planCode').val(); + let flag = checkValue(planCode); + if (flag) { + $('#planCode').val(''); + return layer.msg('需求计划编号查询包含特殊字符,请重新输入', {icon: 2}); + } + reloadTable(1); + } else if (type === 2) { + $('#planCode').val(''); + $('#status').val(''); + layui.form.render(); + reloadTable(1); + } +} + +// 刷新页面数据 +function reloadData() { + reloadTable(pageNum); +} + +// 重载表格 +function reloadTable(pageNum) { + table.reload("currentTableId", { + page: { + curr: pageNum ? pageNum : 1, + }, + where: { + encryptedData: JSON.stringify({ + 'planCode': $('#planCode').val(), + 'modelId': objParam.modelId, + 'proId': objParam.proId, + 'queryType': 2 + }), + }, + }, + ); +} + +// 初始化表格 +function initTable() { + tableIns = table.render({ + elem: "#currentTableId", + id: 'currentTableId', + headers: { + authorization: sessionStorage.getItem("gz-token"), + }, + height: "full-150", + url: dataUrl + "backstage/inventoryCount/getLkDetailsByProAndModel", + where: { + encryptedData: JSON.stringify({ + 'planCode': $('#planCode').val(), + 'modelId': objParam.modelId, + 'proId': objParam.proId, + 'queryType': 2 + }), + }, + request: { + pageName: 'pageNum', + limitName: 'pageSize' + }, + parseData: function (res) { // res 即为原始返回的数据 + if (res.code === 401) { + closeWindowOpen(); + } + return { + "code": 0, // 解析接口状态 + "msg": '获取成功', // 解析提示文本 + "count": res.total, // 解析数据长度 + "data": res.list // 解析数据列表 + }; + }, + cols: [ + [ + { + width: '6%', + title: "序号", + align: "center", + templet: function (d) { + return d.LAY_NUM; + }, + }, + { + field: "planCode", + width: '9%', + title: "需求计划编号", + unresize: true, + align: "center", + templet: function (d) { + return "" + d.planCode + ""; + }, + }, + { + field: "proName", + width: '20%', + title: "工程名称", + unresize: true, + align: "center", + }, + { + field: "type", + title: "物资类型", + width: '11%', + unresize: true, + align: "center", + }, + { + field: "name", + title: "物资名称", + width: '12%', + unresize: true, + align: "center", + }, + { + field: "model", + title: "规格型号", + width: '12%', + unresize: true, + align: "center", + }, + { + field: "unit", + title: "单位", + width: '5%', + unresize: true, + align: "center", + }, + { + field: "totalCg", + title: "采购数量", + width: '8%', + align: "center", + unresize: true, + templet: function (d) { + return d.totalCg; + }, + }, + { + field: "totalLk", + title: "利库数量", + width: '8%', + align: "center", + unresize: true, + templet: function (d) { + return d.totalLk; + }, + }, + { + field: "totalCk", + title: "出库数量", + width: '8%', + align: "center", + unresize: true, + templet: function (d) { + return d.totalCk; + }, + }, + ], + ], + limits: [10, 15, 20, 25, 50, 100], + limit: 20, + page: true, + done: function (res, curr, count) { + pageNum = tableIns.config.page.curr; + table.resize("currentTableId"); + }, + }); +} + +function deleteDetail(id){ + console.log(id) + layer.confirm('是否撤销此数据?', { + btn: ['确定', '关闭'] //按钮 + }, function(){ + let url = dataUrl + `backstage/purchase/deleteDetail/${id}`; + ajaxRequest(url, "POST","", true, function () { + }, function (result) { + if (result.code === 200) { + layer.msg(result.msg, {icon: 1}) + tableIns.reload("currentTableId"); + } + }, function (xhr, status, error) { + errorFn(xhr, status, error) + }, null); + }, function(){ + + }); +} + +// 导出 +function exportExcel() { + let params = { + 'planCode': $('#planCode').val(), + 'status': $('#status').val(), + 'proId': objParam.proId + } + let url = dataUrl + "backstage/purchase/exportDetails"; + exportExcelUtil(url, '需求计划详情', JSON.stringify(params)); +} + +// 发货 +function sendOutForm(obj, type) { + obj.proName = objParam.proName; + obj.companyName=objParam.companyName; + let content = '../aq_demand_plan/child/send_out_form.html'; + if (type === 2) { + content = '../aq_demand_plan/child/send_out_edit_form.html'; + } else if (type === 3) { + content = '../aq_demand_plan/child/send_out_supplemen.html'; + } + openIframeByParamObj2("sendOutForm", "采购发货", content, "92%", "95%", obj); +} + +function sendOutDeviceForm(obj) { + obj.proName = objParam.proName; + let content = '../aq_demand_plan/child/send_out_form_device.html'; + openIframeByParamObj2("sendOutForm", "设备发货", content, "92%", "95%", obj); +} + + +// 采购发货成功 +function sendOutSuccess(data) { + let obj = JSON.parse(data); + openIframeByParamObj2("sendOutSuccess", "采购发货成功", "../aq_demand_plan/child/send_out_success.html", "92%", "95%", obj); +} + +// 详情 +function sendOutDetail(obj) { + obj.proName = objParam.proName; + openIframeByParamObj2("sendOutDetail", "详情", "../aq_demand_plan/child/send_out_detail.html", "92%", "95%", obj); +} + +// 下载二维码 +function downLoadQrCode(obj) { + openIframeByParamObj2("downLoadQrCode", "二维码", "../aq_demand_plan/child/send_out_qrcode.html", "92%", "95%", obj); +} + +// 需求计划详情 +function viewPlanDetail(obj) { + openIframeByParamObj2("viewPlanDetail", "需求计划详情", "../aq_demand_plan/child/apply_plan_detail.html", "92%", "95%", obj); +} + +// 刷新页面数据 +function refreshAllData() { + getProDetails(); + reloadData(); +} diff --git a/js/aq_inventory/child/project_lk_details.js b/js/aq_inventory/child/project_lk_details.js new file mode 100644 index 0000000..b6d006d --- /dev/null +++ b/js/aq_inventory/child/project_lk_details.js @@ -0,0 +1,291 @@ +let objParam; +let form, table, tableIns, layer, element; +let pageNum = 1; + +function setParams(params) { + objParam = JSON.parse(params); + console.error(objParam); + $('#proName').html(objParam.proName); + layui.use(["form", "table", 'layer', 'element'], function () { + form = layui.form; + table = layui.table; + element = layui.element; + layer = layui.layer; + // getProDetails(); + initTable(); + }); +} + +// 数据概览 +function getProDetails() { + let params = { + encryptedData: JSON.stringify({ + 'proId': objParam.proId + }) + }; + let url = dataUrl + 'backstage/purchase/getProDetails'; + ajaxRequest(url, "POST", params, true, function () { + }, function (result) { + if (result.code === 200) { + setNum(result.data); + } + }, function (xhr, status, error) { + errorFn(xhr, status, error) + }, null); + + // 数据概览赋值 + function setNum(obj) { + $('#planNum').html(obj.planNum); + $('#lkNum').html(obj.lkNum); + $('#cgNum').html(obj.cgNum); + $('#money').html(' ¥ ' + (obj.money ? obj.money : 0)); + $('#bmname').html(obj.bmname); + $('.layui-progress').remove(); + console.log(obj) + var color = "layui-bg-orange"; + if (obj.process < 100) { + color = "layui-bg-orange"; + } else if (obj.process == 100) { + color = "layui-bg-primary"; + } else if (obj.process > 100) { + color = "layui-bg-red"; + } + $("#progress").after(` +
+
+
+ `); + element.render(); + } + +} + +// 查询/重置 +function queryTable(type) { + if (type === 1) { + let planCode = $('#planCode').val(); + let flag = checkValue(planCode); + if (flag) { + $('#planCode').val(''); + return layer.msg('需求计划编号查询包含特殊字符,请重新输入', {icon: 2}); + } + reloadTable(1); + } else if (type === 2) { + $('#planCode').val(''); + $('#status').val(''); + layui.form.render(); + reloadTable(1); + } +} + +// 刷新页面数据 +function reloadData() { + reloadTable(pageNum); +} + +// 重载表格 +function reloadTable(pageNum) { + table.reload("currentTableId", { + page: { + curr: pageNum ? pageNum : 1, + }, + where: { + encryptedData: JSON.stringify({ + 'planCode': $('#planCode').val(), + 'modelId': objParam.modelId, + 'proId': objParam.proId, + 'queryType': 1 + }), + }, + }, + ); +} + +// 初始化表格 +function initTable() { + tableIns = table.render({ + elem: "#currentTableId", + id: 'currentTableId', + headers: { + authorization: sessionStorage.getItem("gz-token"), + }, + height: "full-150", + url: dataUrl + "backstage/inventoryCount/getLkDetailsByProAndModel", + where: { + encryptedData: JSON.stringify({ + 'planCode': $('#planCode').val(), + 'modelId': objParam.modelId, + 'proId': objParam.proId, + 'queryType': 1 + }), + }, + request: { + pageName: 'pageNum', + limitName: 'pageSize' + }, + parseData: function (res) { // res 即为原始返回的数据 + if (res.code === 401) { + closeWindowOpen(); + } + return { + "code": 0, // 解析接口状态 + "msg": '获取成功', // 解析提示文本 + "count": res.total, // 解析数据长度 + "data": res.list // 解析数据列表 + }; + }, + cols: [ + [ + { + width: '6%', + title: "序号", + align: "center", + templet: function (d) { + return d.LAY_NUM; + }, + }, + { + field: "planCode", + width: '13%', + title: "需求计划编号", + unresize: true, + align: "center", + templet: function (d) { + return "" + d.planCode + ""; + }, + }, + { + field: "proName", + width: '20%', + title: "工程名称", + unresize: true, + align: "center", + }, + { + field: "type", + title: "物资类型", + width: '14%', + unresize: true, + align: "center", + }, + { + field: "name", + title: "物资名称", + width: '15%', + unresize: true, + align: "center", + }, + { + field: "model", + title: "规格型号", + width: '15%', + unresize: true, + align: "center", + }, + { + field: "unit", + title: "单位", + width: '8%', + unresize: true, + align: "center", + }, + { + field: "totalLk", + title: "利库数量", + width: '8%', + align: "center", + unresize: true, + templet: function (d) { + return d.totalLk; + }, + }, + ], + ], + limits: [10, 15, 20, 25, 50, 100], + limit: 20, + page: true, + done: function (res, curr, count) { + pageNum = tableIns.config.page.curr; + table.resize("currentTableId"); + }, + }); +} + +function deleteDetail(id){ + console.log(id) + layer.confirm('是否撤销此数据?', { + btn: ['确定', '关闭'] //按钮 + }, function(){ + let url = dataUrl + `backstage/purchase/deleteDetail/${id}`; + ajaxRequest(url, "POST","", true, function () { + }, function (result) { + if (result.code === 200) { + layer.msg(result.msg, {icon: 1}) + tableIns.reload("currentTableId"); + } + }, function (xhr, status, error) { + errorFn(xhr, status, error) + }, null); + }, function(){ + + }); +} + +// 导出 +function exportExcel() { + let params = { + 'planCode': $('#planCode').val(), + 'status': $('#status').val(), + 'proId': objParam.proId + } + let url = dataUrl + "backstage/purchase/exportDetails"; + exportExcelUtil(url, '需求计划详情', JSON.stringify(params)); +} + +// 发货 +function sendOutForm(obj, type) { + obj.proName = objParam.proName; + obj.companyName=objParam.companyName; + let content = '../aq_demand_plan/child/send_out_form.html'; + if (type === 2) { + content = '../aq_demand_plan/child/send_out_edit_form.html'; + } else if (type === 3) { + content = '../aq_demand_plan/child/send_out_supplemen.html'; + } + openIframeByParamObj2("sendOutForm", "采购发货", content, "92%", "95%", obj); +} + +function sendOutDeviceForm(obj) { + obj.proName = objParam.proName; + let content = '../aq_demand_plan/child/send_out_form_device.html'; + openIframeByParamObj2("sendOutForm", "设备发货", content, "92%", "95%", obj); +} + + +// 采购发货成功 +function sendOutSuccess(data) { + let obj = JSON.parse(data); + openIframeByParamObj2("sendOutSuccess", "采购发货成功", "../aq_demand_plan/child/send_out_success.html", "92%", "95%", obj); +} + +// 详情 +function sendOutDetail(obj) { + obj.proName = objParam.proName; + openIframeByParamObj2("sendOutDetail", "详情", "../aq_demand_plan/child/send_out_detail.html", "92%", "95%", obj); +} + +// 下载二维码 +function downLoadQrCode(obj) { + openIframeByParamObj2("downLoadQrCode", "二维码", "../aq_demand_plan/child/send_out_qrcode.html", "92%", "95%", obj); +} + +// 需求计划详情 +function viewPlanDetail(obj) { + openIframeByParamObj2("viewPlanDetail", "需求计划详情", "../aq_demand_plan/child/apply_plan_detail.html", "92%", "95%", obj); +} + +// 刷新页面数据 +function refreshAllData() { + getProDetails(); + reloadData(); +} diff --git a/js/aq_inventory/child/project_tk_details.js b/js/aq_inventory/child/project_tk_details.js new file mode 100644 index 0000000..4eee6a4 --- /dev/null +++ b/js/aq_inventory/child/project_tk_details.js @@ -0,0 +1,298 @@ +let objParam; +let form, table, tableIns, layer, element; +let pageNum = 1; + +function setParams(params) { + objParam = JSON.parse(params); + console.error(objParam); + $('#proName').html(objParam.proName); + layui.use(["form", "table", 'layer', 'element'], function () { + form = layui.form; + table = layui.table; + element = layui.element; + layer = layui.layer; + // getProDetails(); + initTable(); + }); +} + +// 数据概览 +function getProDetails() { + let params = { + encryptedData: JSON.stringify({ + 'proId': objParam.proId + }) + }; + let url = dataUrl + 'backstage/purchase/getProDetails'; + ajaxRequest(url, "POST", params, true, function () { + }, function (result) { + if (result.code === 200) { + setNum(result.data); + } + }, function (xhr, status, error) { + errorFn(xhr, status, error) + }, null); + + // 数据概览赋值 + function setNum(obj) { + $('#planNum').html(obj.planNum); + $('#lkNum').html(obj.lkNum); + $('#cgNum').html(obj.cgNum); + $('#money').html(' ¥ ' + (obj.money ? obj.money : 0)); + $('#bmname').html(obj.bmname); + $('.layui-progress').remove(); + console.log(obj) + var color = "layui-bg-orange"; + if (obj.process < 100) { + color = "layui-bg-orange"; + } else if (obj.process == 100) { + color = "layui-bg-primary"; + } else if (obj.process > 100) { + color = "layui-bg-red"; + } + $("#progress").after(` +
+
+
+ `); + element.render(); + } + +} + +// 查询/重置 +function queryTable(type) { + if (type === 1) { + let planCode = $('#planCode').val(); + let flag = checkValue(planCode); + if (flag) { + $('#planCode').val(''); + return layer.msg('需求计划编号查询包含特殊字符,请重新输入', {icon: 2}); + } + reloadTable(1); + } else if (type === 2) { + $('#planCode').val(''); + $('#status').val(''); + layui.form.render(); + reloadTable(1); + } +} + +// 刷新页面数据 +function reloadData() { + reloadTable(pageNum); +} + +// 重载表格 +function reloadTable(pageNum) { + table.reload("currentTableId", { + page: { + curr: pageNum ? pageNum : 1, + }, + where: { + encryptedData: JSON.stringify({ + 'planCode': $('#planCode').val(), + 'modelId': objParam.modelId, + 'proId': objParam.proId, + 'queryType': 1 + }), + }, + }, + ); +} + +// 初始化表格 +function initTable() { + tableIns = table.render({ + elem: "#currentTableId", + id: 'currentTableId', + headers: { + authorization: sessionStorage.getItem("gz-token"), + }, + height: "full-150", + url: dataUrl + "backstage/inventoryCount/getBackDetailsByProAndModel", + where: { + encryptedData: JSON.stringify({ + 'planCode': $('#planCode').val(), + 'modelId': objParam.modelId, + 'proId': objParam.proId, + 'queryType': 1 + }), + }, + request: { + pageName: 'pageNum', + limitName: 'pageSize' + }, + parseData: function (res) { // res 即为原始返回的数据 + if (res.code === 401) { + closeWindowOpen(); + } + return { + "code": 0, // 解析接口状态 + "msg": '获取成功', // 解析提示文本 + "count": res.total, // 解析数据长度 + "data": res.list // 解析数据列表 + }; + }, + cols: [ + [ + { + width: '6%', + title: "序号", + align: "center", + templet: function (d) { + return d.LAY_NUM; + }, + }, + { + field: "planCode", + width: '10%', + title: "退料单号", + unresize: true, + align: "center", + templet: function (d) { + return d.planCode; + }, + }, + { + field: "proName", + width: '20%', + title: "工程名称", + unresize: true, + align: "center", + }, + { + field: "type", + title: "物资类型", + width: '11%', + unresize: true, + align: "center", + }, + { + field: "name", + title: "物资名称", + width: '13%', + unresize: true, + align: "center", + }, + { + field: "model", + title: "规格型号", + width: '13%', + unresize: true, + align: "center", + }, + { + field: "unit", + title: "单位", + width: '8%', + unresize: true, + align: "center", + }, + { + field: "backTime", + title: "退还时间", + width: '10%', + unresize: true, + align: "center", + }, + { + field: "totalBack", + title: "退还数量", + width: '8%', + align: "center", + unresize: true, + templet: function (d) { + return d.totalBack; + }, + }, + ], + ], + limits: [10, 15, 20, 25, 50, 100], + limit: 20, + page: true, + done: function (res, curr, count) { + pageNum = tableIns.config.page.curr; + table.resize("currentTableId"); + }, + }); +} + +function deleteDetail(id){ + console.log(id) + layer.confirm('是否撤销此数据?', { + btn: ['确定', '关闭'] //按钮 + }, function(){ + let url = dataUrl + `backstage/purchase/deleteDetail/${id}`; + ajaxRequest(url, "POST","", true, function () { + }, function (result) { + if (result.code === 200) { + layer.msg(result.msg, {icon: 1}) + tableIns.reload("currentTableId"); + } + }, function (xhr, status, error) { + errorFn(xhr, status, error) + }, null); + }, function(){ + + }); +} + +// 导出 +function exportExcel() { + let params = { + 'planCode': $('#planCode').val(), + 'status': $('#status').val(), + 'proId': objParam.proId + } + let url = dataUrl + "backstage/purchase/exportDetails"; + exportExcelUtil(url, '需求计划详情', JSON.stringify(params)); +} + +// 发货 +function sendOutForm(obj, type) { + obj.proName = objParam.proName; + obj.companyName=objParam.companyName; + let content = '../aq_demand_plan/child/send_out_form.html'; + if (type === 2) { + content = '../aq_demand_plan/child/send_out_edit_form.html'; + } else if (type === 3) { + content = '../aq_demand_plan/child/send_out_supplemen.html'; + } + openIframeByParamObj2("sendOutForm", "采购发货", content, "92%", "95%", obj); +} + +function sendOutDeviceForm(obj) { + obj.proName = objParam.proName; + let content = '../aq_demand_plan/child/send_out_form_device.html'; + openIframeByParamObj2("sendOutForm", "设备发货", content, "92%", "95%", obj); +} + + +// 采购发货成功 +function sendOutSuccess(data) { + let obj = JSON.parse(data); + openIframeByParamObj2("sendOutSuccess", "采购发货成功", "../aq_demand_plan/child/send_out_success.html", "92%", "95%", obj); +} + +// 详情 +function sendOutDetail(obj) { + obj.proName = objParam.proName; + openIframeByParamObj2("sendOutDetail", "详情", "../aq_demand_plan/child/send_out_detail.html", "92%", "95%", obj); +} + +// 下载二维码 +function downLoadQrCode(obj) { + openIframeByParamObj2("downLoadQrCode", "二维码", "../aq_demand_plan/child/send_out_qrcode.html", "92%", "95%", obj); +} + +// 需求计划详情 +function viewPlanDetail(obj) { + openIframeByParamObj2("viewPlanDetail", "需求计划详情", "../aq_demand_plan/child/apply_plan_detail.html", "92%", "95%", obj); +} + +// 刷新页面数据 +function refreshAllData() { + getProDetails(); + reloadData(); +} diff --git a/js/aq_inventory/project_material_statistics.js b/js/aq_inventory/project_material_statistics.js index 182d0f8..3724527 100644 --- a/js/aq_inventory/project_material_statistics.js +++ b/js/aq_inventory/project_material_statistics.js @@ -5,7 +5,7 @@ layui.use(["form", "table"], function () { form = layui.form; table = layui.table; initTable(); - getStatistics(); + // getStatistics(); }); @@ -187,7 +187,9 @@ function initTable() { align: "center", sort: true, templet: function (d) { - return d.totalLk || 0; + const totalLk = d.totalLk || 0; + const rowData = JSON.stringify(d).replace(/"/g, '"'); + return `${totalLk}`; }, }, { @@ -198,7 +200,9 @@ function initTable() { align: "center", sort: true, templet: function (d) { - return d.totalCk || 0; + const totalCk = d.totalCk || 0; + const rowData = JSON.stringify(d).replace(/"/g, '"'); + return `${totalCk}`; }, }, { @@ -209,7 +213,9 @@ function initTable() { align: "center", sort: true, templet: function (d) { - return d.totalBack || 0; + const totalBack = d.totalBack || 0; + const rowData = JSON.stringify(d).replace(/"/g, '"'); + return `${totalBack}`; }, }, { @@ -240,31 +246,37 @@ function initTable() { } // 查看详情 -function viewDetail(id) { - layer.msg('查看工程物料详情功能待开发', { icon: 1 }); - // 这里可以添加查看详情的逻辑,比如打开新窗口或弹窗显示详细信息 - // openIframe('工程物料详情', 'page/aq_inventory/project_material_detail.html?id=' + id); +function viewDetail(obj, type) { + console.log('查看详情', type, obj); + if (type === 1) { + openIframeByParamObj("projectLkDetails", "利库详情", "./child/project_lk_details.html", "92%", "95%", obj, 0); + } else if (type===2){ + openIframeByParamObj("projectCkDetails", "出库详情", "./child/project_ck_details.html", "92%", "95%", obj, 0); + } else { + openIframeByParamObj("projectTkDetails", "退库详情", "./child/project_tk_details.html", "92%", "95%", obj, 0); + } } + // 导出Excel function exportExcel() { let keyWord = $('#keyWord').val(); let isShortage = $('#isShortage').val(); - + let params = { 'keyWord': keyWord, 'isShortage': isShortage }; - + let encryptedData = JSON.stringify(params); let url = dataUrl + 'backstage/inventoryCount/exportLedgerListByProjectAndModel?encryptedData=' + encodeURIComponent(encryptedData); - + // 创建隐藏的下载链接 let link = document.createElement('a'); link.href = url; link.download = '工程物料统计_' + new Date().getTime() + '.xlsx'; link.style.display = 'none'; - + // 添加授权头并下载 fetch(url, { method: 'GET', @@ -287,4 +299,4 @@ function exportExcel() { }).catch(error => { layer.msg('导出失败:' + error.message, { icon: 2 }); }); -} \ No newline at end of file +} \ No newline at end of file diff --git a/page/aq_inventory/child/project_ck_details.html b/page/aq_inventory/child/project_ck_details.html new file mode 100644 index 0000000..72a2fe1 --- /dev/null +++ b/page/aq_inventory/child/project_ck_details.html @@ -0,0 +1,57 @@ + + + + + + + 工程详情 + + + + + + + + +
+
+
+
+ 搜索信息 +
+
+
+
+
+ +
+
+
+ + +
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/page/aq_inventory/child/project_lk_details.html b/page/aq_inventory/child/project_lk_details.html new file mode 100644 index 0000000..63fa284 --- /dev/null +++ b/page/aq_inventory/child/project_lk_details.html @@ -0,0 +1,57 @@ + + + + + + + 工程详情 + + + + + + + + +
+
+
+
+ 搜索信息 +
+
+
+
+
+ +
+
+
+ + +
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/page/aq_inventory/child/project_tk_details.html b/page/aq_inventory/child/project_tk_details.html new file mode 100644 index 0000000..5d9f81f --- /dev/null +++ b/page/aq_inventory/child/project_tk_details.html @@ -0,0 +1,57 @@ + + + + + + + 工程详情 + + + + + + + + +
+
+
+
+ 搜索信息 +
+
+
+
+
+ +
+
+
+ + +
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + \ No newline at end of file