From 1bae911c36fb5e24fe7414a7bd51b468f6ad7d47 Mon Sep 17 00:00:00 2001 From: hayu <1604366271@qq.com> Date: Thu, 17 Jul 2025 16:55:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=B7=A5=E7=A8=8B=E9=A2=86?= =?UTF-8?q?=E7=94=A8=E9=85=8D=E4=BB=B6=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/accessory/child/part_detail.js | 169 ++++++++++++++++++++++ js/accessory/child/pro_part_detail.js | 139 ++++++++++++++++++ js/accessory/device_pro_list.js | 157 ++++++++++++++++++++ page/accessory/child/part_detail.html | 64 ++++++++ page/accessory/child/pro_part_detail.html | 51 +++++++ page/accessory/device_pro_list.html | 51 +++++++ 6 files changed, 631 insertions(+) create mode 100644 js/accessory/child/part_detail.js create mode 100644 js/accessory/child/pro_part_detail.js create mode 100644 js/accessory/device_pro_list.js create mode 100644 page/accessory/child/part_detail.html create mode 100644 page/accessory/child/pro_part_detail.html create mode 100644 page/accessory/device_pro_list.html diff --git a/js/accessory/child/part_detail.js b/js/accessory/child/part_detail.js new file mode 100644 index 0000000..0fff88e --- /dev/null +++ b/js/accessory/child/part_detail.js @@ -0,0 +1,169 @@ +let form, table, laydate; +let tableIns; +let pageNum = 1; // 定义分页 + + +function setParams(params) { + objParam = JSON.parse(params); + layui.use(["form", "table", 'upload', 'layer', 'laydate'], function () { + form = layui.form; + table = layui.table; + laydate = layui.laydate; + laydate.render({ + elem: '#ID-laydate-rangeLinked', + range: ['#startDay', '#endDay'], + rangeLinked: true + }); + initTable(); + }); +} + +// 查询/重置 +function queryTable(type) { + if (type === 1) { + let keyWord = $('#keyWord').val(); + let flag = checkValue(keyWord); + if (flag) { + $('#keyWord').val(''); + return layer.msg('关键字查询包含特殊字符,请重新输入', { icon: 2 }); + } + reloadTable(1); + } else if (type === 2) { + $('#keyWord').val(''); + $('#startDay').val(''); + $('#endDay').val(''); + layui.form.render(); + reloadTable(1); + } +} + +// 刷新页面数据 +function reloadData() { + reloadTable(pageNum); +} + +// 重载表格 +function reloadTable(pageNum) { + table.reload("currentTableId", { + page: { + curr: pageNum ? pageNum : 1, + }, + where: { + encryptedData: JSON.stringify({ + 'keyWord': $('#keyWord').val(), + 'deviceId': objParam.deviceId, + 'proId': objParam.proId, + 'startDay': $('#startDay').val(), + 'endDay': $('#endDay').val() + }), + }, + }, + ); +} + +// 初始化表格 +function initTable() { + tableIns = table.render({ + elem: "#currentTableId", + id: 'currentTableId', + headers: { + authorization: sessionStorage.getItem("gz-token"), + }, + height: "full-170", + url: dataUrl + "backstage/statistic/getPartList", + where: { + encryptedData: JSON.stringify({ + 'keyWord': $('#keyWord').val(), + 'deviceId': objParam.deviceId, + 'proId': objParam.proId, + 'startDay': $('#startDay').val(), + 'endDay': $('#endDay').val() + }), + }, + request: { + pageName: 'pageNum', + limitName: 'pageSize' + }, + parseData: function (res) { // res 即为原始返回的数据 + if(res.code === 401){ + closeWindowOpen(); + } + return { + "code": 0, // 解析接口状态 + "msg": '获取成功', // 解析提示文本 + "count": res.total, // 解析数据长度 + "data": res.list // 解析数据列表 + }; + }, + cols: [ + [ + { + width: '5%', + title: "序号", + align: "center", + templet: function (d) { + return d.LAY_NUM; + }, + }, + { + width: '15%', + title: "配件领用设备", + unresize: true, + align: "center", + templet: function (d) { + return objParam.module; + }, + }, + { + field: "proName", + width: '15%', + title: "领用工程", + unresize: true, + align: "center", + }, + { + field: "code", + width: '14%', + title: "领料单编号", + unresize: true, + align: "center", + }, + { + field: "partName", + width: '15%', + title: "配件名称", + unresize: true, + align: "center", + }, + { + field: "partModel", + width: '12%', + title: "配件规格", + unresize: true, + align: "center", + }, + { + field: "applyNum", + width: '8%', + title: "领用数量", + unresize: true, + align: "center", + }, + { + field: "createTime", + 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"); + }, + }); +} diff --git a/js/accessory/child/pro_part_detail.js b/js/accessory/child/pro_part_detail.js new file mode 100644 index 0000000..f58c766 --- /dev/null +++ b/js/accessory/child/pro_part_detail.js @@ -0,0 +1,139 @@ +let form, table; +let tableIns; +let pageNum = 1; // 定义分页 + + +function setParams(params) { + objParam = JSON.parse(params); + layui.use(["form", "table", 'upload', 'layer'], function () { + form = layui.form; + table = layui.table; + initTable(); + }); +} + +// 查询/重置 +function queryTable(type) { + if (type === 1) { + let keyWord = $('#keyWord').val(); + let flag = checkValue(keyWord); + if (flag) { + $('#keyWord').val(''); + return layer.msg('关键字查询包含特殊字符,请重新输入', { icon: 2 }); + } + reloadTable(1); + } else if (type === 2) { + $('#keyWord').val(''); + // $('#proStatus').val(''); + layui.form.render(); + reloadTable(1); + } +} + +// 刷新页面数据 +function reloadData() { + reloadTable(pageNum); +} + +// 重载表格 +function reloadTable(pageNum) { + table.reload("currentTableId", { + page: { + curr: pageNum ? pageNum : 1, + }, + where: { + encryptedData: JSON.stringify({ + 'keyWord': $('#keyWord').val(), + 'id': objParam.id + }), + }, + }, + ); +} + +// 初始化表格 +function initTable() { + tableIns = table.render({ + elem: "#currentTableId", + id: 'currentTableId', + headers: { + authorization: sessionStorage.getItem("gz-token"), + }, + height: "full-170", + url: dataUrl + "backstage/statistic/getListDetails", + where: { + encryptedData: JSON.stringify({ + 'keyWord': $('#keyWord').val(), + 'id': objParam.id + }), + }, + request: { + pageName: 'pageNum', + limitName: 'pageSize' + }, + parseData: function (res) { // res 即为原始返回的数据 + if(res.code === 401){ + closeWindowOpen(); + } + return { + "code": 0, // 解析接口状态 + "msg": '获取成功', // 解析提示文本 + "count": res.total, // 解析数据长度 + "data": res.list // 解析数据列表 + }; + }, + cols: [ + [ + { + width: '20%', + title: "序号", + align: "center", + templet: function (d) { + return d.LAY_NUM; + }, + }, + { + width: '30%', + title: "配件领用设备", + unresize: true, + align: "center", + templet: function (d) { + return objParam.module; + }, + }, + { + field: "proName", + width: '30%', + title: "领用工程", + unresize: true, + align: "center", + }, + { + title: "领用配件详情", + width: '20%', + align: "center", + unresize: true, + templet: function (d) { + let html = ""; + d.module=objParam.module; + 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 partDetail(obj) { + openIframeByParamObj("part_detail", "配件详情", "./part_detail.html", "92%", "95%", obj); +} diff --git a/js/accessory/device_pro_list.js b/js/accessory/device_pro_list.js new file mode 100644 index 0000000..c14239e --- /dev/null +++ b/js/accessory/device_pro_list.js @@ -0,0 +1,157 @@ +let form, table; +let tableIns; +let pageNum = 1; // 定义分页 +layui.use(["form", "table"], function () { + form = layui.form; + table = layui.table; + initTable(); +}); + +// 查询/重置 +function queryTable(type) { + if (type === 1) { + let keyWord = $('#keyWord').val(); + let flag = checkValue(keyWord); + if (flag) { + $('#keyWord').val(''); + return layer.msg('关键字查询包含特殊字符,请重新输入', { icon: 2 }); + } + reloadTable(1); + } else if (type === 2) { + $('#keyWord').val(''); + // $('#proStatus').val(''); + layui.form.render(); + reloadTable(1); + } +} + +// 刷新页面数据 +function reloadData() { + reloadTable(pageNum); +} + +// 重载表格 +function reloadTable(pageNum) { + table.reload("currentTableId", { + page: { + curr: pageNum ? pageNum : 1, + }, + where: { + encryptedData: JSON.stringify({ + 'keyWord': $('#keyWord').val(), + // 'proStatus': $('#proStatus').val() + }), + }, + }, + ); +} + +// 初始化表格 +function initTable() { + tableIns = table.render({ + elem: "#currentTableId", + id: 'currentTableId', + headers: { + authorization: sessionStorage.getItem("gz-token"), + }, + height: "full-170", + url: dataUrl + "backstage/statistic/findListByPage", + where: { + encryptedData: JSON.stringify({ + 'keyWord': $('#keyWord').val(), + }), + }, + request: { + pageName: 'pageNum', + limitName: 'pageSize' + }, + parseData: function (res) { // res 即为原始返回的数据 + if(res.code === 401){ + closeWindowOpen(); + } + return { + "code": 0, // 解析接口状态 + "msg": '获取成功', // 解析提示文本 + "count": res.total, // 解析数据长度 + "data": res.list // 解析数据列表 + }; + }, + cols: [ + [ + { + width: '15%', + title: "序号", + align: "center", + templet: function (d) { + return d.LAY_NUM; + }, + }, + { + field: "module", + width: '24.5%', + title: "配件领用设备", + unresize: true, + align: "center", + sort:true, + }, + { + field: "deviceCode", + width: '20%', + title: "设备编号", + unresize: true, + align: "center", + }, + { + field: "remark", + width: '20%', + title: "备注", + unresize: true, + align: "center", + }, + { + title: "领用工程", + width: '20%', + align: "center", + unresize: true, + templet: function (d) { + let html = ""; + html += "" + d.num + ""; + 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 exportExcel() { + let params = { + 'keyWord': $('#keyWord').val(), + } + let url = dataUrl + "backstage/statistic/exportProListPage"; + exportExcelUtil(url, '工程统计', JSON.stringify(params)); +} + +// 配件退料详情 +function proCountDetail(obj) { + openIframeByParamObj("pro_part_detail", "工程详情", "./child/pro_part_detail.html", "92%", "95%", obj); +} + +// 工程状态 +function setProStatus(status) { + if (status === '1') { + return "●在建"; + } else if (status === '2') { + return "●完工"; + } else { + return '/'; + } +} \ No newline at end of file diff --git a/page/accessory/child/part_detail.html b/page/accessory/child/part_detail.html new file mode 100644 index 0000000..5dd33c4 --- /dev/null +++ b/page/accessory/child/part_detail.html @@ -0,0 +1,64 @@ + + + +
+ +