Commit 5f3d62d9 authored by xiejb's avatar xiejb

高级搜索 获取货主 全选逻辑

parent 717e2232
......@@ -18,7 +18,7 @@
</van-search>
<div class="search">
<search-result :result-num="searchNum"></search-result>
<van-checkbox class="" @click="allItemClick()" v-model="allChecked">全选</van-checkbox>
<van-checkbox class="" @click="allItemClick()" v-model="isAllChecked">全选</van-checkbox>
</div>
<div class="w100 listHeight" ref="scrollRef">
<van-pull-refresh
......@@ -86,12 +86,19 @@ export default {
checked: '',
checkedList: [],
choosedPost: [],
allChecked: false
isAllChecked: false
}
},
computed: {
linkInfo () {
return this.$store.state.linkInfo
},
allChecked () {
if (this.choosedPost.length === this.postDataList.length) {
this.isAllChecked = true
} else {
this.isAllChecked = false
}
}
},
props: {
......@@ -142,7 +149,7 @@ export default {
const companyList = []
this.checkedList = []
this.choosedPost = []
if (this.allChecked) {
if (this.isAllChecked) {
this.postDataList.forEach(item => {
// console.log(item)
const model = item
......@@ -199,7 +206,12 @@ export default {
} else {
this.checkedList.push(item.id)
this.choosedPost.push(item)
}
}
if (this.choosedPost.length === this.postDataList.length) {
this.isAllChecked = true
} else {
this.isAllChecked = false
}
},
onRefresh() {
// 刷新接口
......@@ -217,14 +229,14 @@ export default {
let _this = this
let data = {
'attr': {
'empid': this.linkInfo.userId
'empid': _this.linkInfo.userId
},
'filters': [
{
key: 'companyname',
opt: 'LIKE',
type: 'S',
value: this.keywords
value: _this.keywords
}
],
'logic': 'or',
......
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