Commit ee16db82 by 王志慧

commit

1 parent ccc32fa4
...@@ -150,6 +150,8 @@ export default { ...@@ -150,6 +150,8 @@ export default {
this.customerList.forEach(item => { this.customerList.forEach(item => {
item.isChecked = this.allChecked item.isChecked = this.allChecked
}) })
this.allChecked ? (this.checkList = this.customerList) : (this.checkList = [])
}, },
searchkeyWord(e) { searchkeyWord(e) {
this.keyWord = e this.keyWord = e
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
<van-popup v-model="tagShow" position="bottom" :style="{ height: '90%' }"> <van-popup v-model="tagShow" position="bottom" :style="{ height: '90%' }">
<div class="container-pop"> <div class="container-pop">
<search placeholder="请输入关键字" :keyword="keyWord" @search="searchkeyWord"></search> <search placeholder="请输入关键字" :keyword="keyWord" @search="searchkeyWord"></search>
<div class="content" ref="scrollView"> <div class="contentWrap">
<van-list :finished="finished" finished-text="" offset="100" :immediate-check="false">
<div class="close-container" v-if="checkAll.length > 0"> <div class="close-container" v-if="checkAll.length > 0">
<div class="nav-icon"> <div class="nav-icon">
<img src="../../assets/images/icon/nav-icon.png" /> <img src="../../assets/images/icon/nav-icon.png" />
...@@ -27,6 +28,7 @@ ...@@ -27,6 +28,7 @@
</template> </template>
<empty v-else description="没有找到你搜索的内容" /> <empty v-else description="没有找到你搜索的内容" />
</div> </div>
</van-list>
</div> </div>
<div class="pop-footer"> <div class="pop-footer">
<div class="reset" @click="reset">重置</div> <div class="reset" @click="reset">重置</div>
...@@ -42,6 +44,8 @@ export default { ...@@ -42,6 +44,8 @@ export default {
name: 'make', name: 'make',
data() { data() {
return { return {
loading: false,
finished: false,
keyWord: '', keyWord: '',
tagList: [], tagList: [],
checkAll: [], checkAll: [],
...@@ -75,7 +79,7 @@ export default { ...@@ -75,7 +79,7 @@ export default {
}, },
add(index, ids) { add(index, ids) {
if (this.tagList[index].taggingList[ids].isChecked) { if (this.tagList[index].taggingList[ids].isChecked) {
this.checkAll.push(this.tagList[index].taggingList[ids]) this.checkAll.push({ ...this.tagList[index].taggingList[ids] })
} else { } else {
this.checkAll.splice(index, 1) this.checkAll.splice(index, 1)
} }
...@@ -99,8 +103,7 @@ export default { ...@@ -99,8 +103,7 @@ export default {
keyWord: this.keyWord keyWord: this.keyWord
} }
groupTag.gettagList(obj).then(res => { groupTag.gettagList(obj).then(res => {
console.log(res) if (res.data && res.data.length > 0) {
if (res.data&&res.data.length > 0) {
this.tagList = res.data this.tagList = res.data
if (this.tagList.length > 0) { if (this.tagList.length > 0) {
for (let i = 0; i < this.tagList.length; i++) { for (let i = 0; i < this.tagList.length; i++) {
...@@ -110,16 +113,31 @@ export default { ...@@ -110,16 +113,31 @@ export default {
} }
} }
} }
if (this.checkAll.length > 0 && this.tagList.length > 0) {
this.saveTag()
}
} else { } else {
this.tagList = [] this.tagList = []
} }
console.log( this.tagList)
}) })
}, },
searchkeyWord(e) { searchkeyWord(e) {
this.keyWord = e this.keyWord = e
this.init() this.init()
}, },
//搜素之后保留选中标签
saveTag() {
for (let i = 0; i < this.tagList.length; i++) {
for (let j = 0; j < this.tagList[i].taggingList.length; j++) {
this.checkAll.forEach(item => {
if (item.taggingId == this.tagList[i].taggingList[j].taggingId) {
this.tagList[i].checked = true
this.tagList[i].taggingList[j].isChecked = true
}
})
}
}
},
clearData() { clearData() {
if (this.tagList.length > 0) { if (this.tagList.length > 0) {
for (let i = 0; i < this.tagList.length; i++) { for (let i = 0; i < this.tagList.length; i++) {
...@@ -134,7 +152,6 @@ export default { ...@@ -134,7 +152,6 @@ export default {
}, },
//打标签 //打标签
handleTag() { handleTag() {
console.log(this.externalUserIds)
let taggingInfo = [] let taggingInfo = []
for (let i = 0; i < this.tagList.length; i++) { for (let i = 0; i < this.tagList.length; i++) {
if (this.tagList[i].checked) { if (this.tagList[i].checked) {
...@@ -179,7 +196,7 @@ export default { ...@@ -179,7 +196,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.container-pop { .container-pop {
width: 100%; width: 100%;
.content{ .contentWrap {
height: calc(90vh - 120px); height: calc(90vh - 120px);
overflow-y: scroll; overflow-y: scroll;
} }
...@@ -224,7 +241,7 @@ export default { ...@@ -224,7 +241,7 @@ export default {
justify-content: space-between; justify-content: space-between;
padding: 0 16px; padding: 0 16px;
position: fixed; position: fixed;
bottom: 35px; bottom: 20px;
box-sizing: border-box; box-sizing: border-box;
.reset { .reset {
font-size: 16px; font-size: 16px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!