From e1cb4683afc361d043d38d8d3352345aae28a699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Fri, 20 Mar 2026 10:33:51 +0800 Subject: [PATCH] =?UTF-8?q?feat(wms=E6=8A=A5=E8=A1=A8):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=AD=A3=E5=93=81=E7=8E=87=E6=98=BE=E7=A4=BA=E5=B9=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BC=82=E5=B8=B8=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在报表模板中添加正品率(passRate2)显示项 重构getLossList调用逻辑,改为在getList完成后调用 优化calc.js中的异常统计计算,添加各异常库占比数据 --- klp-ui/src/views/wms/report/js/calc.js | 33 +++++++++++++++---- klp-ui/src/views/wms/report/template/day.vue | 9 +++-- .../src/views/wms/report/template/month.vue | 10 ++++-- klp-ui/src/views/wms/report/template/team.vue | 10 ++++-- klp-ui/src/views/wms/report/template/year.vue | 10 ++++-- 5 files changed, 54 insertions(+), 18 deletions(-) diff --git a/klp-ui/src/views/wms/report/js/calc.js b/klp-ui/src/views/wms/report/js/calc.js index 79e6d870..b81917a4 100644 --- a/klp-ui/src/views/wms/report/js/calc.js +++ b/klp-ui/src/views/wms/report/js/calc.js @@ -25,6 +25,9 @@ const calcSummary = (list, lossList) => { return item.warehouseId == '2019583656787259393' || item.warehouseId == '2019583325311414274' || item.warehouseId == '2019583429955104769' || item.warehouseId == '2019583137616310273' }).length / totalCount : 0 + // 正品率(1-异常率) + const passRate2 = totalCount != 0 ? (1 - abRate * totalCount) : 0 + return { outCount, outTotalWeight: outTotalWeight.toFixed(2), @@ -38,6 +41,7 @@ const calcSummary = (list, lossList) => { passRate: (passRate * 100)?.toFixed(2) + '%', lossRate: (lossRate * 100)?.toFixed(2) + '%', abRate: (abRate * 100)?.toFixed(2) || 0, + passRate2: (passRate2 * 100)?.toFixed(2) || 0, } } @@ -45,14 +49,25 @@ const calcAbSummary = (list) => { // 异常统计,统计四个异常库中的各自的数量和总重 let o = { jishuCount: 0, - jishuWeight: 0, miniCount: 0, - miniWeight: 0, rubbishCount: 0, - rubbishWeight: 0, returnCount: 0, + + jishuWeight: 0, + miniWeight: 0, + rubbishWeight: 0, returnWeight: 0, + + // 计入技术部的钢卷占比 + jishuRate: 0, + // 计入小钢卷库的钢卷占比 + miniRate: 0, + // 计入废品库的钢卷占比 + rubbishRate: 0, + // 计入退货库的钢卷占比 + returnRate: 0, } + const totalCount = list.length for (let i = 0; i < list.length; i++) { // { label: '技术部', value: '2019583656787259393' }, // { label: '小钢卷库', value: '2019583325311414274' }, @@ -83,13 +98,19 @@ const calcAbSummary = (list) => { } return [ { label: '技术部钢卷数', value: o['jishuCount'] }, - { label: '技术部钢卷重量', value: o['jishuWeight'] }, { label: '小钢卷库钢卷数', value: o['miniCount'] }, - { label: '小钢卷库钢卷重量', value: o['miniWeight'] }, { label: '废品库钢卷数', value: o['rubbishCount'] }, - { label: '废品库钢卷重量', value: o['rubbishWeight'] }, { label: '退货库钢卷数', value: o['returnCount'] }, + + { label: '技术部钢卷重量', value: o['jishuWeight'] }, + { label: '小钢卷库钢卷重量', value: o['miniWeight'] }, + { label: '废品库钢卷重量', value: o['rubbishWeight'] }, { label: '退货库钢卷重量', value: o['returnWeight'] }, + + { label: '技术部占比', value: (o['jishuCount'] / totalCount * 100).toFixed(2) + '%' }, + { label: '小钢卷库占比', value: (o['miniCount'] / totalCount * 100).toFixed(2) + '%' }, + { label: '废品库占比', value: (o['rubbishCount'] / totalCount * 100).toFixed(2) + '%' }, + { label: '退货库占比', value: (o['returnCount'] / totalCount * 100).toFixed(2) + '%' }, ] } diff --git a/klp-ui/src/views/wms/report/template/day.vue b/klp-ui/src/views/wms/report/template/day.vue index 88e37c14..6cdcbef6 100644 --- a/klp-ui/src/views/wms/report/template/day.vue +++ b/klp-ui/src/views/wms/report/template/day.vue @@ -62,6 +62,8 @@ {{ summary.lossRate }} {{ summary.abRate }} + + {{ summary.passRate2 }} @@ -229,7 +231,7 @@ export default { // 统一查询入口(兼容回车和按钮点击) handleQuery() { this.getList() - this.getLossList() + // this.getLossList() }, // 核心查询逻辑 getList() { @@ -264,7 +266,8 @@ export default { computedWidth: parseFloat(width), } }) - this.loading = false + this.getLossList() + // this.loading = false }) }, async getLossList() { @@ -333,7 +336,7 @@ export default { }, mounted() { this.getList() - this.getLossList() + // this.getLossList() this.loadColumns() } } diff --git a/klp-ui/src/views/wms/report/template/month.vue b/klp-ui/src/views/wms/report/template/month.vue index d2405d58..45aaf022 100644 --- a/klp-ui/src/views/wms/report/template/month.vue +++ b/klp-ui/src/views/wms/report/template/month.vue @@ -62,6 +62,8 @@ {{ summary.lossRate }} {{ summary.abRate }} + + {{ summary.passRate2 }} @@ -259,7 +261,7 @@ export default { // 统一查询入口(兼容回车和按钮点击) handleQuery() { this.getList() - this.getLossList() + // this.getLossList() }, // 核心查询逻辑 getList() { @@ -294,7 +296,9 @@ export default { computedWidth: parseFloat(width), } }) - this.loading = false + // this.loading = false + this.getLossList() + // this.loading = false }) }, async getLossList() { @@ -363,7 +367,7 @@ export default { }, mounted() { this.getList() - this.getLossList() + // this.getLossList() this.loadColumns() } } diff --git a/klp-ui/src/views/wms/report/template/team.vue b/klp-ui/src/views/wms/report/template/team.vue index 70e7dd29..6c6dfd14 100644 --- a/klp-ui/src/views/wms/report/template/team.vue +++ b/klp-ui/src/views/wms/report/template/team.vue @@ -67,6 +67,8 @@ {{ summary.passRate }} {{ summary.lossRate }} {{ summary.abRate }} + + {{ summary.passRate2 }} @@ -243,7 +245,7 @@ export default { }, handleQuery() { this.getList(); - this.getLossList(); + // this.getLossList(); }, getList() { this.loading = true; @@ -273,7 +275,9 @@ export default { computedWidth: parseFloat(width), } }); - this.loading = false; + // this.loading = false; + this.getLossList() + // this.loading = false; }).catch(err => { console.error('查询失败:', err); this.loading = false; @@ -349,7 +353,7 @@ export default { }, mounted() { this.getList(); - this.getLossList(); + // this.getLossList(); this.loadColumns(); } }; diff --git a/klp-ui/src/views/wms/report/template/year.vue b/klp-ui/src/views/wms/report/template/year.vue index ae74bbb9..24911d4b 100644 --- a/klp-ui/src/views/wms/report/template/year.vue +++ b/klp-ui/src/views/wms/report/template/year.vue @@ -62,6 +62,8 @@ {{ summary.lossRate }} {{ summary.abRate }} + + {{ summary.passRate2 }} @@ -238,7 +240,7 @@ export default { // 统一查询入口(兼容回车和按钮点击) handleQuery() { this.getList() - this.getLossList() + // this.getLossList() }, // 核心查询逻辑 getList() { @@ -273,7 +275,9 @@ export default { computedWidth: parseFloat(width), } }) - this.loading = false + // this.loading = false + this.getLossList() + // this.loading = false }) }, async getLossList() { @@ -342,7 +346,7 @@ export default { }, mounted() { this.getList() - this.getLossList() + // this.getLossList() this.loadColumns() } }