Commit a779c304 authored by xiejb's avatar xiejb

供应商 去重

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