|
@@ -1,185 +1,250 @@
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
- <Search :search="search" :reset="resetQuery">
|
|
|
|
|
|
+ <!-- 统计 -->
|
|
|
|
+ <summaryStatistics></summaryStatistics>
|
|
|
|
+ <Search :search="moreSearch" :reset="moreReset">
|
|
<template v-slot:body>
|
|
<template v-slot:body>
|
|
- <el-form-item label="短剧名称" prop="trade_no">
|
|
|
|
- <el-input v-model="query.trade_no" placeholder="请输入短剧名称" clearable />
|
|
|
|
- </el-form-item>
|
|
|
|
<el-form-item label="时间">
|
|
<el-form-item label="时间">
|
|
<el-date-picker unlink-panels clearable @change="timeChange" format="YYYY/MM/DD" value-format="YYYY-MM-DD"
|
|
<el-date-picker unlink-panels clearable @change="timeChange" format="YYYY/MM/DD" value-format="YYYY-MM-DD"
|
|
v-model="query.time" type="daterange" :shortcuts="shortcuts" range-separator="To" start-placeholder="开始时间"
|
|
v-model="query.time" type="daterange" :shortcuts="shortcuts" range-separator="To" start-placeholder="开始时间"
|
|
end-placeholder="结束时间" />
|
|
end-placeholder="结束时间" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="优化师" prop="user_id" v-if="!rolesIdentify.includes('optimizer')">
|
|
|
|
+ <el-select v-model="query.user_id" filterable remote clearable
|
|
|
|
+ :remote-method="(query) => { remoteMethod(query, 'channelPromotionsUsers') }" placeholder="选择优化师">
|
|
|
|
+ <el-option v-for="item in promotionsUsersList" :key="item.user_id" :label="item.name" :value="item.user_id" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="小程序" prop="miniprogram_id">
|
|
|
|
+ <el-select v-model="query.miniprogram_id" filterable remote
|
|
|
|
+ :remote-method="(query) => { remoteMethod(query, 'channelMiniprogram') }" clearable placeholder="选择小程序">
|
|
|
|
+ <el-option v-for="item in channelMiniprogram" :key="item.miniprogram_id" :label="item.name"
|
|
|
|
+ :value="item.miniprogram_id" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
</template>
|
|
</template>
|
|
<template v-slot:extra_button>
|
|
<template v-slot:extra_button>
|
|
- <exportExcel api="channel/order_list" sheet_name="订单列表" :title_obj="titleObj"
|
|
|
|
|
|
+ <exportExcel api="statistic/charge/list" sheet_name="充值统计" :title_obj="titleObj"
|
|
:extro_params="{ is_export: true, ...query }">
|
|
:extro_params="{ is_export: true, ...query }">
|
|
</exportExcel>
|
|
</exportExcel>
|
|
</template>
|
|
</template>
|
|
- </Search>
|
|
|
|
- <div style="margin:8px 0;">
|
|
|
|
- <el-card shadow="hover" :body-style="{ padding: '20px' }">
|
|
|
|
- <div class="stat-wrapper">
|
|
|
|
- <div>所选时间段内累计充值金额:
|
|
|
|
- <span class="ml-2 mr-4 stat">{{ statisticalData.yesterday_total_coins || '暂无数据' }}</span>
|
|
|
|
- </div>
|
|
|
|
- <div>累计充值笔数:
|
|
|
|
- <span class="ml-2 mr-4 stat">{{ statisticalData.yesterday_available_amount || '暂无数据' }}</span>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <template v-slot:content>
|
|
|
|
+ <div style="margin:8px 6px;" v-action="'statistic.chargeTJ.listTotalCharge'">
|
|
|
|
+ <el-card shadow="hover" :body-style="{ padding: '20px' }">
|
|
|
|
+ <div class="stat-wrapper">
|
|
|
|
+ <div>所选时间段内累计充值金额:
|
|
|
|
+ <span class="ml-2 mr-4 stat">{{ statisticalData.sum_pay_money || '暂无数据' }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div>累计充值笔数:
|
|
|
|
+ <span class="ml-2 mr-4 stat">{{ statisticalData.sum_pay_count || '暂无数据' }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </el-card>
|
|
</div>
|
|
</div>
|
|
- </el-card>
|
|
|
|
- </div>
|
|
|
|
- <div class="table-default">
|
|
|
|
- <el-table :data="tableData" class="mt-3" v-loading="loading">
|
|
|
|
- <el-table-column prop="day_at" label="时间" />
|
|
|
|
- <el-table-column prop="username" label="优化师" min-width="160px" />
|
|
|
|
- <el-table-column prop="miniprogram_name" label="小程序名称" min-width="160px" />
|
|
|
|
- <el-table-column label="充值金额" prop="pay_money">
|
|
|
|
- <template #header>
|
|
|
|
- <div class="flex items-center">
|
|
|
|
- <span>充值金额</span>
|
|
|
|
- <el-tooltip placement="top">
|
|
|
|
- <template #content>
|
|
|
|
- 当日累计充值金额<br />
|
|
|
|
|
|
+ <div class="table-default" v-action="'statistic.chargeTJ.list'">
|
|
|
|
+ <el-table :data="tableData" class="mt-3" v-loading="loading">
|
|
|
|
+ <el-table-column prop="day_at" label="时间" />
|
|
|
|
+ <el-table-column prop="username" label="优化师" min-width="160px" />
|
|
|
|
+ <el-table-column prop="miniprogram_name" label="小程序名称" min-width="160px" />
|
|
|
|
+ <el-table-column label="充值金额" prop="pay_money" min-width="160px">
|
|
|
|
+ <template #header>
|
|
|
|
+ <div class="flex items-center">
|
|
|
|
+ <span>充值金额</span>
|
|
|
|
+ <el-tooltip placement="top">
|
|
|
|
+ <template #content>
|
|
|
|
+ 当日累计充值金额<br />
|
|
|
|
+ </template>
|
|
|
|
+ <el-icon>
|
|
|
|
+ <InfoFilled />
|
|
|
|
+ </el-icon>
|
|
|
|
+ </el-tooltip>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <div class="wrapper">
|
|
|
|
+ <div>{{ scope.row.pay_money }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="充值笔数" prop="pay_count" min-width="160px">
|
|
|
|
+ <template #header>
|
|
|
|
+ <div class="flex items-center">
|
|
|
|
+ <span>充值笔数</span>
|
|
|
|
+ <el-tooltip placement="top">
|
|
|
|
+ <template #content>
|
|
|
|
+ 当日累计充值笔数<br />
|
|
|
|
+ </template>
|
|
|
|
+ <el-icon>
|
|
|
|
+ <InfoFilled />
|
|
|
|
+ </el-icon>
|
|
|
|
+ </el-tooltip>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <div class="wrapper">
|
|
|
|
+ <div>{{ scope.row.pay_count }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="新增用户充值总额" prop="new_user_pay_money" min-width="160px">
|
|
|
|
+ <template #header>
|
|
|
|
+ <div class="flex items-center">
|
|
|
|
+ <span>新增用户充值总额</span>
|
|
|
|
+ <el-tooltip placement="top">
|
|
|
|
+ <template #content>
|
|
|
|
+ 当日新用户充值总额<br />
|
|
|
|
+ </template>
|
|
|
|
+ <el-icon>
|
|
|
|
+ <InfoFilled />
|
|
|
|
+ </el-icon>
|
|
|
|
+ </el-tooltip>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <div class="wrapper">
|
|
|
|
+ <div>{{ scope.row.new_user_pay_money }}</div>
|
|
|
|
+ <div>普通:{{ scope.row.new_user_common_pay_money }}</div>
|
|
|
|
+ <div>会员:{{ scope.row.new_user_vip_pay_money }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="普通充值" min-width="250">
|
|
|
|
+ <el-table-column prop="common_pay_money" label="金额" min-width="160px">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <div class="wrapper">
|
|
|
|
+ <div>总额:{{ scope.row.common_pay_money }}</div>
|
|
|
|
+ <div>人均:{{ scope.row.common_pay_money_per }}</div>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
- <el-icon>
|
|
|
|
- <InfoFilled />
|
|
|
|
- </el-icon>
|
|
|
|
- </el-tooltip>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- <template #default="scope">
|
|
|
|
- <div class="wrapper">
|
|
|
|
- <div>{{ scope.row.pay_money }}</div>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="充值笔数" prop="pay_count">
|
|
|
|
- <template #header>
|
|
|
|
- <div class="flex items-center">
|
|
|
|
- <span>充值笔数</span>
|
|
|
|
- <el-tooltip placement="top">
|
|
|
|
- <template #content>
|
|
|
|
- 当日累计充值笔数<br />
|
|
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="支付订单数" prop="common_pay_count" min-width="160px">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <div class="wrapper">
|
|
|
|
+ <div class="mb-2">
|
|
|
|
+ <span class="mr-2">已:{{ scope.row.common_pay_count }}</span>
|
|
|
|
+ <span>未:{{ scope.row.common_unpay_count }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div>支付率:{{ scope.row.common_pay_rate }}</div>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
- <el-icon>
|
|
|
|
- <InfoFilled />
|
|
|
|
- </el-icon>
|
|
|
|
- </el-tooltip>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- <template #default="scope">
|
|
|
|
- <div class="wrapper">
|
|
|
|
- <div>{{ scope.row.pay_count }}</div>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="新增用户充值总额" prop="new_user_pay_money">
|
|
|
|
- <template #header>
|
|
|
|
- <div class="flex items-center">
|
|
|
|
- <span>新增用户充值总额</span>
|
|
|
|
- <el-tooltip placement="top">
|
|
|
|
- <template #content>
|
|
|
|
- 当日新用户充值总额<br />
|
|
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="会员充值" min-width="250">
|
|
|
|
+ <el-table-column prop="vip_pay_money" label="金额" min-width="160px">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <div class="wrapper">
|
|
|
|
+ <div>总额:{{ scope.row.vip_pay_money }}</div>
|
|
|
|
+ <div>人均:{{ scope.row.vip_pay_money_per }}</div>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
- <el-icon>
|
|
|
|
- <InfoFilled />
|
|
|
|
- </el-icon>
|
|
|
|
- </el-tooltip>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- <template #default="scope">
|
|
|
|
- <div class="wrapper">
|
|
|
|
- <div>{{ scope.row.new_user_pay_money }}</div>
|
|
|
|
- <div>普通:{{ scope.row.new_user_common_pay_money }}</div>
|
|
|
|
- <div>会员:{{ scope.row.new_user_vip_pay_money }}</div>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="普通充值" min-width="250">
|
|
|
|
- <el-table-column prop="common_pay_money" label="金额">
|
|
|
|
- <template #default="scope">
|
|
|
|
- <div class="wrapper">
|
|
|
|
- <div>总额:{{ scope.row.common_pay_money }}</div>
|
|
|
|
- <div>人均:{{ scope.row.common_pay_money }}</div>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="支付订单数" prop="common_pay_count">
|
|
|
|
- <template #default="scope">
|
|
|
|
- <div class="wrapper">
|
|
|
|
- <div class="mb-2">
|
|
|
|
- <span class="mr-2">已:{{ scope.row.common_pay_count }}</span>
|
|
|
|
- <span>未:{{ scope.row.common_unpay_count }}</span>
|
|
|
|
- </div>
|
|
|
|
- <div>支付率:{{ scope.row.common_pay_rate }}</div>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="会员充值" min-width="250">
|
|
|
|
- <el-table-column prop="vip_pay_money" label="金额">
|
|
|
|
- <template #default="scope">
|
|
|
|
- <div class="wrapper">
|
|
|
|
- <div>总额:{{ scope.row.vip_pay_money }}</div>
|
|
|
|
- <div>人均:{{ scope.row.vip_pay_money_per }}</div>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="支付订单数" prop="vip_pay_count">
|
|
|
|
- <template #default="scope">
|
|
|
|
- <div class="wrapper">
|
|
|
|
- <div class="mb-2">
|
|
|
|
- <span class="mr-2">已:{{ scope.row.vip_pay_count }}</span>
|
|
|
|
- <span>未:{{ scope.row.vip_unpay_count }}</span>
|
|
|
|
- </div>
|
|
|
|
- <div>支付率:{{ scope.row.vip_pay_rate }}</div>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
- <Paginate />
|
|
|
|
- </div>
|
|
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="支付订单数" prop="vip_pay_count" min-width="160px">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <div class="wrapper">
|
|
|
|
+ <div class="mb-2">
|
|
|
|
+ <span class="mr-2">已:{{ scope.row.vip_pay_count }}</span>
|
|
|
|
+ <span>未:{{ scope.row.vip_unpay_count }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div>支付率:{{ scope.row.vip_pay_rate }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ <Paginate />
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </Search>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
|
+import summaryStatistics from './summaryStatistics.vue';
|
|
import { shortcuts } from '@/utils/shortcuts'
|
|
import { shortcuts } from '@/utils/shortcuts'
|
|
import { useRouter, useRoute } from 'vue-router'
|
|
import { useRouter, useRoute } from 'vue-router'
|
|
import { InfoFilled } from '@element-plus/icons-vue';
|
|
import { InfoFilled } from '@element-plus/icons-vue';
|
|
import { useGetList } from '@/hook/curd/useGetList';
|
|
import { useGetList } from '@/hook/curd/useGetList';
|
|
|
|
+import { statisticChargeListTotalCharge } from '@/api/dataStatistics/rechargeStatistics/index'
|
|
import { titleObj } from "./excelTitle";
|
|
import { titleObj } from "./excelTitle";
|
|
import moment from 'moment';
|
|
import moment from 'moment';
|
|
-const start_date = moment().startOf('month').format('YYYY-MM-DD')
|
|
|
|
-const end_date = moment().endOf('month').format('YYYY-MM-DD')
|
|
|
|
|
|
+const start_date = moment().subtract(7, 'days').format('YYYY-MM-DD');
|
|
|
|
+const end_date = moment().format('YYYY-MM-DD');
|
|
const statisticalData = ref({})
|
|
const statisticalData = ref({})
|
|
const api = 'statistic/charge/list';
|
|
const api = 'statistic/charge/list';
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
const { data, query, search, reset, loading } = useGetList(api);
|
|
const { data, query, search, reset, loading } = useGetList(api);
|
|
const rolesIdentify = inject('rolesIdentify')
|
|
const rolesIdentify = inject('rolesIdentify')
|
|
|
|
+import {
|
|
|
|
+ channelMiniprogramUseList,
|
|
|
|
+ channelPromotionsUsers,
|
|
|
|
+} from '@/api/orders/index'
|
|
|
|
+const channelMiniprogram = ref([])
|
|
|
|
+const promotionsUsersList = ref([])
|
|
|
|
+
|
|
|
|
+const remoteMethod = (query: string, type: string,) => {
|
|
|
|
+ console.log(query, 'queryquery', type);
|
|
|
|
+ switch (type) {
|
|
|
|
+ case 'channelPromotionsUsers':
|
|
|
|
+ initRemoteOption('channelPromotionsUsers', { name: query })
|
|
|
|
+ break;
|
|
|
|
+ case 'channelMiniprogram':
|
|
|
|
+ initRemoteOption('channelMiniprogram', { name: query })
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const initRemoteOption = (type: string, params?: object) => {
|
|
|
|
+ switch (type) {
|
|
|
|
+ case 'channelPromotionsUsers':
|
|
|
|
+ channelPromotionsUsers({ limit: 30, ...params }).then(res => {
|
|
|
|
+ promotionsUsersList.value = res.data
|
|
|
|
+ })
|
|
|
|
+ break;
|
|
|
|
+ case 'channelMiniprogram':
|
|
|
|
+ channelMiniprogramUseList({ limit: 30, ...params }).then(res => {
|
|
|
|
+ channelMiniprogram.value = res.data
|
|
|
|
+ })
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|
|
const timeChange = (e: object) => {
|
|
const timeChange = (e: object) => {
|
|
console.log(e, 'timeChangetimeChangetimeChange');
|
|
console.log(e, 'timeChangetimeChangetimeChange');
|
|
if (query.value.time) {
|
|
if (query.value.time) {
|
|
const timeArr = toRaw(e);
|
|
const timeArr = toRaw(e);
|
|
- query.value.created_at_start = timeArr[0]
|
|
|
|
- query.value.created_at_end = timeArr[1]
|
|
|
|
|
|
+ query.value.start_at = timeArr[0]
|
|
|
|
+ query.value.end_at = timeArr[1]
|
|
} else {
|
|
} else {
|
|
- delete query.value.created_at_start
|
|
|
|
- delete query.value.created_at_end
|
|
|
|
|
|
+ delete query.value.start_at
|
|
|
|
+ delete query.value.end_at
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-const resetQuery = () => {
|
|
|
|
|
|
+const moreSearch = () => {
|
|
|
|
+ search();
|
|
|
|
+ statisticChargeListTotalCharge({ ...query.value }).then(res => {
|
|
|
|
+ statisticalData.value = res.data
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const moreReset = () => {
|
|
reset()
|
|
reset()
|
|
|
|
+ statisticChargeListTotalCharge({ ...query.value }).then(res => {
|
|
|
|
+ statisticalData.value = res.data
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
const tableData = computed(() => data.value?.data);
|
|
const tableData = computed(() => data.value?.data);
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
- search();
|
|
|
|
|
|
+ initRemoteOption('channelPromotionsUsers')
|
|
|
|
+ initRemoteOption('channelMiniprogram')
|
|
|
|
+ query.value.time = [start_date, end_date];
|
|
|
|
+ query.value.start_at = start_date;
|
|
|
|
+ query.value.end_at = end_date;
|
|
|
|
+ moreSearch();
|
|
});
|
|
});
|
|
</script>
|
|
</script>
|
|
|
|
|