|
|
@@ -271,6 +271,28 @@
|
|
|
</template>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="机型" prop="modelKey">
|
|
|
+ <DictSelection
|
|
|
+ dictName="物品机型"
|
|
|
+ clearable
|
|
|
+ v-model="form.modelKey"
|
|
|
+ multiple
|
|
|
+ >
|
|
|
+ </DictSelection>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="颜色" prop="colorKey">
|
|
|
+ <DictSelection
|
|
|
+ dictName="物品颜色"
|
|
|
+ clearable
|
|
|
+ v-model="form.colorKey"
|
|
|
+ multiple
|
|
|
+ >
|
|
|
+ </DictSelection>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="状态">
|
|
|
<template>
|
|
|
@@ -286,7 +308,7 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="8" v-for="(f, idx) in fileList" :key="idx">
|
|
|
- <el-form-item :label="f.label" :prop="'extField.'+f.prop">
|
|
|
+ <el-form-item :label="f.label" :prop="'extField.' + f.prop">
|
|
|
<template>
|
|
|
<div class="form-line">
|
|
|
<component
|
|
|
@@ -406,7 +428,7 @@
|
|
|
import { finishPageTab, reloadPageTab } from '@/utils/page-tab-util';
|
|
|
import { produceTypeList } from '@/enum/dict.js';
|
|
|
import { copyObj } from '@/utils/util';
|
|
|
-
|
|
|
+ import { parameterGetByCode } from '@/api/system/dictionary/index.js';
|
|
|
const defCategoryQms = [
|
|
|
{
|
|
|
categoryId: '',
|
|
|
@@ -523,7 +545,8 @@
|
|
|
attributeType: 1,
|
|
|
weightUnit: '',
|
|
|
packingUnit: '',
|
|
|
-
|
|
|
+ colorKey: [],
|
|
|
+ modelKey: [],
|
|
|
extField: {},
|
|
|
// isConsumables:2,
|
|
|
extTagField: {
|
|
|
@@ -591,7 +614,8 @@
|
|
|
ruleCode: null,
|
|
|
codeShow: false,
|
|
|
|
|
|
- status: null
|
|
|
+ status: null,
|
|
|
+ isNetWeight: 0
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -620,6 +644,8 @@
|
|
|
netWeight: '',
|
|
|
weightUnit: '',
|
|
|
packingUnit: '',
|
|
|
+ colorKey: [],
|
|
|
+ modelKey: [],
|
|
|
extField: {},
|
|
|
extTagField: {
|
|
|
isConsumables: 0
|
|
|
@@ -754,8 +780,19 @@
|
|
|
// this.getDictList('zeroPartPros');
|
|
|
},
|
|
|
async created() {
|
|
|
+ //主数据物品是否计算净重
|
|
|
+ parameterGetByCode({
|
|
|
+ code: 'main_isNetWeight'
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.value) {
|
|
|
+ this.isNetWeight = res.value;
|
|
|
+ if (this.isNetWeight == 1) {
|
|
|
+ this.$set(this.categoryWms, 'isUnpack', 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
//新增
|
|
|
- console.log('88888888');
|
|
|
|
|
|
this.$set(
|
|
|
this.form,
|
|
|
@@ -820,6 +857,34 @@
|
|
|
} else {
|
|
|
this.form.volume = '';
|
|
|
}
|
|
|
+ this.setNetWeight();
|
|
|
+ },
|
|
|
+ //计算净重
|
|
|
+ setNetWeight() {
|
|
|
+ if (
|
|
|
+ this.form.specification &&
|
|
|
+ this.form.weightUnit == 'KG' &&
|
|
|
+ this.isNetWeight == 1
|
|
|
+ ) {
|
|
|
+ let modelArr = this.form.specification.split('*');
|
|
|
+ let modelLong = modelArr[0]; // model规格长度
|
|
|
+ let modeWide = modelArr[1]; // model规格宽度
|
|
|
+ let modeHight = modelArr[2]?.substr(0, modelArr[2].indexOf('mm')); // model规格高度
|
|
|
+ modeHight = Number(modeHight);
|
|
|
+ let volume = (modelLong * modeWide * modeHight) / 1000;
|
|
|
+ this.$set(
|
|
|
+ this.form,
|
|
|
+ 'netWeight',
|
|
|
+ parseFloat((volume * 7.85) / 1000).toFixed(4)
|
|
|
+ );
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // this.$refs.warehouseRefs &&
|
|
|
+ // this.$refs.warehouseRefs.changeNetWeight(this.form.netWeight);
|
|
|
+ this.handleInput3();
|
|
|
+ });
|
|
|
+
|
|
|
+ // this.form.netWeight = volume*7.85/1000;
|
|
|
+ }
|
|
|
},
|
|
|
changeMeasureType() {
|
|
|
if (this.form.measureType == 1) {
|
|
|
@@ -827,6 +892,7 @@
|
|
|
} else {
|
|
|
this.$set(this.categoryWms, 'isUnpack', 0);
|
|
|
}
|
|
|
+ this.setNetWeight();
|
|
|
},
|
|
|
handleInput(value) {
|
|
|
// this.form.volume = this.$handleInputPublicHasPoint(value);
|
|
|
@@ -851,8 +917,9 @@
|
|
|
) {
|
|
|
this.$refs.warehouseRefs.changeNetWeight(this.form.netWeight);
|
|
|
}
|
|
|
+ this.setNetWeight();
|
|
|
},
|
|
|
- changeUnit() {
|
|
|
+ async changeUnit() {
|
|
|
if (this.$route.query.id == '' || this.$route.query.id == null) {
|
|
|
if (this.form.measuringUnit) {
|
|
|
// 计量单位是‘立方’ 体积单位默认是‘立方’
|
|
|
@@ -865,11 +932,14 @@
|
|
|
} else {
|
|
|
this.form.volume = 0;
|
|
|
}
|
|
|
+
|
|
|
this.categoryPurchase.measuringUnit = this.form.measuringUnit;
|
|
|
console.log(this.categoryPurchase.measuringUnit, '采购信息');
|
|
|
// 如果有计量单位和包装单位 默认添加包装组
|
|
|
if (this.form.packingUnit) {
|
|
|
- this.$refs.warehouseRefs.defaultBuild(this.form.packingUnit);
|
|
|
+ await this.$refs.warehouseRefs.defaultBuild(
|
|
|
+ this.form.packingUnit
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
@@ -882,12 +952,15 @@
|
|
|
console.log(this.form.packingUnit, 'this.form.packingUnit');
|
|
|
if (this.packageDispositionVOList.length === 0) {
|
|
|
console.log('如果没有包装组');
|
|
|
- this.$refs.warehouseRefs.defaultBuild(this.form.packingUnit);
|
|
|
+ await this.$refs.warehouseRefs.defaultBuild(
|
|
|
+ this.form.packingUnit
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
this.isShow = true;
|
|
|
}
|
|
|
+ await this.setNetWeight();
|
|
|
},
|
|
|
|
|
|
// changeAttribute(val) {
|
|
|
@@ -915,6 +988,14 @@
|
|
|
|
|
|
const info = deepClone(data);
|
|
|
info.category.produceType = info.category.produceType[0];
|
|
|
+ try {
|
|
|
+ if (info.category.colorKey) {
|
|
|
+ info.category.colorKey = info.category.colorKey.split(',');
|
|
|
+ }
|
|
|
+ if (info.category.modelKey) {
|
|
|
+ info.category.modelKey = info.category.modelKey.split(',');
|
|
|
+ }
|
|
|
+ } catch (error) {}
|
|
|
|
|
|
this.form = {
|
|
|
...info.category
|
|
|
@@ -1282,7 +1363,12 @@
|
|
|
}
|
|
|
);
|
|
|
}
|
|
|
-
|
|
|
+ if (data.category.colorKey) {
|
|
|
+ data.category.colorKey = data.category.colorKey.toString();
|
|
|
+ }
|
|
|
+ if (data.category.modelKey) {
|
|
|
+ data.category.modelKey = data.category.modelKey.toString();
|
|
|
+ }
|
|
|
data.category.produceType = data.category.produceType
|
|
|
? [data.category.produceType]
|
|
|
: [];
|