Commit 36fde3cc authored by Marcus's avatar Marcus

品牌管理-最后一个商标不能删除

http://zentao.jdshangmen.com/bug-view-692.html
parent d51359b4
......@@ -2,7 +2,7 @@
<el-form ref="form" :model="form" label-width="80px">
<el-card class="box-card" style="margin-bottom: 15px">
<div slot="header" class="clearfix">
<el-button style="float: right; padding: 3px 0" type="text" @click="$emit('delete')">删除</el-button>
<el-button v-show="isShowDelete" style="float: right; padding: 3px 0" type="text" @click="$emit('delete')">删除</el-button>
</div>
<el-form-item :label="'商标' + (index + 1)">
<el-input v-model="form.brandName" placeholder="商标"></el-input>
......@@ -37,6 +37,10 @@
export default {
name: "BrandForm",
props: {
isShowDelete: {
type: Boolean,
default: true
},
productTypeList: {
type: Array,
default: []
......
......@@ -110,6 +110,7 @@
<h3>包含商标列表</h3>
<brand-form
:is-show-delete="form.trademarkList.length > 1"
v-for="(item, index) in form.trademarkList"
v-model="form.trademarkList[index]"
:index="index"
......@@ -119,9 +120,9 @@
@delete="form.trademarkList.splice(index, 1)"></brand-form>
<el-button type="primary" @click="form.trademarkList.push({
brandName: '',
brandName: form.titleZh,
productBrandId: form.id,
trademarkCategoryRelList: []
trademarkCategoryRelList: [{productCategoryId:0, productId:0}]
})">添加商标</el-button>
<div slot="footer" style="text-align: center">
......@@ -287,6 +288,7 @@ export default {
if (!valid) {
return;
}
if (this.form.trademarkList?.length > 0){
// 修改的提交
if (this.form.id != null) {
updateProductBrank(this.form).then(response => {
......@@ -302,6 +304,10 @@ export default {
this.open = false;
this.getList();
});
} else {
this.$modal.alert('请至少添加一个商标')
}
});
},
/** 删除按钮操作 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment