diff --git a/js/accessory/accessory_store_list.js b/js/accessory/accessory_store_list.js index 6001e78..4b63ff1 100644 --- a/js/accessory/accessory_store_list.js +++ b/js/accessory/accessory_store_list.js @@ -1,11 +1,15 @@ -let form, table, element; +let form, table, laydate; let tableIns; let pageNum = 1; // 定义分页 -layui.use(["form", "table"], function () { +layui.use(["form", "table", 'laydate'], function () { form = layui.form; table = layui.table; - element = layui.element; - element.render(); + laydate = layui.laydate; + laydate.render({ + elem: '#ID-laydate-rangeLinked', + range: ['#startDate', '#endDate'], + rangeLinked: true + }); initTable(); }); @@ -14,8 +18,9 @@ function queryTable(type) { if (type === 1) { reloadTable(1); } else if (type === 2) { - $('#proName').val(''); - $('#status').val('0'); + $('#keyWord').val(''); + $('#startDate').val(''); + $('#endDate').val(''); layui.form.render(); reloadTable(1); } @@ -34,8 +39,9 @@ function reloadTable(pageNum) { }, where: { encryptedData: JSON.stringify({ - 'proName': $('#proName').val(), - 'status': $('#status').val() + 'keyWord': $('#keyWord').val(), + 'startDate': $('#startDate').val(), + 'endDate': $('#endDate').val() }), }, }, @@ -51,11 +57,12 @@ function initTable() { authorization: sessionStorage.getItem("gz-token"), }, height: "full-170", - url: dataUrl + "backstage/planOut/getProPlanPage", + url: dataUrl + "backstage/partInput/findByPage", where: { encryptedData: JSON.stringify({ - 'proName': $('#proName').val(), - 'status': $('#status').val() + 'keyWord': $('#keyWord').val(), + 'startDate': $('#startDate').val(), + 'endDate': $('#endDate').val() }), }, request: { @@ -81,55 +88,55 @@ function initTable() { }, }, { - field: "proName", + field: "code", width: '15%', title: "入库编号", unresize: true, align: "center", }, { - field: "proName", + field: "inputUser", width: '10%', title: "入库人", unresize: true, align: "center", }, { - field: "proName", + field: "inputNum", width: '10%', title: "入库数量", unresize: true, align: "center", }, { - field: "lastDay", + field: "allPrice", width: '10%', title: "成本价格(元)", unresize: true, align: "center", }, { - field: "lastDay", + field: "inputDay", width: '10%', title: "入库时间", unresize: true, align: "center", }, { - field: "lastDay", + field: "remark", width: '19.9%', title: "备注", unresize: true, align: "center", }, { - field: "lastDay", + field: "isFlag", width: '10%', title: "单价是否录入", unresize: true, align: "center", templet: function (d) { - return setStatusColor(d.status); + return setStatusColor(d.isFlag); }, }, { @@ -151,7 +158,6 @@ function initTable() { page: true, done: function (res, curr, count) { pageNum = tableIns.config.page.curr; - element.render(); table.resize("currentTableId"); }, }); @@ -162,7 +168,7 @@ function setStatusColor(value) { value = value ? parseInt(value) : 0; let color = ""; let name = '' - if (value === 0) { + if (value === '0') { color = "#f56c6c"; } return '' + name + ""; diff --git a/page/accessory/accessory_store_list.html b/page/accessory/accessory_store_list.html index ad8afe5..4e39b07 100644 --- a/page/accessory/accessory_store_list.html +++ b/page/accessory/accessory_store_list.html @@ -22,20 +22,21 @@
- +
-
-
- - - +
+
+
+ +
+
-
+
+ +