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