From 5245512e4cc12ca0aa0b60e6f3cd3c74e95f285e Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Mon, 11 Nov 2024 12:28:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E8=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/demandPlan/apply_plan_detail.css | 8 +- js/demandPlan/child/apply_plan_detail.js | 24 +-- .../child/demand_plan_detail_list.js | 166 ++++++++++++++++++ .../child/excess_inventory_source.js | 5 +- .../child/unplanned_quantity_list.js | 27 +-- js/demandPlan/delivery_list.js | 9 +- js/public.js | 2 +- .../child/demand_plan_detail_list.html | 86 +++++++++ 8 files changed, 281 insertions(+), 46 deletions(-) create mode 100644 js/demandPlan/child/demand_plan_detail_list.js create mode 100644 page/demandPlan/child/demand_plan_detail_list.html diff --git a/css/demandPlan/apply_plan_detail.css b/css/demandPlan/apply_plan_detail.css index f7ecc03..d1070be 100644 --- a/css/demandPlan/apply_plan_detail.css +++ b/css/demandPlan/apply_plan_detail.css @@ -10,8 +10,7 @@ body { #main-box { width: 100%; - height: 100%; - padding: 0 2% 0 2%; + padding: 0 1% 0 1%; box-sizing: border-box; background-color: #fff; border-radius: 5px; @@ -86,6 +85,11 @@ body { background-color: #f2f2f2; } +#baseTable tr td, +#baseTable tr th{ + text-align: center; +} + #implement-box { width: 100%; flex-direction: column; diff --git a/js/demandPlan/child/apply_plan_detail.js b/js/demandPlan/child/apply_plan_detail.js index 7f2cf59..0995b7d 100644 --- a/js/demandPlan/child/apply_plan_detail.js +++ b/js/demandPlan/child/apply_plan_detail.js @@ -3,6 +3,8 @@ let details; let form, layer, laydate; function setParams(obj) { objParam = JSON.parse(obj); + // console.log(objParam); + idParam = objParam.id; layui.use(['form', 'layer', 'laydate'], function () { form = layui.form; @@ -68,10 +70,10 @@ function getbaseList(results) { html += "" + l.typeName + ""; html += "" + l.type + ""; html += "" + l.module + ""; - html += "" + l.unit + ""; + html += "" + setNullValue(l.unit) + ""; html += "" + l.needNum + ""; html += "" + l.times + ""; - html += "" + l.remarks + ""; + html += "" + setNullValue(l.remarks) + ""; html += ""; } } else { @@ -80,16 +82,6 @@ function getbaseList(results) { $("#baseTable tbody").empty().append(html); } -function rowFunction(id) { - var h = ""; - h += ""; - h += ""; - h += ""; - return h; -} - // 导出 function exportData() { let params = { @@ -210,10 +202,10 @@ function getDetailById() { }, function (result) { console.log(result); if (result.code === 200) { - setPlanBasicTableInfo(result.obj); - getbaseList(result.obj.details); - setOperRecordInfo(result.obj.auditList,result.obj); - details = result.obj.details; + setPlanBasicTableInfo(result.data); + getbaseList(result.data.details); + setOperRecordInfo(result.data.auditList, result.data); + details = result.data.details; } }, function (xhr, status, error) { errorFn(xhr, status, error) diff --git a/js/demandPlan/child/demand_plan_detail_list.js b/js/demandPlan/child/demand_plan_detail_list.js new file mode 100644 index 0000000..49023ab --- /dev/null +++ b/js/demandPlan/child/demand_plan_detail_list.js @@ -0,0 +1,166 @@ +let objParam; +let form, table, element, tableIns, layer; +let pageNum = 1; +function setParams(obj) { + objParam = JSON.parse(obj); + console.log(objParam); + $('#proName').html(objParam.proName); + layui.use(["form", "table", 'element', 'layer'], function () { + form = layui.form; + table = layui.table; + element = layui.element; + layer = layui.layer; + initTable(); + }); +} + +// 查询/重置 +function queryTable(type) { + if (type === 1) { + reloadTable(1); + } else if (type === 2) { + $('#keyWord').val(''); + layui.form.render(); + reloadTable(1); + } + } + + // 刷新页面数据 + function reloadData() { + reloadData(pageNum); + } + + // 重载表格 + function reloadTable(pageNum) { + table.reload("currentTableId", { + page: { + curr: pageNum ? pageNum : 1, + }, + where: { + encryptedData: JSON.stringify({ + 'keyWord': $('#keyWord').val() + }), + }, + }, + ); + } + +function initTable() { + tableIns = table.render({ + elem: "#currentTableId", + id: 'currentTableId', + headers: { + authorization: sessionStorage.getItem("gz-token"), + }, + height: "full-180", + url: dataUrl + "backstage/planOut/getDataPlanByPage", + where: { + encryptedData: JSON.stringify({ + 'keyWord': $('#keyWord').val() + }), + }, + request: { + pageName: 'pageNum', + limitName: 'pageSize' + }, + parseData: function (res) { // res 即为原始返回的数据 + return { + "code": 0, // 解析接口状态 + "msg": '获取成功', // 解析提示文本 + "count": res.total, // 解析数据长度 + "data": res.list // 解析数据列表 + }; + }, + cols: [ + [ + { + width: '9.9%', + title: "序号", + align: "center", + templet: function (d) { + return d.LAY_NUM; + }, + }, + { + field: "code", + width: '15%', + title: "计划编号", + unresize: true, + align: "center", + }, + { + field: "proName", + width: '20%', + title: "工程名称", + unresize: true, + align: "center", + }, + { + field: "needTime", + width: '10%', + title: "需用日期", + unresize: true, + align: "center", + }, + { + field: "creator", + width: '10%', + title: "申请人 ", + unresize: true, + align: "center", + }, + { + field: "createTime", + width: '10%', + title: "申请时间", + unresize: true, + align: "center", + }, + { + field: "remark", + width: '15%', + title: "计划说明 ", + unresize: true, + align: "center", + }, + { + width: '10%', + title: "操作 ", + unresize: true, + align: "center", + templet: function (d) { + let html = ""; + html += "详情"; + return html; + }, + }, + ] + ], + limits: [10, 15, 20, 25, 50, 100], + limit: 10, + page: true, + done: function (res, curr, count) { + pageNum = tableIns.config.page.curr; + element.render(); + table.resize("currentTableId"); + }, + }); +} + +// 数量颜色 1.需要量 2.已发货量 3.待发货量 +function setNumColor(value, type) { + let color = "#409Eff"; + if (type === 1) { + color = "#409Eff"; + } else if (type === 2) { + color = "#19be6b"; + } else if (type === 3) { + color = "#f56c6c"; + } + return '' + value + ""; +} + +// 需求计划编号 +function plan_detail(obj){ + openIframeByParamObj2("plan_detail", "机具需求计划", "./apply_plan_detail.html", "92%", "95%", obj); +} \ No newline at end of file diff --git a/js/demandPlan/child/excess_inventory_source.js b/js/demandPlan/child/excess_inventory_source.js index 25d4f3d..61e09d5 100644 --- a/js/demandPlan/child/excess_inventory_source.js +++ b/js/demandPlan/child/excess_inventory_source.js @@ -80,7 +80,7 @@ function initTable() { }, { field: "code", - width: '10%', + width: '12%', title: "需求计划编号", unresize: true, align: "center", @@ -99,7 +99,7 @@ function initTable() { }, { field: "projectPart", - width: '15%', + width: '13%', title: "项目部分", unresize: true, align: "center", @@ -130,6 +130,7 @@ function initTable() { width: '9%', title: "需用量 ", unresize: true, + align: "center", templet: function (d) { return setNumColor(d.needNum, 1); }, diff --git a/js/demandPlan/child/unplanned_quantity_list.js b/js/demandPlan/child/unplanned_quantity_list.js index a49bf6d..b4f1a77 100644 --- a/js/demandPlan/child/unplanned_quantity_list.js +++ b/js/demandPlan/child/unplanned_quantity_list.js @@ -132,7 +132,7 @@ function initTable() { unresize: true, templet: function (d) { let html = ""; - html += "查看来源"; + html += "查看来源"; return html; }, }, @@ -169,27 +169,6 @@ function setNumColor(value, type) { return '' + value + ""; } -// 设置进度值 -function schedule(d) { - d.progress = parseFloat(d.progress) - d.filter == undefined ? (d.filter = d.LAY_NUM) : d.filter; - d.progress == undefined ? (d.progress = 100) : d.progress; - var color = "layui-bg-orange"; - if (d.progress < 100) { - color = "layui-bg-orange"; - } else if (d.progress === 100) { - color = "layui-bg-primary"; - } else if (d.progress > 100) { - color = "layui-bg-blue"; - } - //设置页面进度条 - return ( - '
' + - '
' + - "
" - ); -} - // 导出 function exportExcel() { let encryptedData = JSON.stringify({ @@ -213,6 +192,6 @@ function print() { } // 查看来源 -function viewSource(id) { - openIframeByParam("viewSource", "未发货机具设备超出库存数量-数据来源", "./view_resource_list.html", "92%", "95%", id); +function viewSource(obj) { + openIframeByParam("viewSource", "未发货机具设备超出库存数量-数据来源", "./delivery_detail_list.html", "92%", "95%", obj); } \ No newline at end of file diff --git a/js/demandPlan/delivery_list.js b/js/demandPlan/delivery_list.js index f00bb6a..11cf857 100644 --- a/js/demandPlan/delivery_list.js +++ b/js/demandPlan/delivery_list.js @@ -134,7 +134,9 @@ function initTable() { unresize: true, align: "center", templet: function (d) { - return setNumColor(d.planNum); + let html = ""; + html += ""+setNumColor(d.planNum)+""; + return html; }, }, { @@ -267,4 +269,9 @@ function openViewData(type) { // type 1.超库存量 2.计划外量 function earlyInfo(type) { openIframeByParam("viewData", "预警信息", "./child/early_info_list.html", "92%", "95%", type); +} + +// 需求计划 +function view_plan(obj){ + openIframeByParamObj("view_plan", "需求计划", "./child/demand_plan_detail_list.html", "92%", "95%", obj); } \ No newline at end of file diff --git a/js/public.js b/js/public.js index 679b7df..89c8af9 100644 --- a/js/public.js +++ b/js/public.js @@ -115,7 +115,7 @@ const getNowDate = () => { function setNullValue(value) { if (value === 0) { return 0; - } else if (!value) { + } else if (!value || value === 'null') { return ''; } return value; diff --git a/page/demandPlan/child/demand_plan_detail_list.html b/page/demandPlan/child/demand_plan_detail_list.html new file mode 100644 index 0000000..aba2256 --- /dev/null +++ b/page/demandPlan/child/demand_plan_detail_list.html @@ -0,0 +1,86 @@ + + + + + + + 发货详情-全部 + + + + + + + +
+
+

+
+
+
+ 搜索信息 +
+
+
+
+
+ +
+
+
+ + + +
+
+
+
+
+
+
+
+
+
+ + + + + + + + \ No newline at end of file