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

fix(库存调拨): 修复调入工厂问题

liujt 7 месяцев назад
Родитель
Сommit
d951072e60
1 измененных файлов с 13 добавлено и 5 удалено
  1. 13 5
      src/views/warehouseManagement/inventoryAllocation/add.vue

+ 13 - 5
src/views/warehouseManagement/inventoryAllocation/add.vue

@@ -819,9 +819,10 @@
       } else {
         if(this.factoryList.find(item => item.id == this.userInfo.factoryId)?.id) {
           this.factoryId = this.userInfo.factoryId;
-          if(this.allocateId == 1) {
-            this.params.targetFactoriesId = this.factoryId
-          }
+          this.params.targetFactoriesId = this.factoryId
+          // if(this.allocateId == 1) {
+          //   this.params.targetFactoriesId = this.factoryId
+          // }
          this.getTreeData(this.factoryId) 
         }
       }
@@ -988,14 +989,21 @@
         this.getTreeData();
       },
       targetFactoryChange() {
-        this.reset();
-        this.getTreeData();
+        // this.reset();
+        // this.getTreeData();
       },
       search() {
         return new Promise((resolve, reject) => {
           // 重置错误标志
           this.searchState.hasError = false;
 
+          if(!this.params.targetFactoriesId){
+            this.searchState.hasError = true;
+            const errorMsg = '调入工厂不能为空';
+            this.$message.error(errorMsg);
+            return reject(new Error(errorMsg));
+          }
+
           if(!this.params.inWarehouseId){
             this.searchState.hasError = true;
             const errorMsg = '调入仓库不能为空';