Commit bf02f42a authored by xiejb's avatar xiejb

客户数据去重

parent eba3492c
......@@ -16,7 +16,7 @@
<i slot="left-icon" class="fa fa-search"></i>
<div slot="action" class="font14" @click="onSearch">搜索</div>
</van-search>
<search-result :result-num="searchNum"></search-result>
<!-- <search-result :result-num="searchNum"></search-result> -->
<div class="w100 listHeight" ref="scrollRef">
<van-pull-refresh
v-model="isRefreshing"
......@@ -70,6 +70,7 @@ export default {
currentPage: 1,
pageSize: 10,
postDataList: [],
postClientIdList: [],
checked: '',
checkedList: [],
choosedPost: []
......@@ -114,6 +115,7 @@ export default {
this.postShow = val
if (val) {
this.postDataList = []
this.postClientIdList = []
this.checkedList = []
this.searchNum = '0'
this.choosedPost = JSON.parse(JSON.stringify(this.customer))
......@@ -230,12 +232,16 @@ export default {
if (_this.currentPage === 1) {
_this.searchNum = getResListNum(rt.msg)
this.postDataList = []
this.postClientIdList = []
}
if (this.isRefreshing) {
this.postDataList = rt.data
this.postClientIdList = []
this.postDataList = this.deleteRepeatAction(rt.data)
// this.postDataList = rt.data
}
else if (!!rt.data || rt.data.length > 0) {
this.postDataList = this.postDataList.concat(rt.data)
// this.postDataList = this.postDataList.concat(rt.data)
this.postDataList = this.postDataList.concat(this.deleteRepeatAction(rt.data))
}
// _this.postDataListSetAction(rt.data)
// 重置刷新提示
......@@ -277,6 +283,19 @@ export default {
})
return supplierList
},
// 客户去重postClientIdList
deleteRepeatAction (httpArray) {
const clientIdArray = []
httpArray.forEach(item => {
const removeItem = item
if (this.postClientIdList.indexOf(item.comPartyId) > -1) {
} else {
this.postClientIdList.push(item.comPartyId)
clientIdArray.push(item)
}
})
return clientIdArray
},
/// 判断数值是否为空
isJudgeStrNull(val) {
if (val !== null && val !== undefined && val !== '') {
......
......@@ -291,7 +291,7 @@ export default {
}
})
})
console.log(this.companyIdList)
// console.log(this.companyIdList)
return array
},
/// 判断数值是否为空
......
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