diff --git a/src/views/product/rule/index.vue b/src/views/product/rule/index.vue index 6d23546..b04fd27 100644 --- a/src/views/product/rule/index.vue +++ b/src/views/product/rule/index.vue @@ -246,6 +246,7 @@ export default { } }, ruleAddFormFun(){ + if (this.ruleAddForm.name === null || this.ruleAddForm.name.length === 0){ this.$message({ message: '规格名称不可为空', @@ -260,7 +261,6 @@ export default { }); return; } - let ruleAttr = this.form.ruleAttrList.find(ruleAttr => ruleAttr.name === this.ruleAddForm.name); if (ruleAttr === undefined){ this.form.ruleAttrList.push({ @@ -337,6 +337,7 @@ export default { const id = row.id || this.ids getRule(id).then(response => { this.form = response.data; + this.form.ruleAttrList=response.data.ruleAttrList this.open = true; this.title = "修改商品规格"; });