diff --git a/api/init.json b/api/init.json index 10e9069..762bde0 100644 --- a/api/init.json +++ b/api/init.json @@ -26,18 +26,6 @@ "href": "page/welcome-1.html", "icon": "fa fa-tachometer", "target": "_self" - }, - { - "title": "首页1", - "href": "page/welcome-2.html", - "icon": "fa fa-tachometer", - "target": "_self" - }, - { - "title": "首页1", - "href": "page/welcome-3.html", - "icon": "fa fa-tachometer", - "target": "_self" } ] }, @@ -82,7 +70,7 @@ "target": "_self" }, { - "title": "工程统计", + "title": "库存统计", "href": "page/accessory/inventory_statistics_list.html", "icon": "fa fa-tachometer", "target": "_self" diff --git a/js/accessory/inventory_statistics_list.js b/js/accessory/inventory_statistics_list.js index b9e0c33..c0d5f3c 100644 --- a/js/accessory/inventory_statistics_list.js +++ b/js/accessory/inventory_statistics_list.js @@ -1,298 +1,173 @@ -let form, table, element; +let form, table; let tableIns; let pageNum = 1; // 定义分页 layui.use(["form", "table"], function () { - form = layui.form; - table = layui.table; - element = layui.element; - // 动态插入进度条元素 - /* $("#num-progress").after(` -
-
-
- `); - $("#num-progress2").after(` -
-
-
- `); - $("#num-progress3").after(` -
-
-
- `); */ - element.render(); - initTable(); - getStatistics(); + form = layui.form; + table = layui.table; + initTable(); + getStatistics(); }); // 数据概览 function getStatistics() { - let url = dataUrl + 'backstage/planOut/getStatistics'; - ajaxRequest(url, "POST", null, true, function () { - }, function (result) { - console.log(result); - if (result.code === 200) { - setNum(result.data); - } - }, function (xhr, status, error) { - errorFn(xhr, status, error) - }, null); + let url = dataUrl + 'backstage/planOut/getStatistics'; + ajaxRequest(url, "POST", null, true, function () { + }, function (result) { + console.log(result); + if (result.code === 200) { + setNum(result.data); + } + }, function (xhr, status, error) { + errorFn(xhr, status, error) + }, null); - // 数据概览赋值 - function setNum(obj) { - $('#totalNum').html(obj.needNum); - $('#dfhNum').html(obj.dfhNum); - $('#fhNum').html(obj.fhNum); - $('#overNum').html(obj.overNum); - $('#noPlanNum').html(obj.noPlanNum); - /* $('#dfh').html(obj.dfh + '%'); - $('#yfh').html(obj.yfh + '%'); - let dfh = obj.dfh; - let yfh = obj.yfh; - $("#num-progress").after(` -
-
-
- `); - $("#num-progress2").after(` -
-
-
- `); - $("#num-progress3").after(` -
-
-
- `); */ - } + // 数据概览赋值 + function setNum(obj) { + $('#totalNum').html(obj.needNum); + $('#dfhNum').html(obj.dfhNum); + $('#fhNum').html(obj.fhNum); + $('#overNum').html(obj.overNum); + $('#noPlanNum').html(obj.noPlanNum); + } } // 查询/重置 function queryTable(type) { - if (type === 1) { - reloadTable(1); - } else if (type === 2) { - $('#proName').val(''); - $('#status').val('0'); - layui.form.render(); - reloadTable(1); - } + if (type === 1) { + reloadTable(1); + } else if (type === 2) { + $('#type').val(''); + $('#name').val(''); + $('#model').val(''); + $('#status').val(''); + layui.form.render(); + reloadTable(1); + } } // 刷新页面数据 function reloadData() { - reloadData(pageNum); + reloadData(pageNum); } // 重载表格 function reloadTable(pageNum) { - table.reload("currentTableId", { - page: { - curr: pageNum ? pageNum : 1, + table.reload("currentTableId", { + page: { + curr: pageNum ? pageNum : 1, + }, + where: { + encryptedData: JSON.stringify({ + 'type': $('#type').val(), + 'name': $('#name').val(), + 'model': $('#model').val(), + 'status': $('#status').val() + }), + }, }, - where: { - encryptedData: JSON.stringify({ - 'proName': $('#proName').val(), - 'status': $('#status').val() - }), - }, - }, - ); + ); } // 初始化表格 function initTable() { - tableIns = table.render({ - elem: "#currentTableId", - id: 'currentTableId', - headers: { - authorization: sessionStorage.getItem("gz-token"), - }, - height: "full-350", - url: dataUrl + "backstage/planOut/getProPlanPage", - where: { - encryptedData: JSON.stringify({ - 'proName': $('#proName').val(), - 'status': $('#status').val() - }), - }, - request: { - pageName: 'pageNum', - limitName: 'pageSize' - }, - parseData: function (res) { // res 即为原始返回的数据 - return { - "code": 0, // 解析接口状态 - "msg": '获取成功', // 解析提示文本 - "count": res.total, // 解析数据长度 - "data": res.list // 解析数据列表 - }; - }, - cols: [ - [ - { - width: '5%', - title: "序号", - align: "center", - templet: function (d) { - return d.LAY_NUM; - }, + tableIns = table.render({ + elem: "#currentTableId", + id: 'currentTableId', + headers: { + authorization: sessionStorage.getItem("gz-token"), }, - { - field: "proName", - width: '20%', - title: "工程名称", - unresize: true, - align: "center", + height: "full-300", + url: dataUrl + "backstage/planOut/getProPlanPage", + where: { + encryptedData: JSON.stringify({ + 'type': $('#type').val(), + 'name': $('#name').val(), + 'model': $('#model').val(), + 'status': $('#status').val() + }), }, - { - field: "planNum", - width: '10%', - title: "需求计划数量", - unresize: true, - align: "center", - templet: function (d) { - let html = ""; - html += "" + setNumColor(d.planNum) + ""; - return html; - }, + request: { + pageName: 'pageNum', + limitName: 'pageSize' }, - { - field: "recordNum", - width: '10%', - title: "出库单数量 ", - unresize: true, - align: "center", - templet: function (d) { - return setNumColor(d.recordNum); - }, + parseData: function (res) { // res 即为原始返回的数据 + return { + "code": 0, // 解析接口状态 + "msg": '获取成功', // 解析提示文本 + "count": res.total, // 解析数据长度 + "data": res.list // 解析数据列表 + }; }, - { - field: "status", - title: "发货状态", - width: '10%', - unresize: true, - align: "center", - templet: function (d) { - return setStatusColor(d.status); - }, + cols: [ + [ + { + width: '9.9%', + title: "序号", + align: "center", + templet: function (d) { + return d.LAY_NUM; + }, + }, + { + field: "proName", + width: '15%', + title: "配件类型", + unresize: true, + align: "center", + }, + { + field: "planNum", + width: '15%', + title: "配件名称", + unresize: true, + align: "center", + }, + { + field: "recordNum", + width: '15%', + title: "规格型号 ", + unresize: true, + align: "center", + }, + { + field: "status", + title: "计量单位", + width: '15%', + unresize: true, + align: "center", + }, + { + field: "lastDay", + width: '15%', + title: "库存数量", + unresize: true, + align: "center", + }, + { + field: "progress", + width: '15%', + title: "平均单价(元)", + unresize: true, + align: "center" + }, + ], + ], + limits: [10, 15, 20, 25, 50, 100], + limit: 10, + page: true, + done: function (res, curr, count) { + pageNum = tableIns.config.page.curr; + table.resize("currentTableId"); }, - { - field: "lastDay", - width: '15%', - title: "最后发货时间", - unresize: true, - align: "center", - }, - { - field: "progress", - width: '19.85%', - title: "进度", - unresize: true, - align: "center", - templet: schedule, - }, - { - title: "操作", - width: '10%', - align: "center", - unresize: true, - templet: function (d) { - let html = ""; - 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 setNumColor(value) { - return '' + value + ""; -} - -// 发货状态颜色 -function setStatusColor(value) { - value = value ? parseInt(value) : 0; - let color = "#409Eff"; - let name = '' - if (value === 0) { - color = "#f56c6c"; - name = '未发货'; - } else if (value === 1) { - color = "#ff9900"; - name = '部分发货' - } else if (value === 2) { - color = "#19be6b"; - name = '全部发货' - } - return '' + name + ""; -} - -// 设置进度值 -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 params = { - 'proName': $('#proName').val(), - 'status': $('#status').val() - } - let url = dataUrl + "backstage/export/exportFhList"; - exportExcelUtil(url, '机具公司发货数据', JSON.stringify(params)); -} - -// 发货详情 -function deliveryDetail(obj) { - openIframeByParamObj("deliveryDetail", "详情", "../demandPlan/child/delivery_detail_list.html", "92%", "95%", obj); -} - -// 发货 -function sendGoods(obj) { - openIframeByParamObj("sendGoods", "发货", "../demandPlan/child/send_goods_form.html", "92%", "95%", obj); -} - -// type 1.总需求量 2.待发货量 3.已发货量 -function openViewData(type) { - openIframeByParam("viewData", "数据概览", "../demandPlan/child/view_data_list.html", "92%", "95%", type); -} - -// type 1.超库存量 2.计划外量 -function earlyInfo(type) { - openIframeByParam("viewData", "预警信息", "../demandPlan/child/early_info_list.html", "92%", "95%", type); -} - -// 需求计划 -function view_plan(obj) { - openIframeByParamObj("view_plan", "需求计划", "../demandPlan/child/demand_plan_detail_list.html", "92%", "95%", obj); + let params = { + 'proName': $('#proName').val(), + 'status': $('#status').val() + } + let url = dataUrl + "backstage/export/exportFhList"; + exportExcelUtil(url, '机具公司发货数据', JSON.stringify(params)); } \ No newline at end of file diff --git a/page/accessory/inventory_statistics_list.html b/page/accessory/inventory_statistics_list.html index e48d248..ad7fa6c 100644 --- a/page/accessory/inventory_statistics_list.html +++ b/page/accessory/inventory_statistics_list.html @@ -12,66 +12,84 @@ +
- 数据预览 + 数据概览
-
-
+
+
-

总需求计划量

-

0

+

配件类型

+
+

0

+

+
-
-
+
+
-

待发货量

-

- +

配件库存

+
+

+

+
-
-
+
+
-

已发货量

-

- +

配件价值

+
+

+

+
-
-

预警信息

-
-

超库存量

-

0

+
+
+
+

配件预警(库存为0)

+
+

200

+

+
+
+
+ +
-
-

计划外量

-

0

-
-
@@ -82,24 +100,36 @@
- + +
+
+
+
+ +
+
+
+
+
- +