Commit 18b9039f authored by xiejb's avatar xiejb

高级搜索 供应商数据去重

parent 8230a1a8
......@@ -70,6 +70,7 @@ export default {
currentPage: 1,
pageSize: 10,
postDataList: [],
postDataIdList: [],
checked: '',
checkedList: [],
choosedPost: []
......@@ -100,6 +101,7 @@ export default {
this.postShow = val
if (val) {
this.postDataList = []
this.postDataIdList = []
this.checkedList = []
this.choosedPost = JSON.parse(JSON.stringify(this.customer))
// this.checked = !this.customer.comPartyId ? '' : this.customer.comPartyId
......@@ -221,15 +223,16 @@ export default {
getEmployeeOrgQueryList(data).then(rt => {
if (rt.code === 200) {
if (_this.currentPage === 1) {
_this.searchNum = rt.data.length + ''
this.postDataList = []
_this.postDataList = []
_this.postDataIdList = []
}
if (this.isRefreshing) {
this.postDataList = rt.data
if (_this.isRefreshing) {
_this.postDataList = _this.deleteRepeatAction(rt.data)
}
else if (!!rt.data || rt.data.length > 0) {
this.postDataList = this.postDataList.concat(rt.data)
_this.postDataList = _this.postDataList.concat(_this.deleteRepeatAction(rt.data))
}
_this.searchNum = _this.postDataList.length + ''
// _this.postDataListSetAction(rt.data)
// 重置刷新提示
_this.isRefreshing = false
......@@ -259,6 +262,20 @@ export default {
_this.finished = true
})
},
// 数据去重
deleteRepeatAction (httpArray) {
const array = []
httpArray.forEach(item => {
const removeItem = item
if(this.postDataIdList.indexOf(item.org) > -1) {
} else {
this.postDataIdList.push(item.org)
array.push(item)
}
})
return array
},
/// 判断数值是否为空
isJudgeStrNull(val) {
if (val !== null && val !== undefined && val !== '') {
......
......@@ -596,7 +596,6 @@ export default {
font-size: 14PX;
/deep/ .van-cell{
padding: 5px 0px;
}
/deep/ .van-cell::after{
position: fixed;
......@@ -611,7 +610,7 @@ export default {
color: #1989fa;
}
.title {
margin: auto
margin: 5px auto;
}
.inputInfo {
color: #666666;
......
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