master
parent
4d69cfa12f
commit
3cf0ffd590
|
@ -211,6 +211,7 @@
|
|||
</el-row>
|
||||
</div>
|
||||
<div v-show="stepNumber === 1">
|
||||
{{this.categoryOptionValue}}
|
||||
<el-form-item label="品类" prop="type">
|
||||
<el-cascader
|
||||
style="width: 100%"
|
||||
|
@ -458,6 +459,7 @@ export default {
|
|||
templateAttributeList: [],
|
||||
attributeList: []
|
||||
},
|
||||
respData: [],
|
||||
templateTitleList: [
|
||||
{
|
||||
"label":"规格图片",
|
||||
|
@ -477,7 +479,9 @@ export default {
|
|||
"image": null,
|
||||
"stock": null,
|
||||
"price": null
|
||||
}
|
||||
},
|
||||
parentObj: [],
|
||||
bigParentObj: []
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
|
@ -498,15 +502,51 @@ export default {
|
|||
handler(value) {
|
||||
console.log(value)
|
||||
if (value != null){
|
||||
getTemplateAttribute(value).then(response => {
|
||||
const {data} = response;
|
||||
const {templateAttributeGroupList,templateAttributeList,attributeList} = data;
|
||||
this.categoryCommonElement.templateAttributeGroupList = templateAttributeGroupList;
|
||||
this.categoryCommonElement.templateAttributeList = templateAttributeList;
|
||||
this.categoryCommonElement.attributeList = attributeList;
|
||||
getTemplateAttribute(value).then(res => {
|
||||
console.log("res",res)
|
||||
this.categoryCommonElement.templateAttributeGroupList = res.data.templateAttributeGroupList;
|
||||
this.categoryCommonElement.templateAttributeList = res.data.templateAttributeList;
|
||||
this.categoryCommonElement.attributeList = res.data.attributeList;
|
||||
console.log(this.respData)
|
||||
if (this.respData!= null && this.respData != [] && this.respData != undefined && this.respData.length>0){
|
||||
console.log("llll")
|
||||
console.log("qian",this.categoryCommonElement)
|
||||
this.categoryCommonElement.templateAttributeGroupList.forEach(template =>{
|
||||
console.log("template",template)
|
||||
template.attributeList.forEach(te => {
|
||||
this.respData.forEach(
|
||||
asPro => {
|
||||
if (te.id === asPro.attributeId){
|
||||
te.value = asPro.value
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
})
|
||||
// console.log("onj",this.parentObj)
|
||||
// this.bigParentObj.push(this.parentObj)
|
||||
// console.log("big",this.bigParentObj)
|
||||
// console.log("big",this.bigParentObj)
|
||||
// this.categoryCommonElement.templateAttributeGroupList = []
|
||||
// this.categoryCommonElement.templateAttributeGroupList.push(this.bigParentObj)
|
||||
console.log("categoryCommonElement",this.categoryCommonElement)
|
||||
this.categoryCommonElement.templateAttributeList.forEach(
|
||||
tem => {
|
||||
this.respData.forEach(
|
||||
asPro => {
|
||||
if (tem.id = asPro.attributeId){
|
||||
tem.value = asPro.value
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
this.respData.forEach(asPro => {
|
||||
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -715,11 +755,150 @@ export default {
|
|||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getInfo(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改商品信息";
|
||||
});
|
||||
// this.form = response.data;
|
||||
|
||||
this.form = response.data.projectInfo
|
||||
// this.categoryOptionValue[0] = response.data.projectInfo.mianType
|
||||
// this.categoryOptionValue[1] = response.data.projectInfo.parentType
|
||||
// this.categoryOptionValue[2] = response.data.projectInfo.type
|
||||
|
||||
// this.form.mianType = response.data.projectInfo.mianType;
|
||||
// this.form.parentType = response.data.projectInfo.parentType;
|
||||
// this.form.type = response.data.projectInfo.type;
|
||||
this.respData = response.data.asProductAttributeInfoList
|
||||
this.categoryOptionValue = [
|
||||
Number(response.data.projectInfo.mianType),
|
||||
Number(response.data.projectInfo.parentType),
|
||||
Number(response.data.projectInfo.type)
|
||||
];
|
||||
|
||||
// getTemplateAttribute(response.data.projectInfo.type).then(res => {
|
||||
// console.log("res",res)
|
||||
// this.categoryCommonElement.templateAttributeGroupList = res.data.templateAttributeGroupList;
|
||||
// this.categoryCommonElement.templateAttributeList = res.data.templateAttributeList;
|
||||
// this.categoryCommonElement.attributeList = res.data.attributeList;
|
||||
// console.log("qian",this.categoryCommonElement)
|
||||
// this.categoryCommonElement.templateAttributeGroupList.forEach(template =>{
|
||||
// console.log("template",template)
|
||||
// template.attributeList.forEach(te => {
|
||||
// this.respData.forEach(
|
||||
// asPro => {
|
||||
// if (te.id === asPro.attributeId){
|
||||
// this.parentObj.push(asPro)
|
||||
// }
|
||||
// }
|
||||
// )
|
||||
// te.attributeList = this.parentObj
|
||||
// this.bigParentObj = te
|
||||
// })
|
||||
// })
|
||||
// // console.log("onj",this.parentObj)
|
||||
// // this.bigParentObj.push(this.parentObj)
|
||||
// // console.log("big",this.bigParentObj)
|
||||
// console.log("big",this.bigParentObj)
|
||||
// this.categoryCommonElement.templateAttributeGroupList = []
|
||||
// this.categoryCommonElement.templateAttributeGroupList.push(this.bigParentObj)
|
||||
// console.log("categoryCommonElement",this.categoryCommonElement)
|
||||
// this.categoryCommonElement.templateAttributeList.forEach(
|
||||
// tem => {
|
||||
// this.respData.forEach(
|
||||
// asPro => {
|
||||
// if (tem.id = asPro.attributeId){
|
||||
// tem.value = asPro.value
|
||||
// }
|
||||
// }
|
||||
// )
|
||||
// }
|
||||
// )
|
||||
// this.respData.forEach(asPro => {
|
||||
//
|
||||
// })
|
||||
// })
|
||||
|
||||
|
||||
|
||||
// this.categoryCommonElement.templateAttributeGroupList.forEach(template =>{
|
||||
// template.attributeList.forEach(te => {
|
||||
// this.respData.forEach(
|
||||
// asPro => {
|
||||
// console.log(asPro)
|
||||
// console.log(te)
|
||||
// if (te.attributeId === asPro.attributeId){
|
||||
// te.value = asPro.value
|
||||
// }
|
||||
// }
|
||||
// )
|
||||
// })
|
||||
// })
|
||||
// console.log("天下无敌")
|
||||
// console.log(response)
|
||||
this.open = true;
|
||||
this.title = "修改商品信息";
|
||||
});
|
||||
|
||||
},
|
||||
// handleUpdate(row) {
|
||||
// this.open =true
|
||||
// this.reset();
|
||||
//
|
||||
// const id = row.id || this.ids;
|
||||
// getInfo(id).then(response => {
|
||||
// this.updateForm(response.data);
|
||||
// this.getTemplateAttributes(response.data.projectInfo.type);
|
||||
// });
|
||||
// },
|
||||
//
|
||||
// updateForm(data) {
|
||||
// this.form = data.projectInfo;
|
||||
// this.respData = data.asProductAttributeInfoList;
|
||||
// this.categoryOptionValue = [
|
||||
// data.projectInfo.mianType,
|
||||
// data.projectInfo.parentType,
|
||||
// data.projectInfo.type
|
||||
// ];
|
||||
// },
|
||||
//
|
||||
// getTemplateAttributes(type) {
|
||||
// getTemplateAttribute(type).then(res => {
|
||||
// this.updateCategoryCommonElement(res.data);
|
||||
// });
|
||||
// },
|
||||
//
|
||||
// updateCategoryCommonElement(data) {
|
||||
// this.categoryCommonElement.templateAttributeGroupList = data.templateAttributeGroupList;
|
||||
// this.categoryCommonElement.templateAttributeList = data.templateAttributeList;
|
||||
// this.categoryCommonElement.attributeList = data.attributeList;
|
||||
//
|
||||
// this.updateAttributeList();
|
||||
// },
|
||||
//
|
||||
// updateAttributeList() {
|
||||
// this.categoryCommonElement.templateAttributeGroupList.forEach(template => {
|
||||
// template.attributeList.map(te => {
|
||||
// let attributeList = this.getAttributeList(te.id);
|
||||
// // console.log("attr",attributeList)
|
||||
// te.value = this.getAttributeList(te.id).value;
|
||||
// this.bigParentObj = te;
|
||||
// });
|
||||
// });
|
||||
//
|
||||
//
|
||||
// },
|
||||
//
|
||||
// getAttributeList(id) {
|
||||
// let attributeList = {};
|
||||
// this.respData.forEach(asPro => {
|
||||
// if (id === asPro.attributeId) {
|
||||
// attributeList = asPro
|
||||
// }
|
||||
// });
|
||||
// return attributeList;
|
||||
// },
|
||||
//
|
||||
// clearTemplateAttributeGroupList() {
|
||||
// console.log("偶极矩",this.categoryCommonElement.templateAttributeGroupList)
|
||||
// this.categoryCommonElement.templateAttributeGroupList = [];
|
||||
// },
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
|
|
Loading…
Reference in New Issue