yijing пре 1 година
родитељ
комит
2c0e80199f

+ 12 - 12
src/views/material/product/components/ProductionInfo.vue

@@ -109,18 +109,18 @@
     data() {
       return {
         rules: {
-          productionDays: [
-            {
-              required: true,
-              message: '请输入生产周期',
-              trigger: ['blur', 'change']
-            },
-            {
-              pattern: positiveIntegerReg,
-              message: '请输入正确的生产周期',
-              trigger: ['blur', 'change']
-            }
-          ]
+          // productionDays: [
+          //   {
+          //     required: true,
+          //     message: '请输入生产周期',
+          //     trigger: ['blur', 'change']
+          //   },
+          //   {
+          //     pattern: positiveIntegerReg,
+          //     message: '请输入正确的生产周期',
+          //     trigger: ['blur', 'change']
+          //   }
+          // ]
         }
       };
     },

+ 25 - 5
src/views/material/product/components/WarehouseInfo.vue

@@ -37,7 +37,7 @@
           }">
             <el-input v-model="form.secureInventory" @input="handleInput1">
               <template #append>
-                {{ packingUnit }}
+                {{ measuringUnit }}
               </template>
             </el-input>
           </el-form-item>
@@ -50,7 +50,7 @@
           }">
             <el-input v-model="form.minInventory" @input="handleInput2">
               <template #append>
-                {{ packingUnit }}
+                {{ measuringUnit }}
               </template>
             </el-input>
           </el-form-item>
@@ -63,7 +63,7 @@
           }">
             <el-input v-model="form.maxInventory" @input="handleInput3">
               <template #append>
-                {{ packingUnit }}
+                {{ measuringUnit }}
               </template>
             </el-input>
           </el-form-item>
@@ -209,8 +209,21 @@ export default {
         return '';
       }
     },
+    // netWeight: {
+    //   type: String,
+    //   default() {
+    //     return '';
+    //   }
+    // },
   },
   watch: {
+    // netWeight(val) {
+    //   this.packagingSpecification = this.packagingSpecification.map(
+    //     (item) => {
+    //       return { ...item, minPackageCell: val };
+    //     }
+    //   );
+    // },
     measuringUnit(val) {
       this.packagingSpecification = this.packagingSpecification.map(
         (item) => {
@@ -320,10 +333,17 @@ export default {
     console.log(this.hasPushed, 'has');
   },
   mounted() {
-    console.log(this.packingRules, 'packingRules');
+
   },
   methods: {
-
+    changeNetWeight(val) {
+      console.log(val)
+      if (this.packagingSpecification.length > 0) {
+        this.$nextTick(() => {
+          this.packagingSpecification[0].minPackageCell = val
+        })
+      }
+    },
     handleInput1(value) {
       this.form.secureInventory = this.$handleInputPublic(value);
     },

+ 37 - 19
src/views/material/product/detail.vue

@@ -23,11 +23,7 @@
             </el-form-item>
           </el-col>
 
-          <el-col :span="8">
-            <el-form-item label="图号/件号" prop="imgCode">
-              <el-input v-model="form.imgCode" />
-            </el-form-item>
-          </el-col>
+
           <el-col :span="8">
             <el-form-item label="名称" prop="name">
               <el-input v-model="form.name" />
@@ -91,7 +87,7 @@
 
           <el-col :span="8">
             <el-form-item label="重量单位" prop="weightUnit">
-              <DictSelection dictName="重量单位" clearable v-model="form.weightUnit">
+              <DictSelection dictName="重量单位" clearable v-model="form.weightUnit" @change="changeWeightUnit">
               </DictSelection>
             </el-form-item>
           </el-col>
@@ -102,18 +98,13 @@
               </DictSelection>
             </el-form-item>
           </el-col>
-
           <el-col :span="8">
-            <el-form-item label="体积">
-              <div class="form-line">
-                <el-input v-model="form.volume" style="width: calc(100% - 100px)" />
-                <!-- @input="handleInput1" -->
-                <DictSelection dictName="体积单位" clearable v-model="form.volumeUnit" style="width: 100px">
-                </DictSelection>
-              </div>
+            <el-form-item label="图号/件号" prop="imgCode">
+              <el-input v-model="form.imgCode" />
             </el-form-item>
           </el-col>
 
+
           <el-col :span="8">
             <el-form-item label="毛重">
               <div class="form-line">
@@ -129,7 +120,16 @@
               </div>
             </el-form-item>
           </el-col>
-
+          <el-col :span="8">
+            <el-form-item label="体积">
+              <div class="form-line">
+                <el-input v-model="form.volume" style="width: calc(100% - 100px)" />
+                <!-- @input="handleInput1" -->
+                <DictSelection dictName="体积单位" clearable v-model="form.volumeUnit" style="width: 100px">
+                </DictSelection>
+              </div>
+            </el-form-item>
+          </el-col>
           <el-col :span="8">
             <el-form-item label="级别">
               <template>
@@ -267,6 +267,7 @@ export default {
         categoryLevelName: '',
         isConsumable: 1,
         measuringUnit: '',
+        netWeight: '',
         attributeType: '',
         weightUnit: '',
         packingUnit: '',
@@ -296,7 +297,7 @@ export default {
       categorySales: {},
       categoryPurchase: { purchaseMultiplier: 1, measuringUnit: '' },
       categoryAps: {},
-      categoryMes: {},
+      categoryMes: { productionDays: '1' },
       categoryMold: {},
       categoryPallet: {},
       categoryQms: {
@@ -306,7 +307,10 @@ export default {
       categoryWms: {
         isUnpack: 1,
         isWarn: 1,
-        inventoryMode: ''
+        inventoryMode: '',
+        secureInventory: '1',
+        minInventory: '1',
+        maxInventory: '1',
       },
       packageDispositionVOList: [],
       categoryLevelPathId: null,
@@ -366,6 +370,7 @@ export default {
             // categoryLevelName: '',
             isConsumable: 1,
             measuringUnit: '',
+            netWeight: '',
             weightUnit: '',
             packingUnit: '',
             extField: {}
@@ -376,7 +381,7 @@ export default {
             remarkAttach: []
           };
           this.categoryAps = {};
-          this.categoryMes = {};
+          this.categoryMes = { productionDays: '10' };
           this.categoryMold = {};
           this.categoryPallet = {};
           this.categoryQms = {};
@@ -384,7 +389,11 @@ export default {
           this.categoryWms = {
             isUnpack: 1,
             isWarn: 1,
-            inventoryMode: this.form.isConsumable
+            inventoryMode: this.form.isConsumable,
+            minPackageCell: '',
+            secureInventory: '10',
+            minInventory: '10',
+            maxInventory: '10',
           };
           this.packageDispositionVOList = [];
           this.categoryLevelPathId = null;
@@ -458,12 +467,21 @@ export default {
     },
     handleInput3(value) {
       this.form.netWeight = this.$handleInputPublicHasPoint(value);
+      if (this.form.weightUnit == this.form.measuringUnit) {
+        this.$refs.warehouseRefs.changeNetWeight(this.form.netWeight);
+      }
     },
     changeConsumable() {
       this.categoryWms.inventoryMode = this.form.isConsumable;
     },
+    changeWeightUnit() {
+      if (this.form.measuringUnit && this.form.packingUnit && this.form.netWeight) {
+        this.$refs.warehouseRefs.changeNetWeight(this.form.netWeight);
+      }
+    },
     changeUnit() {
       if (this.$route.query.id == '' || this.$route.query.id == null) {
+
         if (this.form.measuringUnit) {
           this.categoryPurchase.measuringUnit = this.form.measuringUnit;
           console.log(this.categoryPurchase.measuringUnit, '采购信息');