|
|
@@ -213,6 +213,23 @@
|
|
|
</template>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="属性类型:" prop="attributeType">
|
|
|
+ <el-select
|
|
|
+ v-model="form.attributeType"
|
|
|
+ filterable
|
|
|
+ class="ele-block"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in attributeList"
|
|
|
+ :key="item.value"
|
|
|
+ :value="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</el-card>
|
|
|
@@ -227,6 +244,7 @@
|
|
|
<!-- 分类选择弹窗 -->
|
|
|
<CategoryDialog ref="categoryRefs" @chooseCategory="confirmCategory" />
|
|
|
<!-- 仓储配置 -->
|
|
|
+ <<<<<<< HEAD
|
|
|
<WarehouseInfo
|
|
|
ref="warehouseRefs"
|
|
|
v-if="isShow"
|
|
|
@@ -236,6 +254,16 @@
|
|
|
:packageDispositionVOList="packageDispositionVOList"
|
|
|
@change="changePackagingSpecification"
|
|
|
/>
|
|
|
+ =======
|
|
|
+ <WarehouseInfo
|
|
|
+ ref="warehouseRefs"
|
|
|
+ :form="categoryWms"
|
|
|
+ :measuringUnit="form.measuringUnit"
|
|
|
+ :packingUnit="form.packingUnit"
|
|
|
+ :packageDispositionVOList="packageDispositionVOList"
|
|
|
+ @change="changePackagingSpecification"
|
|
|
+ />
|
|
|
+ >>>>>>> 778152e35a1d73386814551d9d6194caae9cf792
|
|
|
<!-- 销售配置 -->
|
|
|
<SalesInfos ref="salesRefs" :form="categorySales" />
|
|
|
<!-- 采购信息 -->
|
|
|
@@ -295,6 +323,39 @@
|
|
|
import { deepClone } from '@/utils/index';
|
|
|
import { finishPageTab, reloadPageTab } from '@/utils/page-tab-util';
|
|
|
|
|
|
+ <<<<<<< HEAD
|
|
|
+ export default {
|
|
|
+ name: 'product',
|
|
|
+ components: {
|
|
|
+ SalesInfos,
|
|
|
+ PurchasingInfo,
|
|
|
+ linkMsg,
|
|
|
+ GroupDialog,
|
|
|
+ deptSelect,
|
|
|
+ personSelect,
|
|
|
+ WarehouseInfo,
|
|
|
+ ProcureInfo,
|
|
|
+ ProductionInfo,
|
|
|
+ PlanInfo,
|
|
|
+ SalesInfo,
|
|
|
+ QualityInfo,
|
|
|
+ BoatInfo,
|
|
|
+ TurnoverInfo,
|
|
|
+ MoldInfo,
|
|
|
+ RemarkInfo,
|
|
|
+ CategoryDialog,
|
|
|
+ CodeDialog
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ isShow: true,
|
|
|
+ packagingSpecificationList: [],
|
|
|
+ loading: false,
|
|
|
+ levelOptions: [
|
|
|
+ {
|
|
|
+ label: '特级',
|
|
|
+ value: '特级'
|
|
|
+ =======
|
|
|
export default {
|
|
|
name: 'product',
|
|
|
components: {
|
|
|
@@ -319,7 +380,6 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- isShow: true,
|
|
|
packagingSpecificationList: [],
|
|
|
loading: false,
|
|
|
levelOptions: [
|
|
|
@@ -340,6 +400,24 @@
|
|
|
value: '三级'
|
|
|
}
|
|
|
],
|
|
|
+ attributeList: [
|
|
|
+ {
|
|
|
+ label: '总装',
|
|
|
+ value: 1
|
|
|
+ >>>>>>> 778152e35a1d73386814551d9d6194caae9cf792
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '部件',
|
|
|
+ value: 2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '零',
|
|
|
+ value: 3
|
|
|
+ },{
|
|
|
+ label: '原材料',
|
|
|
+ value: 4
|
|
|
+ }
|
|
|
+ ],
|
|
|
form: {
|
|
|
categoryLevelGroupName: '',
|
|
|
categoryLevelName: '',
|
|
|
@@ -347,7 +425,7 @@
|
|
|
measuringUnit: '',
|
|
|
weightUnit: '',
|
|
|
packingUnit: '',
|
|
|
-
|
|
|
+ attributeType:'',
|
|
|
extField: {}
|
|
|
},
|
|
|
|
|
|
@@ -355,24 +433,39 @@
|
|
|
remarkAttach: []
|
|
|
},
|
|
|
categorySales: {},
|
|
|
- categoryPurchase: { purchaseMultiplier: 1, measuringUnit: '' },
|
|
|
+ categoryPurchase: { purchaseMultiplier: 1 },
|
|
|
categoryAps: {},
|
|
|
categoryMes: {},
|
|
|
categoryMold: {},
|
|
|
categoryPallet: {},
|
|
|
- categoryQms: {
|
|
|
- isComeCheck: '1'
|
|
|
- },
|
|
|
+ categoryQms: {},
|
|
|
categoryVehicle: {},
|
|
|
categoryWms: {
|
|
|
- isUnpack: 1,
|
|
|
- isWarn: 1,
|
|
|
- inventoryMode: ''
|
|
|
+ isUnpack: 1
|
|
|
},
|
|
|
packageDispositionVOList: [],
|
|
|
categoryLevelPathId: null,
|
|
|
|
|
|
- dictList: [],
|
|
|
+ remarkform: {
|
|
|
+ remarkAttach: []
|
|
|
+ },
|
|
|
+ categorySales: {},
|
|
|
+ categoryPurchase: { purchaseMultiplier: 1, measuringUnit: '' },
|
|
|
+ categoryAps: {},
|
|
|
+ categoryMes: {},
|
|
|
+ categoryMold: {},
|
|
|
+ categoryPallet: {},
|
|
|
+ categoryQms: {
|
|
|
+ isComeCheck: '1'
|
|
|
+ },
|
|
|
+ categoryVehicle: {},
|
|
|
+ categoryWms: {
|
|
|
+ isUnpack: 1,
|
|
|
+ isWarn: 1,
|
|
|
+ inventoryMode: ''
|
|
|
+ },
|
|
|
+ packageDispositionVOList: [],
|
|
|
+ categoryLevelPathId: null,
|
|
|
|
|
|
fileList: [],
|
|
|
// 表单验证规则
|
|
|
@@ -428,7 +521,6 @@
|
|
|
packingUnit: '',
|
|
|
extField: {}
|
|
|
};
|
|
|
- this.categorySales = {};
|
|
|
this.purchaseInfo = {};
|
|
|
this.remarkform = {
|
|
|
remarkAttach: []
|
|
|
@@ -440,16 +532,140 @@
|
|
|
this.categoryQms = {};
|
|
|
this.categoryVehicle = {};
|
|
|
this.categoryWms = {
|
|
|
- isUnpack: 1,
|
|
|
- isWarn: 1,
|
|
|
- inventoryMode: this.form.isConsumable
|
|
|
+ isUnpack: 1
|
|
|
};
|
|
|
this.packageDispositionVOList = [];
|
|
|
this.categoryLevelPathId = null;
|
|
|
|
|
|
- this.dictList = [];
|
|
|
+ status: null
|
|
|
+ };
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ '$route.query.id': {
|
|
|
+ handler(id) {
|
|
|
+ if (id) {
|
|
|
+ this._getDetails();
|
|
|
+ } else {
|
|
|
+ this.form = {
|
|
|
+ categoryLevelGroupName: '',
|
|
|
+ // categoryLevelName: '',
|
|
|
+ isConsumable: 1,
|
|
|
+ measuringUnit: '',
|
|
|
+ weightUnit: '',
|
|
|
+ packingUnit: '',
|
|
|
+ extField: {}
|
|
|
+ };
|
|
|
+ this.categorySales = {};
|
|
|
+ this.purchaseInfo = {};
|
|
|
+ this.remarkform = {
|
|
|
+ remarkAttach: []
|
|
|
+ };
|
|
|
+ this.categoryAps = {};
|
|
|
+ this.categoryMes = {};
|
|
|
+ this.categoryMold = {};
|
|
|
+ this.categoryPallet = {};
|
|
|
+ this.categoryQms = {};
|
|
|
+ this.categoryVehicle = {};
|
|
|
+ this.categoryWms = {
|
|
|
+ isUnpack: 1,
|
|
|
+ isWarn: 1,
|
|
|
+ inventoryMode: this.form.isConsumable
|
|
|
+ };
|
|
|
+ this.packageDispositionVOList = [];
|
|
|
+ this.categoryLevelPathId = null;
|
|
|
+
|
|
|
+ this.dictList = [];
|
|
|
+
|
|
|
+ this.fileList = [];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ immediate: true
|
|
|
+
|
|
|
+ },
|
|
|
+ async activated() {
|
|
|
+ this.status = this.$route.query.status;
|
|
|
+ this.form.categoryLevelId = this.$route.query.categoryLevelId;
|
|
|
+ this.form.categoryLevelName = this.$route.query.categoryLevelName;
|
|
|
+ this.form.categoryLevelPath = this.$route.query.categoryLevelPath;
|
|
|
+ this.form.categoryLevelPathId = this.$route.query.categoryLevelPathId;
|
|
|
+
|
|
|
+ this.ruleCode = this.$route.query.ruleCode;
|
|
|
+ if (this.ruleCode && this.ruleCode != '自定义' && this.status != 0) {
|
|
|
+ const code = await getCode(this.ruleCode);
|
|
|
+ this.$set(this.form, 'code', code);
|
|
|
+ }
|
|
|
+
|
|
|
+ this.getFieldModel();
|
|
|
+
|
|
|
+ this.getDictList('productionType');
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ //新增
|
|
|
+
|
|
|
+ this.$set(
|
|
|
+ this.form,
|
|
|
+ 'categoryLevelId',
|
|
|
+ this.$route.query.categoryLevelId
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ this.form,
|
|
|
+ 'categoryLevelName',
|
|
|
+ this.$route.query.categoryLevelName
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ this.form,
|
|
|
+ 'categoryLevelPath',
|
|
|
+ this.$route.query.categoryLevelPath
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ this.form,
|
|
|
+ 'categoryLevelPathId',
|
|
|
+ this.$route.query.categoryLevelPathId
|
|
|
+ );
|
|
|
+ this.status = this.$route.query.status;
|
|
|
+ this.ruleCode = this.$route.query.ruleCode;
|
|
|
+ if (this.ruleCode && this.ruleCode != '自定义' && this.status != 0) {
|
|
|
+ const code = await getCode(this.ruleCode);
|
|
|
+ this.$set(this.form, 'code', code);
|
|
|
+ }
|
|
|
+
|
|
|
+ this.getFieldModel();
|
|
|
+
|
|
|
+ this.getDictList('productionType');
|
|
|
+ },
|
|
|
+ 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() {
|
|
|
+ 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.fileList = [];
|
|
|
+ this.isShow = true;
|
|
|
}
|
|
|
},
|
|
|
deep: true,
|
|
|
@@ -505,40 +721,15 @@
|
|
|
|
|
|
this.getFieldModel();
|
|
|
|
|
|
+ // if (this.$route.query.id) {
|
|
|
+ // this._getDetails();
|
|
|
+ // }
|
|
|
this.getDictList('productionType');
|
|
|
},
|
|
|
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() {
|
|
|
- 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;
|
|
|
+ if (this.form.measuringUnit && this.form.packingUnit) {
|
|
|
+ this.$refs.warehouseRefs.defaultBuild(this.form.packingUnit);
|
|
|
}
|
|
|
},
|
|
|
changePackagingSpecification(val) {
|
|
|
@@ -553,9 +744,6 @@
|
|
|
...info.category
|
|
|
};
|
|
|
|
|
|
- // if (this.form.measuringUnit && this.form.packingUnit) {
|
|
|
- // this.$refs.warehouseRefs.defaultBuild(this.form.packingUnit);
|
|
|
- // }
|
|
|
this.categoryLevelPathId = info.category.categoryLevelPathIdParent;
|
|
|
this.judgeSet(info);
|
|
|
|
|
|
@@ -572,7 +760,6 @@
|
|
|
// 判断字段类型并赋值
|
|
|
judgeSet(info) {
|
|
|
console.log('info-------', info);
|
|
|
-
|
|
|
if (typeof info.categoryAps == 'string') {
|
|
|
this.categoryAps = {};
|
|
|
} else {
|
|
|
@@ -679,9 +866,17 @@
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ <<<<<<< HEAD
|
|
|
+ // if (this.form.measuringUnit && this.form.packingUnit) {
|
|
|
+ // this.$refs.warehouseRefs.defaultBuild(this.form.packingUnit);
|
|
|
+ // }
|
|
|
+ this.categoryLevelPathId = info.category.categoryLevelPathIdParent;
|
|
|
+ this.judgeSet(info);
|
|
|
+ =======
|
|
|
openCategory() {
|
|
|
this.$refs.categoryRefs.open();
|
|
|
},
|
|
|
+ >>>>>>> 778152e35a1d73386814551d9d6194caae9cf792
|
|
|
|
|
|
openCode() {
|
|
|
this.codeShow = true;
|
|
|
@@ -693,6 +888,78 @@
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
|
|
|
+ <<<<<<< HEAD
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
+ // 判断字段类型并赋值
|
|
|
+ judgeSet(info) {
|
|
|
+ console.log('info-------', info);
|
|
|
+
|
|
|
+ if (typeof info.categoryAps == 'string') {
|
|
|
+ this.categoryAps = {};
|
|
|
+ } else {
|
|
|
+ this.categoryAps = info.categoryAps;
|
|
|
+ }
|
|
|
+ if (typeof info.categoryMes == 'string') {
|
|
|
+ this.categoryMes = {};
|
|
|
+ } else {
|
|
|
+ this.categoryMes = info.categoryMes;
|
|
|
+ }
|
|
|
+ if (typeof info.categoryMold == 'string') {
|
|
|
+ this.categoryMold = {};
|
|
|
+ } else {
|
|
|
+ this.categoryMold = info.categoryMold;
|
|
|
+ }
|
|
|
+ if (typeof info.categoryPallet == 'string') {
|
|
|
+ this.categoryPallet = {};
|
|
|
+ } else {
|
|
|
+ this.categoryPallet = info.categoryPallet;
|
|
|
+ }
|
|
|
+ if (typeof info.categorySales == 'string') {
|
|
|
+ this.categorySales = {};
|
|
|
+ } else {
|
|
|
+ this.categorySales = info.categorySales;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (typeof info.categoryPurchase == 'string') {
|
|
|
+ this.categoryPurchase = {};
|
|
|
+ } else {
|
|
|
+ this.categoryPurchase = info.categoryPurchase;
|
|
|
+ }
|
|
|
+ if (typeof info.categoryQms == 'string') {
|
|
|
+ this.categoryQms = {};
|
|
|
+ } else {
|
|
|
+ this.categoryQms = info.categoryQms;
|
|
|
+ }
|
|
|
+ if (typeof info.categoryVehicle == 'string') {
|
|
|
+ this.categoryVehicle = {};
|
|
|
+ } else {
|
|
|
+ this.categoryVehicle = info.categoryVehicle;
|
|
|
+ }
|
|
|
+ if (typeof info.categoryWms == 'string') {
|
|
|
+ this.categoryWms = {};
|
|
|
+ } else {
|
|
|
+ this.categoryWms = info.categoryWms;
|
|
|
+ }
|
|
|
+ if (typeof info.packageDispositionVOList == 'string') {
|
|
|
+ this.packageDispositionVOList = [];
|
|
|
+ } else {
|
|
|
+ this.packageDispositionVOList = info.packageDispositionVOList;
|
|
|
+ console.log(
|
|
|
+ 'this.packageDispositionVOList---!!!----',
|
|
|
+ this.packageDispositionVOList
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ getFieldModel() {
|
|
|
+ fieldModel({ relevance: 't_main_category' }).then((res) => {
|
|
|
+ this.fileList = res;
|
|
|
+
|
|
|
+ this.fileList.forEach((f) => {
|
|
|
+ this.$set(this.form.extField, f.prop, ''); // 初始化动态模型属性
|
|
|
+ });
|
|
|
+ =======
|
|
|
cancel() {
|
|
|
// finishPageTab();
|
|
|
// this.$router.go(-1);
|
|
|
@@ -702,6 +969,7 @@
|
|
|
query: {
|
|
|
categoryLevelId: this.form.categoryLevelId
|
|
|
}
|
|
|
+ >>>>>>> 778152e35a1d73386814551d9d6194caae9cf792
|
|
|
});
|
|
|
} else {
|
|
|
this.$router.push({
|
|
|
@@ -709,6 +977,213 @@
|
|
|
query: {
|
|
|
categoryLevelId: this.form.categoryLevelId
|
|
|
}
|
|
|
+ <<<<<<< HEAD
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
+
|
|
|
+ async getDictList(code) {
|
|
|
+ let { data: res } = await getByCode(code);
|
|
|
+ this.dictList = res.map((item) => {
|
|
|
+ let values = Object.keys(item);
|
|
|
+ return {
|
|
|
+ value: Number(values[0]),
|
|
|
+ label: item[values[0]]
|
|
|
+ };
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ openCategory() {
|
|
|
+ this.$refs.categoryRefs.open();
|
|
|
+ },
|
|
|
+
|
|
|
+ openCode() {
|
|
|
+ this.codeShow = true;
|
|
|
+ },
|
|
|
+
|
|
|
+ chooseCode(code) {
|
|
|
+ this.$set(this.form, 'code', code);
|
|
|
+ this.codeShow = false;
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
+
|
|
|
+ cancel() {
|
|
|
+ // finishPageTab();
|
|
|
+ // this.$router.go(-1);
|
|
|
+ if (this.$route.query.rootTreeId == 9) {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/product/oneProduct',
|
|
|
+ query: {
|
|
|
+ categoryLevelId: this.form.categoryLevelId
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/material/product',
|
|
|
+ query: {
|
|
|
+ categoryLevelId: this.form.categoryLevelId
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 保存
|
|
|
+ submit() {
|
|
|
+ this.$refs.manageForm.validate(async (valid) => {
|
|
|
+ let productionValid = await this.$refs.productionRefs.getFormValid();
|
|
|
+ let warehouseValid = await this.$refs.warehouseRefs.getFormValid();
|
|
|
+
|
|
|
+ if (!valid || !productionValid || !warehouseValid) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ let packageDispositionVOList = [];
|
|
|
+ if (this.packagingSpecificationList.length > 0) {
|
|
|
+ packageDispositionVOList = this.packagingSpecificationList.map(
|
|
|
+ (item) => {
|
|
|
+ let obj = {
|
|
|
+ code: item.code,
|
|
|
+ name: item.name
|
|
|
+ };
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ ...obj,
|
|
|
+ id: item.id0,
|
|
|
+ sort: 0,
|
|
|
+ status: item.status,
|
|
|
+ packageCell: 1,
|
|
|
+ packageUnit: item.packageUnit,
|
|
|
+ conversionUnit: item.packageUnit
|
|
|
+ },
|
|
|
+ {
|
|
|
+ ...obj,
|
|
|
+ id: item.id1,
|
|
|
+ sort: 1,
|
|
|
+ packageCell: item.minPackageCell,
|
|
|
+ packageUnit: item.packageUnit,
|
|
|
+ conversionUnit: item.minConversionUnit,
|
|
|
+ status: item.status
|
|
|
+ },
|
|
|
+ {
|
|
|
+ ...obj,
|
|
|
+ id: item.id2,
|
|
|
+ sort: 2,
|
|
|
+ packageCell: item.inPackageCell,
|
|
|
+ packageUnit: item.minConversionUnit,
|
|
|
+ conversionUnit: item.inConversionUnit,
|
|
|
+ status: item.status
|
|
|
+ },
|
|
|
+ {
|
|
|
+ ...obj,
|
|
|
+ id: item.id3,
|
|
|
+ sort: 3,
|
|
|
+ packageCell: item.outPackageCell,
|
|
|
+ packageUnit: item.inConversionUnit,
|
|
|
+ conversionUnit: item.outConversionUnit,
|
|
|
+ status: item.status
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ );
|
|
|
+ let packagingSpecificationList =
|
|
|
+ this.packagingSpecificationList.filter(
|
|
|
+ (item) => item.status == 1
|
|
|
+ );
|
|
|
+ this.form.extField.packingSpecification = packagingSpecificationList
|
|
|
+ .map((item) => {
|
|
|
+ return [
|
|
|
+ `${item.minPackageCell}${item.packageUnit}/${item.minConversionUnit}`,
|
|
|
+ `${item.inPackageCell}${item.minConversionUnit}/${item.inConversionUnit}`,
|
|
|
+ `${item.outPackageCell}${item.inConversionUnit}/${item.outConversionUnit}`
|
|
|
+ ];
|
|
|
+ })
|
|
|
+ .flat()
|
|
|
+ .join(',');
|
|
|
+ } else {
|
|
|
+ this.form.extField.packingSpecification = '';
|
|
|
+ }
|
|
|
+
|
|
|
+ this.loading = true;
|
|
|
+ // const imgList = this.remarkform.imgList;
|
|
|
+ // const arr = [];
|
|
|
+ // if (imgList.length) {
|
|
|
+ // imgList.map((item) => {
|
|
|
+ // arr.push(item.storePath);
|
|
|
+ // });
|
|
|
+ // this.form.remarkAttach = arr.join(',');
|
|
|
+ // }
|
|
|
+ // this.form.remark = this.remarkform.remark
|
|
|
+ // ? this.remarkform.remark
|
|
|
+ // : '';
|
|
|
+
|
|
|
+ const data = {
|
|
|
+ categorySales: this.categorySales,
|
|
|
+ categoryPurchase: this.categoryPurchase,
|
|
|
+ categoryWms: this.categoryWms,
|
|
|
+ categoryAps: this.categoryAps,
|
|
|
+ categoryMes: this.categoryMes,
|
|
|
+ categoryMold: this.categoryMold,
|
|
|
+ categoryPallet: this.categoryPallet,
|
|
|
+ categoryQms: this.categoryQms,
|
|
|
+ categoryVehicle: this.categoryVehicle,
|
|
|
+ category: {
|
|
|
+ ...this.form,
|
|
|
+ ...this.remarkform,
|
|
|
+ ...this.PathInfo
|
|
|
+ },
|
|
|
+ packageDispositionVOList: packageDispositionVOList.flat()
|
|
|
+ };
|
|
|
+
|
|
|
+ if (this.$route.query.status == 1) {
|
|
|
+ data.categorySales.id = null;
|
|
|
+ data.categoryPurchase.id = null;
|
|
|
+ data.category.id = null;
|
|
|
+ data.categoryWms.id = null;
|
|
|
+ data.categoryAps.id = null;
|
|
|
+ data.categoryMes.id = null;
|
|
|
+ data.categoryMold.id = null;
|
|
|
+ data.categoryPallet.id = null;
|
|
|
+ data.categoryQms.id = null;
|
|
|
+ data.categoryVehicle.id = null;
|
|
|
+ data.packageDispositionVOList = data.packageDispositionVOList.map(
|
|
|
+ (item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ id: null
|
|
|
+ };
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ console.log('保存', data);
|
|
|
+ addMaterial(data)
|
|
|
+ .then((msg) => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.success(msg);
|
|
|
+ // reloadPageTab({ fullPath: '/material/product' });
|
|
|
+ // this.$router.go(-1);
|
|
|
+ this.cancel();
|
|
|
+ // if (this.$route.query.rootTreeId == 9) {
|
|
|
+ // this.$router.push({
|
|
|
+ // path: '/product/oneProduct',
|
|
|
+ // query: {
|
|
|
+ // categoryLevelId: this.form.categoryLevelId
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // this.$router.push({
|
|
|
+ // path: '/material/product',
|
|
|
+ // query: {
|
|
|
+ // categoryLevelId: this.form.categoryLevelId
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ =======
|
|
|
+ >>>>>>> 778152e35a1d73386814551d9d6194caae9cf792
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
@@ -717,9 +1192,8 @@
|
|
|
submit() {
|
|
|
this.$refs.manageForm.validate(async (valid) => {
|
|
|
let productionValid = await this.$refs.productionRefs.getFormValid();
|
|
|
- let warehouseValid = await this.$refs.warehouseRefs.getFormValid();
|
|
|
|
|
|
- if (!valid || !productionValid || !warehouseValid) {
|
|
|
+ if (!valid || !productionValid) {
|
|
|
return false;
|
|
|
}
|
|
|
|