|
@@ -3,6 +3,7 @@
|
|
|
<AbstractEnt
|
|
|
class="abstract-ent-item"
|
|
|
v-for="(ent, index) in entDetailList"
|
|
|
+ v-show="ent.totalNum > 0"
|
|
|
:entType="ent.type"
|
|
|
:title="ent.name"
|
|
|
:key="index"
|
|
@@ -39,28 +40,48 @@ export default {
|
|
|
}),
|
|
|
entList() {
|
|
|
const { winners, buyers } = this.summary
|
|
|
- return buyers.concat(winners)
|
|
|
+ let winners3 = []
|
|
|
+ if (Array.isArray(winners) && winners.length > 3) {
|
|
|
+ winners3 = winners.slice(0, 3)
|
|
|
+ } else {
|
|
|
+ winners3 = winners
|
|
|
+ }
|
|
|
+ return buyers.concat(winners3).filter((b) => b.link)
|
|
|
},
|
|
|
entDetailList() {
|
|
|
return this.entList.map((e) => {
|
|
|
const detail = this.req[e.id] || {}
|
|
|
return {
|
|
|
...e,
|
|
|
+ totalNum: this.calcTotalNum(detail),
|
|
|
detail
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
- entList(eList) {
|
|
|
- if (Array.isArray(eList) && eList.length > 0) {
|
|
|
- eList.forEach((ent) => {
|
|
|
- this.getEntInfo(ent.type, ent.id)
|
|
|
- })
|
|
|
+ entList: {
|
|
|
+ immediate: true,
|
|
|
+ handler(eList) {
|
|
|
+ if (Array.isArray(eList) && eList.length > 0) {
|
|
|
+ eList.forEach((ent) => {
|
|
|
+ this.getEntInfo(ent.type, ent.id)
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ calcTotalNum(item = {}) {
|
|
|
+ const amountCount = item.bidamountCount || 0
|
|
|
+ const biddingCount = item.biddingCount || 0
|
|
|
+ const contactCount = item.contactCount || 0
|
|
|
+ const cooperate = item.cooperate || 0
|
|
|
+ const projectCount = item.projectCount || 0
|
|
|
+ return (
|
|
|
+ amountCount + biddingCount + contactCount + cooperate + projectCount
|
|
|
+ )
|
|
|
+ },
|
|
|
async getEntInfo(type, id) {
|
|
|
const { data, error_code: code } = await ajaxGetMiniEntInfo(type, id)
|
|
|
if (code === 0 && data) {
|
|
@@ -87,7 +108,7 @@ export default {
|
|
|
}
|
|
|
openAppOrWxPage(LINKS.大会员超级订阅采购单位画像页面, {
|
|
|
query: {
|
|
|
- entName: item.value
|
|
|
+ entName: item.id
|
|
|
}
|
|
|
})
|
|
|
},
|