开门红添加合计字段

This commit is contained in:
mengxiaolong
2021-01-27 14:02:10 +08:00
parent 2622a47604
commit 71be9d86e7
4 changed files with 43 additions and 15 deletions

View File

@@ -94,6 +94,8 @@ let hgb = ['/sale/order/selectHgb', '/sale/order/getHgbDetail']
let whitelist = ['/agent/white/getWhiteInfo'] let whitelist = ['/agent/white/getWhiteInfo']
let goodStart = ['/data/performance/getComPerformance']
let whiteList = [ let whiteList = [
'/customer/agent/getCustomersList', '/customer/agent/getCustomersList',
...proposal, ...proposal,
@@ -106,7 +108,8 @@ let whiteList = [
...preserve, ...preserve,
...renewalManage, ...renewalManage,
...hgb, ...hgb,
...whitelist ...whitelist,
...goodStart
] ]
// 创建axios实例 // 创建axios实例

View File

@@ -11,6 +11,13 @@
{{ column.name }} {{ column.name }}
</th> </th>
</tr> </tr>
<tr v-show="values.length !== 0">
<td class="sticky bleft bright" colspan="2">合计</td>
<td class="bright">{{ totalYsbb }}</td>
<td class="bright">{{ totalYsjs }}</td>
<td class="bright">{{ totalBzbf }}</td>
<td class="bright">{{ totalCbjs }}</td>
</tr>
<tr v-for="(value, index) in values" :key="index"> <tr v-for="(value, index) in values" :key="index">
<td class="sticky bleft bright">{{ index + 1 }}</td> <td class="sticky bleft bright">{{ index + 1 }}</td>
<td v-for="(key, i) in needGettingKey" :key="i" class="bright" :class="{ orgName: i === 0 }">{{ value[key] | blankFilter }}</td> <td v-for="(key, i) in needGettingKey" :key="i" class="bright" :class="{ orgName: i === 0 }">{{ value[key] | blankFilter }}</td>
@@ -56,7 +63,11 @@ export default {
{ name: '承保标保(万元)', key: 'bzbf' }, { name: '承保标保(万元)', key: 'bzbf' },
{ name: '承保件数(件)', key: 'cbjs' } { name: '承保件数(件)', key: 'cbjs' }
], ],
values: [] values: [],
totalYsbb: 0,
totalYsjs: 0,
totalBzbf: 0,
totalCbjs: 0
} }
}, },
watch: { watch: {
@@ -90,15 +101,25 @@ export default {
} }
} }
} }
this.calculateTotal()
}, },
calculate() { calculateTotal() {
let allPrice = this.values.reduce((prevVal, currVal) => { this.totalYsbb = 0
return prevVal + Number(currVal.cbbb) this.totalYsjs = 0
}, 0) this.totalBzbf = 0
this.values.map(product => { this.totalCbjs = 0
product.percent = ((product.cbbb / allPrice) * 100).toFixed(2) for (let data of this.values) {
return product let ysbb = isNaN(parseFloat(data.ysbb)) ? 0 : parseFloat(data.ysbb)
}) let ysjs = isNaN(parseInt(data.ysjs)) ? 0 : parseInt(data.ysjs)
let bzbf = isNaN(parseFloat(data.bzbf)) ? 0 : parseFloat(data.bzbf)
let cbjs = isNaN(parseInt(data.cbjs)) ? 0 : parseInt(data.cbjs)
this.totalYsbb += ysbb
this.totalYsjs += ysjs
this.totalBzbf += bzbf
this.totalCbjs += cbjs
}
this.totalYsbb = this.totalYsbb.toFixed(2)
this.totalBzbf = this.totalBzbf.toFixed(2)
} }
}, },
filters: { filters: {

View File

@@ -480,4 +480,8 @@ span {
::v-deep .van-button { ::v-deep .van-button {
padding: 0 10px; padding: 0 10px;
} }
*::-webkit-scrollbar {
display: none;
}
</style> </style>

View File

@@ -62,7 +62,7 @@
</div> </div>
<div class="home-product-pcenter performance"> <div class="home-product-pcenter performance">
<div class="pcenter-list"> <div class="pcenter-list">
<table class="myTable" style="min-width: 160vw;" cellspacing="0" cellpadding="0"> <table class="myTable" style="width: 145vw;" cellspacing="0" cellpadding="0">
<tr> <tr>
<th v-for="(thead, index) in theads" :class="{ 'sticky-col': index <= 1 }" :key="index">{{ thead }}</th> <th v-for="(thead, index) in theads" :class="{ 'sticky-col': index <= 1 }" :key="index">{{ thead }}</th>
</tr> </tr>
@@ -76,7 +76,7 @@
<td>{{ org.cbbfMon | blankFilter }}</td> <td>{{ org.cbbfMon | blankFilter }}</td>
</tr> </tr>
<tr v-if="organizationData.length === 0"> <tr v-if="organizationData.length === 0">
<td :colspan="theads.length" style="text-align: left; padding-left: 25%;"> <td :colspan="theads.length" style="text-align: left; padding-left: 28%;">
<span v-if="isTableDataLoad">暂无数据</span> <span v-if="isTableDataLoad">暂无数据</span>
<van-loading v-if="!isTableDataLoad" type="spinner" /> <van-loading v-if="!isTableDataLoad" type="spinner" />
</td> </td>
@@ -91,7 +91,7 @@
<td>{{ org.bzbf | blankFilter }}</td> <td>{{ org.bzbf | blankFilter }}</td>
</tr> </tr>
<tr v-if="performanceData.length === 0"> <tr v-if="performanceData.length === 0">
<td :colspan="theads.length" style="text-align: left; padding-left: 25%;"> <td :colspan="theads.length" style="text-align: left; padding-left: 28%;">
<span v-if="isTableDataLoad">暂无数据</span> <span v-if="isTableDataLoad">暂无数据</span>
<van-loading v-if="!isTableDataLoad" type="spinner" /> <van-loading v-if="!isTableDataLoad" type="spinner" />
</td> </td>
@@ -303,7 +303,7 @@ td.sticky-col:nth-of-type(1) {
th.sticky-col:nth-of-type(2), th.sticky-col:nth-of-type(2),
td.sticky-col:nth-of-type(2) { td.sticky-col:nth-of-type(2) {
position: sticky; position: sticky;
left: 59px; left: 53px;
} }
.home-product-container { .home-product-container {
@@ -358,7 +358,7 @@ td.sticky-col:nth-of-type(2) {
border-collapse: collapse; border-collapse: collapse;
td, td,
th { th {
padding: 10px 5px; padding: 10px 2px;
background-color: #fff3f1; background-color: #fff3f1;
color: #d84535; color: #d84535;
font-size: 14px; font-size: 14px;