|
@@ -216,7 +216,7 @@
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
type: "number",
|
|
|
- defaultValue: 20
|
|
|
+ defaultValue: 0
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -229,7 +229,6 @@
|
|
|
attr: {
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
- defaultValue: '袋'
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -243,7 +242,6 @@
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
type: "number",
|
|
|
- defaultValue: 100
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -257,7 +255,6 @@
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
type: "number",
|
|
|
- defaultValue: 100
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -271,7 +268,6 @@
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
type: "number",
|
|
|
- defaultValue: 5
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -285,7 +281,6 @@
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
type: "number",
|
|
|
- defaultValue: 5
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -299,7 +294,6 @@
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
type: "number",
|
|
|
- defaultValue: 18
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -313,7 +307,6 @@
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
type: "number",
|
|
|
- defaultValue: 6
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -377,7 +370,6 @@
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
type: "number",
|
|
|
- defaultValue: 20
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -390,7 +382,6 @@
|
|
|
attr: {
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
- defaultValue: '袋'
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -404,7 +395,6 @@
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
type: "number",
|
|
|
- defaultValue: 100
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -418,7 +408,6 @@
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
type: "number",
|
|
|
- defaultValue: 100
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -432,7 +421,6 @@
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
type: "number",
|
|
|
- defaultValue: 500
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -446,7 +434,6 @@
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
type: "number",
|
|
|
- defaultValue: 28
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -460,7 +447,6 @@
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
type: "number",
|
|
|
- defaultValue: 18
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -474,7 +460,6 @@
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
type: "number",
|
|
|
- defaultValue: 6
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -513,12 +498,12 @@
|
|
|
categoryName: [{
|
|
|
required: true, message: '请输入物料分类', trigger: 'change'
|
|
|
}],
|
|
|
- vmCategoryName: [{
|
|
|
- required: true, message: '请输入虚拟分类', trigger: 'change'
|
|
|
- }],
|
|
|
- organizationCategoryName: [{
|
|
|
- required: true, message: '请输入机构商品分类', trigger: 'change'
|
|
|
- }],
|
|
|
+ // vmCategoryName: [{
|
|
|
+ // required: true, message: '请输入虚拟分类', trigger: 'change'
|
|
|
+ // }],
|
|
|
+ // organizationCategoryName: [{
|
|
|
+ // required: true, message: '请输入机构商品分类', trigger: 'change'
|
|
|
+ // }],
|
|
|
}
|
|
|
},
|
|
|
columns: [
|
|
@@ -663,7 +648,7 @@
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- labelWidth:'116px',
|
|
|
+ labelWidth: '116px',
|
|
|
span: 6,
|
|
|
label: '机构商品分类',
|
|
|
prop: 'organizationCategoryName',
|
|
@@ -886,7 +871,6 @@
|
|
|
},
|
|
|
}
|
|
|
mounted() {
|
|
|
- // this.getTreeList()
|
|
|
this.getAttribute()
|
|
|
this.timer = setInterval(() => {
|
|
|
this.getDataList()
|
|
@@ -994,72 +978,73 @@
|
|
|
getDetail(e : any) {
|
|
|
console.log('编辑 ==> ', e);
|
|
|
(this as any).$refs.byTool.setTool({ return: true, save: true, delete: true })
|
|
|
- this.loading = this.$loading({ target: '.my-container' })
|
|
|
+ this.loading = this.$loading({ target: '.my-container' });
|
|
|
+ api.single({ id: e.vmCategoryId }, 'maindataMaterialVmcategory').then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ if (res.data) e.vmCategoryName = res.data.name;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ api.single({ id: e.organizationCategoryId }, 'maindataMaterialOrganizationCategory').then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ if (res.data) e.organizationCategoryName = res.data.name;
|
|
|
+ }
|
|
|
+ });
|
|
|
api.single({ id: e.categoryId }, 'maindataMaterialCategory').then((res : any) => {
|
|
|
- if (res.code === 200) e.categoryName = res.data.name
|
|
|
- }).then(() => {
|
|
|
- api.single({ id: e.vmCategoryId }, 'maindataMaterialVmcategory').then((res : any) => {
|
|
|
- if (res.code === 200) e.vmCategoryName = res.data.name
|
|
|
- }).then(() => {
|
|
|
- api.single({ id: e.organizationCategoryId }, 'maindataMaterialOrganizationCategory').then((res : any) => {
|
|
|
- if (res.code === 200) e.organizationCategoryName = res.data.name
|
|
|
- }).then(() => {
|
|
|
- if (e.attributeId) {
|
|
|
- api.single({ id: e.attributeId }, 'maindataMaterialAttribute').then((res : any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- if (res.data) this.selectValue = res.data.name
|
|
|
- }
|
|
|
- })
|
|
|
+ if (res.code === 200) e.categoryName = res.data.name;
|
|
|
+ if (e.attributeId) {
|
|
|
+ api.single({ id: e.attributeId }, 'maindataMaterialAttribute').then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ if (res.data) this.selectValue = res.data.name
|
|
|
}
|
|
|
- this.intercept = e.attributeId // 拦截物料属性判断
|
|
|
- this.isEdit = true;
|
|
|
- this.editInfo = e;
|
|
|
- this.isShow = 'add';
|
|
|
- // 标签
|
|
|
- if (e.tags) {
|
|
|
- this.tagsData = e.tags.split(",")
|
|
|
- } else this.tagsData = [];
|
|
|
- this.materialSpec = e.materialSpec
|
|
|
- this.isSingle = e.materialSpec === 0 ? true : false;
|
|
|
- if (e.attributeList) this.attributeList = JSON.parse(e.attributeList);
|
|
|
- other.selectByMaterialId({ id: e.id }, 'maindataMaterialSku').then((res : any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- if (this.isSingle) {
|
|
|
- this.selectValue = '' // 物料属性名称
|
|
|
- this.towTable = '' // 表格数据
|
|
|
- this.attributeList = []; // 属性规格
|
|
|
- (this as any).$refs.singeTable.setValue(res.data);
|
|
|
- } else {
|
|
|
- this.forFun(this.attributeList[0], 0) // 生成sku
|
|
|
- let tableConfig = (this as any).$lodash.cloneDeep(this.tableConfig);
|
|
|
- let skuRuleList = (this as any).$lodash.cloneDeep(this.skuRuleList);
|
|
|
- let newColumns = (this as any).$lodash.cloneDeep(this.attributeList).reverse();
|
|
|
- res.data.map((v : any, i : any) => {
|
|
|
- v = Object.assign(v, skuRuleList[i])
|
|
|
- v.dataIndex = i
|
|
|
- })
|
|
|
- newColumns.map((v : any) => {
|
|
|
- tableConfig.columns.unshift({
|
|
|
- width: '80px',
|
|
|
- title: v.title,
|
|
|
- field: v.field,
|
|
|
- })
|
|
|
- });
|
|
|
- this.tableList = (this as any).$lodash.cloneDeep(res.data);
|
|
|
- // console.log('表格配置 ==> ', tableConfig);
|
|
|
- console.log('skuRuleList ==> ', skuRuleList);
|
|
|
- console.log('表格数据 ==> ', this.tableList);
|
|
|
- this.setTableConfig = tableConfig;
|
|
|
- setTimeout(() => {
|
|
|
- (this as any).$refs.table.setConfig(tableConfig); // 设置表格配置
|
|
|
- (this as any).$refs.table.setValue(this.tableList) // 设置表格数据
|
|
|
- }, 300)
|
|
|
- }
|
|
|
- }
|
|
|
- (this as any).$refs.form.setValue(e)
|
|
|
- this.loading.close()
|
|
|
- })
|
|
|
})
|
|
|
+ }
|
|
|
+ this.intercept = e.attributeId // 拦截物料属性判断
|
|
|
+ this.isEdit = true;
|
|
|
+ this.editInfo = e;
|
|
|
+ this.isShow = 'add';
|
|
|
+ // 标签
|
|
|
+ if (e.tags) {
|
|
|
+ this.tagsData = e.tags.split(",")
|
|
|
+ } else this.tagsData = [];
|
|
|
+ this.materialSpec = e.materialSpec
|
|
|
+ this.isSingle = e.materialSpec === 0 ? true : false;
|
|
|
+ if (e.attributeList) this.attributeList = JSON.parse(e.attributeList);
|
|
|
+ other.selectByMaterialId({ id: e.id }, 'maindataMaterialSku').then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ if (this.isSingle) {
|
|
|
+ this.selectValue = '' // 物料属性名称
|
|
|
+ this.towTable = '' // 表格数据
|
|
|
+ this.attributeList = []; // 属性规格
|
|
|
+ (this as any).$refs.singeTable.setValue(res.data);
|
|
|
+ } else {
|
|
|
+ this.forFun(this.attributeList[0], 0) // 生成sku
|
|
|
+ let tableConfig = (this as any).$lodash.cloneDeep(this.tableConfig);
|
|
|
+ let skuRuleList = (this as any).$lodash.cloneDeep(this.skuRuleList);
|
|
|
+ let newColumns = (this as any).$lodash.cloneDeep(this.attributeList).reverse();
|
|
|
+ res.data.map((v : any, i : any) => {
|
|
|
+ v = Object.assign(v, skuRuleList[i])
|
|
|
+ v.dataIndex = i
|
|
|
+ })
|
|
|
+ newColumns.map((v : any) => {
|
|
|
+ tableConfig.columns.unshift({
|
|
|
+ width: '80px',
|
|
|
+ title: v.title,
|
|
|
+ field: v.field,
|
|
|
+ })
|
|
|
+ });
|
|
|
+ this.tableList = (this as any).$lodash.cloneDeep(res.data);
|
|
|
+ // console.log('表格配置 ==> ', tableConfig);
|
|
|
+ console.log('skuRuleList ==> ', skuRuleList);
|
|
|
+ console.log('表格数据 ==> ', this.tableList);
|
|
|
+ this.setTableConfig = tableConfig;
|
|
|
+ setTimeout(() => {
|
|
|
+ (this as any).$refs.table.setConfig(tableConfig); // 设置表格配置
|
|
|
+ (this as any).$refs.table.setValue(this.tableList) // 设置表格数据
|
|
|
+ }, 300)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ (this as any).$refs.form.setValue(e)
|
|
|
+ this.loading.close()
|
|
|
})
|
|
|
})
|
|
|
}
|
|
@@ -1408,19 +1393,6 @@
|
|
|
} else this.failHandle(res)
|
|
|
})
|
|
|
}
|
|
|
- // 获取树型导航数据
|
|
|
- getTreeList() {
|
|
|
- api.treeList('maindataMaterialCategory').then((res : any) => {
|
|
|
- // console.log(res.data[0]);
|
|
|
- if (res.code === 200) {
|
|
|
- this.data = res.data;
|
|
|
- this.expandedKeys.push(res.data[0].id)
|
|
|
- res.data[0].children.map((v : any) => {
|
|
|
- this.expandedKeys.push(v.id)
|
|
|
- })
|
|
|
- } else this.failHandle(res)
|
|
|
- })
|
|
|
- }
|
|
|
// 获取列表数据
|
|
|
getDataList() {
|
|
|
if (!this.$refs.moduleView) {
|
|
@@ -1618,6 +1590,7 @@
|
|
|
padding-right: 16px;
|
|
|
flex-shrink: 0;
|
|
|
height: 740px;
|
|
|
+
|
|
|
// box-sizing: border-box;
|
|
|
.bill-tab {
|
|
|
width: 150px;
|