feat(报表): 优化各工序报表的损耗数据获取逻辑

将getLossList方法改为异步方式,同时获取酸轧/镀锌和分条工序的数据
合并两个工序的数据后再查询钢卷信息,提高数据完整性和准确性
添加updateBy参数区分不同工序的管理员
This commit is contained in:
砂糖
2026-03-02 10:50:47 +08:00
parent 2aeb19a685
commit 141d39263f
10 changed files with 389 additions and 287 deletions

View File

@@ -318,36 +318,46 @@ export default {
this.loading = false
})
},
getLossList() {
async getLossList() {
this.loading = true
listPendingAction({
const res1 = await listPendingAction({
actionType: 11, // 酸轧工序
pageSize: 9999,
pageSize: 999,
pageNum: 1,
startTime: this.queryParams.byCreateTimeStart,
endTime: this.queryParams.byCreateTimeEnd,
}).then(res => {
const actions = res.rows
const coilIds = actions.map(item => item.coilId).join(',')
console.log(coilIds)
if (!coilIds) {
this.$message({
message: '暂无数据',
type: 'warning',
})
this.lossList = []
this.loading = false
return
}
listCoilWithIds({
...this.queryParams,
byCreateTimeStart: undefined,
byCreateTimeEnd: undefined,
coilIds: coilIds,
}).then(res => {
this.lossList = res.rows
this.loading = false
})
const res2 = await listPendingAction({
// actionStatus: 2,
warehouseId: this.queryParams.planId,
// actionType: 401,
actionType: 200, // 分条工序
pageSize: 999,
pageNum: 1,
startTime: this.queryParams.byCreateTimeStart,
endTime: this.queryParams.byCreateTimeEnd,
updateBy: 'suanzhakuguan',
})
const actions = res1.rows.concat(res2.rows)
const coilIds = actions.map(item => item.coilId).join(',')
console.log(coilIds)
if (!coilIds) {
this.$message({
message: '暂无数据',
type: 'warning',
})
this.lossList = []
this.loading = false
return
}
listCoilWithIds({
...this.queryParams,
byCreateTimeStart: undefined,
byCreateTimeEnd: undefined,
coilIds: coilIds,
}).then(res => {
this.lossList = res.rows
this.loading = false
})
},
// 导出