From 800cf0c8d1a5cbffc8b1e00b98774b90cd403418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Tue, 31 Mar 2026 18:54:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(wms=E6=8A=A5=E8=A1=A8):=20=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E5=BC=82=E5=B8=B8=E7=8E=87=E8=AE=A1=E7=AE=97=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=B9=B6=E7=BB=9F=E4=B8=80=E7=99=BE=E5=88=86=E6=AF=94?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在异常率计算中增加质量状态判断条件 - 将分母从totalCount改为outCount以匹配业务需求 - 统一异常率和正品率的百分比格式输出 --- klp-ui/src/views/wms/report/js/calc.js | 30 ++++++++++++++++++-------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/klp-ui/src/views/wms/report/js/calc.js b/klp-ui/src/views/wms/report/js/calc.js index fd88a95f..4152a0bc 100644 --- a/klp-ui/src/views/wms/report/js/calc.js +++ b/klp-ui/src/views/wms/report/js/calc.js @@ -26,9 +26,16 @@ const calcSummary = (list, lossList) => { // '2019583325311414274', // '2019583429955104769', // '2019583137616310273',这四个库中的占比 + const abStatus = ['O', 'C-', 'C+', 'C', 'D-', 'D+', 'D'] const abRate = totalCount != 0 ? list.filter(item => { - return item.warehouseId == '2019583656787259393' || item.warehouseId == '2019583325311414274' || item.warehouseId == '2019583429955104769' || item.warehouseId == '2019583137616310273' - }).length / totalCount : 0 + // 质量状态为O, C- , C+, C, D-, D+, D的钢卷也属于异常 + return (item.warehouseId == '2019583656787259393' + || item.warehouseId == '2019583325311414274' + || item.warehouseId == '2019583429955104769' + || item.warehouseId == '2019583137616310273' + || abStatus.includes(item.qualityStatus) + ) + }).length / outCount : 0 // 正品率(1-异常率) const passRate2 = totalCount != 0 ? (1 - abRate) : 0 @@ -48,8 +55,8 @@ const calcSummary = (list, lossList) => { avgWeightDiff, passRate: (passRate * 100)?.toFixed(2) + '%', lossRate: (lossRate * 100)?.toFixed(2) + '%', - abRate: (abRate * 100)?.toFixed(2) || 0, - passRate2: (passRate2 * 100)?.toFixed(2) || 0, + abRate: (abRate * 100)?.toFixed(2) + '%' || 0, + passRate2: (passRate2 * 100)?.toFixed(2) + '%' || 0, } } @@ -187,9 +194,14 @@ const calcMSummary = (list, lossList) => { // '2019583325311414274', // '2019583429955104769', // '2019583137616310273',这四个库中的占比 - const abRate = totalCount != 0 ? nonMCoils.filter(item => { - return item.warehouseId == '2019583656787259393' || item.warehouseId == '2019583325311414274' || item.warehouseId == '2019583429955104769' || item.warehouseId == '2019583137616310273' - }).length / totalCount : 0 + const abStatus = ['O', 'C-', 'C+', 'C', 'D-', 'D+', 'D'] + const abRate = totalCount != 0 ? nonMCoils.filter(item => {// 质量状态为O, C- , C+, C, D-, D+, D的钢卷也属于异常 + return (item.warehouseId == '2019583656787259393' + || item.warehouseId == '2019583325311414274' + || item.warehouseId == '2019583429955104769' + || item.warehouseId == '2019583137616310273' + || abStatus.includes(item.qualityStatus)) + }).length / outCount : 0 // 正品率(1-异常率) const passRate2 = totalCount != 0 ? (1 - abRate) : 0 @@ -209,8 +221,8 @@ const calcMSummary = (list, lossList) => { avgWeightDiff, passRate: (passRate * 100)?.toFixed(2) + '%', lossRate: (lossRate * 100)?.toFixed(2) + '%', - abRate: (abRate * 100)?.toFixed(2) || 0, - passRate2: (passRate2 * 100)?.toFixed(2) || 0, + abRate: (abRate * 100)?.toFixed(2) + '%' || 0, + passRate2: (passRate2 * 100)?.toFixed(2) + '%' || 0, } }