From 49bb8e116f38a0a7c2d0834bb814daf78ab29848 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Wed, 8 Jul 2026 17:16:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(wms/menu):=20=E6=B7=BB=E5=8A=A0=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E9=92=A2=E5=8D=B7=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96=E8=8F=9C=E5=8D=95=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 新增单行/多行异常钢卷导出按钮,带权限控制 2. 优化菜单导出Excel,新增路由地址和完整路由地址列 --- klp-ui/src/views/system/menu/index.vue | 38 +++++++++++++++++------ klp-ui/src/views/wms/coil/panels/base.vue | 26 ++++++++++++++++ 2 files changed, 55 insertions(+), 9 deletions(-) diff --git a/klp-ui/src/views/system/menu/index.vue b/klp-ui/src/views/system/menu/index.vue index 92e302b3e..61eac578b 100644 --- a/klp-ui/src/views/system/menu/index.vue +++ b/klp-ui/src/views/system/menu/index.vue @@ -617,12 +617,30 @@ export default { }; // 递归展平为一维数组,缩进体现层级 - const flattenTree = (nodes, level = 0, result = []) => { + const flattenTree = (nodes, level = 0, parentPath = '', result = []) => { nodes.forEach(node => { const prefix = '\u3000'.repeat(level); // 全角空格缩进 + const ownPath = node.path || ''; + // 计算完整路由地址(仅菜单类型 C 有效) + let fullPath = ''; + if (node.menuType === 'C') { + if (node.isFrame === '0') { + // 外链:完整路由就是自身路径 + fullPath = ownPath; + } else { + // 内部路由:父路径 + 自身路径 + const parent = parentPath ? (parentPath.endsWith('/') ? parentPath : parentPath + '/') : ''; + fullPath = '/' + parent + ownPath; + } + } + // 目录(M)的路径作为子节点的父路径 + const currentParentPath = node.menuType === 'M' ? ownPath : parentPath; + result.push({ menuName: prefix + node.menuName, menuType: menuTypeMap[node.menuType] || node.menuType, + path: ownPath, + fullPath: fullPath, icon: node.icon || '', orderNum: node.orderNum, perms: node.perms || '', @@ -631,7 +649,7 @@ export default { createTime: node.createTime || '' }); if (node.children && node.children.length > 0) { - flattenTree(node.children, level + 1, result); + flattenTree(node.children, level + 1, currentParentPath, result); } }); return result; @@ -647,19 +665,21 @@ export default { // 构建 Excel 数据 const wsData = [ - ['菜单名称', '菜单类型', '图标', '排序', '权限标识', '组件路径', '状态', '创建时间'], + ['菜单名称', '菜单类型', '路由地址', '完整路由地址', '图标', '排序', '权限标识', '组件路径', '状态', '创建时间'], ...flatData.map(item => [ - item.menuName, item.menuType, item.icon, - item.orderNum, item.perms, item.component, - item.status, item.createTime + item.menuName, item.menuType, item.path, + item.fullPath, item.icon, item.orderNum, + item.perms, item.component, item.status, + item.createTime ]) ]; const ws = XLSX.utils.aoa_to_sheet(wsData); ws['!cols'] = [ - { wch: 30 }, { wch: 10 }, { wch: 12 }, - { wch: 8 }, { wch: 25 }, { wch: 30 }, - { wch: 8 }, { wch: 20 } + { wch: 30 }, { wch: 10 }, { wch: 22 }, + { wch: 30 }, { wch: 12 }, { wch: 8 }, + { wch: 25 }, { wch: 30 }, { wch: 8 }, + { wch: 20 } ]; const wb = XLSX.utils.book_new(); diff --git a/klp-ui/src/views/wms/coil/panels/base.vue b/klp-ui/src/views/wms/coil/panels/base.vue index 4a9f4d876..b3bdc664a 100644 --- a/klp-ui/src/views/wms/coil/panels/base.vue +++ b/klp-ui/src/views/wms/coil/panels/base.vue @@ -135,6 +135,14 @@ 导出全部 + + 单行异常导出 + + + + 多行异常导出 + + 按实际库区排序 @@ -2336,6 +2344,24 @@ export default { }, 'coil.xlsx') } }, + /** 单行异常导出 — 每个钢卷一行,附带异常信息 */ + handleAbnormalExportSingle() { + const { orderBy, ...query } = this.queryParams; + query.selectType = query.itemType; + this.download('wms/materialCoil/exportAbnormal', { + ...query, + abnormalExportCount: 1, + }, `abnormalCoil_${new Date().getTime()}.xlsx`) + }, + /** 多行异常导出 — 每个异常记录一行,附带异常信息 */ + handleAbnormalExportMulti() { + const { orderBy, ...query } = this.queryParams; + query.selectType = query.itemType; + this.download('wms/materialCoil/exportAbnormal', { + ...query, + abnormalExportCount: 0, + }, `abnormalCoil_${new Date().getTime()}.xlsx`) + }, async handleNewExportProps(row) { this.loading = true let coilIds = ''