fix(wms报表): 修复数据过滤和去重逻辑
确保在映射coilId和processedCoilIds前先过滤掉空值,避免潜在的错误
This commit is contained in:
@@ -321,8 +321,8 @@ export default {
|
||||
queryParams: {
|
||||
startTime: start,
|
||||
endTime: end,
|
||||
byCreateTimeStart: start,
|
||||
byCreateTimeEnd: end,
|
||||
// byCreateTimeStart: start,
|
||||
// byCreateTimeEnd: end,
|
||||
enterCoilNo: '',
|
||||
currentCoilNo: '',
|
||||
warehouseId: '',
|
||||
@@ -465,9 +465,9 @@ export default {
|
||||
// 所有报表类型都使用原始的 listPendingAction 方式获取数据
|
||||
const res = await listPendingAction({ ...this.queryParams, actionType: this.actionType, actionStatus: 2 });
|
||||
// 获取两层数据
|
||||
const lossIds = res.rows.map(item => item.coilId);
|
||||
const lossIds = res.rows.filter(item => item.coilId).map(item => item.coilId);
|
||||
// 使用new Set去重
|
||||
const outIds = [...new Set(res.rows.map(item => item.processedCoilIds))];
|
||||
const outIds = [...new Set(res.rows.filter(item => item.processedCoilIds).map(item => item.processedCoilIds))];
|
||||
|
||||
if (lossIds.length === 0 || outIds.length === 0) {
|
||||
this.$message({
|
||||
|
||||
Reference in New Issue
Block a user