Sfoglia il codice sorgente

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

liujt 7 mesi fa
parent
commit
d951072e60
1 ha cambiato i file con 13 aggiunte e 5 eliminazioni
  1. 13 5
      src/views/warehouseManagement/inventoryAllocation/add.vue

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

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