From 1cbf2e49f31f550508dcd90afab6171d51330ee4 Mon Sep 17 00:00:00 2001 From: syruan <321359594@qq.com> Date: Sun, 25 May 2025 12:44:28 +0800 Subject: [PATCH] =?UTF-8?q?refactor(api):=20=E9=87=8D=E6=9E=84=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E7=B3=BB=E7=BB=9F=E8=8F=9C=E5=8D=95=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 调整菜单结构,合并相似功能模块 - 新增工程物料统计功能 - 优化采购发货流程,移除不必要的验证- 更新UI样式,调整侧边栏宽度 --- api/init.json | 72 +++-- css/custom-sidebar.css | 97 ++++++ css/layuimini.css | 6 +- js/aq_demand_plan/child/send_out_form.js | 9 - .../child/send_out_form_table.js | 6 +- .../project_material_statistics.js | 290 ++++++++++++++++++ page/aq_demand_plan/child/send_out_form.html | 17 +- .../project_material_statistics.html | 144 +++++++++ 8 files changed, 579 insertions(+), 62 deletions(-) create mode 100644 css/custom-sidebar.css create mode 100644 js/aq_inventory/project_material_statistics.js create mode 100644 page/aq_inventory/project_material_statistics.html diff --git a/api/init.json b/api/init.json index dec4568..812b354 100644 --- a/api/init.json +++ b/api/init.json @@ -16,9 +16,9 @@ "target": "_self", "child": [ { - "title": "系统管理", + "title": "安全系统基础管理", "href": "", - "icon": "fa fa-book", + "icon": "fa fa-cog", "target": "_self", "child": [ { @@ -28,36 +28,10 @@ "target": "_self" }, { - "title": "审核人员配置", - "href": "page/system/audit_user_set_list.html", - "icon": "fa fa-shield", - "target": "_self" - } - ] - }, - { - "title": "基础管理", - "href": "", - "icon": "fa fa-cog", - "target": "_self", - "child": [ - { - "title": "类型管理", + "title": "安全用品物资类型", "href": "page/aq_basic/type_list.html", "icon": "fa fa-asterisk", "target": "_self" - }, - { - "title": "供应商管理", - "href": "page/aq_basic/supplier_list.html", - "icon": "fa fa-university", - "target": "_self" - }, - { - "title": "框架合同", - "href": "page/aq_basic/framework_contract_list.html", - "icon": "fa fa-file-o", - "target": "_self" } ] }, @@ -80,27 +54,39 @@ "target": "_self" }, { - "title": "采购发货", + "title": "调拨 / 发货", "href": "page/aq_demand_plan/send_out_list.html", "icon": "fa fa-shield", "target": "_self" + }, + { + "title": "计划审核人员配置", + "href": "page/system/audit_user_set_list.html", + "icon": "fa fa-shield", + "target": "_self" } ] }, { - "title": "库存管理", + "title": "安全用品库存管理", "href": "", "icon": "fa fa-th", "target": "_self", "child": [ { - "title": "库存统计", + "title": "工程领退台账", + "href": "page/aq_inventory/project_material_statistics.html", + "icon": "fa fa-th-large", + "target": "_self" + }, + { + "title": "安全用品库存统计", "href": "page/aq_inventory/inventory_count_list.html", "icon": "fa fa-th-large", "target": "_self" }, { - "title": "库存盘点", + "title": "安全用品库存盘点", "href": "page/aq_inventory/inventory_take_stock.html", "icon": "fa fa-th-large", "target": "_self" @@ -108,19 +94,19 @@ ] }, { - "title": "退料管理", + "title": "安全用品退料", "href": "", "icon": "fa fa-th", "target": "_self", "child": [ { - "title": "退料清点", + "title": "安全用品退料清点", "href": "page/aq_back_material/back_material_list.html", "icon": "fa fa-th-large", "target": "_self" }, { - "title": "退料检验", + "title": "安全用品退料检验", "href": "page/aq_back_material/back_check.html", "icon": "fa fa-th-large", "target": "_self" @@ -128,11 +114,23 @@ ] }, { - "title": "结算管理", + "title": "供应商管理", "href": "", "icon": "fa fa-th", "target": "_self", "child": [ + { + "title": "安全用品供应商", + "href": "page/aq_basic/supplier_list.html", + "icon": "fa fa-university", + "target": "_self" + }, + { + "title": "供应商框架合同", + "href": "page/aq_basic/framework_contract_list.html", + "icon": "fa fa-file-o", + "target": "_self" + }, { "title": "供应商结算统计", "href": "page/aq_settlement/settlement_list.html", diff --git a/css/custom-sidebar.css b/css/custom-sidebar.css new file mode 100644 index 0000000..1c790b4 --- /dev/null +++ b/css/custom-sidebar.css @@ -0,0 +1,97 @@ +/* 自定义侧边栏宽度样式 */ + +/* 修改左侧菜单宽度为250px */ +.layui-side { + width: 232px !important; +} + +.layui-layout-admin .layui-side { + width: 232px !important; +} + +/* 修改菜单容器和列表的宽度 */ +.layuimini-menu-left { + width: 232px !important; +} + +.layuimini-menu-left > ul { + width: 232px !important; +} + +.layuimini-menu-left .layui-nav { + width: 232px !important; +} + +.layuimini-menu-left .layui-nav-item { + width: 232px !important; +} + +/* 修改子菜单的宽度 */ +.layuimini-menu-left .layui-nav-child { + width: 232px !important; +} + +.layuimini-menu-left .layui-nav-child dd { + width: 232px !important; +} + +/* 调整主体内容区域的左边距 */ +.layui-body { + left: 232px !important; +} + +.layui-layout-admin .layui-body { + left: 232px !important; +} + +/* 调整logo区域宽度 */ +.layui-layout-admin .layui-logo { + width: 232px !important; +} + +/* 调整底部区域的左边距 */ +.layui-layout-admin .layui-footer { + left: 232px !important; +} + +/* 调整layuimini相关样式 */ +.layui-layout-left { + left: 232px !important; +} + +.layuimini-tool { + left: 255px !important; +} + +/* 调整侧边栏滚动区域 */ +.layui-side-scroll { + width: 240px !important; +} + +/* 响应式设计调整 */ +@media screen and (min-width: 1025px) { + .layuimini-mini .layui-layout-admin .layui-body { + left: 60px !important; + } + + .layuimini-mini .layui-side { + width: 60px !important; + } + + /* 缩放状态下的菜单宽度 */ + .layuimini-mini .layuimini-menu-left { + width: 60px !important; + } + + .layuimini-mini .layuimini-menu-left > ul { + width: 60px !important; + } +} + +/* 手机端适配 */ +@media screen and (max-width: 1024px) { + .layuimini-all .layui-layout-admin .layuimini-menu-left, + .layuimini-all .layui-header .layuimini-logo { + left: -250px !important; + } +} \ No newline at end of file diff --git a/css/layuimini.css b/css/layuimini.css index 09428a5..b5b5e73 100644 --- a/css/layuimini.css +++ b/css/layuimini.css @@ -59,7 +59,7 @@ } .layui-layout-left { - left: 295px !important; + left: 345px !important; } .layui-nav.layui-layout-left.layuimini-header-menu.layuimini-pc-show { @@ -99,7 +99,7 @@ .layuimini-tool { position: absolute !important; top: 0; - left: 235px; + left: 285px; width: 60px; height: 100%; line-height: 60px; @@ -795,7 +795,7 @@ /**菜单缩放*/ .layuimini-mini .layuimini-menu-left .layui-nav-more,.layuimini-mini .layuimini-menu-left .layui-nav-child{ - display: none;!important; + display: none !important; } } diff --git a/js/aq_demand_plan/child/send_out_form.js b/js/aq_demand_plan/child/send_out_form.js index 720db29..1f53398 100644 --- a/js/aq_demand_plan/child/send_out_form.js +++ b/js/aq_demand_plan/child/send_out_form.js @@ -155,16 +155,7 @@ function beforeSubmitApply() { if (!l.supId) { return layer.msg('序号为' + (i + 1) + '的数据,未选择供应商', { icon: 7 }); } - if (!l.ccDay) { - return layer.msg('序号为' + (i + 1) + '的数据,未选择出厂日期', { icon: 7 }); - } - if (!l.jyDay) { - return layer.msg('序号为' + (i + 1) + '的数据,未选择检验日期', { icon: 7 }); - } } - // if (parseInt(o.needNum) < (cgNum + lkNum)) { // 采购量 大于需求量 - // return layer.msg('序号为' + (i + 1) + '的数据,采购量和利库量不能大于需要量', { icon: 7 }); - // } } openIframeByParamObj("quickAddForm", "采购发货确认", "./send_out_confirm.html", "92%", "92%", dataList); } diff --git a/js/aq_demand_plan/child/send_out_form_table.js b/js/aq_demand_plan/child/send_out_form_table.js index 3d2ac06..80c1794 100644 --- a/js/aq_demand_plan/child/send_out_form_table.js +++ b/js/aq_demand_plan/child/send_out_form_table.js @@ -1,4 +1,3 @@ - function setBaseTable(results) { let html = ""; if (results && results.length > 0) { @@ -45,15 +44,14 @@ function setFormInput(value, type, id) { setSelectData(id) + ''; } else if (type === 4) { // 出厂日期 - html += ''; + html += ''; } else if (type === 5) { // 检验日期 - html += ''; + html += ''; } else if (type === 6) { // 备注 html += ''; } html += ''; return html; - } function setSelectData(modelId) { diff --git a/js/aq_inventory/project_material_statistics.js b/js/aq_inventory/project_material_statistics.js new file mode 100644 index 0000000..9896df4 --- /dev/null +++ b/js/aq_inventory/project_material_statistics.js @@ -0,0 +1,290 @@ +let form, table; +let tableIns; +let pageNum = 1; // 定义分页 +layui.use(["form", "table"], function () { + form = layui.form; + table = layui.table; + initTable(); + getStatistics(); +}); + + +// 数据概览 +function getStatistics() { + let encryptedData = {}; + let url = dataUrl + 'backstage/projectMaterial/getStatistics?encryptedData=' + encodeURIComponent(JSON.stringify(encryptedData)); + ajaxRequest(url, "GET", null, true, function () { + }, function (result) { + if (result.code === 200) { + setNum(result.data); + } + }, function (xhr, status, error) { + errorFn(xhr, status, error) + }, null); + + // 数据概览赋值 + function setNum(obj) { + $('#num').html(parseInt(obj.projectCount || 0)); + $('#num2').html(parseInt(obj.totalPurchaseCount || 0)); + $('#num3').html(parseInt(obj.totalOutCount || 0)); + $('#num4').html(parseInt(obj.totalShortageCount || 0)); + } +} + +// 查询/重置 +function queryTable(type) { + if (type === 1) { + let projectName = $('#projectName').val(); + let flag = checkValue(projectName); + if (flag) { + $('#projectName').val(''); + return layer.msg('工程名称查询包含特殊字符,请重新输入', { icon: 2 }); + } + let useUnit = $('#useUnit').val(); + let flag2 = checkValue(useUnit); + if (flag2) { + $('#useUnit').val(''); + return layer.msg('领用单位查询包含特殊字符,请重新输入', { icon: 2 }); + } + reloadTable(1); + } else if (type === 2) { + $('#projectName').val(''); + $('#useUnit').val(''); + $('#isShortage').val(''); + layui.form.render(); + reloadTable(1); + } +} + +// 刷新页面数据 +function reloadData() { + reloadTable(1); + getStatistics(); +} + +// 重载表格 +function reloadTable(pageNum) { + table.reload("currentTableId", { + where: { + encryptedData: JSON.stringify({ + 'proName': $('#projectName').val(), + 'isShortage': $('#isShortage').val() + }), + }, + }, + ); +} + +// 初始化表格 +function initTable() { + tableIns = table.render({ + elem: "#currentTableId", + id: 'currentTableId', + headers: { + authorization: sessionStorage.getItem("gz-token"), + }, + // height: "full-300", + url: dataUrl + "backstage/inventoryCount/queryLedgerListByProjectAndModel", + where: { + encryptedData: JSON.stringify({ + 'proName': $('#projectName').val(), + 'leaseUnit': $('#useUnit').val(), + 'isShortage': $('#isShortage').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; + }, + }, + { + field: "proName", + width: '10%', + title: "工程名称", + unresize: true, + align: "center", + sort: true, + }, + { + field: "type", + width: '10%', + title: "物资类型", + unresize: true, + align: "center", + sort: true, + }, + { + field: "name", + width: '10%', + title: "物资名称", + unresize: true, + align: "center", + sort: true, + }, + { + field: "model", + width: '10%', + title: "规格型号", + unresize: true, + align: "center", + sort: true, + }, + { + field: "unit", + width: '6%', + title: "单位", + unresize: true, + align: "center", + sort: true, + }, + { + field: "needNum", + width: '8%', + title: "需用量", + unresize: true, + align: "center", + sort: true, + templet: function (d) { + return d.totalCg || 0; + }, + }, + { + field: "totalCg", + width: '8%', + title: "采购量", + unresize: true, + align: "center", + sort: true, + templet: function (d) { + return d.totalCg || 0; + }, + }, + { + field: "totalLk", + title: "利库量", + width: '8%', + unresize: true, + align: "center", + sort: true, + templet: function (d) { + return d.totalLk || 0; + }, + }, + { + field: "totalCk", + width: '8%', + title: "出库总量", + unresize: true, + align: "center", + sort: true, + templet: function (d) { + return d.totalCk || 0; + }, + }, + { + field: "totalBack", + width: '8%', + title: "退还数量", + unresize: true, + align: "center", + sort: true, + templet: function (d) { + return d.totalBack || 0; + }, + }, + { + field: "totalDiff", + width: '8%', + title: "差缺量", + unresize: true, + align: "center", + sort: true, + templet: function (d) { + let totalDiff = d.totalDiff || 0; + if (totalDiff > 0) { + return '' + totalDiff + ''; + } + return totalDiff; + }, + }, + ], + ], + limits: [10, 20, 30, 50, 100], + limit: 50, + page: false, + done: function (res, curr, count) { + pageNum = tableIns.config.page.curr; + table.resize("currentTableId"); + }, + }); +} + +// 查看详情 +function viewDetail(id) { + layer.msg('查看工程物料详情功能待开发', { icon: 1 }); + // 这里可以添加查看详情的逻辑,比如打开新窗口或弹窗显示详细信息 + // openIframe('工程物料详情', 'page/aq_inventory/project_material_detail.html?id=' + id); +} + +// 导出Excel +function exportExcel() { + let projectName = $('#projectName').val(); + let isShortage = $('#isShortage').val(); + + let params = { + 'proName': projectName, + 'isShortage': isShortage + }; + + let encryptedData = JSON.stringify(params); + let url = dataUrl + 'backstage/inventoryCount/exportLedgerListByProjectAndModel?encryptedData=' + encodeURIComponent(encryptedData); + + // 创建隐藏的下载链接 + let link = document.createElement('a'); + link.href = url; + link.download = '工程物料统计_' + new Date().getTime() + '.xlsx'; + link.style.display = 'none'; + + // 添加授权头并下载 + fetch(url, { + method: 'GET', + headers: { + 'authorization': sessionStorage.getItem("gz-token") + } + }).then(response => { + if (response.ok) { + return response.blob(); + } + throw new Error('导出失败'); + }).then(blob => { + let downloadUrl = window.URL.createObjectURL(blob); + link.href = downloadUrl; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + window.URL.revokeObjectURL(downloadUrl); + layer.msg('导出成功', { icon: 1 }); + }).catch(error => { + layer.msg('导出失败:' + error.message, { icon: 2 }); + }); +} \ No newline at end of file diff --git a/page/aq_demand_plan/child/send_out_form.html b/page/aq_demand_plan/child/send_out_form.html index 37b0335..558e1ab 100644 --- a/page/aq_demand_plan/child/send_out_form.html +++ b/page/aq_demand_plan/child/send_out_form.html @@ -53,17 +53,17 @@
- +
+ maxlength="30" lay-affix="clear">
- +
-
@@ -78,9 +78,8 @@
-

提示:最多上传5个附件

-

支持格式:jpg、png、jpeg

-

doc、docx、pdf、xlsx、xls

+

必传项:请上传出门条

+

可选项: 领料单、装卸货照片、车牌号

@@ -151,8 +150,8 @@ *采购量 *利库量 *供应商 - *出厂日期 - *检验日期 + 出厂日期 + 检验日期 备注 diff --git a/page/aq_inventory/project_material_statistics.html b/page/aq_inventory/project_material_statistics.html new file mode 100644 index 0000000..d49b963 --- /dev/null +++ b/page/aq_inventory/project_material_statistics.html @@ -0,0 +1,144 @@ + + + + + + 工程物料统计 + + + + + + + + + + + +
+
+ +
+ 搜索信息 +
+
+
+
+
+ +
+
+
+
+ +
+
+
+ + + +
+
+ +
+
+
+
+
+
+
+
+ + + + + + + + \ No newline at end of file