feat(wms-report): 新增对比报表页面和尺寸异常统计功能

1. 新增comparison.vue对比报表页面,支持基期/当期数据对比、快速环比查询、明细表格查看和列配置
2. 在action.vue报表中添加尺寸异常统计模块,统计长度和厚度异常的卷数、总重及占比
3. 新增告警阈值配置获取逻辑,从系统配置中读取长度和厚度异常阈值
This commit is contained in:
2026-06-13 11:15:38 +08:00
parent 12ea9b0b83
commit 6edc6e1100
2 changed files with 450 additions and 1 deletions

View File

@@ -265,6 +265,17 @@
<!-- 分条信息统计 -->
<split-summary v-if="productionLine == '分条线'" :origin-outputlist="outList" :origin-loss-list="lossList"
:common-coil-ids="commonCoilIds"></split-summary>
<el-descriptions title="尺寸异常统计" :column="4" border>
<el-descriptions-item label="长度异常卷数">{{ sizeAbnormalSummary.length.count }}</el-descriptions-item>
<el-descriptions-item label="长度异常总重">{{ sizeAbnormalSummary.length.weight }}t</el-descriptions-item>
<el-descriptions-item label="长度异常数量占比">{{ sizeAbnormalSummary.length.countRate }}</el-descriptions-item>
<el-descriptions-item label="长度异常重量占比">{{ sizeAbnormalSummary.length.weightRate }}</el-descriptions-item>
<el-descriptions-item label="厚度异常卷数">{{ sizeAbnormalSummary.thickness.count }}</el-descriptions-item>
<el-descriptions-item label="厚度异常总重">{{ sizeAbnormalSummary.thickness.weight }}t</el-descriptions-item>
<el-descriptions-item label="厚度异常数量占比">{{ sizeAbnormalSummary.thickness.countRate }}</el-descriptions-item>
<el-descriptions-item label="厚度异常重量占比">{{ sizeAbnormalSummary.thickness.weightRate }}</el-descriptions-item>
</el-descriptions>
</template>
<!-- team, day, month, year 类型的统计信息 -->
@@ -344,6 +355,17 @@
<div ref="monthChart" style="width: 100%; height: 350px;"></div>
</el-card>
</div>
<el-descriptions title="尺寸异常统计" :column="4" border>
<el-descriptions-item label="长度异常卷数">{{ sizeAbnormalSummary.length.count }}</el-descriptions-item>
<el-descriptions-item label="长度异常总重">{{ sizeAbnormalSummary.length.weight }}t</el-descriptions-item>
<el-descriptions-item label="长度异常数量占比">{{ sizeAbnormalSummary.length.countRate }}</el-descriptions-item>
<el-descriptions-item label="长度异常重量占比">{{ sizeAbnormalSummary.length.weightRate }}</el-descriptions-item>
<el-descriptions-item label="厚度异常卷数">{{ sizeAbnormalSummary.thickness.count }}</el-descriptions-item>
<el-descriptions-item label="厚度异常总重">{{ sizeAbnormalSummary.thickness.weight }}t</el-descriptions-item>
<el-descriptions-item label="厚度异常数量占比">{{ sizeAbnormalSummary.thickness.countRate }}</el-descriptions-item>
<el-descriptions-item label="厚度异常重量占比">{{ sizeAbnormalSummary.thickness.weightRate }}</el-descriptions-item>
</el-descriptions>
</template>
<!-- 明细信息和标签页 -->
@@ -547,7 +569,9 @@ export default {
],
lossColumns: [],
outputColumns: [],
actionIds: ''
actionIds: '',
lengthThreshold: 0,
thicknessThreshold: 0
}
},
computed: {
@@ -610,6 +634,41 @@ export default {
customExportStorageKey() {
return `coil-report-action-${this.actionType}`
},
sizeAbnormalSummary() {
const totalCount = this.outList.length
const totalWeight = this.outList.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0)
const lengthAbnormal = this.outList.filter(row => {
const lengthDiff = (row.actualLength || 0) - (row.theoreticalLength || 0)
const theoreticalLength = row.theoreticalLength || 1
return Math.abs(lengthDiff) / theoreticalLength > this.lengthThreshold
})
const thicknessAbnormal = this.outList.filter(row => {
const thicknessDiff = (row.theoreticalThickness || 0) - (row.computedThickness || 0)
return thicknessDiff > this.thicknessThreshold
})
const laCount = lengthAbnormal.length
const laWeight = lengthAbnormal.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0)
const taCount = thicknessAbnormal.length
const taWeight = thicknessAbnormal.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0)
return {
length: {
count: laCount,
weight: laWeight.toFixed(2),
countRate: totalCount > 0 ? (laCount / totalCount * 100).toFixed(2) + '%' : '0.00%',
weightRate: totalWeight > 0 ? (laWeight / totalWeight * 100).toFixed(2) + '%' : '0.00%',
},
thickness: {
count: taCount,
weight: taWeight.toFixed(2),
countRate: totalCount > 0 ? (taCount / totalCount * 100).toFixed(2) + '%' : '0.00%',
weightRate: totalWeight > 0 ? (taWeight / totalWeight * 100).toFixed(2) + '%' : '0.00%',
}
}
},
},
watch: {
warehouseOptions: {
@@ -625,6 +684,7 @@ export default {
this.initDateByReportType()
this.handleQuery()
this.loadColumns()
this.getAlarmThreshold()
},
methods: {
initDateByReportType() {
@@ -1102,6 +1162,10 @@ export default {
this.loading = false
})
},
getAlarmThreshold() {
this.getConfigKey('material.warning.length').then(response => { this.lengthThreshold = parseFloat(response.msg) || 0 })
this.getConfigKey('material.warning.thickness').then(response => { this.thicknessThreshold = parseFloat(response.msg) || 0 })
},
loadColumns() {
this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || []
this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || []