更新
This commit is contained in:
@@ -226,7 +226,7 @@
|
||||
if (res.code == 20000) {
|
||||
if (res.data.length > 0) {
|
||||
|
||||
let staging = res.data.filter(item => !this.hideCard.includes(item
|
||||
let staging = res.data.filter(item => item.companyType != 5).filter(item => !this.hideCard.includes(item
|
||||
.companyId))
|
||||
staging.forEach(item => {
|
||||
this.$set(item, 'currentPage', 1)
|
||||
|
||||
@@ -312,13 +312,15 @@
|
||||
computed: {
|
||||
companyList() {
|
||||
if (this.isCompany) {
|
||||
return this.order.companyAccounts
|
||||
let filterData = this.order.companyAccounts.filter(item => item.companyType != 5)
|
||||
return filterData
|
||||
}
|
||||
},
|
||||
companyOtherList() {
|
||||
if (this.isCompany) {
|
||||
// return this.order.otherAccounts
|
||||
let target = this.sortParticulars(this.order.otherAccounts,'balance')
|
||||
let filterData = this.order.otherAccounts.filter(item => item.companyType != 5)
|
||||
let target = this.sortParticulars(filterData,'balance')
|
||||
return target
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
</view>
|
||||
|
||||
<view class="text-right flex-sub oil-main-color">
|
||||
<text v-if="activeCard.shareCompanyQuota==1">
|
||||
<text v-if="activeCard && activeCard.shareCompanyQuota==1">
|
||||
共享余额
|
||||
</text>
|
||||
<text v-else>
|
||||
@@ -235,13 +235,12 @@
|
||||
},
|
||||
cards() {
|
||||
if (this.cardList.length) {
|
||||
let cards = []
|
||||
// console.log(this.cardList,'---------------------')
|
||||
this.cardList.forEach((e) => {
|
||||
// cards.push(e.accountCardCode)
|
||||
let staging = this.cardList.filter(item => item.companyType != 5)
|
||||
let target = this.sortHandler(staging)
|
||||
target.forEach((e) => {
|
||||
e.companyName = e.companyName + '('+( e.companyType==0?`柴油账户:${e.balance}元`:e.companyType==1?`汽油账户:${e.balance}元`:e.companyType==2?`LNG账户:${e.balance}元`:`尿素:${e.balance}元`) + ')'
|
||||
})
|
||||
return this.cardList
|
||||
return target
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -267,6 +266,40 @@
|
||||
this.getSiteInfo(option.siteId)
|
||||
},
|
||||
methods: {
|
||||
sortHandler(arr) {
|
||||
let internalArr = arr.filter(item => item.oilCardType == 2)
|
||||
let externalArr = arr.filter(item => item.oilCardType == 3)
|
||||
// let internalTarget = this.sortParticulars(internalArr, 'shareCompanyQuota')
|
||||
let externalTarget = this.sortParticulars(externalArr, 'balance')
|
||||
if (internalArr.length || externalTarget.length) return [...internalArr, ...externalTarget]
|
||||
else return arr
|
||||
},
|
||||
sortParticulars(arr, field) {
|
||||
let target = []
|
||||
let map = new Map()
|
||||
let keys = [],
|
||||
values = []
|
||||
arr.forEach(item => {
|
||||
map.set(item, item[field])
|
||||
})
|
||||
for (let key of map.keys()) {
|
||||
keys.push(key)
|
||||
}
|
||||
for (let value of map.values()) {
|
||||
values.push(value)
|
||||
}
|
||||
values.sort()
|
||||
values.reverse()
|
||||
values.forEach(value => {
|
||||
keys.forEach(key => {
|
||||
if (map.get(key) == value) {
|
||||
target.push(key)
|
||||
map.set(key, new Date().getTime())
|
||||
}
|
||||
})
|
||||
})
|
||||
return target
|
||||
},
|
||||
qrR() {
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user