图表更新
This commit is contained in:
parent
33cb4c8623
commit
d4e5d9be06
|
@ -45,4 +45,13 @@ export function getServiceIncome(params) {
|
|||
})
|
||||
}
|
||||
|
||||
// 根据月份获取分成金额
|
||||
export function getBonusMonthAmount(params) {
|
||||
return request({
|
||||
url: '/system/dashboard/bonusMonthAmount',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ export default {
|
|||
series: [{
|
||||
name: '充值(元)',
|
||||
type: 'line',
|
||||
data: this.getHourData(this.billData, 'recharge'),
|
||||
data: this.getHourData(this.billData, 'rechargeAmount'),
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#246EFF',
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-row type="flex">
|
||||
<el-tabs v-model="queryParams.groupBy" style="width: 100%">
|
||||
<el-tab-pane label="月报表" name="create_month">
|
||||
<range-picker v-model="queryParams.year" @change="onChangeYear" suffix="年"/>
|
||||
<el-tabs style="width: 100%">
|
||||
<el-tab-pane label="月报表">
|
||||
<range-picker v-model="queryParams.payTimeYear" @change="onChangeYear" suffix="年"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-row>
|
||||
|
@ -15,6 +15,8 @@
|
|||
import SingleLineChart from "@/components/SingleLineChart/index.vue";
|
||||
import RangePicker from "@/components/RangePicker/index.vue";
|
||||
import {countBill, listBill} from "@/api/system/recharge";
|
||||
import {BonusArrivalType} from "@/utils/constants";
|
||||
import {getBonusMonthAmount} from "@/api/system/dashboard";
|
||||
|
||||
export default {
|
||||
name: 'userRechargeReport',
|
||||
|
@ -31,11 +33,9 @@ export default {
|
|||
labels: ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'], // x轴
|
||||
chartData: [], // 报表数据
|
||||
queryParams: {
|
||||
type: 1,
|
||||
year: new Date().getFullYear(),
|
||||
status: "2",
|
||||
groupBy: "create_month",
|
||||
mchId: this.mchId,
|
||||
payTimeYear: new Date().getFullYear(),
|
||||
arrivalId: this.mchId,
|
||||
arrivalTypes: BonusArrivalType.userList()
|
||||
},
|
||||
loading: false,
|
||||
}
|
||||
|
@ -48,21 +48,21 @@ export default {
|
|||
methods: {
|
||||
// 当年份发生变化
|
||||
onChangeYear(year) {
|
||||
this.queryParams.year = year;
|
||||
this.queryParams.payTimeYear = year;
|
||||
this.getReportData(this.mchId);
|
||||
},
|
||||
// 获取到账人的报表
|
||||
getReportData(mchId) {
|
||||
this.loading = true;
|
||||
this.queryParams.mchId = mchId | this.mchId;
|
||||
countBill(this.queryParams).then(response => {
|
||||
this.queryParams.arrivalId = mchId | this.mchId;
|
||||
getBonusMonthAmount(this.queryParams).then(response => {
|
||||
let data = response.data;
|
||||
// 按月统计数据
|
||||
let list = [];
|
||||
if (data != null) {
|
||||
for (let i = 1; i <= this.getReportMonth(); i ++) {
|
||||
let monthData = data.find(item => item.createMonth === i);
|
||||
list[i - 1] = monthData == null ? 0 : monthData.recharge;
|
||||
let monthData = data.find(item => item.month === i);
|
||||
list[i - 1] = monthData == null ? 0 : monthData.amount;
|
||||
}
|
||||
}
|
||||
this.chartData = list;
|
||||
|
@ -74,7 +74,7 @@ export default {
|
|||
getReportMonth() {
|
||||
let now = new Date();
|
||||
let nowYear = new Date().getFullYear()
|
||||
let paramYear = this.queryParams.year;
|
||||
let paramYear = this.queryParams.payTimeYear;
|
||||
if (paramYear < nowYear) {
|
||||
return 12;
|
||||
}
|
||||
|
|
|
@ -114,8 +114,8 @@
|
|||
<template v-else-if="column.key === 'storeCount'">
|
||||
{{d.row.storeCount | defaultValue}} 家
|
||||
</template>
|
||||
<template v-else-if="column.key === 'rechargeAmount'">
|
||||
{{d.row.rechargeAmount | money}} 元
|
||||
<template v-else-if="column.key === 'totalIncome'">
|
||||
{{d.row.totalIncome | money}} 元
|
||||
</template>
|
||||
<template v-else-if="column.key === 'withDrawlAmount'">
|
||||
{{d.row.withDrawlAmount | money}} 元
|
||||
|
@ -328,8 +328,8 @@ export default {
|
|||
{key: 'remark', visible: true, label: '备注', align: 'center', minWidth: null, sortable: false, overflow: true, width: null},
|
||||
{key: 'status', visible: true, label: '状态', align: 'center', minWidth: null, sortable: true, width: null},
|
||||
{key: 'createTime', visible: true, label: '注册时间', align: 'center', minWidth: "120", sortable: true, width: "100"},
|
||||
{key: 'rechargeAmount', visible: true, label: '充值金额', align: 'center', minWidth: null, sortable: true, width: "120"},
|
||||
{key: 'withDrawlAmount', visible: true, label: '提现金额', align: 'center', minWidth: null, sortable: true, width: "120"},
|
||||
{key: 'totalIncome', visible: true, label: '收入金额', align: 'center', minWidth: null, sortable: false, width: "120"},
|
||||
{key: 'withDrawlAmount', visible: true, label: '提现金额', align: 'center', minWidth: null, sortable: false, width: "120"},
|
||||
{key: 'balance', visible: true, label: '余额', align: 'center', minWidth: null, sortable: true, width: null},
|
||||
{key: 'realServiceRate', visible: true, label: '商户服务费', align: 'center', minWidth: null, sortable: false, width: "120"},
|
||||
{key: 'agentServiceRate', visible: true, label: '代理服务费', align: 'center', minWidth: null, sortable: false, width: "120"},
|
||||
|
|
Loading…
Reference in New Issue
Block a user