|
|
@@ -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;
|