|
@@ -214,19 +214,31 @@ export default {
|
|
|
const workOrderMap = new Map(res.map((it) => [it.workOrderId, it]));
|
|
const workOrderMap = new Map(res.map((it) => [it.workOrderId, it]));
|
|
|
|
|
|
|
|
// 更新List中的每个项目
|
|
// 更新List中的每个项目
|
|
|
- this.List.forEach((item,index) => {
|
|
|
|
|
- if (workOrderMap.has(item.workOrderId)) {
|
|
|
|
|
- // 直接从映射中获取数据,避免嵌套循环
|
|
|
|
|
- this.$set(item, 'toWarehouseList', [
|
|
|
|
|
- JSON.parse(JSON.stringify(workOrderMap.get(item.workOrderId)))
|
|
|
|
|
- ]);
|
|
|
|
|
-
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$set(item, 'toWarehouseList', []);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // this.List.forEach((item,index) => {
|
|
|
|
|
+ // if (workOrderMap.has(item.workOrderId)) {
|
|
|
|
|
+ // // 直接从映射中获取数据,避免嵌套循环
|
|
|
|
|
+ // this.$set(item, 'toWarehouseList', [
|
|
|
|
|
+ // JSON.parse(JSON.stringify(workOrderMap.get(item.workOrderId)))
|
|
|
|
|
+ // ]);
|
|
|
|
|
+
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // this.$set(item, 'toWarehouseList', []);
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ // });
|
|
|
|
|
+
|
|
|
|
|
+ this.List.forEach((item,index) => {
|
|
|
|
|
+ let arr=[]
|
|
|
|
|
+ res.map(titem=>{
|
|
|
|
|
+ if(item.workOrderId==titem.workOrderId){
|
|
|
|
|
+ arr.push(titem)
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$set(item, 'toWarehouseList', arr);
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
@@ -248,25 +260,34 @@ export default {
|
|
|
|
|
|
|
|
console.log(workOrderMap, '99');
|
|
console.log(workOrderMap, '99');
|
|
|
// 更新List中的每个项目
|
|
// 更新List中的每个项目
|
|
|
- this.List.map((item) => {
|
|
|
|
|
- if (workOrderMap.has(item.workOrderId)) {
|
|
|
|
|
- console.log(1);
|
|
|
|
|
- // 直接从映射中获取数据,避免嵌套循环
|
|
|
|
|
- this.$set(item, 'toWarehouseList', [
|
|
|
|
|
- JSON.parse(JSON.stringify(workOrderMap.get(item.workOrderId)))
|
|
|
|
|
- ]);
|
|
|
|
|
|
|
+ // this.List.map((item) => {
|
|
|
|
|
+ // if (workOrderMap.has(item.workOrderId)) {
|
|
|
|
|
+ // console.log(1);
|
|
|
|
|
+ // // 直接从映射中获取数据,避免嵌套循环
|
|
|
|
|
+ // this.$set(item, 'toWarehouseList', [
|
|
|
|
|
+ // JSON.parse(JSON.stringify(workOrderMap.get(item.workOrderId)))
|
|
|
|
|
+ // ]);
|
|
|
|
|
+
|
|
|
|
|
|
|
|
- console.log(item, '5555');
|
|
|
|
|
|
|
+ // } else {
|
|
|
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ // this.$set(item, 'toWarehouseList', []);
|
|
|
|
|
|
|
|
- this.$set(item, 'toWarehouseList', []);
|
|
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ // });
|
|
|
|
|
+ this.List.forEach((item,index) => {
|
|
|
|
|
+ let arr=[]
|
|
|
|
|
+ res.map(titem=>{
|
|
|
|
|
+ if(item.workOrderId==titem.workOrderId){
|
|
|
|
|
+ arr.push(titem)
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$set(item, 'toWarehouseList', arr);
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
console.log(this.List, '6666666666');
|
|
console.log(this.List, '6666666666');
|
|
|
});
|
|
});
|