Compare commits
No commits in common. "139177be42b04f88f8f9f217dbeb0ef3e94d3196" and "4d69cfa12fbcda321b35ff0c1e693e84df37f22b" have entirely different histories.
139177be42
...
4d69cfa12f
|
@ -211,7 +211,6 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<div v-show="stepNumber === 1">
|
<div v-show="stepNumber === 1">
|
||||||
{{this.categoryOptionValue}}
|
|
||||||
<el-form-item label="品类" prop="type">
|
<el-form-item label="品类" prop="type">
|
||||||
<el-cascader
|
<el-cascader
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
@ -232,7 +231,7 @@
|
||||||
<div style="height: 200px; width: 100%;">
|
<div style="height: 200px; width: 100%;">
|
||||||
<el-form ref="templateAttributeGroupForm" label-width="80px">
|
<el-form ref="templateAttributeGroupForm" label-width="80px">
|
||||||
<el-form-item :label="attribute.name" v-for="attribute in templateAttributeGroup.attributeList">
|
<el-form-item :label="attribute.name" v-for="attribute in templateAttributeGroup.attributeList">
|
||||||
<el-input v-model="attribute.value" :key="attribute.id"></el-input>
|
<el-input v-model="attribute.value"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -333,7 +332,6 @@
|
||||||
<el-button type="primary" @click="oneSetting">一键设置</el-button>
|
<el-button type="primary" @click="oneSetting">一键设置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
{{skuList}}
|
|
||||||
<el-table
|
<el-table
|
||||||
:data="skuList"
|
:data="skuList"
|
||||||
border
|
border
|
||||||
|
@ -460,7 +458,6 @@ export default {
|
||||||
templateAttributeList: [],
|
templateAttributeList: [],
|
||||||
attributeList: []
|
attributeList: []
|
||||||
},
|
},
|
||||||
respData: [],
|
|
||||||
templateTitleList: [
|
templateTitleList: [
|
||||||
{
|
{
|
||||||
"label":"规格图片",
|
"label":"规格图片",
|
||||||
|
@ -480,10 +477,7 @@ export default {
|
||||||
"image": null,
|
"image": null,
|
||||||
"stock": null,
|
"stock": null,
|
||||||
"price": null
|
"price": null
|
||||||
},
|
}
|
||||||
fifObj: [],
|
|
||||||
respSkuList: [],
|
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -504,62 +498,15 @@ export default {
|
||||||
handler(value) {
|
handler(value) {
|
||||||
console.log(value)
|
console.log(value)
|
||||||
if (value != null){
|
if (value != null){
|
||||||
getTemplateAttribute(value).then(res => {
|
getTemplateAttribute(value).then(response => {
|
||||||
this.categoryCommonElement.templateAttributeGroupList = res.data.templateAttributeGroupList;
|
const {data} = response;
|
||||||
this.categoryCommonElement.templateAttributeList = res.data.templateAttributeList;
|
const {templateAttributeGroupList,templateAttributeList,attributeList} = data;
|
||||||
this.categoryCommonElement.attributeList = res.data.attributeList;
|
this.categoryCommonElement.templateAttributeGroupList = templateAttributeGroupList;
|
||||||
console.log(this.respData)
|
this.categoryCommonElement.templateAttributeList = templateAttributeList;
|
||||||
if (this.respData!= null && this.respData != [] && this.respData != undefined && this.respData.length>0){
|
this.categoryCommonElement.attributeList = attributeList;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
this.categoryCommonElement.templateAttributeGroupList.forEach(template =>{
|
|
||||||
template.attributeList.forEach(te => {
|
|
||||||
this.respData.forEach(
|
|
||||||
asPro => {
|
|
||||||
if (te.id === asPro.attributeId){
|
|
||||||
this.$set(te, 'value', asPro.value)
|
|
||||||
this.fifObj.push(asPro)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
// 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){
|
|
||||||
this.$set(tem, 'value', asPro.value);
|
|
||||||
this.fifObj.push(asPro)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
this.attributeCheckedList = []
|
|
||||||
this.respData.forEach(asPro => {
|
|
||||||
if (!this.fifObj.includes(asPro)){
|
|
||||||
this.attributeCheckedList.push(asPro)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.attributeIdCheckedList = []
|
|
||||||
this.categoryCommonElement.attributeList.forEach(attr => {
|
|
||||||
this.attributeCheckedList.forEach(attri => {
|
|
||||||
if (attr.id == attri.attributeId){
|
|
||||||
attri.name = attr.name
|
|
||||||
this.attributeIdCheckedList.push(attr.id)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -576,7 +523,6 @@ export default {
|
||||||
},
|
},
|
||||||
changeRule(ruleId){
|
changeRule(ruleId){
|
||||||
this.titleList = []
|
this.titleList = []
|
||||||
console.log("list",this.ruleList)
|
|
||||||
let ruleInfo = this.ruleList.find(ruleInfo => ruleInfo.id === ruleId);
|
let ruleInfo = this.ruleList.find(ruleInfo => ruleInfo.id === ruleId);
|
||||||
const {ruleAttrList} = ruleInfo;
|
const {ruleAttrList} = ruleInfo;
|
||||||
let skuTotal = 1;
|
let skuTotal = 1;
|
||||||
|
@ -622,13 +568,6 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.respSkuList != null && this.respSkuList != [] && this.respSkuList.length>0){
|
|
||||||
for (let i = 0; i < this.respSkuList.length; i++) {
|
|
||||||
this.skuList[i].stock = this.respSkuList[i].stock
|
|
||||||
this.skuList[i].price = this.respSkuList[i].price
|
|
||||||
this.skuList[i].image = this.respSkuList[i].image
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
saveCustomAttribute(){
|
saveCustomAttribute(){
|
||||||
addAttribute({"code": this.customAttributeForm.code, "name": this.customAttributeForm.name}).then(response => {
|
addAttribute({"code": this.customAttributeForm.code, "name": this.customAttributeForm.name}).then(response => {
|
||||||
|
@ -776,155 +715,11 @@ export default {
|
||||||
this.reset();
|
this.reset();
|
||||||
const id = row.id || this.ids
|
const id = row.id || this.ids
|
||||||
getInfo(id).then(response => {
|
getInfo(id).then(response => {
|
||||||
// this.form = response.data;
|
this.form = response.data;
|
||||||
console.log("response",response)
|
|
||||||
|
|
||||||
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.respSkuList = response.data.projectSkuInfoList
|
|
||||||
|
|
||||||
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.open = true;
|
||||||
this.title = "修改商品信息";
|
this.title = "修改商品信息";
|
||||||
console.log("id",response.data.projectInfo.ruleId)
|
|
||||||
this.changeRule(response.data.projectInfo.ruleId)
|
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
// 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() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
|
@ -962,9 +757,6 @@ export default {
|
||||||
productSkuList: productSkuList
|
productSkuList: productSkuList
|
||||||
};
|
};
|
||||||
console.log(productAddReq)
|
console.log(productAddReq)
|
||||||
if (productAddReq.projectAddModel.id != undefined && productAddReq.projectAddModel.id != null){
|
|
||||||
productAddReq.id = productAddReq.projectAddModel.id
|
|
||||||
}
|
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateInfo(productAddReq).then(response => {
|
updateInfo(productAddReq).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
|
Loading…
Reference in New Issue