Commit 18b9039f authored by xiejb's avatar xiejb

高级搜索 供应商数据去重

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