Jelajahi Sumber

入库管理新增供应商列表功能并优化产品保存逻辑

yusheng 9 bulan lalu
induk
melakukan
a33e083660
1 mengubah file dengan 9 tambahan dan 5 penghapusan
  1. 9 5
      src/views/warehouseManagement/stockManagement/add.vue

+ 9 - 5
src/views/warehouseManagement/stockManagement/add.vue

@@ -1720,6 +1720,10 @@
             await storageApi.getCategoryPackageDisposition({
               categoryIds: data.map((item) => item.categoryId)
             });
+          // 获取供应商
+          const supplierList = await storageApi.contactQueryByCategoryIdsAPI({
+            categoryIds: data.map((item) => item.categoryId)
+          });
           this.packingSpecificationOption = data.map((item) => {
             return packingSpecification
               .filter((ite) => item.categoryId == ite.categoryId)
@@ -1815,7 +1819,8 @@
             if (item.weight === null || item.weight === undefined) {
               item.weight = 0;
             }
-
+            item.supplierListOptions=supplierList[item.categoryId], // 供应商列表
+ 
             item.packingUnit = item.measuringUnit; // 单位
             item.packingUnitId = item.packingSpecificationOption.find(
               (v) => v.conversionUnit == item.measuringUnit
@@ -1829,10 +1834,9 @@
             return item;
           });
           console.log(this.productList, 'productList');
-          this.$nextTick(()=>{
-          this.batchSave();
-
-          })
+          this.$nextTick(() => {
+            this.batchSave();
+          });
           // this.productList.map((v) => {
           //   v.weight = isNaN(v.weight);
           // });