后台优化 - 各分区充值统计 - 增加国家明细

This commit is contained in:
2025-08-20 16:31:49 +08:00
parent 83e3df1b52
commit 75879f805b
6 changed files with 873 additions and 230 deletions

View File

@@ -64,4 +64,12 @@ export const exportChargeRecordTotalExport = query => {
params: query,
responseType: 'blob'
});
};
// 充值明细
export const getChargeRecordPartitionRegionDetail = query => {
return request({
url: '/admin/chargeRecord/partitionRegionDetail',
method: 'get',
params: query
});
};

View File

@@ -25,25 +25,123 @@
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="date" align="center" label="日期" />
<el-table-column prop="v5payUsd" align="center" label="
V5play充值美元" />
<el-table-column prop="googleUsd" align="center" label="google充值美元" />
<el-table-column prop="razerUsd" align="center" label="razer充值" />
<el-table-column
prop="v5payUsd"
align="center"
label="
V5play充值美元"
>
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'v5pay')"
type="text"
size="medium "
>{{ scope.row.v5payUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="googleUsd" align="center" label="google充值美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'google_play_billing')"
type="text"
size="medium "
>{{ scope.row.googleUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="razerUsd" align="center" label="razer充值">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'razer')"
type="text"
size="medium "
>{{ scope.row.razerUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column
prop="payermaxUsd"
align="center"
label="payermax充值美元"
/>
<el-table-column prop="myCardUsd" align="center" label="myCard充值美元" />
>
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'payermax')"
type="text"
size="medium "
>{{ scope.row.payermaxUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="myCardUsd" align="center" label="myCard充值美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'MyCard')"
type="text"
size="medium "
>{{ scope.row.myCardUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column
prop="startPayUsd"
align="center"
label="startPay充值美元"
/>
<el-table-column prop="iosUsd" align="center" label="ios充值美元" />
<el-table-column prop="companyUsd" align="center" label="对公打款美元" />
<el-table-column prop="totalUsd" align="center" label="总充值美元" />
>
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'start_pay')"
type="text"
size="medium "
>{{ scope.row.startPayUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="iosUsd" align="center" label="ios充值美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'ios_pay')"
type="text"
size="medium "
>{{ scope.row.iosUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="companyUsd" align="center" label="对公打款美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'company')"
type="text"
size="medium "
>{{ scope.row.companyUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="totalUsd" align="center" label="总充值美元" >
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, '')"
type="text"
size="medium "
>{{ scope.row.totalUsd }}</el-button
>
</template>
</el-table-column>
</el-table>
<!--国家明细弹窗 -->
<el-dialog v-model="detailDialog" title="国家明细" width="25%" center>
<!-- 表格数据 -->
<el-table
v-loading="detailData.loading"
:data="detailData.data"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="regionName" align="center" label="国家" />
<el-table-column prop="usd" align="center" label="充值美元" />
</el-table>
</el-dialog>
</div>
</template>
@@ -56,20 +154,29 @@ export default {
import { ref, onMounted, reactive, computed } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { dateFormat } from "@/utils/system-helper";
import {getChargeRecordPartitionDetail,exportPartitionDetail} from '@/api/users/ChargeRecordPartitionStatisticsView.js'
import {
getChargeRecordPartitionDetail,
exportPartitionDetail,
getChargeRecordPartitionRegionDetail,
} from "@/api/users/ChargeRecordPartitionStatisticsView.js";
import { formatDate } from "@/utils/relDate";
const dataTime = ref([]);
const formData = reactive({
beginDate: "",
endDate: "",
partitionId:2
partitionId: 2,
});
const tableData = reactive({
data: [],
total: 0,
loading: false,
});
const detailDialog = ref(false);
const detailData = reactive({
data: [],
loading: false,
});
// 查询
const getData = () => {
tableData.loading = true;
@@ -81,50 +188,70 @@ const getData = () => {
formData.endDate = dataTime.value;
}
getChargeRecordPartitionDetail(formData).then((res) => {
tableData.data = res;
tableData.loading = false;
tableData.data = res;
tableData.loading = false;
});
};
// 导出
const confirmExportExcel = async () => {
// Object.assign(formData, { pageSize: 10000, pageNo: 1 });
try {
const res = await exportPartitionDetail(formData);
if (res) {
ElMessage({
message: "导出成功",
type: "success",
});
let time = formatDate(new Date());
let alink = document.createElement("a");
alink.download = `分区充值统计${time}.xls`;
alink.style.display = "none";
const blob = new Blob([res]);
alink.href = URL.createObjectURL(blob);
document.body.appendChild(alink);
alink.click();
URL.revokeObjectURL(alink.href);
}
} catch (error) {
ElMessage({
message: error.message,
type: "error",
});
}
};
// 导出
const confirmExportExcel = async () => {
// Object.assign(formData, { pageSize: 10000, pageNo: 1 });
try {
const res = await exportPartitionDetail(formData);
if (res) {
ElMessage({
message: "导出成功",
type: "success",
});
let time = formatDate(new Date());
let alink = document.createElement("a");
alink.download = `分区充值统计${time}.xls`;
alink.style.display = "none";
const blob = new Blob([res]);
alink.href = URL.createObjectURL(blob);
document.body.appendChild(alink);
alink.click();
URL.revokeObjectURL(alink.href);
}
} catch (error) {
ElMessage({
message: error.message,
type: "error",
});
}
};
// 设置默认日期范围今天到7天前
const setDefaultDateRange = () => {
const today = new Date();
const sevenDaysAgo = new Date();
sevenDaysAgo.setDate(today.getDate() - 7);
dataTime.value = [
dateFormat(sevenDaysAgo, "yyyy-MM-dd"),
dateFormat(today, "yyyy-MM-dd")
dateFormat(today, "yyyy-MM-dd"),
];
};
// 国家明细
const detailDialogFun = (beginDate, channel) => {
detailData.loading = true;
getChargeRecordPartitionRegionDetail({
beginDate,
channel,
partitionId: 2,
}).then((res) => {
if (res.code == 200) {
detailData.data = res.data;
detailData.loading = false;
detailDialog.value = true;
} else {
detailData.loading = false;
ElMessage({
message: res.message,
type: "error",
});
}
});
};
onMounted(() => {
setDefaultDateRange();
getData();
@@ -164,4 +291,4 @@ onMounted(() => {
line-height: 35px;
margin-bottom: 20px;
}
</style>
</style>

View File

@@ -25,25 +25,123 @@
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="date" align="center" label="日期" />
<el-table-column prop="v5payUsd" align="center" label="
V5play充值美元" />
<el-table-column prop="googleUsd" align="center" label="google充值美元" />
<el-table-column prop="razerUsd" align="center" label="razer充值" />
<el-table-column
prop="v5payUsd"
align="center"
label="
V5play充值美元"
>
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'v5pay')"
type="text"
size="medium "
>{{ scope.row.v5payUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="googleUsd" align="center" label="google充值美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'google_play_billing')"
type="text"
size="medium "
>{{ scope.row.googleUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="razerUsd" align="center" label="razer充值">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'razer')"
type="text"
size="medium "
>{{ scope.row.razerUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column
prop="payermaxUsd"
align="center"
label="payermax充值美元"
/>
<el-table-column prop="myCardUsd" align="center" label="myCard充值美元" />
>
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'payermax')"
type="text"
size="medium "
>{{ scope.row.payermaxUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="myCardUsd" align="center" label="myCard充值美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'MyCard')"
type="text"
size="medium "
>{{ scope.row.myCardUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column
prop="startPayUsd"
align="center"
label="startPay充值美元"
/>
<el-table-column prop="iosUsd" align="center" label="ios充值美元" />
<el-table-column prop="companyUsd" align="center" label="对公打款美元" />
<el-table-column prop="totalUsd" align="center" label="总充值美元" />
>
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'start_pay')"
type="text"
size="medium "
>{{ scope.row.startPayUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="iosUsd" align="center" label="ios充值美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'ios_pay')"
type="text"
size="medium "
>{{ scope.row.iosUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="companyUsd" align="center" label="对公打款美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'company')"
type="text"
size="medium "
>{{ scope.row.companyUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="totalUsd" align="center" label="总充值美元" >
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, '')"
type="text"
size="medium "
>{{ scope.row.totalUsd }}</el-button
>
</template>
</el-table-column>
</el-table>
<!--国家明细弹窗 -->
<el-dialog v-model="detailDialog" title="国家明细" width="25%" center>
<!-- 表格数据 -->
<el-table
v-loading="detailData.loading"
:data="detailData.data"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="regionName" align="center" label="国家" />
<el-table-column prop="usd" align="center" label="充值美元" />
</el-table>
</el-dialog>
</div>
</template>
@@ -56,20 +154,29 @@ export default {
import { ref, onMounted, reactive, computed } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { dateFormat } from "@/utils/system-helper";
import {getChargeRecordPartitionDetail,exportPartitionDetail} from '@/api/users/ChargeRecordPartitionStatisticsView.js'
import {
getChargeRecordPartitionDetail,
exportPartitionDetail,
getChargeRecordPartitionRegionDetail,
} from "@/api/users/ChargeRecordPartitionStatisticsView.js";
import { formatDate } from "@/utils/relDate";
const dataTime = ref([]);
const formData = reactive({
beginDate: "",
endDate: "",
partitionId:16
partitionId: 16,
});
const tableData = reactive({
data: [],
total: 0,
loading: false,
});
const detailDialog = ref(false);
const detailData = reactive({
data: [],
loading: false,
});
// 查询
const getData = () => {
tableData.loading = true;
@@ -81,50 +188,70 @@ const getData = () => {
formData.endDate = dataTime.value;
}
getChargeRecordPartitionDetail(formData).then((res) => {
tableData.data = res;
tableData.loading = false;
tableData.data = res;
tableData.loading = false;
});
};
// 导出
const confirmExportExcel = async () => {
// Object.assign(formData, { pageSize: 10000, pageNo: 1 });
try {
const res = await exportPartitionDetail(formData);
if (res) {
ElMessage({
message: "导出成功",
type: "success",
});
let time = formatDate(new Date());
let alink = document.createElement("a");
alink.download = `分区充值统计${time}.xls`;
alink.style.display = "none";
const blob = new Blob([res]);
alink.href = URL.createObjectURL(blob);
document.body.appendChild(alink);
alink.click();
URL.revokeObjectURL(alink.href);
}
} catch (error) {
ElMessage({
message: error.message,
type: "error",
});
}
};
// 导出
const confirmExportExcel = async () => {
// Object.assign(formData, { pageSize: 10000, pageNo: 1 });
try {
const res = await exportPartitionDetail(formData);
if (res) {
ElMessage({
message: "导出成功",
type: "success",
});
let time = formatDate(new Date());
let alink = document.createElement("a");
alink.download = `分区充值统计${time}.xls`;
alink.style.display = "none";
const blob = new Blob([res]);
alink.href = URL.createObjectURL(blob);
document.body.appendChild(alink);
alink.click();
URL.revokeObjectURL(alink.href);
}
} catch (error) {
ElMessage({
message: error.message,
type: "error",
});
}
};
// 设置默认日期范围今天到7天前
const setDefaultDateRange = () => {
const today = new Date();
const sevenDaysAgo = new Date();
sevenDaysAgo.setDate(today.getDate() - 7);
dataTime.value = [
dateFormat(sevenDaysAgo, "yyyy-MM-dd"),
dateFormat(today, "yyyy-MM-dd")
dateFormat(today, "yyyy-MM-dd"),
];
};
// 国家明细
const detailDialogFun = (beginDate, channel) => {
detailData.loading = true;
getChargeRecordPartitionRegionDetail({
beginDate,
channel,
partitionId: 16,
}).then((res) => {
if (res.code == 200) {
detailData.data = res.data;
detailData.loading = false;
detailDialog.value = true;
} else {
detailData.loading = false;
ElMessage({
message: res.message,
type: "error",
});
}
});
};
onMounted(() => {
setDefaultDateRange();
getData();
@@ -164,4 +291,4 @@ onMounted(() => {
line-height: 35px;
margin-bottom: 20px;
}
</style>
</style>

View File

@@ -25,25 +25,123 @@
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="date" align="center" label="日期" />
<el-table-column prop="v5payUsd" align="center" label="
V5play充值美元" />
<el-table-column prop="googleUsd" align="center" label="google充值美元" />
<el-table-column prop="razerUsd" align="center" label="razer充值" />
<el-table-column
prop="v5payUsd"
align="center"
label="
V5play充值美元"
>
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'v5pay')"
type="text"
size="medium "
>{{ scope.row.v5payUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="googleUsd" align="center" label="google充值美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'google_play_billing')"
type="text"
size="medium "
>{{ scope.row.googleUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="razerUsd" align="center" label="razer充值">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'razer')"
type="text"
size="medium "
>{{ scope.row.razerUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column
prop="payermaxUsd"
align="center"
label="payermax充值美元"
/>
<el-table-column prop="myCardUsd" align="center" label="myCard充值美元" />
>
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'payermax')"
type="text"
size="medium "
>{{ scope.row.payermaxUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="myCardUsd" align="center" label="myCard充值美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'MyCard')"
type="text"
size="medium "
>{{ scope.row.myCardUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column
prop="startPayUsd"
align="center"
label="startPay充值美元"
/>
<el-table-column prop="iosUsd" align="center" label="ios充值美元" />
<el-table-column prop="companyUsd" align="center" label="对公打款美元" />
<el-table-column prop="totalUsd" align="center" label="总充值美元" />
>
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'start_pay')"
type="text"
size="medium "
>{{ scope.row.startPayUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="iosUsd" align="center" label="ios充值美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'ios_pay')"
type="text"
size="medium "
>{{ scope.row.iosUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="companyUsd" align="center" label="对公打款美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'company')"
type="text"
size="medium "
>{{ scope.row.companyUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="totalUsd" align="center" label="总充值美元" >
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, '')"
type="text"
size="medium "
>{{ scope.row.totalUsd }}</el-button
>
</template>
</el-table-column>
</el-table>
<!--国家明细弹窗 -->
<el-dialog v-model="detailDialog" title="国家明细" width="25%" center>
<!-- 表格数据 -->
<el-table
v-loading="detailData.loading"
:data="detailData.data"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="regionName" align="center" label="国家" />
<el-table-column prop="usd" align="center" label="充值美元" />
</el-table>
</el-dialog>
</div>
</template>
@@ -56,20 +154,29 @@ export default {
import { ref, onMounted, reactive, computed } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { dateFormat } from "@/utils/system-helper";
import {getChargeRecordPartitionDetail,exportPartitionDetail} from '@/api/users/ChargeRecordPartitionStatisticsView.js'
import {
getChargeRecordPartitionDetail,
exportPartitionDetail,
getChargeRecordPartitionRegionDetail,
} from "@/api/users/ChargeRecordPartitionStatisticsView.js";
import { formatDate } from "@/utils/relDate";
const dataTime = ref([]);
const formData = reactive({
beginDate: "",
endDate: "",
partitionId:1
partitionId: 1,
});
const tableData = reactive({
data: [],
total: 0,
loading: false,
});
const detailDialog = ref(false);
const detailData = reactive({
data: [],
loading: false,
});
// 查询
const getData = () => {
tableData.loading = true;
@@ -81,50 +188,70 @@ const getData = () => {
formData.endDate = dataTime.value;
}
getChargeRecordPartitionDetail(formData).then((res) => {
tableData.data = res;
tableData.loading = false;
tableData.data = res;
tableData.loading = false;
});
};
// 导出
const confirmExportExcel = async () => {
// Object.assign(formData, { pageSize: 10000, pageNo: 1 });
try {
const res = await exportPartitionDetail(formData);
if (res) {
ElMessage({
message: "导出成功",
type: "success",
});
let time = formatDate(new Date());
let alink = document.createElement("a");
alink.download = `分区充值统计${time}.xls`;
alink.style.display = "none";
const blob = new Blob([res]);
alink.href = URL.createObjectURL(blob);
document.body.appendChild(alink);
alink.click();
URL.revokeObjectURL(alink.href);
}
} catch (error) {
ElMessage({
message: error.message,
type: "error",
});
}
};
// 导出
const confirmExportExcel = async () => {
// Object.assign(formData, { pageSize: 10000, pageNo: 1 });
try {
const res = await exportPartitionDetail(formData);
if (res) {
ElMessage({
message: "导出成功",
type: "success",
});
let time = formatDate(new Date());
let alink = document.createElement("a");
alink.download = `分区充值统计${time}.xls`;
alink.style.display = "none";
const blob = new Blob([res]);
alink.href = URL.createObjectURL(blob);
document.body.appendChild(alink);
alink.click();
URL.revokeObjectURL(alink.href);
}
} catch (error) {
ElMessage({
message: error.message,
type: "error",
});
}
};
// 设置默认日期范围今天到7天前
const setDefaultDateRange = () => {
const today = new Date();
const sevenDaysAgo = new Date();
sevenDaysAgo.setDate(today.getDate() - 7);
dataTime.value = [
dateFormat(sevenDaysAgo, "yyyy-MM-dd"),
dateFormat(today, "yyyy-MM-dd")
dateFormat(today, "yyyy-MM-dd"),
];
};
// 国家明细
const detailDialogFun = (beginDate, channel) => {
detailData.loading = true;
getChargeRecordPartitionRegionDetail({
beginDate,
channel,
partitionId: 1,
}).then((res) => {
if (res.code == 200) {
detailData.data = res.data;
detailData.loading = false;
detailDialog.value = true;
} else {
detailData.loading = false;
ElMessage({
message: res.message,
type: "error",
});
}
});
};
onMounted(() => {
setDefaultDateRange();
getData();
@@ -164,4 +291,4 @@ onMounted(() => {
line-height: 35px;
margin-bottom: 20px;
}
</style>
</style>

View File

@@ -25,25 +25,123 @@
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="date" align="center" label="日期" />
<el-table-column prop="v5payUsd" align="center" label="
V5play充值美元" />
<el-table-column prop="googleUsd" align="center" label="google充值美元" />
<el-table-column prop="razerUsd" align="center" label="razer充值" />
<el-table-column
prop="v5payUsd"
align="center"
label="
V5play充值美元"
>
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'v5pay')"
type="text"
size="medium "
>{{ scope.row.v5payUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="googleUsd" align="center" label="google充值美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'google_play_billing')"
type="text"
size="medium "
>{{ scope.row.googleUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="razerUsd" align="center" label="razer充值">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'razer')"
type="text"
size="medium "
>{{ scope.row.razerUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column
prop="payermaxUsd"
align="center"
label="payermax充值美元"
/>
<el-table-column prop="myCardUsd" align="center" label="myCard充值美元" />
>
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'payermax')"
type="text"
size="medium "
>{{ scope.row.payermaxUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="myCardUsd" align="center" label="myCard充值美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'MyCard')"
type="text"
size="medium "
>{{ scope.row.myCardUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column
prop="startPayUsd"
align="center"
label="startPay充值美元"
/>
<el-table-column prop="iosUsd" align="center" label="ios充值美元" />
<el-table-column prop="companyUsd" align="center" label="对公打款美元" />
<el-table-column prop="totalUsd" align="center" label="总充值美元" />
>
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'start_pay')"
type="text"
size="medium "
>{{ scope.row.startPayUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="iosUsd" align="center" label="ios充值美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'ios_pay')"
type="text"
size="medium "
>{{ scope.row.iosUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="companyUsd" align="center" label="对公打款美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'company')"
type="text"
size="medium "
>{{ scope.row.companyUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="totalUsd" align="center" label="总充值美元" >
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, '')"
type="text"
size="medium "
>{{ scope.row.totalUsd }}</el-button
>
</template>
</el-table-column>
</el-table>
<!--国家明细弹窗 -->
<el-dialog v-model="detailDialog" title="国家明细" width="25%" center>
<!-- 表格数据 -->
<el-table
v-loading="detailData.loading"
:data="detailData.data"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="regionName" align="center" label="国家" />
<el-table-column prop="usd" align="center" label="充值美元" />
</el-table>
</el-dialog>
</div>
</template>
@@ -56,20 +154,29 @@ export default {
import { ref, onMounted, reactive, computed } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { dateFormat } from "@/utils/system-helper";
import {getChargeRecordPartitionDetail,exportPartitionDetail} from '@/api/users/ChargeRecordPartitionStatisticsView.js'
import {
getChargeRecordPartitionDetail,
exportPartitionDetail,
getChargeRecordPartitionRegionDetail,
} from "@/api/users/ChargeRecordPartitionStatisticsView.js";
import { formatDate } from "@/utils/relDate";
const dataTime = ref([]);
const formData = reactive({
beginDate: "",
endDate: "",
partitionId:8
partitionId: 8,
});
const tableData = reactive({
data: [],
total: 0,
loading: false,
});
const detailDialog = ref(false);
const detailData = reactive({
data: [],
loading: false,
});
// 查询
const getData = () => {
tableData.loading = true;
@@ -81,50 +188,70 @@ const getData = () => {
formData.endDate = dataTime.value;
}
getChargeRecordPartitionDetail(formData).then((res) => {
tableData.data = res;
tableData.loading = false;
tableData.data = res;
tableData.loading = false;
});
};
// 导出
const confirmExportExcel = async () => {
// Object.assign(formData, { pageSize: 10000, pageNo: 1 });
try {
const res = await exportPartitionDetail(formData);
if (res) {
ElMessage({
message: "导出成功",
type: "success",
});
let time = formatDate(new Date());
let alink = document.createElement("a");
alink.download = `分区充值统计${time}.xls`;
alink.style.display = "none";
const blob = new Blob([res]);
alink.href = URL.createObjectURL(blob);
document.body.appendChild(alink);
alink.click();
URL.revokeObjectURL(alink.href);
}
} catch (error) {
ElMessage({
message: error.message,
type: "error",
});
}
};
// 导出
const confirmExportExcel = async () => {
// Object.assign(formData, { pageSize: 10000, pageNo: 1 });
try {
const res = await exportPartitionDetail(formData);
if (res) {
ElMessage({
message: "导出成功",
type: "success",
});
let time = formatDate(new Date());
let alink = document.createElement("a");
alink.download = `分区充值统计${time}.xls`;
alink.style.display = "none";
const blob = new Blob([res]);
alink.href = URL.createObjectURL(blob);
document.body.appendChild(alink);
alink.click();
URL.revokeObjectURL(alink.href);
}
} catch (error) {
ElMessage({
message: error.message,
type: "error",
});
}
};
// 设置默认日期范围今天到7天前
const setDefaultDateRange = () => {
const today = new Date();
const sevenDaysAgo = new Date();
sevenDaysAgo.setDate(today.getDate() - 7);
dataTime.value = [
dateFormat(sevenDaysAgo, "yyyy-MM-dd"),
dateFormat(today, "yyyy-MM-dd")
dateFormat(today, "yyyy-MM-dd"),
];
};
// 国家明细
const detailDialogFun = (beginDate, channel) => {
detailData.loading = true;
getChargeRecordPartitionRegionDetail({
beginDate,
channel,
partitionId: 8,
}).then((res) => {
if (res.code == 200) {
detailData.data = res.data;
detailData.loading = false;
detailDialog.value = true;
} else {
detailData.loading = false;
ElMessage({
message: res.message,
type: "error",
});
}
});
};
onMounted(() => {
setDefaultDateRange();
getData();
@@ -164,4 +291,4 @@ onMounted(() => {
line-height: 35px;
margin-bottom: 20px;
}
</style>
</style>

View File

@@ -25,25 +25,123 @@
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="date" align="center" label="日期" />
<el-table-column prop="v5payUsd" align="center" label="
V5play充值美元" />
<el-table-column prop="googleUsd" align="center" label="google充值美元" />
<el-table-column prop="razerUsd" align="center" label="razer充值" />
<el-table-column
prop="v5payUsd"
align="center"
label="
V5play充值美元"
>
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'v5pay')"
type="text"
size="medium "
>{{ scope.row.v5payUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="googleUsd" align="center" label="google充值美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'google_play_billing')"
type="text"
size="medium "
>{{ scope.row.googleUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="razerUsd" align="center" label="razer充值">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'razer')"
type="text"
size="medium "
>{{ scope.row.razerUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column
prop="payermaxUsd"
align="center"
label="payermax充值美元"
/>
<el-table-column prop="myCardUsd" align="center" label="myCard充值美元" />
>
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'payermax')"
type="text"
size="medium "
>{{ scope.row.payermaxUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="myCardUsd" align="center" label="myCard充值美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'MyCard')"
type="text"
size="medium "
>{{ scope.row.myCardUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column
prop="startPayUsd"
align="center"
label="startPay充值美元"
/>
<el-table-column prop="iosUsd" align="center" label="ios充值美元" />
<el-table-column prop="companyUsd" align="center" label="对公打款美元" />
<el-table-column prop="totalUsd" align="center" label="总充值美元" />
>
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'start_pay')"
type="text"
size="medium "
>{{ scope.row.startPayUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="iosUsd" align="center" label="ios充值美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'ios_pay')"
type="text"
size="medium "
>{{ scope.row.iosUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="companyUsd" align="center" label="对公打款美元">
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, 'company')"
type="text"
size="medium "
>{{ scope.row.companyUsd }}</el-button
>
</template>
</el-table-column>
<el-table-column prop="totalUsd" align="center" label="总充值美元" >
<template v-slot="scope">
<el-button
@click="detailDialogFun(scope.row.date, '')"
type="text"
size="medium "
>{{ scope.row.totalUsd }}</el-button
>
</template>
</el-table-column>
</el-table>
<!--国家明细弹窗 -->
<el-dialog v-model="detailDialog" title="国家明细" width="25%" center>
<!-- 表格数据 -->
<el-table
v-loading="detailData.loading"
:data="detailData.data"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="regionName" align="center" label="国家" />
<el-table-column prop="usd" align="center" label="充值美元" />
</el-table>
</el-dialog>
</div>
</template>
@@ -56,20 +154,29 @@ export default {
import { ref, onMounted, reactive, computed } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { dateFormat } from "@/utils/system-helper";
import {getChargeRecordPartitionDetail,exportPartitionDetail} from '@/api/users/ChargeRecordPartitionStatisticsView.js'
import {
getChargeRecordPartitionDetail,
exportPartitionDetail,
getChargeRecordPartitionRegionDetail,
} from "@/api/users/ChargeRecordPartitionStatisticsView.js";
import { formatDate } from "@/utils/relDate";
const dataTime = ref([]);
const formData = reactive({
beginDate: "",
endDate: "",
partitionId:4
partitionId: 4,
});
const tableData = reactive({
data: [],
total: 0,
loading: false,
});
const detailDialog = ref(false);
const detailData = reactive({
data: [],
loading: false,
});
// 查询
const getData = () => {
tableData.loading = true;
@@ -81,50 +188,70 @@ const getData = () => {
formData.endDate = dataTime.value;
}
getChargeRecordPartitionDetail(formData).then((res) => {
tableData.data = res;
tableData.loading = false;
tableData.data = res;
tableData.loading = false;
});
};
// 导出
const confirmExportExcel = async () => {
// Object.assign(formData, { pageSize: 10000, pageNo: 1 });
try {
const res = await exportPartitionDetail(formData);
if (res) {
ElMessage({
message: "导出成功",
type: "success",
});
let time = formatDate(new Date());
let alink = document.createElement("a");
alink.download = `分区充值统计${time}.xls`;
alink.style.display = "none";
const blob = new Blob([res]);
alink.href = URL.createObjectURL(blob);
document.body.appendChild(alink);
alink.click();
URL.revokeObjectURL(alink.href);
}
} catch (error) {
ElMessage({
message: error.message,
type: "error",
});
}
};
// 导出
const confirmExportExcel = async () => {
// Object.assign(formData, { pageSize: 10000, pageNo: 1 });
try {
const res = await exportPartitionDetail(formData);
if (res) {
ElMessage({
message: "导出成功",
type: "success",
});
let time = formatDate(new Date());
let alink = document.createElement("a");
alink.download = `分区充值统计${time}.xls`;
alink.style.display = "none";
const blob = new Blob([res]);
alink.href = URL.createObjectURL(blob);
document.body.appendChild(alink);
alink.click();
URL.revokeObjectURL(alink.href);
}
} catch (error) {
ElMessage({
message: error.message,
type: "error",
});
}
};
// 设置默认日期范围今天到7天前
const setDefaultDateRange = () => {
const today = new Date();
const sevenDaysAgo = new Date();
sevenDaysAgo.setDate(today.getDate() - 7);
dataTime.value = [
dateFormat(sevenDaysAgo, "yyyy-MM-dd"),
dateFormat(today, "yyyy-MM-dd")
dateFormat(today, "yyyy-MM-dd"),
];
};
// 国家明细
const detailDialogFun = (beginDate, channel) => {
detailData.loading = true;
getChargeRecordPartitionRegionDetail({
beginDate,
channel,
partitionId: 4,
}).then((res) => {
if (res.code == 200) {
detailData.data = res.data;
detailData.loading = false;
detailDialog.value = true;
} else {
detailData.loading = false;
ElMessage({
message: res.message,
type: "error",
});
}
});
};
onMounted(() => {
setDefaultDateRange();
getData();
@@ -164,4 +291,4 @@ onMounted(() => {
line-height: 35px;
margin-bottom: 20px;
}
</style>
</style>