商品属性修改
parent
8f4035206e
commit
ecfc615f9f
|
@ -175,7 +175,8 @@
|
|||
v-for="brand in brandList"
|
||||
:key="brand.id"
|
||||
:label="brand.nam"
|
||||
:value="brand.id">
|
||||
:value="brand.id"
|
||||
>
|
||||
<el-row>
|
||||
<div style="display: inline-flex; align-items: center;">
|
||||
{{ brand.nam }}-----------------
|
||||
|
@ -277,6 +278,7 @@
|
|||
<div slot="header" class="clearfix">
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane label="商品属性组" name="first">
|
||||
{{e}}
|
||||
<el-row>
|
||||
<el-col :span="6"
|
||||
v-for="templateAttributeGroup in categoryCommonElement.templateAttributeGroupList">
|
||||
|
@ -367,8 +369,6 @@
|
|||
<editor v-model="form.remark" :min-height="192"/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
|
||||
</el-form>
|
||||
|
||||
|
||||
|
@ -434,7 +434,6 @@ export default {
|
|||
templateAttributeGroupList: [],
|
||||
templateAttributeList: [],
|
||||
attributeList: []
|
||||
|
||||
},
|
||||
ruleAddFormStatus: false,
|
||||
addRulePropertyValue: null,
|
||||
|
@ -483,6 +482,7 @@ export default {
|
|||
groupList:"",
|
||||
attributeList:"",
|
||||
persionList:"",
|
||||
remark:'',
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
|
@ -517,6 +517,13 @@ export default {
|
|||
a:[],
|
||||
b:[],
|
||||
c:[],
|
||||
d:[],
|
||||
e:[
|
||||
{
|
||||
"name":null,
|
||||
"value":null
|
||||
}
|
||||
],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
|
@ -546,7 +553,7 @@ export default {
|
|||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
|
@ -602,7 +609,6 @@ export default {
|
|||
for (let forIndex = parseInt(currentIndex) - 1; forIndex >= 0; forIndex--) {
|
||||
forSize = forSize * ruleAttrList[forIndex].ruleList.length
|
||||
}
|
||||
console.log(`${ruleAttrInfo.name} 规格连续出现的次数 :${continuousSize} 循环出现的次数: ${forSize}`)
|
||||
|
||||
let counter = 0;
|
||||
for (let forIndex = 0; forIndex < forSize; forIndex++) {
|
||||
|
@ -610,7 +616,7 @@ export default {
|
|||
ruleList.forEach(value => {
|
||||
for (let continuousIndex = 0; continuousIndex < continuousSize; continuousIndex++) {
|
||||
this.skuList[counter++]["prop" + currentIndex] = value;
|
||||
console.log(value)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -634,10 +640,7 @@ export default {
|
|||
// 从第一个属性开始生成组合
|
||||
generateSkuCombinations(0, '');
|
||||
|
||||
// 打印结果
|
||||
this.skuList1.forEach(sku => {
|
||||
console.log(sku);
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
handleCheckedCitiesChange() {
|
||||
|
@ -758,15 +761,20 @@ export default {
|
|||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getInfo(id).then(response => {
|
||||
console.log(response)
|
||||
this.form = response.data;
|
||||
this.oneSettingValue=response.data.specification
|
||||
this.e=[]
|
||||
this.e=response.data.asProductAttributeInfo
|
||||
console.log(this.e)
|
||||
this.changeRule(response.data.ruleId)
|
||||
this.onSubmit()
|
||||
this.form.type=parseInt(response.data.type)
|
||||
this.form.mianType=parseInt(response.data.mianType)
|
||||
this.form.parentType=parseInt(response.data.parentType)
|
||||
this.CategoryTree()
|
||||
this.open = true;
|
||||
this.title = "修改商品信息";
|
||||
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
|
@ -774,13 +782,30 @@ export default {
|
|||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
this.selectAttribut()
|
||||
console.log(this.form)
|
||||
updateInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
this.form=""
|
||||
});
|
||||
} else {
|
||||
console.log(this.categoryCommonElement)
|
||||
this.selectAttribut()
|
||||
addInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
this.form=""
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
selectAttribut(){
|
||||
this.a=[]
|
||||
this.b=[]
|
||||
this.c=[]
|
||||
this.categoryCommonElement.templateAttributeGroupList.forEach(
|
||||
templateAttributeGroup=>{
|
||||
templateAttributeGroup.attributeList.forEach(
|
||||
|
@ -800,24 +825,11 @@ export default {
|
|||
this.c+=(attributeChecked.id+"-"+attributeChecked.name+"-"+attributeChecked.value)
|
||||
}
|
||||
)
|
||||
console.log(this.a)
|
||||
console.log(this.b)
|
||||
console.log(this.c)
|
||||
this.form.sku=this.skuList1
|
||||
this.form.specification=this.oneSettingValue
|
||||
// this.form.categoryList=this.a.concat(this.b).concat(this.c)
|
||||
this.form.groupList=this.a
|
||||
this.form.attributeList=this.b
|
||||
this.form.persionList=this.c
|
||||
console.log(this.form)
|
||||
addInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
|
@ -835,7 +847,7 @@ export default {
|
|||
this.download('product/info/export', {
|
||||
...this.queryParams
|
||||
}, `info_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue