feat(wms报表): 添加正品率显示并优化异常统计

在报表模板中添加正品率(passRate2)显示项
重构getLossList调用逻辑,改为在getList完成后调用
优化calc.js中的异常统计计算,添加各异常库占比数据
This commit is contained in:
砂糖
2026-03-20 10:33:51 +08:00
parent 7e1e4b7b62
commit e1cb4683af
5 changed files with 54 additions and 18 deletions

View File

@@ -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) + '%' },
]
}