|
|
@@ -14,6 +14,7 @@
|
|
|
<!-- <Button type="primary" class="margin-right20" @click="addAccount">添加新用户</Button>-->
|
|
|
<Table
|
|
|
border
|
|
|
+ show-summary
|
|
|
:columns="tableTitle"
|
|
|
:data="tableContent"
|
|
|
class="margin-bottom20 margin-top20"
|
|
|
@@ -359,7 +360,8 @@ import {
|
|
|
shareholderOpen,
|
|
|
updatePromotion,
|
|
|
accountInfo,
|
|
|
- updateAccountInfo, proxyTypeEnum, addAccountMethod, manualRecharge, manualWithdrawal
|
|
|
+ updateAccountInfo, proxyTypeEnum, addAccountMethod, manualRecharge, manualWithdrawal,
|
|
|
+ totalList
|
|
|
} from "@/api/account";
|
|
|
export default {
|
|
|
name: 'financialManagement',
|
|
|
@@ -397,6 +399,16 @@ export default {
|
|
|
certificateImages:[],
|
|
|
certificate:'',
|
|
|
currentRow:{},
|
|
|
+ totalLists:{
|
|
|
+ totalIncome:0,
|
|
|
+ totalOutIncome:0,
|
|
|
+ totalConsumption:0,
|
|
|
+ totalIntegralIncome:0,
|
|
|
+ totalBalance:0,
|
|
|
+ totalProfit:0,
|
|
|
+ totalGratitudeIncome:0,
|
|
|
+ generalProxyIncome:0,
|
|
|
+ },
|
|
|
account:'',
|
|
|
financeTitle:'人工充值',
|
|
|
idNumber:'',
|
|
|
@@ -447,14 +459,19 @@ export default {
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
- title: '总提现及转出',
|
|
|
- key: 'totalOutIncome',
|
|
|
+ title: '代理总收入',
|
|
|
+ key: 'incomeTotal',
|
|
|
+ align: 'center',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '总代理抽成',
|
|
|
+ key: 'generalProxyAccount',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
- title: '代理总收入',
|
|
|
- key: 'proxyInterest',
|
|
|
- align: 'center',
|
|
|
+ title: '总提现及转出',
|
|
|
+ key: 'totalOutIncome',
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
title: '总消费',
|
|
|
@@ -531,9 +548,23 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
|
+ this.getTotalList(),
|
|
|
this.getTableData()
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 获取总计金额
|
|
|
+ getTotalList(){
|
|
|
+ let params = {
|
|
|
+ data:{
|
|
|
+ id:0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ totalList(params).then(res => {
|
|
|
+ if (res.rspCode === 0) {
|
|
|
+ this.totalLists = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 获取表格数据
|
|
|
getTableData () {
|
|
|
this.loading = false
|
|
|
@@ -550,6 +581,19 @@ export default {
|
|
|
if (res.rspCode === 0) {
|
|
|
this.tableContent = res.data
|
|
|
this.total = res.total
|
|
|
+ this.tableContent.forEach(item => {
|
|
|
+ this.$set(item, 'incomeTotal', (item.gratitudeInterest + item.proxyInterest).toFixed(2))
|
|
|
+ })
|
|
|
+ this.tableContent.push({
|
|
|
+ id: '总计',
|
|
|
+ totalIncome: this.totalLists.totalIncome,
|
|
|
+ agileAmount: this.totalLists.totalBalance,
|
|
|
+ agileInterest: this.totalLists.totalIntegralIncome,
|
|
|
+ generalProxyAccount: this.totalLists.generalProxyIncome,
|
|
|
+ totalOutIncome: this.totalLists.totalOutIncome,
|
|
|
+ consumerInterest: this.totalLists.totalConsumption,
|
|
|
+ incomeTotal: (Number(this.totalLists.totalProfit) + Number(this.totalLists.totalGratitudeIncome)).toFixed(2)
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
@@ -644,6 +688,42 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ //总计表格展示
|
|
|
+ handleSummary ({ columns, data }) {
|
|
|
+ const sums = {};
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ const key = column.key;
|
|
|
+ if (index === 0) {
|
|
|
+ sums[key] = {
|
|
|
+ key,
|
|
|
+ value: '总价'
|
|
|
+ };
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // const values = data.map(item => Number(item[key]));
|
|
|
+ // if (!values.every(value => isNaN(value))) {
|
|
|
+ // const v = values.reduce((prev, curr) => {
|
|
|
+ // const value = Number(curr);
|
|
|
+ // if (!isNaN(value)) {
|
|
|
+ // return prev + curr;
|
|
|
+ // } else {
|
|
|
+ // return prev;
|
|
|
+ // }
|
|
|
+ // }, 0);
|
|
|
+ // sums[key] = {
|
|
|
+ // key,
|
|
|
+ // value: v + ' 元'
|
|
|
+ // };
|
|
|
+ // } else {
|
|
|
+ // sums[key] = {
|
|
|
+ // key,
|
|
|
+ // value: 'N/A'
|
|
|
+ // };
|
|
|
+ // }
|
|
|
+ });
|
|
|
+
|
|
|
+ return sums;
|
|
|
+ },
|
|
|
addAccountSubmit(){
|
|
|
let params = {
|
|
|
data:{
|