Преглед на файлове

入库项根据型号配置显示

chen преди 2 години
родител
ревизия
3752b33752
променени са 1 файла, в които са добавени 18 реда и са изтрити 0 реда
  1. 18 0
      src/views/productBatch/productBatch.vue

+ 18 - 0
src/views/productBatch/productBatch.vue

@@ -90,6 +90,7 @@
 
 <script>
   import {getList, getDetail, add, update, remove} from "@/api/productBatch/productBatch";
+  import {getDetail as getModelDetail } from "@/api/productModel/productModel";
   import option from "@/option/productBatch/productBatch";
   import optionSub from "@/option/productBatch/product.js";
   import {mapGetters} from "vuex";
@@ -146,6 +147,18 @@
       //   });
       // }
 
+      'form.productModelId'(newValue, oldValue) {
+        if(newValue){
+          this.$nextTick(() => {
+            getModelDetail(newValue).then(res => {
+              this.optionSub.column.waterCooling.hide= !(","+res.data.data.inStockFormItem+",").includes(",water_cooling,")
+              this.optionSub.column.airtight.hide= !(","+res.data.data.inStockFormItem+",").includes(",airtight,")
+              this.optionSub.column.coldQrCode.hide= !(","+res.data.data.inStockFormItem+",").includes(",cold_qr_code,")
+            });
+          });
+        }
+      }
+
     },
     created () {
       let that = this;
@@ -283,6 +296,10 @@
       },
       beforeOpen(done, type) {
         this.optionSub.menu = false;
+        
+        this.option.column.productModelId.disabled=false;
+        this.option.column.clientId.disabled=false;
+        this.option.column.factoryId.disabled=false;
         if (["edit", "view"].includes(type)) {
           getDetail(this.form.id).then(res => {
             this.form = res.data.data;
@@ -309,6 +326,7 @@
           this.optionSub.menu = true;
           if(!this.form.details){
             this.form.details = [{"$cellEdit":true},{"$cellEdit":true},{"$cellEdit":true},{"$cellEdit":true},{"$cellEdit":true},{"$cellEdit":true},{"$cellEdit":true}]
+            
           }
         }
         done();