diff --git a/js/accessory/inventory_statistics_list.js b/js/accessory/inventory_statistics_list.js index 9f53e25..0981908 100644 --- a/js/accessory/inventory_statistics_list.js +++ b/js/accessory/inventory_statistics_list.js @@ -142,13 +142,22 @@ function initTable() { title: "库存数量", unresize: true, align: "center", + templet: function (d) { + if(d.num > 0){ + return d.num; + } + return '
' + d.num + '
'; + }, }, { field: "price", width: '15%', title: "平均单价(元)", unresize: true, - align: "center" + align: "center", + templet: function (d) { + return ' ¥ ' + d.price; + }, }, ], ], diff --git a/js/accessory/pro_count_list.js b/js/accessory/pro_count_list.js index 8cc0154..82b82be 100644 --- a/js/accessory/pro_count_list.js +++ b/js/accessory/pro_count_list.js @@ -1,15 +1,9 @@ -let form, table, laydate; +let form, table; let tableIns; let pageNum = 1; // 定义分页 -layui.use(["form", "table", 'laydate'], function () { +layui.use(["form", "table"], function () { form = layui.form; table = layui.table; - laydate = layui.laydate; - laydate.render({ - elem: '#ID-laydate-rangeLinked', - range: ['#startDay', '#endDay'], - rangeLinked: true - }); initTable(); }); @@ -18,9 +12,8 @@ function queryTable(type) { if (type === 1) { reloadTable(1); } else if (type === 2) { - $('#keyWord').val(''); - $('#startDate').val(''); - $('#endDate').val(''); + $('#proName').val(''); + $('#proStatus').val(''); layui.form.render(); reloadTable(1); } @@ -39,9 +32,8 @@ function reloadTable(pageNum) { }, where: { encryptedData: JSON.stringify({ - 'keyWord': $('#keyWord').val(), - 'startDate': $('#startDate').val(), - 'endDate': $('#endDate').val() + 'proName': $('#proName').val(), + 'proStatus': $('#proStatus').val() }), }, }, @@ -57,12 +49,11 @@ function initTable() { authorization: sessionStorage.getItem("gz-token"), }, height: "full-170", - url: dataUrl + "backstage/partInput/findByPage", + url: dataUrl + "backstage/statistic/getProListPage", where: { encryptedData: JSON.stringify({ - 'keyWord': $('#keyWord').val(), - 'startDate': $('#startDate').val(), - 'endDate': $('#endDate').val() + 'proName': $('#proName').val(), + 'proStatus': $('#proStatus').val() }), }, request: { @@ -88,40 +79,40 @@ function initTable() { }, }, { - field: "code", + field: "proName", width: '15%', title: "工程名称", unresize: true, align: "center", }, { - field: "inputUser", + field: "proStatus", width: '8%', title: "工程状态", unresize: true, align: "center", templet: function (d) { - return setProStatus('1'); + return setProStatus(d.proStatus); }, }, { - field: "inputNum", + field: "wxdNum", width: '10%', title: "维修单数量", unresize: true, align: "center", templet: function (d) { - return '1'; + return '' + setNullNumValue(d.wxdNum) + ''; }, }, { - field: "allPrice", + field: "lydNum", width: '10%', title: "配件领料单数量", unresize: true, align: "center", templet: function (d) { - return '1'; + return '' + setNullNumValue(d.lydNum) + ''; }, }, { @@ -141,10 +132,9 @@ function initTable() { unresize: true, align: "center", templet: function (d) { - return '领:2,563
'; - // return '领:2,563
用:2,000
退:563
'; + return '领:' + setNullNumValue(d.lyNum) + '
'; }, - + }, { field: "remark", @@ -153,8 +143,7 @@ function initTable() { unresize: true, align: "center", templet: function (d) { - return '领:2,563
'; - // return '领:2,563
用:2,000
退:563
'; + return '领:' + setNullNumValue(d.lyMoney) + '
'; }, }, { @@ -184,10 +173,10 @@ function initTable() { function exportExcel() { let params = { 'proName': $('#proName').val(), - 'status': $('#status').val() + 'proStatus': $('#proStatus').val() } - let url = dataUrl + "backstage/export/exportFhList"; - exportExcelUtil(url, '配件入库数据', JSON.stringify(params)); + let url = dataUrl + "backstage/statistic/exportProListPage"; + exportExcelUtil(url, '工程统计', JSON.stringify(params)); } // 配件退料详情 @@ -201,5 +190,7 @@ function setProStatus(status) { return "●在建"; } else if (status === '2') { return "●完工"; + } else { + return ''; } } \ No newline at end of file diff --git a/js/public.js b/js/public.js index 6978d3f..b0451fa 100644 --- a/js/public.js +++ b/js/public.js @@ -148,6 +148,16 @@ function setNullValue(value) { return value; } +// 数字空值赋值 +function setNullNumValue(value) { + if (value === 0) { + return 0; + } else if (!value || value === 'null') { + return 0; + } + return value; +} + function getUrlParam(key) { var href = window.location.href; var url = href.split("?"); diff --git a/page/accessory/pro_count_list.html b/page/accessory/pro_count_list.html index 926a48a..355d2ce 100644 --- a/page/accessory/pro_count_list.html +++ b/page/accessory/pro_count_list.html @@ -22,12 +22,13 @@