فهرست منبع

根据产品拆分包装

yijing 1 سال پیش
والد
کامیت
a8f48744e2
1فایلهای تغییر یافته به همراه20 افزوده شده و 2 حذف شده
  1. 20 2
      src/views/bpm/stockManagement/storage.vue

+ 20 - 2
src/views/bpm/stockManagement/storage.vue

@@ -969,7 +969,8 @@ export default {
           });
           console.log(this.productList, 'this.productListtttttttttttt')
           this.$nextTick(() => {
-            this.listSaveArrs();
+            this.batchSave();
+            // this.listSaveArrs()
           });
         });
       }
@@ -2130,7 +2131,7 @@ export default {
                   return {
                     assetCode: row.categoryCode + row.index,
                     batchNum: row.batchNo,
-                    num: row.packingQuantity
+                    num
                   };
                 }
               }
@@ -2244,6 +2245,23 @@ export default {
         this.showMaterialList.length / this.pageSize
       );
     },
+    async batchSave() {
+      try {
+        // 验证所有未保存的表单
+        await this.validateForm()
+
+        // 遍历所有产品进行保存
+        for (let i = 0; i < this.productList.length; i++) {
+          const row = this.productList[i]
+          if (!row.isSave) {
+            // 执行单个保存逻辑
+            await this.listSave(row, i)
+          }
+        }
+      } catch (error) {
+        this.$message.error('批量保存失败,请检查必填项')
+      }
+    },
     listSave(row, index) {
       console.log('row22222222', row);
       this.validateFormIndividually(index).then(async () => {