Просмотр исходного кода

优化入库管理产品保存逻辑并移除冗余代码

yusheng 9 месяцев назад
Родитель
Сommit
1e51b370f4
1 измененных файлов с 22 добавлено и 18 удалено
  1. 22 18
      src/views/warehouseManagement/stockManagement/add.vue

+ 22 - 18
src/views/warehouseManagement/stockManagement/add.vue

@@ -1829,29 +1829,33 @@
             return item;
           });
           console.log(this.productList, 'productList');
+          this.$nextTick(()=>{
+          this.batchSave();
+
+          })
           // this.productList.map((v) => {
           //   v.weight = isNaN(v.weight);
           // });
 
           // 获取包装维度数据
-          const arr = [];
-          for (const key in this.productList) {
-            for (const k in this.productList[key]
-              .outInDetailRecordRequestList) {
-              arr.push({
-                ...this.productList[key].outInDetailRecordRequestList[k]
-              });
-            }
-          }
-          this.packingList = arr;
+          // const arr = [];
+          // for (const key in this.productList) {
+          //   for (const k in this.productList[key]
+          //     .outInDetailRecordRequestList) {
+          //     arr.push({
+          //       ...this.productList[key].outInDetailRecordRequestList[k]
+          //     });
+          //   }
+          // }
+
           // 获取物料维度数据
-          let iArr = [];
-          arr.forEach((item) => {
-            item.materialDetailList.forEach((ele) => {
-              iArr.push({ ...ele });
-            });
-          });
-          this.materialList = iArr;
+          // let iArr = [];
+          // arr.forEach((item) => {
+          //   item.materialDetailList.forEach((ele) => {
+          //     iArr.push({ ...ele });
+          //   });
+          // });
+          // this.materialList = iArr;
         } else {
           this.selWWData = query;
           this.$set(this.formData, 'sourceBizNo', query.sourceBizNo);
@@ -2800,7 +2804,6 @@
               );
             }
           });
-          console.log(list);
           Promise.all(list)
             .then(() => {
               console.log('保存成功!');
@@ -2903,6 +2906,7 @@
       },
       //产品保存操作
       async listSave(row, index) {
+        console.log(row, ';ddd');
         return new Promise(async (resolve, reject) => {
           try {
             await this.validateFormIndividually(index);