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 @@ - +