From 48273d49b5ab5637fd952acad4985b4ccc3817e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Fri, 27 Feb 2026 13:05:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(wms):=20=E4=BF=AE=E6=AD=A3=E4=BB=93?= =?UTF-8?q?=E5=BA=93ID=E6=A0=BC=E5=BC=8F=E5=92=8C=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BC=98=E5=8C=96=E5=9B=A2=E9=98=9F?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复仓库ID格式错误,统一为正确格式 修改calcSummary计算逻辑,使用lossList计算损耗数据 重构团队报表页面,增加班组统计功能 优化日期选择器,支持月份范围选择 调整钢卷标签显示为"投入钢卷" --- klp-ui/src/views/wms/report/js/calc.js | 26 +++- klp-ui/src/views/wms/report/zha.vue | 4 +- klp-ui/src/views/wms/report/zha/day.vue | 6 +- klp-ui/src/views/wms/report/zha/month.vue | 4 +- klp-ui/src/views/wms/report/zha/team.vue | 157 ++++++++++++-------- klp-ui/src/views/wms/report/zha/year.vue | 4 +- klp-ui/src/views/wms/report/zinc.vue | 4 +- klp-ui/src/views/wms/report/zinc/day.vue | 22 +-- klp-ui/src/views/wms/report/zinc/month.vue | 8 +- klp-ui/src/views/wms/report/zinc/team.vue | 162 +++++++++++++-------- klp-ui/src/views/wms/report/zinc/year.vue | 8 +- 11 files changed, 251 insertions(+), 154 deletions(-) diff --git a/klp-ui/src/views/wms/report/js/calc.js b/klp-ui/src/views/wms/report/js/calc.js index cd6b0939..79e6d870 100644 --- a/klp-ui/src/views/wms/report/js/calc.js +++ b/klp-ui/src/views/wms/report/js/calc.js @@ -1,12 +1,12 @@ -const calcSummary = (list) => { +const calcSummary = (list, lossList) => { // 总钢卷数量、总重、均重 const outCount = list.length const outTotalWeight = list.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 const outAvgWeight = outCount > 0 ? (outTotalWeight / outCount)?.toFixed(2) : 0 // 损失钢卷数量、总重、均重 - const lossCount = list.length - const lossTotalWeight = list.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 + const lossCount = lossList.length + const lossTotalWeight = lossList.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 const lossAvgWeight = lossCount > 0 ? (lossTotalWeight / lossCount)?.toFixed(2) : 0 // 合计数量、总重、均重 const totalCount = outCount + lossCount @@ -14,7 +14,7 @@ const calcSummary = (list) => { const totalAvgWeight = totalCount > 0 ? (totalWeight / totalCount)?.toFixed(2) : 0 // 成品比率 - const passRate = outCount > 0 ? (outCount / lossCount) : 0 + const passRate = outCount > 0 ? (outTotalWeight / lossTotalWeight) : 0 // 损失比率 const lossRate = totalCount > 0 ? (1 - passRate) : 0 // 异常率,成品在warehouseId在'2019583656787259393', @@ -93,7 +93,25 @@ const calcAbSummary = (list) => { ] } +const calcTeamSummary = (list) => { + // 按照班组汇总信息 + const teamSummary = {} + for (let i = 0; i < list.length; i++) { + const coil = list[i]; + if (!teamSummary[coil.team]) { + teamSummary[coil.team] = { + count: 0, + weight: 0, + } + } + teamSummary[coil.team].count = teamSummary[coil.team].count + 1 + teamSummary[coil.team].weight = teamSummary[coil.team].weight + parseFloat(coil.netWeight) || 0 + } + return teamSummary +} + export { calcSummary, calcAbSummary, + calcTeamSummary, } \ No newline at end of file diff --git a/klp-ui/src/views/wms/report/zha.vue b/klp-ui/src/views/wms/report/zha.vue index 11782543..2826bf48 100644 --- a/klp-ui/src/views/wms/report/zha.vue +++ b/klp-ui/src/views/wms/report/zha.vue @@ -197,10 +197,10 @@ export default { createBy: 'suanzhakuguan', warehouseId: '2019583656787259393' }, - '20195833325311414274': { + '2019583325311414274': { selectType: 'product', createBy: 'suanzhakuguan', - warehouseId: '20195833325311414274' + warehouseId: '2019583325311414274' }, '2019583429955104769': { selectType: 'product', diff --git a/klp-ui/src/views/wms/report/zha/day.vue b/klp-ui/src/views/wms/report/zha/day.vue index 57ca4ad6..48ba02fc 100644 --- a/klp-ui/src/views/wms/report/zha/day.vue +++ b/klp-ui/src/views/wms/report/zha/day.vue @@ -71,7 +71,7 @@ - +