|
@@ -2,7 +2,7 @@
|
|
|
<div class="ele-body">
|
|
<div class="ele-body">
|
|
|
<el-card shadow="never">
|
|
<el-card shadow="never">
|
|
|
<el-form
|
|
<el-form
|
|
|
- label-width="120px"
|
|
|
|
|
|
|
+ label-width="100px"
|
|
|
ref="manageForm"
|
|
ref="manageForm"
|
|
|
:model="form"
|
|
:model="form"
|
|
|
:rules="rules"
|
|
:rules="rules"
|
|
@@ -80,6 +80,7 @@
|
|
|
v-model="form.isConsumable"
|
|
v-model="form.isConsumable"
|
|
|
size="small"
|
|
size="small"
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
|
|
+ @change="changeConsumable"
|
|
|
>
|
|
>
|
|
|
<el-option :value="1" label="批量"></el-option>
|
|
<el-option :value="1" label="批量"></el-option>
|
|
|
<el-option :value="0" label="单件"></el-option>
|
|
<el-option :value="0" label="单件"></el-option>
|
|
@@ -142,12 +143,16 @@
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="体积">
|
|
<el-form-item label="体积">
|
|
|
<div class="form-line">
|
|
<div class="form-line">
|
|
|
- <el-input v-model="form.volume" />
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="form.volume"
|
|
|
|
|
+ style="width: calc(100% - 100px)"
|
|
|
|
|
+ @input="handleInputPublicHasPoint"
|
|
|
|
|
+ />
|
|
|
<DictSelection
|
|
<DictSelection
|
|
|
- class="line-select"
|
|
|
|
|
dictName="体积单位"
|
|
dictName="体积单位"
|
|
|
clearable
|
|
clearable
|
|
|
v-model="form.volumeUnit"
|
|
v-model="form.volumeUnit"
|
|
|
|
|
+ style="width: 100px"
|
|
|
>
|
|
>
|
|
|
</DictSelection>
|
|
</DictSelection>
|
|
|
</div>
|
|
</div>
|
|
@@ -224,6 +229,7 @@
|
|
|
<!-- 仓储配置 -->
|
|
<!-- 仓储配置 -->
|
|
|
<WarehouseInfo
|
|
<WarehouseInfo
|
|
|
ref="warehouseRefs"
|
|
ref="warehouseRefs"
|
|
|
|
|
+ v-if="isShow"
|
|
|
:form="categoryWms"
|
|
:form="categoryWms"
|
|
|
:measuringUnit="form.measuringUnit"
|
|
:measuringUnit="form.measuringUnit"
|
|
|
:packingUnit="form.packingUnit"
|
|
:packingUnit="form.packingUnit"
|
|
@@ -233,7 +239,11 @@
|
|
|
<!-- 销售配置 -->
|
|
<!-- 销售配置 -->
|
|
|
<SalesInfos ref="salesRefs" :form="categorySales" />
|
|
<SalesInfos ref="salesRefs" :form="categorySales" />
|
|
|
<!-- 采购信息 -->
|
|
<!-- 采购信息 -->
|
|
|
- <PurchasingInfo ref="PurchasingInfoRefs" :form="categoryPurchase" />
|
|
|
|
|
|
|
+ <PurchasingInfo
|
|
|
|
|
+ ref="PurchasingInfoRefs"
|
|
|
|
|
+ v-if="categoryPurchase"
|
|
|
|
|
+ :form="categoryPurchase"
|
|
|
|
|
+ />
|
|
|
<!-- 生产信息 -->
|
|
<!-- 生产信息 -->
|
|
|
<ProductionInfo ref="productionRefs" :form="categoryMes" />
|
|
<ProductionInfo ref="productionRefs" :form="categoryMes" />
|
|
|
<!-- 计划 -->
|
|
<!-- 计划 -->
|
|
@@ -309,6 +319,7 @@
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ isShow: true,
|
|
|
packagingSpecificationList: [],
|
|
packagingSpecificationList: [],
|
|
|
loading: false,
|
|
loading: false,
|
|
|
levelOptions: [
|
|
levelOptions: [
|
|
@@ -344,17 +355,19 @@
|
|
|
remarkAttach: []
|
|
remarkAttach: []
|
|
|
},
|
|
},
|
|
|
categorySales: {},
|
|
categorySales: {},
|
|
|
- categoryPurchase: { purchaseMultiplier: 1 },
|
|
|
|
|
|
|
+ categoryPurchase: { purchaseMultiplier: 1, measuringUnit: '' },
|
|
|
categoryAps: {},
|
|
categoryAps: {},
|
|
|
categoryMes: {},
|
|
categoryMes: {},
|
|
|
categoryMold: {},
|
|
categoryMold: {},
|
|
|
categoryPallet: {},
|
|
categoryPallet: {},
|
|
|
categoryQms: {
|
|
categoryQms: {
|
|
|
- isComeCheck: "1"
|
|
|
|
|
|
|
+ isComeCheck: '1'
|
|
|
},
|
|
},
|
|
|
categoryVehicle: {},
|
|
categoryVehicle: {},
|
|
|
categoryWms: {
|
|
categoryWms: {
|
|
|
- isUnpack: 1
|
|
|
|
|
|
|
+ isUnpack: 1,
|
|
|
|
|
+ isWarn: 1,
|
|
|
|
|
+ inventoryMode: ''
|
|
|
},
|
|
},
|
|
|
packageDispositionVOList: [],
|
|
packageDispositionVOList: [],
|
|
|
categoryLevelPathId: null,
|
|
categoryLevelPathId: null,
|
|
@@ -415,6 +428,7 @@
|
|
|
packingUnit: '',
|
|
packingUnit: '',
|
|
|
extField: {}
|
|
extField: {}
|
|
|
};
|
|
};
|
|
|
|
|
+ this.categorySales = {};
|
|
|
this.purchaseInfo = {};
|
|
this.purchaseInfo = {};
|
|
|
this.remarkform = {
|
|
this.remarkform = {
|
|
|
remarkAttach: []
|
|
remarkAttach: []
|
|
@@ -426,7 +440,9 @@
|
|
|
this.categoryQms = {};
|
|
this.categoryQms = {};
|
|
|
this.categoryVehicle = {};
|
|
this.categoryVehicle = {};
|
|
|
this.categoryWms = {
|
|
this.categoryWms = {
|
|
|
- isUnpack: 1
|
|
|
|
|
|
|
+ isUnpack: 1,
|
|
|
|
|
+ isWarn: 1,
|
|
|
|
|
+ inventoryMode: this.form.isConsumable
|
|
|
};
|
|
};
|
|
|
this.packageDispositionVOList = [];
|
|
this.packageDispositionVOList = [];
|
|
|
this.categoryLevelPathId = null;
|
|
this.categoryLevelPathId = null;
|
|
@@ -489,18 +505,40 @@
|
|
|
|
|
|
|
|
this.getFieldModel();
|
|
this.getFieldModel();
|
|
|
|
|
|
|
|
- // if (this.$route.query.id) {
|
|
|
|
|
- // this._getDetails();
|
|
|
|
|
- // }
|
|
|
|
|
this.getDictList('productionType');
|
|
this.getDictList('productionType');
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ handleInputPublicHasPoint(value) {
|
|
|
|
|
+ const filteredValue = value.replace(/[^0-9.]/g, '');
|
|
|
|
|
+ let finalValue = '';
|
|
|
|
|
+ const dotIndex = filteredValue.indexOf('.');
|
|
|
|
|
+ if (dotIndex !== -1) {
|
|
|
|
|
+ finalValue = filteredValue.slice(0, dotIndex + 3);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ finalValue = filteredValue;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.form.volume = finalValue;
|
|
|
|
|
+ },
|
|
|
|
|
+ changeConsumable() {
|
|
|
|
|
+ this.categoryWms.inventoryMode = this.form.isConsumable;
|
|
|
|
|
+ },
|
|
|
changeUnit() {
|
|
changeUnit() {
|
|
|
- if (this.form.measuringUnit) {
|
|
|
|
|
- this.categoryPurchase.measuringUnit = this.form.measuringUnit;
|
|
|
|
|
- if (this.form.packingUnit) {
|
|
|
|
|
- this.$refs.warehouseRefs.defaultBuild(this.form.packingUnit);
|
|
|
|
|
|
|
+ if (this.$route.query.id == '' || this.$route.query.id == null) {
|
|
|
|
|
+ if (this.form.measuringUnit) {
|
|
|
|
|
+ this.categoryPurchase.measuringUnit = this.form.measuringUnit;
|
|
|
|
|
+ // 如果有计量单位和包装单位 默认添加包装组
|
|
|
|
|
+ if (this.form.packingUnit) {
|
|
|
|
|
+ this.$refs.warehouseRefs.defaultBuild(this.form.packingUnit);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.isShow = false;
|
|
|
|
|
+ if (this.form.measuringUnit && this.form.packingUnit) {
|
|
|
|
|
+ console.log(this.form.measuringUnit, 'this.form.measuringUnit');
|
|
|
|
|
+ console.log(this.form.packingUnit, 'this.form.packingUnit');
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ this.isShow = true;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
changePackagingSpecification(val) {
|
|
changePackagingSpecification(val) {
|
|
@@ -515,6 +553,9 @@
|
|
|
...info.category
|
|
...info.category
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ // if (this.form.measuringUnit && this.form.packingUnit) {
|
|
|
|
|
+ // this.$refs.warehouseRefs.defaultBuild(this.form.packingUnit);
|
|
|
|
|
+ // }
|
|
|
this.categoryLevelPathId = info.category.categoryLevelPathIdParent;
|
|
this.categoryLevelPathId = info.category.categoryLevelPathIdParent;
|
|
|
this.judgeSet(info);
|
|
this.judgeSet(info);
|
|
|
|
|
|
|
@@ -531,6 +572,7 @@
|
|
|
// 判断字段类型并赋值
|
|
// 判断字段类型并赋值
|
|
|
judgeSet(info) {
|
|
judgeSet(info) {
|
|
|
console.log('info-------', info);
|
|
console.log('info-------', info);
|
|
|
|
|
+
|
|
|
if (typeof info.categoryAps == 'string') {
|
|
if (typeof info.categoryAps == 'string') {
|
|
|
this.categoryAps = {};
|
|
this.categoryAps = {};
|
|
|
} else {
|
|
} else {
|
|
@@ -675,8 +717,9 @@
|
|
|
submit() {
|
|
submit() {
|
|
|
this.$refs.manageForm.validate(async (valid) => {
|
|
this.$refs.manageForm.validate(async (valid) => {
|
|
|
let productionValid = await this.$refs.productionRefs.getFormValid();
|
|
let productionValid = await this.$refs.productionRefs.getFormValid();
|
|
|
|
|
+ let warehouseValid = await this.$refs.warehouseRefs.getFormValid();
|
|
|
|
|
|
|
|
- if (!valid || !productionValid) {
|
|
|
|
|
|
|
+ if (!valid || !productionValid || !warehouseValid) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|