Commit a779c304 authored by xiejb's avatar xiejb

供应商 去重

parent 36bd4cbc
...@@ -284,7 +284,7 @@ export default { ...@@ -284,7 +284,7 @@ export default {
_this.finished = true _this.finished = true
// } else { // } else {
// 加载成功后下一页自增1 // 加载成功后下一页自增1
_this.currentPage++ // _this.currentPage++
// } // }
} else { } else {
_this.$toast(rt.message) _this.$toast(rt.message)
......
...@@ -71,6 +71,7 @@ export default { ...@@ -71,6 +71,7 @@ export default {
pageSize: 10, pageSize: 10,
postDataList: [], postDataList: [],
postDataIdList: [], postDataIdList: [],
companyIdList: [],
checked: '', checked: '',
checkedList: [], checkedList: [],
choosedPost: [] choosedPost: []
...@@ -102,6 +103,7 @@ export default { ...@@ -102,6 +103,7 @@ export default {
if (val) { if (val) {
this.postDataList = [] this.postDataList = []
this.postDataIdList = [] this.postDataIdList = []
this.companyIdList = []
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
...@@ -187,6 +189,7 @@ export default { ...@@ -187,6 +189,7 @@ export default {
getPostData() { getPostData() {
let _this = this let _this = this
const companyList = [] const companyList = []
_this.companyIdList = []
_this.consignor.forEach(item => { _this.consignor.forEach(item => {
const removeItem = { const removeItem = {
'length': this.pageSize, 'length': this.pageSize,
...@@ -265,15 +268,30 @@ export default { ...@@ -265,15 +268,30 @@ export default {
// 数据去重 // 数据去重
deleteRepeatAction (httpArray) { deleteRepeatAction (httpArray) {
const array = [] const array = []
const companyId = []
httpArray.forEach(item => {
if (companyId.indexOf(item.companynameId) > -1) {
} else {
companyId.push(item.companynameId)
this.companyIdList.push({
companynameId: item.companynameId,
supplierArray: []
})
}
})
httpArray.forEach(item => { httpArray.forEach(item => {
const removeItem = item const removeItem = item
if(this.postDataIdList.indexOf(item.org) > -1) { this.companyIdList.forEach(model => {
if (model.companynameId === item.companynameId) {
if (model.supplierArray.indexOf(item.org) > -1) {
} else { } else {
this.postDataIdList.push(item.org) model.supplierArray.push(item.org)
array.push(item) array.push(item)
} }
}
})
}) })
console.log(this.companyIdList)
return array return array
}, },
/// 判断数值是否为空 /// 判断数值是否为空
......
...@@ -306,7 +306,7 @@ export default { ...@@ -306,7 +306,7 @@ export default {
const vaueArray = [] const vaueArray = []
array.forEach(item => { array.forEach(item => {
if (item.companynameId === companynameId) { if (item.companynameId === companynameId) {
if (item.org === '5081' || item.org === '5082') { if (item.org === '205' || item.org === '307') {
vaueArray.push('508') vaueArray.push('508')
} else { } else {
vaueArray.push(item.org) vaueArray.push(item.org)
......
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