报表更新
This commit is contained in:
parent
ef355e8f89
commit
daf48fd67b
12
src/api/app/dashboard.js
Normal file
12
src/api/app/dashboard.js
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取分成金额统计
|
||||||
|
*/
|
||||||
|
export function appGetBonusDailyAmount(params) {
|
||||||
|
return request({
|
||||||
|
url: '/app/dashboard/bonusDailyAmount',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
|
@ -1,15 +1,20 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-loading="loading">
|
<div v-loading="loading">
|
||||||
<el-row type="flex" style="justify-content: space-between">
|
<el-row type="flex" style="justify-content: space-between">
|
||||||
<el-date-picker
|
<!-- <el-date-picker-->
|
||||||
v-model="computedMonth"
|
<!-- v-model="computedMonth"-->
|
||||||
type="month"
|
<!-- type="month"-->
|
||||||
placeholder="选择月"
|
<!-- placeholder="选择月"-->
|
||||||
|
<!-- @change="getData"-->
|
||||||
|
<!-- :clearable="false"-->
|
||||||
|
<!-- />-->
|
||||||
|
<date-range-picker
|
||||||
|
:start-date.sync="queryParams.payDateStart"
|
||||||
|
:end-date.sync="queryParams.payDateEnd"
|
||||||
@change="getData"
|
@change="getData"
|
||||||
:clearable="false"
|
|
||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
{{queryParams.year}}年{{queryParams.month}}月收入
|
收入
|
||||||
<span style="font-size: 26px">{{totalIncome | money}}</span>
|
<span style="font-size: 26px">{{totalIncome | money}}</span>
|
||||||
元
|
元
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,16 +27,18 @@
|
||||||
import { mchRechargeCount } from '@/api/mch/recharge'
|
import { mchRechargeCount } from '@/api/mch/recharge'
|
||||||
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 DateRangePicker from '@/components/DateRangePicker/index.vue'
|
||||||
|
import { getLastMonthDateStr } from '@/utils'
|
||||||
|
import { appGetBonusDailyAmount } from '@/api/app/dashboard'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'MchRechargeCountReport',
|
name: 'MchRechargeCountReport',
|
||||||
components: { RangePicker, SingleLineChart },
|
components: { DateRangePicker, RangePicker, SingleLineChart },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
year: new Date().getFullYear(),
|
payDateStart: getLastMonthDateStr(1),
|
||||||
month: new Date().getMonth() + 1,
|
payDateEnd: getLastMonthDateStr(0),
|
||||||
groupBy: "create_date"
|
|
||||||
},
|
},
|
||||||
data: [],
|
data: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
|
@ -40,30 +47,16 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
// 数据列表
|
// 数据列表
|
||||||
chartData() {
|
chartData() {
|
||||||
return this.data.map(item => item.recharge);
|
return this.data.map(item => item.value);
|
||||||
},
|
},
|
||||||
labels() {
|
labels() {
|
||||||
return this.data.map(item => item.createDate);
|
return this.data.map(item => item.key);
|
||||||
},
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
totalIncome() {
|
totalIncome() {
|
||||||
if (this.data == null) {
|
if (this.data == null) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return this.data.reduce((pre, cur) => pre + cur.recharge, 0);
|
return this.data.reduce((pre, cur) => pre + cur.value, 0);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -72,7 +65,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
getData() {
|
getData() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
mchRechargeCount(this.queryParams).then(res => {
|
appGetBonusDailyAmount(this.queryParams).then(res => {
|
||||||
this.data = res.data;
|
this.data = res.data;
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
|
@ -40,7 +40,7 @@ export default {
|
||||||
return this.list.map(item => item.key);
|
return this.list.map(item => item.key);
|
||||||
},
|
},
|
||||||
chartData() {
|
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() {
|
created() {
|
||||||
|
|
|
@ -135,6 +135,9 @@
|
||||||
<el-tab-pane label="实名认证记录" lazy>
|
<el-tab-pane label="实名认证记录" lazy>
|
||||||
<real-name :query="{userId: detail.userId}" :view="views.user"/>
|
<real-name :query="{userId: detail.userId}" :view="views.user"/>
|
||||||
</el-tab-pane>
|
</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>
|
<el-tab-pane label="收款账户" lazy>
|
||||||
<account :query="{userId: detail.userId}" :view="views.user"/>
|
<account :query="{userId: detail.userId}" :view="views.user"/>
|
||||||
</el-tab-pane>
|
</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 UserDailyRechargeReport from '@/views/system/smUser/components/UserDailyRechargeReport.vue'
|
||||||
import Bonus from '@/views/ss/bonus/index.vue'
|
import Bonus from '@/views/ss/bonus/index.vue'
|
||||||
import RiskInfo from '@/views/ss/riskInfo/index.vue'
|
import RiskInfo from '@/views/ss/riskInfo/index.vue'
|
||||||
|
import BindRecord from '@/views/system/bindRecord/index.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'User/:userId',
|
name: 'User/:userId',
|
||||||
mixins: [$view, $serviceType],
|
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'],
|
dicts: ['sm_user_type', 'service_type', 'withdraw_service_type'],
|
||||||
computed: {
|
computed: {
|
||||||
BonusArrivalType() {
|
BonusArrivalType() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user