Ver Fonte

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

chencc há 1 ano atrás
pai
commit
8adbdf90cc

+ 6 - 0
src/views/material/product/components/WarehouseInfo.vue

@@ -217,6 +217,12 @@ export default {
     // },
   },
   watch: {
+    'form.isUnpack': {
+      handler(val) {
+        this.$emit('changeType', val);
+      },
+      deep: true
+    },
     // netWeight(val) {
     //   this.packagingSpecification = this.packagingSpecification.map(
     //     (item) => {

+ 46 - 10
src/views/material/product/detail.vue

@@ -74,7 +74,7 @@
 
           <el-col :span="8">
             <el-form-item label="规格" prop="specification">
-              <el-input v-model="form.specification" />
+              <el-input v-model="form.specification" @input="inputSpe" />
             </el-form-item>
           </el-col>
 
@@ -114,7 +114,8 @@
           </el-col>
 
           <el-col :span="8">
-            <el-form-item label="净重">
+            <el-form-item label="净重"
+              :rules="{ required: form.measuringUnit == form.weightUnit, trigger: ['blur', 'change'] }">
               <div class="form-line">
                 <el-input v-model="form.netWeight" @input="handleInput3" />
               </div>
@@ -165,7 +166,7 @@
     <!-- 仓储配置 -->
     <WarehouseInfo ref="warehouseRefs" v-if="isShow" :form="categoryWms" :measuringUnit="form.measuringUnit"
       :packingUnit="form.packingUnit" :packageDispositionVOList="packageDispositionVOList"
-      @change="changePackagingSpecification" />
+      @change="changePackagingSpecification" @changeType="changeType" />
     <!-- 销售配置 -->
     <SalesInfos ref="salesRefs" :form="categorySales" />
     <!-- 采购信息 -->
@@ -305,7 +306,7 @@ export default {
       },
       categoryVehicle: {},
       categoryWms: {
-        isUnpack: 1,
+        isUnpack: '',
         isWarn: 1,
         inventoryMode: '',
         secureInventory: '1',
@@ -381,13 +382,13 @@ export default {
             remarkAttach: []
           };
           this.categoryAps = {};
-          this.categoryMes = { productionDays: '10' };
+          this.categoryMes = { productionDays: '20' };
           this.categoryMold = {};
           this.categoryPallet = {};
           this.categoryQms = {};
           this.categoryVehicle = {};
           this.categoryWms = {
-            isUnpack: 1,
+            isUnpack: '',
             isWarn: 1,
             inventoryMode: this.form.isConsumable,
             minPackageCell: '',
@@ -459,20 +460,42 @@ export default {
     this.getDictList('productionType');
   },
   methods: {
+    inputSpe(val) {
+      if (this.form.measuringUnit == '立方') {
+        if (!val || typeof val !== 'string') {
+          this.form.volume = 0;
+          return;
+        };
+
+        let modelArr = val.split('*');
+        let modelLong = modelArr[0]; // model规格长度
+        let modeWide = modelArr[1]; // model规格宽度
+        let modeHight = modelArr[2]?.substr(0, modelArr[2].indexOf('cm')); // model规格高度
+        modeHight = Number(modeHight);
+
+        let aa = (modelLong * modeWide * modeHight) / 1000000;
+        console.log(aa, 'aa')
+        this.form.volume = aa;
+      } else {
+        this.form.volume = '';
+      }
+
+    },
     handleInput(value) {
-      this.form.volume = this.$handleInputPublicHasPoint(value);
+      // this.form.volume = this.$handleInputPublicHasPoint(value);
     },
     handleInput2(value) {
       this.form.roughWeight = this.$handleInputPublicHasPoint(value);
     },
     handleInput3(value) {
-      this.form.netWeight = this.$handleInputPublicHasPoint(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;
+      this.$set(this.categoryWms, 'inventoryMode', this.form.isConsumable);
+      this.$set(this.categoryWms, 'isUnpack', this.form.isConsumable === 1 ? 0 : 1);
     },
     changeWeightUnit() {
       if (this.form.measuringUnit && this.form.packingUnit && this.form.netWeight) {
@@ -483,6 +506,13 @@ export default {
       if (this.$route.query.id == '' || this.$route.query.id == null) {
 
         if (this.form.measuringUnit) {
+          // 计量单位是‘立方’   体积单位默认是‘立方’
+          if (this.form.measuringUnit == '立方' && this.form.specification != '') {
+            this.form.volumeUnit = '立方';
+            this.inputSpe(this.form.specification)
+          } else {
+            this.form.volume = 0;
+          }
           this.categoryPurchase.measuringUnit = this.form.measuringUnit;
           console.log(this.categoryPurchase.measuringUnit, '采购信息');
           // 如果有计量单位和包装单位 默认添加包装组
@@ -507,8 +537,13 @@ export default {
         this.isShow = true;
       }
     },
+    changeType(val) {
+      this.$set(this.form, 'isConsumable', val == 1 ? 0 : 1);
+      this.$set(this.categoryWms, 'inventoryMode', val == 1 ? 0 : 1);
+    },
+
     changePackagingSpecification(val) {
-      console.log('changePackagingSpecification---', val);
+      console.log('changePackagingSpecification--------默认包装组', val);
       this.packagingSpecificationList = val;
     },
     async _getDetails() {
@@ -807,6 +842,7 @@ export default {
           );
         }
         console.log('保存', data);
+
         addMaterial(data)
           .then((msg) => {
             this.loading = false;

+ 2 - 2
src/views/technology/production/index.vue

@@ -44,9 +44,9 @@
           <el-link type="primary" :underline="false" icon="el-icon-edit" @click="openEdit(row)">
             修改
           </el-link>
-          <el-link type="primary" :underline="false" icon="el-icon-setting" @click="openSetting(row)">
+          <!-- <el-link type="primary" :underline="false" icon="el-icon-setting" @click="openSetting(row)">
             配置工艺参数
-          </el-link>
+          </el-link> -->
 
           <el-popconfirm class="ele-action" title="确定要删除当前工序吗?" @confirm="remove(row)">
             <template v-slot:reference>

+ 2 - 2
vue.config.js

@@ -35,10 +35,10 @@ module.exports = {
     proxy: {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
-        target: 'http://192.168.1.125:18086',
+        // target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.158:18086',
         // target: 'http://192.168.1.176:18086',
-        // target: 'http://192.168.1.251:18086',
+        target: 'http://192.168.1.251:18086',
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {