-
+
- 超库存量 +
- 计划外量 +
diff --git a/css/demandPlan/early_info_list.css b/css/demandPlan/early_info_list.css new file mode 100644 index 0000000..2cc220e --- /dev/null +++ b/css/demandPlan/early_info_list.css @@ -0,0 +1,52 @@ +.layout { + display: flex; + align-items: center; + justify-content: center; +} + +#main-box { + width: 100%; + height: 100%; +} + +#iframe-box { + width: 100%; + box-sizing: border-box; + background-color: #fff; + height: calc(100% - 60px); +} + +.layui-tab-brief { + border: 1px solid #f2f2f2; + border-radius: 5px; + background-color: #ffffff; + height: 50px; +} + +.layui-tab-brief>.layui-tab-title .layui-this { + color: #409eff; +} + +.layui-tab-brief>.layui-tab-more li.layui-this:after, +.layui-tab-brief>.layui-tab-title .layui-this:after { + border-bottom: 2px solid #409eff; +} + +a { + color: #428bca; + text-decoration: none; +} + +a:hover, +a:focus { + color: #2a6496; + text-decoration: underline; +} + +.layuimini-container { + height: 89%; +} + +.layui-tab .layui-tab-title li { + font-size: 16px; +} \ No newline at end of file diff --git a/js/demandPlan/child/early_info_list.js b/js/demandPlan/child/early_info_list.js index ef6ccb5..7a4902d 100644 --- a/js/demandPlan/child/early_info_list.js +++ b/js/demandPlan/child/early_info_list.js @@ -1,6 +1,5 @@ -let form, table, element, tableIns; +let form, table, element; let typeParam; -let pageNum = 1; function setParams(type) { typeParam = type; layui.use(["form", "table", 'element'], function () { @@ -10,292 +9,20 @@ function setParams(type) { // tab 切换事件 element.on('tab(demo-filter-tab)', function (data) { let value = $(this).attr('value'); - typeParam = value; - // table.destroy('currentTableId'); - table.destroy(document.getElementById('currentTableId')); - initTable(typeParam); + element.on('tab(demo-filter-tab)', function (data) { + let value = $(this).attr('value'); + if (value === '1') { // 超库存量 + $('#indexIframe').attr('src', 'excess_inventory_list.html'); + } else if (value === '2') { // 计划外量 + $('#indexIframe').attr('src', 'unplanned_quantity_list.html'); + } + }); }); $('.layui-tab-title li').eq(typeParam - 1).addClass('layui-this'); - initTable(typeParam); - }); -} - -// 查询/重置 -function queryTable(type) { - if (type === 1) { - reloadTable(1); - } else if (type === 2) { - $('#name').val(''); - $('#module').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({ - 'name': $('#name').val(), - 'module': $('#module').val(), - 'type': typeParam - }), - }, - }, - ); -} - -// 初始化表格 -function initTable(type) { - tableIns = table.render({ - elem: "#currentTableId", - id: 'currentTableId', - headers: { - authorization: sessionStorage.getItem("gz-token"), - }, - height: "full-210", - url: dataUrl + "backstage/planOut/getProPlanPage", - where: { - encryptedData: JSON.stringify({ - 'name': $('#name').val(), - 'module': $('#module').val(), - 'type': typeParam - }), - }, - request: { - pageName: 'pageNum', - limitName: 'pageSize' - }, - parseData: function (res) { // res 即为原始返回的数据 - return { - "code": 0, // 解析接口状态 - "msg": '获取成功', // 解析提示文本 - "count": res.total, // 解析数据长度 - "data": res.list // 解析数据列表 - }; - }, - cols: [ - setTableCols(type) - ], - limits: [10, 15, 20, 25, 50, 100], - limit: 10, - page: true, - done: function (res, curr, count) { - pageNum = tableIns.config.page.curr; - element.render(); - }, - }); -} - -function setTableCols(type) { - if (type === 1) { - return [ - { - width: '9.9%', - title: "序号", - align: "center", - templet: function (d) { - return d.LAY_NUM; - }, - }, - { - field: "type", - width: '10%', - title: "物机类型 ", - unresize: true, - align: "center", - }, - { - field: "name", - width: '15%', - title: "物机名称", - unresize: true, - align: "center", - }, - { - field: "module", - width: '15%', - title: "规格 ", - unresize: true, - }, - { - field: "unit", - title: "单位", - width: '10%', - unresize: true, - align: "center", - }, - { - field: "needNum", - title: "需要量", - width: '10%', - unresize: true, - align: "center", - templet: function (d) { - return setNumColor(d.needNum,1); - }, - }, - { - field: "needNum", - title: "库存量", - width: '10%', - unresize: true, - align: "center", - templet: function (d) { - return setNumColor(d.needNum,2); - }, - }, - { - field: "needNum", - title: "超出量", - width: '10%', - unresize: true, - align: "center", - templet: function (d) { - return setNumColor(d.needNum,3); - }, - }, - { - title: "来源工程", - width: '10%', - align: "center", - unresize: true, - templet: function (d) { - let html = ""; - html += "查看来源"; - return html; - }, - }, - ] - } else if (type === 2) { - return [ - { - width: '9.9%', - title: "序号", - align: "center", - templet: function (d) { - return d.LAY_NUM; - }, - }, - { - field: "type", - width: '15%', - title: "物机类型 ", - unresize: true, - align: "center", - }, - { - field: "name", - width: '15%', - title: "物机名称", - unresize: true, - align: "center", - }, - { - field: "module", - width: '10%', - title: "规格 ", - unresize: true, - align: "center", - }, - { - field: "unit", - title: "单位", - width: '10%', - unresize: true, - align: "center", - }, - { - field: "needNum", - title: "计划外发货量", - width: '10%', - unresize: true, - align: "center", - templet: function (d) { - return setNumColor(d.needNum,4); - }, - }, - { - field: "status", - title: "需要日期", - width: '10%', - unresize: true, - align: "center", - }, - { - field: "status", - title: "工程名称", - width: '10%', - unresize: true, - align: "center", - }, - { - title: "来源查询", - width: '10%', - align: "center", - unresize: true, - templet: function (d) { - let html = ""; - html += "来源查询"; - return html; - }, - }, - ] - } -} - -// 设置字体加粗 -function setFontBold(value) { - return '' + value + ""; -} - -// 数量颜色 1.需要量 2.库存量 3.超出量 4.计划外发货量 -function setNumColor(value, type) { - let color = "#409Eff"; - if (type === 1) { - color = "#409Eff"; - } else if (type === 2) { - color = "#19be6b"; - } else if (type === 3) { - color = "#f56c6c"; - }else if (type === 4) { - color = "#f56c6c"; - } - return '' + value + ""; -} - -// 导出 -function exportExcel() { - let encryptedData = JSON.stringify({ - 'proName': $('#proName').val(), - 'status': $('#status').val() - }); - let url = dataUrl + "backstage/planOut/exportExcel?encryptedData=" + encryptedData; - exportExcelUtil(url, '机具公司发货数据'); -} - -// 打印 -function print() { - Print('#body', { - onStart: function () { - console.log('onStart', new Date()) - }, - onEnd: function () { - console.log('onEnd', new Date()) + if(typeParam === 1){ + $('#indexIframe').attr('src', 'excess_inventory_list.html'); + }else{ + $('#indexIframe').attr('src', 'unplanned_quantity_list.html'); } - }) -} - -// 查看来源 -function viewSource(id) { - openIframeByParam("viewSource", "未发货机具设备超出库存数量-数据来源", "./view_resource_list.html", "92%", "95%", id); + }); } \ No newline at end of file diff --git a/js/demandPlan/child/excess_inventory_list.js b/js/demandPlan/child/excess_inventory_list.js new file mode 100644 index 0000000..e4912d0 --- /dev/null +++ b/js/demandPlan/child/excess_inventory_list.js @@ -0,0 +1,207 @@ +let form, table, element,tableIns,layer; +let pageNum = 1; +layui.use(["form", "table", 'element','layer'], function () { + form = layui.form; + table = layui.table; + element = layui.element; + initTable(); + }); + +// 查询/重置 +function queryTable(type) { + if (type === 1) { + reloadTable(1); + } else if (type === 2) { + $('#name').val(''); + $('#module').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({ + 'name': $('#name').val(), + 'module': $('#module').val(), + }), + }, + }, + ); +} + +// 初始化表格 +function initTable() { + tableIns = table.render({ + elem: "#currentTableId", + id: 'currentTableId', + headers: { + authorization: sessionStorage.getItem("gz-token"), + }, + height: "full-140", + url: dataUrl + "backstage/planOut/getPorInfoDetail2", + where: { + encryptedData: JSON.stringify({ + 'name': $('#name').val(), + 'module': $('#module').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: "type", + width: '10%', + title: "物机类型 ", + unresize: true, + align: "center", + }, + { + field: "name", + width: '15%', + title: "物机名称", + unresize: true, + align: "center", + }, + { + field: "module", + width: '15%', + title: "规格 ", + unresize: true, + }, + { + field: "unit", + title: "单位", + width: '10%', + unresize: true, + align: "center", + }, + { + field: "needNum", + title: "需要量", + width: '10%', + unresize: true, + align: "center", + templet: function (d) { + return setNumColor(d.needNum,1); + }, + }, + { + field: "needNum", + title: "库存量", + width: '10%', + unresize: true, + align: "center", + templet: function (d) { + return setNumColor(d.needNum,2); + }, + }, + { + field: "needNum", + title: "超出量", + width: '10%', + unresize: true, + align: "center", + templet: function (d) { + return setNumColor(d.needNum,3); + }, + }, + { + title: "来源工程", + width: '10%', + align: "center", + unresize: true, + 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"); + }, + }); +} + +// 设置字体加粗 +function setFontBold(value) { + return '' + value + ""; +} + +// 数量颜色 1.需要量 2.库存量 3.超出量 4.计划外发货量 +function setNumColor(value, type) { + let color = "#409Eff"; + if (type === 1) { + color = "#409Eff"; + } else if (type === 2) { + color = "#19be6b"; + } else if (type === 3) { + color = "#f56c6c"; + }else if (type === 4) { + color = "#f56c6c"; + } + return '' + value + ""; +} + +// 导出 +function exportExcel() { + let encryptedData = JSON.stringify({ + 'proName': $('#proName').val(), + 'status': $('#status').val() + }); + let url = dataUrl + "backstage/planOut/exportExcel?encryptedData=" + encryptedData; + exportExcelUtil(url, '机具公司发货数据'); +} + +// 打印 +function print() { + Print('#body', { + onStart: function () { + console.log('onStart', new Date()) + }, + onEnd: function () { + console.log('onEnd', new Date()) + } + }) +} + +// 查看来源 +function viewSource(id) { + openIframeByParam("viewSource", "未发货机具设备超出库存数量-数据来源", "./view_resource_list.html", "92%", "95%", id); +} \ No newline at end of file diff --git a/js/demandPlan/child/unplanned_quantity_list.js b/js/demandPlan/child/unplanned_quantity_list.js new file mode 100644 index 0000000..5aa0268 --- /dev/null +++ b/js/demandPlan/child/unplanned_quantity_list.js @@ -0,0 +1,223 @@ +let form, table, element, tableIns, layer; +let pageNum = 1; +layui.use(["form", "table", 'element', 'layer'], function () { + form = layui.form; + table = layui.table; + element = layui.element; + initTable(); +}); + +// 查询/重置 +function queryTable(type) { + if (type === 1) { + reloadTable(1); + } else if (type === 2) { + $('#name').val(''); + $('#module').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({ + 'name': $('#name').val(), + 'module': $('#module').val(), + }), + }, + }, + ); +} + +// 初始化表格 +function initTable() { + tableIns = table.render({ + elem: "#currentTableId", + id: 'currentTableId', + headers: { + authorization: sessionStorage.getItem("gz-token"), + }, + height: "full-140", + url: dataUrl + "backstage/planOut/getPorInfoDetail2", + where: { + encryptedData: JSON.stringify({ + 'name': $('#name').val(), + 'module': $('#module').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: "type", + width: '15%', + title: "物机类型 ", + unresize: true, + align: "center", + }, + { + field: "name", + width: '15%', + title: "物机名称", + unresize: true, + align: "center", + }, + { + field: "module", + width: '10%', + title: "规格 ", + unresize: true, + align: "center", + }, + { + field: "unit", + title: "单位", + width: '10%', + unresize: true, + align: "center", + }, + { + field: "needNum", + title: "计划外发货量", + width: '10%', + unresize: true, + align: "center", + templet: function (d) { + return setNumColor(d.needNum, 4); + }, + }, + { + field: "status", + title: "需要日期", + width: '10%', + unresize: true, + align: "center", + }, + { + field: "status", + title: "工程名称", + width: '10%', + unresize: true, + align: "center", + }, + { + title: "来源查询", + width: '10%', + align: "center", + unresize: true, + 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"); + }, + }); +} + +// 设置字体加粗 +function setFontBold(value) { + return '' + value + ""; +} + +// 数量颜色 1.需要量 2.库存量 3.超出量 4.计划外发货量 +function setNumColor(value, type) { + let color = "#409Eff"; + if (type === 1) { + color = "#409Eff"; + } else if (type === 2) { + color = "#19be6b"; + } else if (type === 3) { + color = "#f56c6c"; + }else if (type === 4) { + color = "#f56c6c"; + } + 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 ( + '