开门红添加合计字段

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 goodStart = ['/data/performance/getComPerformance']
let whiteList = [
'/customer/agent/getCustomersList',
...proposal,
@@ -106,7 +108,8 @@ let whiteList = [
...preserve,
...renewalManage,
...hgb,
...whitelist
...whitelist,
...goodStart
]
// 创建axios实例

View File

@@ -11,6 +11,13 @@
{{ column.name }}
</th>
</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">
<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>
@@ -56,7 +63,11 @@ export default {
{ name: '承保标保(万元)', key: 'bzbf' },
{ name: '承保件数(件)', key: 'cbjs' }
],
values: []
values: [],
totalYsbb: 0,
totalYsjs: 0,
totalBzbf: 0,
totalCbjs: 0
}
},
watch: {
@@ -90,15 +101,25 @@ export default {
}
}
}
this.calculateTotal()
},
calculate() {
let allPrice = this.values.reduce((prevVal, currVal) => {
return prevVal + Number(currVal.cbbb)
}, 0)
this.values.map(product => {
product.percent = ((product.cbbb / allPrice) * 100).toFixed(2)
return product
})
calculateTotal() {
this.totalYsbb = 0
this.totalYsjs = 0
this.totalBzbf = 0
this.totalCbjs = 0
for (let data of this.values) {
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: {

View File

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

View File

@@ -62,7 +62,7 @@
</div>
<div class="home-product-pcenter performance">
<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>
<th v-for="(thead, index) in theads" :class="{ 'sticky-col': index <= 1 }" :key="index">{{ thead }}</th>
</tr>
@@ -76,7 +76,7 @@
<td>{{ org.cbbfMon | blankFilter }}</td>
</tr>
<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>
<van-loading v-if="!isTableDataLoad" type="spinner" />
</td>
@@ -91,7 +91,7 @@
<td>{{ org.bzbf | blankFilter }}</td>
</tr>
<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>
<van-loading v-if="!isTableDataLoad" type="spinner" />
</td>
@@ -303,7 +303,7 @@ td.sticky-col:nth-of-type(1) {
th.sticky-col:nth-of-type(2),
td.sticky-col:nth-of-type(2) {
position: sticky;
left: 59px;
left: 53px;
}
.home-product-container {
@@ -358,7 +358,7 @@ td.sticky-col:nth-of-type(2) {
border-collapse: collapse;
td,
th {
padding: 10px 5px;
padding: 10px 2px;
background-color: #fff3f1;
color: #d84535;
font-size: 14px;