Commit 84efefe2 by 王志慧

fixed

1 parent 20c09605
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
</div> </div>
<span class="notify" @click="btnInnerClick" v-if="allTagsList.length == 0">无可选标签值,可点击此处</span> <span class="notify" @click="btnInnerClick" v-if="allTagsList.length == 0">无可选标签值,可点击此处</span>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button plain size="small" class="btn-three" @click="tagsVisible=false">取 消</el-button> <el-button plain size="small" class="btn-three" @click="tagsVisible = false">取 消</el-button>
<el-button type="primary" size="small" @click="handleConfirm">确 定</el-button> <el-button type="primary" size="small" @click="handleConfirm">确 定</el-button>
</span> </span>
<GLDialog class="role" append-to-body :title="tagDialogTitle" :visible.sync="tagVisible"> <GLDialog class="role" append-to-body :title="tagDialogTitle" :visible.sync="tagVisible">
...@@ -340,10 +340,6 @@ export default { ...@@ -340,10 +340,6 @@ export default {
{ {
labelType: '', labelType: '',
children: [] children: []
},
{
labelType: '',
children: []
} }
] ]
res.data.labelTreeRets && res.data.labelTreeRets &&
...@@ -359,13 +355,14 @@ export default { ...@@ -359,13 +355,14 @@ export default {
}) })
}) })
if (labels.labelType == '自店标签') { if (labels.labelType == '自店标签') {
allTagsList[1].labelType = '自店标签' allTagsList[0].labelType = '自店标签'
allTagsList[1].children.push(labels) allTagsList[0].children.push(labels)
} }
}) })
console.log(allTagsList, 'allTagsList')
this.allTagsList = allTagsList this.allTagsList = allTagsList
// //
} else if(res.code != 0){ } else if (res.code != 0) {
this.$message.error(res.message) this.$message.error(res.message)
} }
this.handleClose() this.handleClose()
...@@ -382,6 +379,11 @@ export default { ...@@ -382,6 +379,11 @@ export default {
return list.slice(0, 9) return list.slice(0, 9)
}, },
handleConfirm() { handleConfirm() {
//判断如果没有标签,点击确定按钮,关闭弹窗
if (this.allTagsList.length == 0) {
this.tagsVisible = false
return
}
this.sloading = true this.sloading = true
let labelIdAddList = [] // 新增的标签 let labelIdAddList = [] // 新增的标签
this.allTagsList.forEach(labels => { this.allTagsList.forEach(labels => {
...@@ -393,6 +395,10 @@ export default { ...@@ -393,6 +395,10 @@ export default {
}) })
}) })
}) })
if (labelIdAddList.length == 0) {
this.$message.error('请至少选择一个自店标签')
return
}
let param = { let param = {
id: this.id, id: this.id,
tagIds: labelIdAddList tagIds: labelIdAddList
...@@ -419,8 +425,7 @@ export default { ...@@ -419,8 +425,7 @@ export default {
}) })
}, },
handleClose() { handleClose() {
this.tagsVisible =true this.tagsVisible = true
this.allTagsList = []
}, },
isHasSome(array) { isHasSome(array) {
var temp = [] //一个新的临时数组 var temp = [] //一个新的临时数组
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!