|
|
|
@ -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() { |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|