You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
967 lines
28 KiB
967 lines
28 KiB
<script setup>
|
|
import { ref, onMounted, reactive, computed, nextTick } from 'vue'
|
|
import ElementPlus from 'element-plus'
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
import { AiFillRead } from 'vue-icons-plus/ai'
|
|
import axios from 'axios'
|
|
import moment from 'moment'
|
|
import API from '@/util/http'
|
|
import * as XLSX from 'xlsx' // 引入 xlsx 库
|
|
|
|
// 提取 XLSX 工具函数
|
|
const { utils, writeFile } = XLSX
|
|
|
|
// 变量
|
|
//这是获取用户信息的接口
|
|
const adminData = ref({})
|
|
const getAdminData = async function () {
|
|
try {
|
|
const result = await API({ url: '/admin/userinfo', data: {} })
|
|
adminData.value = result
|
|
console.log('请求成功', result)
|
|
console.log('用户信息', adminData.value)
|
|
} catch (error) {
|
|
console.log('请求失败', error)
|
|
}
|
|
}
|
|
// 充值明细表格
|
|
const tableData = ref([])
|
|
// 搜索======================================
|
|
// 搜索rechargeVo
|
|
const rechargeVo = ref({
|
|
activityId: '',
|
|
rechargeWay: '',
|
|
area: '',
|
|
startDate: '',
|
|
endDate: '',
|
|
status: ''
|
|
})
|
|
// 搜索对象
|
|
const getObj = ref({
|
|
pageNum: 1,
|
|
pageSize: 50
|
|
})
|
|
//分页总条目
|
|
const total = ref(100)
|
|
// 搜索对象时间
|
|
const getTime = ref([])
|
|
// 搜索活动列表
|
|
const activity = ref([])
|
|
// 所有信息
|
|
const allData = ref([])
|
|
// 搜索地区列表
|
|
const area = ref([])
|
|
|
|
//标签页默认高亮选项
|
|
const activeName = ref('all')
|
|
|
|
// 充值方式选项
|
|
const rechargeWay = ref([])
|
|
// 获取充值方式的数据的接口
|
|
const getPayWay = async function () {
|
|
try {
|
|
const result = await API({ url: '/recharge/recharge/getWay', data: {} })
|
|
rechargeWay.value = result.data.filter((item) => item)
|
|
console.log('请求成功', result)
|
|
console.log('充值方式', rechargeWay.value)
|
|
} catch (error) {
|
|
console.log('请求失败', error)
|
|
}
|
|
}
|
|
|
|
// 方法
|
|
// 合计数存储
|
|
const trueGold = ref(0)
|
|
const trueRGold = ref(0)
|
|
const trueFGold = ref(0)
|
|
//全部
|
|
const totalmoney = ref(0)
|
|
const totalRcoin = ref(0)
|
|
const totalFcoin = ref(0)
|
|
//待审核
|
|
const pendingGold = ref(0)
|
|
const pendingRGold = ref(0)
|
|
const pendingFGold = ref(0)
|
|
// 已通过金币数
|
|
const approvedGold = ref(0)
|
|
const approvedRGold = ref(0)
|
|
const approvedFGold = ref(0)
|
|
// 已驳回金币数
|
|
const rejectedGold = ref(0)
|
|
const rejectedRGold = ref(0)
|
|
const rejectedFGold = ref(0)
|
|
// 搜索==============================================================
|
|
// 搜索方法
|
|
const get = async function (val) {
|
|
try {
|
|
// 地区赋值
|
|
if (adminData.value.area === '泰国') {
|
|
rechargeVo.value.areas = ['泰国', '越南']
|
|
} else if (adminData.value.area !== '总部') {
|
|
rechargeVo.value.area = adminData.value.area
|
|
}
|
|
// 搜索参数页码赋值
|
|
if (typeof val === 'number') {
|
|
getObj.value.pageNum = val
|
|
}
|
|
// 搜索参数时间赋值
|
|
if (getTime.value != null) {
|
|
if (getTime.value[0] && getTime.value[1]) {
|
|
rechargeVo.value.startDate = getTime.value[0]
|
|
rechargeVo.value.endDate = getTime.value[1]
|
|
}
|
|
} else {
|
|
rechargeVo.value.startDate = ''
|
|
rechargeVo.value.endDate = ''
|
|
}
|
|
|
|
// 搜索参数赋值
|
|
rechargeVo.value.sortField = sortField.value
|
|
rechargeVo.value.sortOrder = sortOrder.value
|
|
console.log('搜索参数', getObj.value)
|
|
// 发送POST请求
|
|
const result = await API({
|
|
url: '/recharge/recharge',
|
|
data: { ...getObj.value, rechargeVo: { ...rechargeVo.value } }
|
|
})
|
|
// 复制一份 rechargeVo.value 并移除排序字段和排序方式
|
|
const detailWithoutSort = ref({
|
|
area: rechargeVo.value.area,
|
|
adminId: rechargeVo.value.adminId,
|
|
startDate: rechargeVo.value.startDate,
|
|
endDate: rechargeVo.value.endDate
|
|
})
|
|
const result2 = await API({
|
|
url: '/recharge/recharge/RechargeA',
|
|
data: {
|
|
...detailWithoutSort.value
|
|
}
|
|
})
|
|
|
|
// 检查 result2 是否为空
|
|
if (!result2 || !result2.data || result2.data.length === 0) {
|
|
totalmoney.value = 0
|
|
totalRcoin.value = 0
|
|
totalFcoin.value = 0
|
|
}
|
|
if (result2.data) {
|
|
result2.data.forEach((item) => {
|
|
switch (item.auditStatus) {
|
|
case '待审核':
|
|
// 若 item.raudit 为空则赋值为 0
|
|
// 若 item.sumRaudit 为空则赋值为 0
|
|
pendingGold.value = item.sumRaudit || 0
|
|
pendingRGold.value = item.sumRaudit1 || 0
|
|
pendingFGold.value = item.sumRaudit2 || 0
|
|
break
|
|
case '已通过':
|
|
approvedGold.value = item.sumRaudit || 0
|
|
approvedRGold.value = item.sumRaudit1 || 0
|
|
approvedFGold.value = item.sumRaudit2 || 0
|
|
break
|
|
case '已驳回':
|
|
rejectedGold.value = item.sumRaudit || 0
|
|
rejectedRGold.value = item.sumRaudit1 || 0
|
|
rejectedFGold.value = item.sumRaudit2 || 0
|
|
break
|
|
}
|
|
})
|
|
}
|
|
trueGold.value = pendingGold.value + approvedGold.value + rejectedGold.value
|
|
trueRGold.value =
|
|
pendingRGold.value + approvedRGold.value + rejectedRGold.value
|
|
trueFGold.value =
|
|
pendingFGold.value + approvedFGold.value + rejectedFGold.value
|
|
|
|
// 将响应结果存储到响应式数据中
|
|
console.log('请求成功', result)
|
|
// 存储表格数据
|
|
tableData.value = result.data.list
|
|
console.log('tableData', tableData.value)
|
|
// 存储分页总数
|
|
total.value = result.data.total
|
|
console.log('total', total.value)
|
|
} catch (error) {
|
|
console.log('请求失败', error)
|
|
// 在这里可以处理错误逻辑,比如显示错误提示等
|
|
}
|
|
}
|
|
// 搜索
|
|
const search = function () {
|
|
getObj.value.pageNum = 1
|
|
get()
|
|
}
|
|
// 重置
|
|
const reset = function () {
|
|
rechargeVo.value.activityId = ''
|
|
rechargeVo.value.rechargeWay = ''
|
|
rechargeVo.value.area = ''
|
|
rechargeVo.value.startDate = ''
|
|
rechargeVo.value.endDate = ''
|
|
sortField.value = ''
|
|
sortOrder.value = ''
|
|
getTime.value = []
|
|
}
|
|
// 今天
|
|
const getToday = function () {
|
|
const today = new Date()
|
|
const startDate = new Date(
|
|
today.getFullYear(),
|
|
today.getMonth(),
|
|
today.getDate()
|
|
)
|
|
// 设置结束时间为当天的 23:59:59
|
|
const endDate = new Date(
|
|
today.getFullYear(),
|
|
today.getMonth(),
|
|
today.getDate(),
|
|
23, 59, 59
|
|
)
|
|
getTime.value = [startDate, endDate]
|
|
// 格式化时间
|
|
rechargeVo.value.startDate = moment(startDate).format('YYYY-MM-DD HH:mm:ss')
|
|
rechargeVo.value.endDate = moment(endDate).format('YYYY-MM-DD HH:mm:ss')
|
|
console.log('getTime', getTime.value)
|
|
get()
|
|
}
|
|
|
|
// 昨天
|
|
const getYesterday = function () {
|
|
const yesterday = new Date()
|
|
yesterday.setDate(yesterday.getDate() - 1)
|
|
const startDate = new Date(
|
|
yesterday.getFullYear(),
|
|
yesterday.getMonth(),
|
|
yesterday.getDate()
|
|
)
|
|
// 设置结束时间为昨天的 23:59:59
|
|
const endDate = new Date(
|
|
yesterday.getFullYear(),
|
|
yesterday.getMonth(),
|
|
yesterday.getDate(),
|
|
23, 59, 59
|
|
)
|
|
getTime.value = [startDate, endDate]
|
|
// 格式化时间
|
|
rechargeVo.value.startDate = moment(startDate).format('YYYY-MM-DD HH:mm:ss')
|
|
rechargeVo.value.endDate = moment(endDate).format('YYYY-MM-DD HH:mm:ss')
|
|
console.log('getTime', getTime.value)
|
|
get()
|
|
}
|
|
|
|
// 近7天
|
|
const get7Days = function () {
|
|
const today = new Date()
|
|
const startDate = new Date(
|
|
today.getFullYear(),
|
|
today.getMonth(),
|
|
today.getDate() - 6
|
|
)
|
|
// 设置结束时间为当天的 23:59:59
|
|
const endDate = new Date(
|
|
today.getFullYear(),
|
|
today.getMonth(),
|
|
today.getDate(),
|
|
23, 59, 59
|
|
)
|
|
getTime.value = [startDate, endDate]
|
|
// 格式化时间
|
|
rechargeVo.value.startDate = moment(startDate).format('YYYY-MM-DD HH:mm:ss')
|
|
rechargeVo.value.endDate = moment(endDate).format('YYYY-MM-DD HH:mm:ss')
|
|
console.log('getTime', getTime.value)
|
|
get()
|
|
}
|
|
//全部充值明细
|
|
const adminAll = function () {
|
|
console.log('adminAll')
|
|
rechargeVo.value.status = ''
|
|
getObj.value.pageNum = 1
|
|
get()
|
|
}
|
|
//待审核充值明细
|
|
const adminWait = async function () {
|
|
rechargeVo.value.status = 0
|
|
getObj.value.pageNum = 1
|
|
await get()
|
|
console.log('adminWait')
|
|
trueGold.value = pendingGold.value
|
|
trueRGold.value = pendingRGold.value
|
|
trueFGold.value = pendingFGold.value
|
|
}
|
|
//已通过充值明细
|
|
const adminPass = async function () {
|
|
rechargeVo.value.status = 1
|
|
getObj.value.pageNum = 1
|
|
await get()
|
|
console.log('adminPass')
|
|
trueGold.value = approvedGold.value
|
|
trueRGold.value = approvedRGold.value
|
|
trueFGold.value = approvedFGold.value
|
|
}
|
|
//已驳回充值明细
|
|
const adminReject = async function () {
|
|
rechargeVo.value.status = 2
|
|
getObj.value.pageNum = 1
|
|
await get()
|
|
trueGold.value = rejectedGold.value
|
|
trueRGold.value = rejectedRGold.value
|
|
trueFGold.value = rejectedFGold.value
|
|
console.log('adminReject')
|
|
}
|
|
//点击标签页
|
|
const handleClick = function (tab, event) {
|
|
if (tab.props.name === 'all') {
|
|
adminAll()
|
|
} else if (tab.props.name === 'wait') {
|
|
adminWait()
|
|
} else if (tab.props.name === 'pass') {
|
|
adminPass()
|
|
} else if (tab.props.name === 'reject') {
|
|
adminReject()
|
|
}
|
|
}
|
|
// 获取活动名称
|
|
const getActivity = async function () {
|
|
try {
|
|
// 发送POST请求
|
|
const result = await API({ url: '/recharge/activity/select', data: {} })
|
|
|
|
// 将响应结果存储到响应式数据中
|
|
console.log('请求成功', result)
|
|
// 存储表格数据
|
|
activity.value = result.data
|
|
console.log('activity', activity.value)
|
|
} catch (error) {
|
|
console.log('请求失败', error)
|
|
// 在这里可以处理错误逻辑,比如显示错误提示等
|
|
}
|
|
}
|
|
// 获取地区
|
|
const getArea = async function () {
|
|
console.log('888888888880000000')
|
|
try {
|
|
// 发送POST请求
|
|
const result = await API({ url: '/recharge/user/search', data: {} })
|
|
|
|
// 将响应结果存储到响应式数据中
|
|
console.log('请求成功地区', result.data)
|
|
// 存储地区信息
|
|
area.value = result.data
|
|
console.log('地区', area.value)
|
|
} catch (error) {
|
|
console.log('请求失败', error)
|
|
// 在这里可以处理错误逻辑,比如显示错误提示等
|
|
}
|
|
}
|
|
|
|
// 验证跳转输入框的数字是否合法
|
|
const checkNumber = function () {
|
|
if (typeof parseInt(getObj.value.pageNum) === 'number') {
|
|
console.log('总共有多少页' + Math.ceil(total.value / getObj.value.pageSize))
|
|
if (
|
|
getObj.value.pageNum > 0 &&
|
|
getObj.value.pageNum <= Math.ceil(total.value / getObj.value.pageSize)
|
|
) {
|
|
getObj.value.pageNum = parseInt(getObj.value.pageNum)
|
|
console.log('输入的数字合法')
|
|
get()
|
|
} else {
|
|
//提示
|
|
ElMessage({
|
|
type: 'error',
|
|
message: '请检查输入内容'
|
|
})
|
|
}
|
|
} else {
|
|
//提示
|
|
ElMessage({
|
|
type: 'error',
|
|
message: '请检查输入内容'
|
|
})
|
|
}
|
|
}
|
|
|
|
// 挂载
|
|
onMounted(async function () {
|
|
getAdminData()
|
|
get()
|
|
getActivity()
|
|
getPayWay()
|
|
getArea()
|
|
})
|
|
|
|
const handlePageSizeChange = function (val) {
|
|
getObj.value.pageSize = val
|
|
get()
|
|
}
|
|
const handleCurrentChange = function (val) {
|
|
getObj.value.pageNum = val
|
|
get()
|
|
}
|
|
// 新增排序字段和排序方式
|
|
const sortField = ref('')
|
|
const sortOrder = ref('')
|
|
// 处理排序事件
|
|
const handleSortChange = (column) => {
|
|
console.log('排序字段:', column.prop)
|
|
console.log('排序方式:', column.order)
|
|
if (column.prop === 'paidGold') {
|
|
sortField.value = 'recharge_gold'
|
|
} else if (column.prop === 'freeGold') {
|
|
sortField.value = 'free_gold'
|
|
} else if (column.prop === 'rechargeTime') {
|
|
sortField.value = 'recharge_time'
|
|
} else if (column.prop === 'createTime') {
|
|
sortField.value = 'create_time'
|
|
} else if (column.prop === 'paidMoney') {
|
|
sortField.value = 'paid_gold'
|
|
}
|
|
sortOrder.value = column.order === 'ascending' ? 'ASC' : 'DESC'
|
|
get()
|
|
}
|
|
|
|
// 导出Excel相关变量和方法
|
|
const headers = [
|
|
'序号',
|
|
'姓名',
|
|
'精网号',
|
|
'所属地区',
|
|
'活动名称',
|
|
'货币名称',
|
|
'充值金额',
|
|
'充值方式',
|
|
'永久金币',
|
|
'免费金币',
|
|
'备注',
|
|
'支付方式',
|
|
'提交人',
|
|
'状态',
|
|
'驳回理由',
|
|
'交款时间'
|
|
]
|
|
|
|
const showExportInfoPanel = ref(false)
|
|
|
|
// 点击导出按钮直接显示信息面板
|
|
const exportExcel = async () => {
|
|
try {
|
|
console.log('点击导出按钮,尝试显示信息面板');
|
|
showExportInfoPanel.value = true;
|
|
await nextTick(); // 组件更新显示信息面板
|
|
} catch (error) {
|
|
console.error('显示信息面板失败:', error);
|
|
ElMessage.error('显示信息面板失败,请稍后重试');
|
|
}
|
|
};
|
|
|
|
// 新增导出状态相关变量
|
|
const exportProgress = ref(0)
|
|
const isExporting = ref(false)
|
|
const exportCancelToken = ref(null)
|
|
|
|
// 移除未使用的映射
|
|
// const platformMap = {
|
|
// 0: '初始化金币',
|
|
// 1: 'ERP系统',
|
|
// 2: 'Homily Chart',
|
|
// 3: 'Homily Link',
|
|
// 4: '金币系统'
|
|
// };
|
|
// const updateTypeMap = {
|
|
// 0: '充值',
|
|
// 1: '消费',
|
|
// 2: '退款',
|
|
// 3: '其他'
|
|
// };
|
|
|
|
// 优化后的导出方法
|
|
const doExportExcel = async () => {
|
|
try {
|
|
isExporting.value = true
|
|
exportProgress.value = 0
|
|
showExportInfoPanel.value = false
|
|
|
|
// 初始化 Excel
|
|
const wb = utils.book_new()
|
|
const ws = utils.aoa_to_sheet([headers])
|
|
utils.book_append_sheet(wb, ws, 'Sheet1')
|
|
|
|
// 流式写入配置
|
|
const writer = {
|
|
write: (d, o) => {
|
|
if (!d) return
|
|
utils.sheet_add_aoa(ws, d, { origin: -1 })
|
|
}
|
|
}
|
|
|
|
let page = 1
|
|
let totalExported = 0
|
|
const pageSize = 5000 // 每次请求 5000 条
|
|
let totalRecords = 0
|
|
|
|
// 首次请求获取总记录数
|
|
const firstResult = await API({
|
|
url: '/recharge/recharge',
|
|
method: 'post',
|
|
data: {
|
|
pageNum: 1,
|
|
pageSize,
|
|
rechargeVo: { ...rechargeVo.value }
|
|
}
|
|
})
|
|
totalRecords = firstResult.data.total
|
|
|
|
// 创建取消令牌
|
|
const CancelToken = axios.CancelToken
|
|
exportCancelToken.value = CancelToken.source()
|
|
|
|
// 处理首次请求的数据
|
|
const firstData = firstResult.data.list
|
|
if (firstData.length) {
|
|
const rows = firstData.map((row, index) => [
|
|
totalExported + index + 1,
|
|
row.username || '',
|
|
row.jwcode || '',
|
|
row.area || '',
|
|
row.activityName || '',
|
|
// 假设货币名称字段在数据中为 currencyName,若不存在请替换为实际字段
|
|
row.currencyName || '',
|
|
(row.paidGold / 100).toFixed(2) || '0.00',
|
|
row.rechargeWay || '',
|
|
(row.paidGold / 100).toFixed(2) || '0.00',
|
|
(row.freeGold / 100).toFixed(2) || '0.00',
|
|
row.remark || '',
|
|
row.payWay || '',
|
|
row.name || '',
|
|
// 根据状态值显示对应文本
|
|
row.status === 1 ? '已通过' : row.status === 0 ? '待审核' : row.status === 2 ? '已驳回' : '',
|
|
row.reson || '',
|
|
moment(row.rechargeTime).format('YYYY-MM-DD HH:mm:ss') || ''
|
|
])
|
|
writer.write(rows)
|
|
totalExported += firstData.length
|
|
exportProgress.value = Math.round((totalExported / totalRecords) * 100)
|
|
page++
|
|
}
|
|
|
|
while (totalExported < totalRecords) {
|
|
const result = await API({
|
|
url: '/recharge/recharge',
|
|
method: 'post',
|
|
data: {
|
|
pageNum: page,
|
|
pageSize,
|
|
rechargeVo: { ...rechargeVo.value }
|
|
},
|
|
cancelToken: exportCancelToken.value.token
|
|
})
|
|
|
|
const data = result.data.list
|
|
if (!data.length) break
|
|
|
|
// 转换数据
|
|
const rows = data.map((row, index) => [
|
|
totalExported + index + 1,
|
|
row.username || '',
|
|
row.jwcode || '',
|
|
row.area || '',
|
|
row.activityName || '',
|
|
// 假设货币名称字段在数据中为 currencyName,若不存在请替换为实际字段
|
|
row.currencyName || '',
|
|
(row.paidGold / 100).toFixed(2) || '0.00',
|
|
row.rechargeWay || '',
|
|
(row.paidGold / 100).toFixed(2) || '0.00',
|
|
(row.freeGold / 100).toFixed(2) || '0.00',
|
|
row.remark || '',
|
|
row.payWay || '',
|
|
row.name || '',
|
|
// 根据状态值显示对应文本
|
|
row.status === 1 ? '已通过' : row.status === 0 ? '待审核' : row.status === 2 ? '已驳回' : '',
|
|
row.reson || '',
|
|
moment(row.rechargeTime).format('YYYY-MM-DD HH:mm:ss') || ''
|
|
])
|
|
|
|
// 流式写入
|
|
writer.write(rows)
|
|
totalExported += data.length
|
|
exportProgress.value = Math.round((totalExported / totalRecords) * 100)
|
|
|
|
// 内存控制:每 500 页释放内存
|
|
if (page % 500 === 0) {
|
|
await new Promise(resolve => setTimeout(resolve, 0))
|
|
}
|
|
|
|
page++
|
|
}
|
|
|
|
// 生成最终文件
|
|
writeFile(wb, '客户金币明细.xlsx')
|
|
ElMessage.success(`导出成功,共${totalExported}条数据`)
|
|
} catch (error) {
|
|
if (!axios.isCancel(error)) {
|
|
ElMessage.error(`导出失败: ${error.message}`)
|
|
}
|
|
} finally {
|
|
isExporting.value = false
|
|
exportCancelToken.value = null
|
|
}
|
|
}
|
|
|
|
// 新增取消导出方法
|
|
const cancelExport = () => {
|
|
if (exportCancelToken.value) {
|
|
exportCancelToken.value.cancel('用户取消导出')
|
|
ElMessage.warning('导出已取消')
|
|
isExporting.value = false
|
|
}
|
|
}
|
|
|
|
const putExcel = ref({
|
|
startDate: new Date(),
|
|
endDate: new Date(new Date().setDate(new Date().getDate() + 1))
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<el-row>
|
|
<el-col>
|
|
<el-card style="margin-bottom: 20px">
|
|
<el-row style="margin-bottom: 10px">
|
|
<el-col :span="6">
|
|
<div class="head-card-element">
|
|
<el-text class="mx-1" size="large">活动名称:</el-text>
|
|
<el-select
|
|
v-model="rechargeVo.activityId"
|
|
placeholder="请选择活动名称"
|
|
size="large"
|
|
style="width: 240px"
|
|
clearable
|
|
>
|
|
<el-option
|
|
v-for="item in activity"
|
|
:key="item.activityId"
|
|
:label="item.activityName"
|
|
:value="item.activityId"
|
|
/>
|
|
</el-select>
|
|
</div>
|
|
</el-col>
|
|
<!-- <el-col :span="8">
|
|
<div class="head-card-element">
|
|
<el-text class="mx-1" size="large">充值方式:</el-text>
|
|
<el-select
|
|
v-model="rechargeVo.rechargeWay"
|
|
placeholder="请选择充值方式"
|
|
size="large"
|
|
style="width: 240px"
|
|
clearable
|
|
>
|
|
<el-option
|
|
v-for="item in rechargeWay"
|
|
:key="item"
|
|
:label="item"
|
|
:value="item"
|
|
/>
|
|
</el-select>
|
|
</div>
|
|
</el-col>-->
|
|
<el-col :span="8">
|
|
<div class="head-card-element" v-if="adminData.area == '总部'">
|
|
<el-text class="mx-1" size="large">所属地区:</el-text>
|
|
<el-select
|
|
v-model="rechargeVo.area"
|
|
placeholder="请选择所属地区"
|
|
size="large"
|
|
style="width: 240px"
|
|
clearable
|
|
>
|
|
<el-option
|
|
v-for="item in area"
|
|
:key="item"
|
|
:label="item"
|
|
:value="item"
|
|
/>
|
|
</el-select>
|
|
</div>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="16">
|
|
<div class="head-card-element">
|
|
<el-text class="mx-1" size="large">充值时间:</el-text>
|
|
<el-date-picker
|
|
v-model="getTime"
|
|
type="datetimerange"
|
|
range-separator="至"
|
|
start-placeholder="起始时间"
|
|
end-placeholder="结束时间"
|
|
/>
|
|
<el-button style="margin-left: 10px" @click="getToday()"
|
|
>今</el-button
|
|
>
|
|
<el-button @click="getYesterday()">昨</el-button>
|
|
<el-button @click="get7Days()">近7天</el-button>
|
|
</div>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<div class="head-card-btn">
|
|
<el-button type="success" @click="reset()">重置</el-button>
|
|
<el-button type="primary" @click="search()">查询</el-button>
|
|
<!-- 新增导出按钮 -->
|
|
<el-button type="primary" @click="exportExcel">导出excel</el-button>
|
|
</div>
|
|
</el-col>
|
|
</el-row>
|
|
</el-card>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col>
|
|
<el-card>
|
|
<el-tabs
|
|
v-model="activeName"
|
|
type="card"
|
|
class="demo-tabs"
|
|
@tab-click="handleClick"
|
|
>
|
|
<el-tab-pane label="全部" name="all"></el-tab-pane>
|
|
<el-tab-pane label="待审核" name="wait"></el-tab-pane>
|
|
<el-tab-pane label="已通过" name="pass"></el-tab-pane>
|
|
<el-tab-pane label="已驳回" name="reject"></el-tab-pane>
|
|
<div>
|
|
充值金额:{{ (trueRGold / 100).toFixed(2) }}新币,永久金币:{{
|
|
(trueRGold / 100).toFixed(2)
|
|
}}金币,免费金币:{{ (totalFcoin / 100).toFixed(2) }}金币
|
|
</div>
|
|
</el-tabs>
|
|
<!-- 设置表格容器的高度和滚动样式 -->
|
|
<div style="height: 520px; overflow-y: auto">
|
|
<el-table
|
|
:data="tableData"
|
|
style="width: 100%"
|
|
height="520px"
|
|
@sort-change="handleSortChange"
|
|
>
|
|
<el-table-column
|
|
type="index"
|
|
label="序号"
|
|
width="70px"
|
|
fixed="left"
|
|
>
|
|
<template #default="scope">
|
|
<span>{{
|
|
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
|
|
}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
fixed="left"
|
|
prop="username"
|
|
label="姓名"
|
|
width="100px"
|
|
/>
|
|
<el-table-column
|
|
fixed="left"
|
|
prop="jwcode"
|
|
label="精网号"
|
|
width="110px"
|
|
/>
|
|
<el-table-column prop="area" label="所属地区" width="100px" />
|
|
<el-table-column
|
|
prop="activityName"
|
|
label="活动名称"
|
|
width="150px"
|
|
/>
|
|
<el-table-column prop="" label="货币名称" width="120px" />
|
|
<el-table-column
|
|
prop="paidMoney"
|
|
label="充值金额"
|
|
width="120px"
|
|
sortable=" custom"
|
|
>
|
|
<template #default="scope">
|
|
<span>{{ scope.row.paidGold / 100 }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="rechargeWay"
|
|
label="充值方式"
|
|
width="100px"
|
|
/>
|
|
<el-table-column
|
|
prop="paidGold"
|
|
label="永久金币"
|
|
sortable="“custom”"
|
|
width="110px"
|
|
>
|
|
<template #default="scope">
|
|
<span>{{ scope.row.paidGold / 100 }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="freeGold"
|
|
label="免费金币"
|
|
sortable="“custom”"
|
|
width="110px"
|
|
>
|
|
<template #default="scope">
|
|
<span>{{ scope.row.freeGold / 100 }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="remark"
|
|
label="备注"
|
|
width="200px"
|
|
show-overflow-tooltip
|
|
/>
|
|
<el-table-column prop="payWay" label="支付方式" width="100px" />
|
|
<el-table-column
|
|
prop="rechargeVoucher"
|
|
label="支付凭证"
|
|
width="150px"
|
|
>
|
|
<template #default="scope">
|
|
<el-image
|
|
:preview-src-list="[scope.row.rechargeVoucher]"
|
|
:preview-teleported="true"
|
|
:src="scope.row.rechargeVoucher"
|
|
alt="凭证"
|
|
style="width: 50px; height: 50px"
|
|
/>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="name" label="提交人" width="100px" />
|
|
<el-table-column prop="status" label="状态" width="100px">
|
|
<template #default="scope">
|
|
<span v-if="scope.row.status === 1">
|
|
<div class="status">
|
|
<span class="green-dot"></span>
|
|
<span>已通过</span>
|
|
</div>
|
|
</span>
|
|
<span v-if="scope.row.status === 0">
|
|
<div class="status">
|
|
<span class="grey-dot"></span>
|
|
<span>待审核</span>
|
|
</div>
|
|
</span>
|
|
<span v-if="scope.row.status === 2">
|
|
<div class="status">
|
|
<span class="red-dot"></span>
|
|
<span>已驳回</span>
|
|
</div>
|
|
</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="reson"
|
|
label="驳回理由"
|
|
width="200px"
|
|
show-overflow-tooltip
|
|
/>
|
|
<el-table-column
|
|
prop="rechargeTime"
|
|
sortable="“custom”"
|
|
label="交款时间"
|
|
width="200px"
|
|
>
|
|
<template #default="scope">
|
|
{{
|
|
moment(scope.row.rechargeTime).format('YYYY-MM-DD HH:mm:ss')
|
|
}}
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="createTime"
|
|
sortable="“custom”"
|
|
label="提交时间"
|
|
width="200px"
|
|
/>
|
|
</el-table>
|
|
</div>
|
|
|
|
<!-- 分页 -->
|
|
<div class="pagination" style="margin-top: 20px">
|
|
<el-pagination
|
|
background
|
|
:page-size="getObj.pageSize"
|
|
:page-sizes="[5, 10, 20, 50, 100]"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
:total="total"
|
|
@size-change="handlePageSizeChange"
|
|
@current-change="handleCurrentChange"
|
|
></el-pagination>
|
|
</div>
|
|
</el-card>
|
|
</el-col>
|
|
</el-row>
|
|
|
|
<!-- 导出excel提前展示的信息面板 -->
|
|
<el-dialog
|
|
v-model="showExportInfoPanel"
|
|
title="导出信息确认"
|
|
width="400px"
|
|
:close-on-click-modal="false"
|
|
>
|
|
<div class="info-panel-header">导出信息</div>
|
|
<div v-if="!rechargeVo.activityId && !rechargeVo.area && !rechargeVo.startDate && !rechargeVo.endDate">
|
|
你正在导出所有数据
|
|
</div>
|
|
<div v-else>
|
|
你正在导出以下数据
|
|
</div>
|
|
<div v-if="rechargeVo.activityId">活动名称:{{ rechargeVo.activityId || '' }}</div>
|
|
<div v-if="rechargeVo.area">所属地区:{{ rechargeVo.area || '' }}</div>
|
|
<div v-if="rechargeVo.startDate || rechargeVo.endDate">
|
|
<span>充值时间:</span>
|
|
<span>{{ rechargeVo.startDate ? moment(rechargeVo.startDate).format('YYYY-MM-DD HH:mm:ss') : '无起始时间' }} 至 {{ rechargeVo.endDate ? moment(rechargeVo.endDate).format('YYYY-MM-DD HH:mm:ss') : '无结束时间' }}</span>
|
|
</div>
|
|
<template #footer>
|
|
<span class="dialog-footer">
|
|
<el-button @click="showExportInfoPanel = false">取消</el-button>
|
|
<el-button type="primary" @click="doExportExcel">导出</el-button>
|
|
</span>
|
|
</template>
|
|
</el-dialog>
|
|
|
|
<!-- 导出进度弹窗 -->
|
|
<el-dialog
|
|
v-model="isExporting"
|
|
title="正在导出"
|
|
width="400px"
|
|
:close-on-click-modal="false"
|
|
:show-close="false"
|
|
>
|
|
<el-progress
|
|
:percentage="exportProgress"
|
|
:format="(percentage) => `${percentage}%`"
|
|
/>
|
|
<template #footer>
|
|
<span class="dialog-footer">
|
|
<el-button type="danger" @click="cancelExport">取消导出</el-button>
|
|
</span>
|
|
</template>
|
|
</el-dialog>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.pagination {
|
|
display: flex;
|
|
}
|
|
|
|
.status {
|
|
display: flex;
|
|
}
|
|
|
|
.head-card {
|
|
display: flex;
|
|
}
|
|
|
|
.head-card-element {
|
|
margin-right: 20px;
|
|
}
|
|
|
|
.head-card-btn {
|
|
margin-left: auto;
|
|
}
|
|
</style>
|