From bfcdd0fcc35a888bd61db70a2010b64c0dea28e4 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Wed, 13 Nov 2024 11:54:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E6=96=99=E5=87=BA=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/init.json | 6 + js/accessory/accessory_out_bound_list.js | 203 +++++++++++++++++++ page/accessory/accessory_out_bound_list.html | 66 ++++++ 3 files changed, 275 insertions(+) create mode 100644 js/accessory/accessory_out_bound_list.js create mode 100644 page/accessory/accessory_out_bound_list.html diff --git a/api/init.json b/api/init.json index 6f9d95d..026fb66 100644 --- a/api/init.json +++ b/api/init.json @@ -80,6 +80,12 @@ "href": "page/accessory/accessory_store_list.html", "icon": "fa fa-tachometer", "target": "_self" + }, + { + "title": "领料出库", + "href": "page/accessory/accessory_out_bound_list.html", + "icon": "fa fa-tachometer", + "target": "_self" } ] } diff --git a/js/accessory/accessory_out_bound_list.js b/js/accessory/accessory_out_bound_list.js new file mode 100644 index 0000000..0dd1b36 --- /dev/null +++ b/js/accessory/accessory_out_bound_list.js @@ -0,0 +1,203 @@ +let form, table, laydate; +let tableIns; +let pageNum = 1; // 定义分页 +layui.use(["form", "table", 'laydate'], function () { + form = layui.form; + table = layui.table; + laydate = layui.laydate; + laydate.render({ + elem: '#ID-laydate-rangeLinked', + range: ['#startDate', '#endDate'], + rangeLinked: true + }); + initTable(); +}); + +// 查询/重置 +function queryTable(type) { + if (type === 1) { + reloadTable(1); + } else if (type === 2) { + $('#keyWord').val(''); + $('#startDate').val(''); + $('#endDate').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(), + 'startDate': $('#startDate').val(), + 'endDate': $('#endDate').val() + }), + }, + }, + ); +} + +// 初始化表格 +function initTable() { + tableIns = table.render({ + elem: "#currentTableId", + id: 'currentTableId', + headers: { + authorization: sessionStorage.getItem("gz-token"), + }, + height: "full-170", + url: dataUrl + "backstage/partInput/findByPage", + where: { + encryptedData: JSON.stringify({ + 'keyWord': $('#keyWord').val(), + 'startDate': $('#startDate').val(), + 'endDate': $('#endDate').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: '10%', + title: "领料单编号", + unresize: true, + align: "center", + }, + { + field: "inputUser", + width: '10%', + title: "领用类型", + unresize: true, + align: "center", + }, + { + field: "inputNum", + width: '10%', + title: "领用人", + unresize: true, + align: "center", + }, + { + field: "allPrice", + width: '10%', + title: "联系电话", + unresize: true, + align: "center", + }, + { + field: "inputDay", + width: '10%', + title: "领用数量", + unresize: true, + align: "center", + }, + { + field: "inputDay", + width: '10%', + title: "状态", + unresize: true, + align: "center", + templet: function (d) { + return setCheckStatus(d.status); + }, + }, + { + field: "remark", + width: '20%', + title: "备注", + unresize: true, + align: "center", + }, + { + title: "操作", + width: '10%', + align: "center", + unresize: true, + templet: function (d) { + let html = ""; + html += "详情"; + html += "