yijing 1 жил өмнө
parent
commit
024791b94a

+ 24 - 3
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>
 
@@ -381,7 +381,7 @@ export default {
             remarkAttach: []
           };
           this.categoryAps = {};
-          this.categoryMes = { productionDays: '10' };
+          this.categoryMes = { productionDays: '20' };
           this.categoryMold = {};
           this.categoryPallet = {};
           this.categoryQms = {};
@@ -459,8 +459,24 @@ export default {
     this.getDictList('productionType');
   },
   methods: {
+    inputSpe(val) {
+      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;
+    },
     handleInput(value) {
-      this.form.volume = this.$handleInputPublicHasPoint(value);
+      // this.form.volume = this.$handleInputPublicHasPoint(value);
     },
     handleInput2(value) {
       this.form.roughWeight = this.$handleInputPublicHasPoint(value);
@@ -483,6 +499,10 @@ export default {
       if (this.$route.query.id == '' || this.$route.query.id == null) {
 
         if (this.form.measuringUnit) {
+          // 计量单位是‘立方’   体积单位默认是‘立方’
+          if (this.form.measuringUnit == '立方') {
+            this.form.volumeUnit = '立方';
+          }
           this.categoryPurchase.measuringUnit = this.form.measuringUnit;
           console.log(this.categoryPurchase.measuringUnit, '采购信息');
           // 如果有计量单位和包装单位 默认添加包装组
@@ -807,6 +827,7 @@ export default {
           );
         }
         console.log('保存', data);
+
         addMaterial(data)
           .then((msg) => {
             this.loading = false;

+ 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: {