Commit 5f3d62d9 authored by xiejb's avatar xiejb

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

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