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