报表更新

This commit is contained in:
磷叶 2024-12-02 17:31:23 +08:00
parent ef355e8f89
commit daf48fd67b
4 changed files with 39 additions and 30 deletions

12
src/api/app/dashboard.js Normal file
View File

@ -0,0 +1,12 @@
import request from '@/utils/request'
/**
* 获取分成金额统计
*/
export function appGetBonusDailyAmount(params) {
return request({
url: '/app/dashboard/bonusDailyAmount',
method: 'get',
params
})
}

View File

@ -1,15 +1,20 @@
<template>
<div v-loading="loading">
<el-row type="flex" style="justify-content: space-between">
<el-date-picker
v-model="computedMonth"
type="month"
placeholder="选择月"
<!-- <el-date-picker-->
<!-- v-model="computedMonth"-->
<!-- type="month"-->
<!-- placeholder="选择月"-->
<!-- @change="getData"-->
<!-- :clearable="false"-->
<!-- />-->
<date-range-picker
:start-date.sync="queryParams.payDateStart"
:end-date.sync="queryParams.payDateEnd"
@change="getData"
:clearable="false"
/>
<div>
{{queryParams.year}}{{queryParams.month}}月收入
收入
<span style="font-size: 26px">{{totalIncome | money}}</span>
</div>
@ -22,16 +27,18 @@
import { mchRechargeCount } from '@/api/mch/recharge'
import SingleLineChart from '@/components/SingleLineChart/index.vue'
import RangePicker from '@/components/RangePicker/index.vue'
import DateRangePicker from '@/components/DateRangePicker/index.vue'
import { getLastMonthDateStr } from '@/utils'
import { appGetBonusDailyAmount } from '@/api/app/dashboard'
export default {
name: 'MchRechargeCountReport',
components: { RangePicker, SingleLineChart },
components: { DateRangePicker, RangePicker, SingleLineChart },
data() {
return {
queryParams: {
year: new Date().getFullYear(),
month: new Date().getMonth() + 1,
groupBy: "create_date"
payDateStart: getLastMonthDateStr(1),
payDateEnd: getLastMonthDateStr(0),
},
data: [],
loading: false,
@ -40,30 +47,16 @@ export default {
computed: {
//
chartData() {
return this.data.map(item => item.recharge);
return this.data.map(item => item.value);
},
labels() {
return this.data.map(item => item.createDate);
},
computedMonth: {
get() {
let date = new Date();
date.setFullYear(this.queryParams.year);
date.setMonth(this.queryParams.month - 1);
console.log('get', date)
return date;
},
set(val) {
console.log('set', val)
this.queryParams.year = val.getFullYear();
this.queryParams.month = val.getMonth() + 1;
}
return this.data.map(item => item.key);
},
totalIncome() {
if (this.data == null) {
return 0;
}
return this.data.reduce((pre, cur) => pre + cur.recharge, 0);
return this.data.reduce((pre, cur) => pre + cur.value, 0);
}
},
created() {
@ -72,7 +65,7 @@ export default {
methods: {
getData() {
this.loading = true;
mchRechargeCount(this.queryParams).then(res => {
appGetBonusDailyAmount(this.queryParams).then(res => {
this.data = res.data;
}).finally(() => {
this.loading = false;

View File

@ -40,7 +40,7 @@ export default {
return this.list.map(item => item.key);
},
chartData() {
return this.list.map(item => item.sum == null ? 0 : item.sum.toFixed(2));
return this.list.map(item => item.value == null ? 0 : item.value.toFixed(2));
}
},
created() {

View File

@ -135,6 +135,9 @@
<el-tab-pane label="实名认证记录" lazy>
<real-name :query="{userId: detail.userId}" :view="views.user"/>
</el-tab-pane>
<el-tab-pane label="绑定记录" lazy>
<bind-record :query="{userId: detail.userId}" :view="views.user"/>
</el-tab-pane>
<el-tab-pane label="收款账户" lazy>
<account :query="{userId: detail.userId}" :view="views.user"/>
</el-tab-pane>
@ -176,11 +179,12 @@ import Risk from '@/views/ss/risk/index.vue'
import UserDailyRechargeReport from '@/views/system/smUser/components/UserDailyRechargeReport.vue'
import Bonus from '@/views/ss/bonus/index.vue'
import RiskInfo from '@/views/ss/riskInfo/index.vue'
import BindRecord from '@/views/system/bindRecord/index.vue'
export default {
name: 'User/:userId',
mixins: [$view, $serviceType],
components: { RiskInfo, Bonus, UserDailyRechargeReport, Risk, ReceiveBill, UserConfigDialog, RealName, Withdraw, BooleanTag, Recharge, Device, Suit, Account, RecordBalance, Store, Access, UserRechargeReport, UserAccount, UserDevice, LineChart},
components: { BindRecord, RiskInfo, Bonus, UserDailyRechargeReport, Risk, ReceiveBill, UserConfigDialog, RealName, Withdraw, BooleanTag, Recharge, Device, Suit, Account, RecordBalance, Store, Access, UserRechargeReport, UserAccount, UserDevice, LineChart},
dicts: ['sm_user_type', 'service_type', 'withdraw_service_type'],
computed: {
BonusArrivalType() {