|
@@ -141,23 +141,19 @@
|
|
|
<!-- 分类选择弹窗 -->
|
|
<!-- 分类选择弹窗 -->
|
|
|
<CategoryDialog ref="categoryRefs" @chooseCategory="confirmCategory" />
|
|
<CategoryDialog ref="categoryRefs" @chooseCategory="confirmCategory" />
|
|
|
<!-- 仓储配置 -->
|
|
<!-- 仓储配置 -->
|
|
|
- <WarehouseInfo ref="warehouseRefs" :form="form" />
|
|
|
|
|
- <!-- 采购 -->
|
|
|
|
|
- <ProcureInfo ref="procureRefs" :form="form" />
|
|
|
|
|
|
|
+ <WarehouseInfo ref="warehouseRefs" :form="categoryWms" />
|
|
|
<!-- 生产信息 -->
|
|
<!-- 生产信息 -->
|
|
|
- <ProductionInfo ref="productionRefs" :form="form" />
|
|
|
|
|
|
|
+ <ProductionInfo ref="productionRefs" :form="categoryMes" />
|
|
|
<!-- 计划 -->
|
|
<!-- 计划 -->
|
|
|
- <PlanInfo ref="planRefs" :form="form" />
|
|
|
|
|
- <!-- 销售信息 -->
|
|
|
|
|
- <SalesInfo ref="salesRefs" :form="form" />
|
|
|
|
|
|
|
+ <PlanInfo ref="planRefs" :form="categoryAps" />
|
|
|
<!-- 质量配置 -->
|
|
<!-- 质量配置 -->
|
|
|
- <QualityInfo ref="qualityRefs" :form="form" />
|
|
|
|
|
|
|
+ <QualityInfo ref="qualityRefs" :form="categoryQms" />
|
|
|
<!-- 舟皿信息 -->
|
|
<!-- 舟皿信息 -->
|
|
|
- <BoatInfo ref="qualityRefs" :form="form" />
|
|
|
|
|
|
|
+ <BoatInfo ref="qualityRefs" :form="categoryPallet" />
|
|
|
<!-- 周转车信息 -->
|
|
<!-- 周转车信息 -->
|
|
|
- <TurnoverInfo ref="turnoverRefs" :form="form" />
|
|
|
|
|
|
|
+ <TurnoverInfo ref="turnoverRefs" :form="categoryVehicle" />
|
|
|
<!-- 模具信息 -->
|
|
<!-- 模具信息 -->
|
|
|
- <MoldInfo ref="moldRefs" :form="form" />
|
|
|
|
|
|
|
+ <MoldInfo ref="moldRefs" :form="categoryMold" />
|
|
|
<!-- 备注信息 -->
|
|
<!-- 备注信息 -->
|
|
|
<RemarkInfo ref="remarkRefs" :form="remarkform" />
|
|
<RemarkInfo ref="remarkRefs" :form="remarkform" />
|
|
|
<!-- 关联信息 -->
|
|
<!-- 关联信息 -->
|
|
@@ -182,7 +178,8 @@
|
|
|
import personSelect from '@/components/CommomSelect/person-select.vue';
|
|
import personSelect from '@/components/CommomSelect/person-select.vue';
|
|
|
import linkMsg from './components/link-msg.vue';
|
|
import linkMsg from './components/link-msg.vue';
|
|
|
import { getDetails } from '@/api/classifyManage/itemInformation';
|
|
import { getDetails } from '@/api/classifyManage/itemInformation';
|
|
|
- import { editMaterial } from '@/api/material/manage.js';
|
|
|
|
|
|
|
+ import { addMaterial } from '@/api/material/manage.js';
|
|
|
|
|
+ import { deepClone } from '@/utils/index';
|
|
|
export default {
|
|
export default {
|
|
|
name: 'ManageMaterial',
|
|
name: 'ManageMaterial',
|
|
|
components: {
|
|
components: {
|
|
@@ -209,7 +206,16 @@
|
|
|
categoryLevelGroupName: '',
|
|
categoryLevelGroupName: '',
|
|
|
categoryLevelName: ''
|
|
categoryLevelName: ''
|
|
|
},
|
|
},
|
|
|
- remarkform: {},
|
|
|
|
|
|
|
+ remarkform: {
|
|
|
|
|
+ remarkAttach:[]
|
|
|
|
|
+ },
|
|
|
|
|
+ categoryAps:{},
|
|
|
|
|
+ categoryMes:{},
|
|
|
|
|
+ categoryMold:{},
|
|
|
|
|
+ categoryPallet:{},
|
|
|
|
|
+ categoryQms:{},
|
|
|
|
|
+ categoryVehicle:{},
|
|
|
|
|
+ categoryWms:{},
|
|
|
// 表单验证规则
|
|
// 表单验证规则
|
|
|
rules: {
|
|
rules: {
|
|
|
categoryLevelGroupName: [
|
|
categoryLevelGroupName: [
|
|
@@ -223,7 +229,8 @@
|
|
|
measuringUnit: [
|
|
measuringUnit: [
|
|
|
{ required: true, message: '请选择计量单位', trigger: 'change' }
|
|
{ required: true, message: '请选择计量单位', trigger: 'change' }
|
|
|
]
|
|
]
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ PathInfo:{},
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created () {
|
|
created () {
|
|
@@ -232,10 +239,51 @@
|
|
|
methods: {
|
|
methods: {
|
|
|
async _getDetails () {
|
|
async _getDetails () {
|
|
|
const data = await getDetails(this.$route.query.id);
|
|
const data = await getDetails(this.$route.query.id);
|
|
|
- this.form = data;
|
|
|
|
|
-
|
|
|
|
|
|
|
+ const info = deepClone(data)
|
|
|
|
|
+ this.form = {
|
|
|
|
|
+ ...info.category
|
|
|
|
|
+ }
|
|
|
|
|
+ this.judgeSet(info)
|
|
|
this.searchDeptNodeClick(this.form.deptLeaderId);
|
|
this.searchDeptNodeClick(this.form.deptLeaderId);
|
|
|
},
|
|
},
|
|
|
|
|
+ // 判断字段类型并赋值
|
|
|
|
|
+ judgeSet(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.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
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
// 选择所属部门
|
|
// 选择所属部门
|
|
|
searchDeptNodeClick (id, info) {
|
|
searchDeptNodeClick (id, info) {
|
|
|
// 根据部门获取人员
|
|
// 根据部门获取人员
|
|
@@ -247,7 +295,7 @@
|
|
|
//选择负责人
|
|
//选择负责人
|
|
|
handleDirectorChange (id, info) {},
|
|
handleDirectorChange (id, info) {},
|
|
|
// 确定分类
|
|
// 确定分类
|
|
|
- confirmCategory (node, title) {
|
|
|
|
|
|
|
+ confirmCategory (node, title,PathInfo) {
|
|
|
if (title == '选择产品分类') {
|
|
if (title == '选择产品分类') {
|
|
|
this.$set(this.form, 'productCategoryLevelName', node.name);
|
|
this.$set(this.form, 'productCategoryLevelName', node.name);
|
|
|
this.$set(this.form, 'productCategoryLevelId', node.id);
|
|
this.$set(this.form, 'productCategoryLevelId', node.id);
|
|
@@ -256,6 +304,7 @@
|
|
|
this.$set(this.form, 'categoryLevelId', node.id);
|
|
this.$set(this.form, 'categoryLevelId', node.id);
|
|
|
this.$set(this.form, 'categoryLevelPath', node.name);
|
|
this.$set(this.form, 'categoryLevelPath', node.name);
|
|
|
this.$set(this.form, 'categoryLevelPathId', node.id);
|
|
this.$set(this.form, 'categoryLevelPathId', node.id);
|
|
|
|
|
+ this.PathInfo = PathInfo
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
openCategory () {
|
|
openCategory () {
|
|
@@ -272,26 +321,38 @@
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
this.loading = true;
|
|
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 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 = {
|
|
const data = {
|
|
|
- ...this.form
|
|
|
|
|
|
|
+ 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
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
- editMaterial(data)
|
|
|
|
|
|
|
+ addMaterial(data)
|
|
|
.then((msg) => {
|
|
.then((msg) => {
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
this.$message.success(msg);
|
|
this.$message.success(msg);
|
|
|
- this.updateVisible(false);
|
|
|
|
|
- this.$emit('done');
|
|
|
|
|
|
|
+ finishPageTab()
|
|
|
|
|
+ reloadPageTab({ fullPath: '/material/product' });
|
|
|
|
|
+ this.$router.go(-1)
|
|
|
})
|
|
})
|
|
|
.catch((e) => {
|
|
.catch((e) => {
|
|
|
this.loading = false;
|
|
this.loading = false;
|