Ver código fonte

产品新增仓库id、仓库code字段,并对接后端

xdd 3 meses atrás
pai
commit
8f893903b3
1 arquivos alterados com 6 adições e 2 exclusões
  1. 6 2
      src/views/store/storeProduct/index.vue

+ 6 - 2
src/views/store/storeProduct/index.vue

@@ -732,8 +732,12 @@ export default {
       set(newVal){
       set(newVal){
         this.form.warehouseId = newVal;
         this.form.warehouseId = newVal;
         // 根据id找出code
         // 根据id找出code
-        let option = this.warehouseOptions.filter(e=>e.id===newVal)[0];
-        this.form.warehouseCode = option.warehouseCode;
+        if(this.warehouseOptions){
+          let option = this.warehouseOptions.filter(e=>e.id===newVal)[0];
+          if(option){
+            this.form.warehouseCode = option.warehouseCode;
+          }
+        }
       }
       }
     }
     }
   },
   },