Commit bf02f42a authored by xiejb's avatar xiejb

客户数据去重

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