From 51ce7fe67afd0e5cbcc4a46d684d1178827c4f0d Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Wed, 13 Nov 2024 18:49:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E4=BB=B6=E6=8A=A5=E5=BA=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/init.json | 6 + js/accessory/accessory_scrap_list.js | 178 +++++++++++++++++++++++ page/accessory/accessory_scrap_list.html | 68 +++++++++ 3 files changed, 252 insertions(+) create mode 100644 js/accessory/accessory_scrap_list.js create mode 100644 page/accessory/accessory_scrap_list.html diff --git a/api/init.json b/api/init.json index 43588e7..5240e6a 100644 --- a/api/init.json +++ b/api/init.json @@ -98,6 +98,12 @@ "href": "page/accessory/inventory_count_list.html", "icon": "fa fa-tachometer", "target": "_self" + }, + { + "title": "配件报废", + "href": "page/accessory/accessory_scrap_list.html", + "icon": "fa fa-tachometer", + "target": "_self" } ] } diff --git a/js/accessory/accessory_scrap_list.js b/js/accessory/accessory_scrap_list.js new file mode 100644 index 0000000..95a5492 --- /dev/null +++ b/js/accessory/accessory_scrap_list.js @@ -0,0 +1,178 @@ +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: '15%', + title: "报废编号", + unresize: true, + align: "center", + }, + { + field: "inputUser", + width: '15%', + title: "报废人", + unresize: true, + align: "center", + }, + { + field: "inputNum", + width: '15%', + title: "报废数量", + unresize: true, + align: "center", + }, + { + field: "allPrice", + width: '15%', + title: "报废时间", + unresize: true, + align: "center", + }, + { + field: "remark", + width: '20%', + title: "备注", + 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; + table.resize("currentTableId"); + }, + }); +} + +//审核状态 +function setCheckStatus(status) { + if (status === '1') { + return "●待审核"; + } else if (status === '2') { + return "●审核通过"; + } else if (status === '3') { + return "●审核驳回"; + } + return "●待审核"; +} + +// 导出 +function exportExcel() { + let params = { + 'proName': $('#proName').val(), + 'status': $('#status').val() + } + let url = dataUrl + "backstage/export/exportFhList"; + exportExcelUtil(url, '配件入库数据', JSON.stringify(params)); +} + +// 详情 配件报废 +function accessoryScrapDetail(obj) { + openIframeByParamObj("accessory_scrap_detail", "配件出库记录", "../accessory/child/accessory_out_bound_detail.html", "92%", "95%", obj); +} + +// 配件报废 +function accessoryScrap(obj) { + openIframeByParamObj("accessory_scrap", "配件报废", "../accessory/child/accessory_out_bound_detail.html", "92%", "95%", obj); +} \ No newline at end of file diff --git a/page/accessory/accessory_scrap_list.html b/page/accessory/accessory_scrap_list.html new file mode 100644 index 0000000..bc8d917 --- /dev/null +++ b/page/accessory/accessory_scrap_list.html @@ -0,0 +1,68 @@ + + + +
+ +