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