审核列表添加字段
This commit is contained in:
parent
11dc5759ce
commit
27c1c02dcf
|
|
@ -8,3 +8,8 @@ export const getRechargeCheckListApi = (params: any) => {
|
|||
export const reviewRechargeOrder = (params: any) => {
|
||||
return request.post('/user/reviewRechargeOrder', { ...params })
|
||||
}
|
||||
|
||||
// 获取充值渠道选项(下拉框用)
|
||||
export const getRechargeChannelOptions = () => {
|
||||
return request.get('/user/rechargeChannelOptions', undefined, { showMessage: false })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
import { request } from '@/api'
|
||||
|
||||
// 获取取款渠道选项(下拉框用)
|
||||
export const getWithdrawChannelOptions = () => {
|
||||
return request.get('/withdraw/withdrawChannelOptions', undefined, { showMessage: false })
|
||||
}
|
||||
|
||||
// 获取用户钱包信息
|
||||
export const getWalletCapital = () => {
|
||||
return request.get('/user/getWalletCapital', undefined, { showMessage: false })
|
||||
|
|
@ -53,6 +58,7 @@ export const getWithdrawReviewList = (params: {
|
|||
start_time?: string
|
||||
end_time?: string
|
||||
user_name?: string
|
||||
channel_id?: number
|
||||
}) => {
|
||||
return request.get('/withdraw/withdrawReviewList', params as any)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,22 +59,23 @@ export const tableColumns = [
|
|||
// 用户名
|
||||
{ prop: 'username', label: '用户名' },
|
||||
//单号
|
||||
{ prop: 'orderNo', label: '单号' },
|
||||
{ prop: 'account_id', label: '子账号' },
|
||||
{ prop: 'orderNo', label: '单号' , width:'200' },
|
||||
{ prop: 'account_id', label: '子账号'},
|
||||
//操作类型
|
||||
{ prop: 'type', label: '操作类型' },
|
||||
{ prop: 'type', label: '操作类型', width:'120' },
|
||||
//资金流向
|
||||
// { prop: 'fundDirection', label: '资金流向' },
|
||||
//原有金额
|
||||
{ prop: 'amount', label: '变动金额', isNumber: true },
|
||||
{ prop: 'amount', label: '变动金额', isNumber: true , width:'120' },
|
||||
{ prop: 'description', label: '描述', isNumber: true , width:'120'},
|
||||
//余额变动
|
||||
{ prop: 'balance', label: '变动后余额' , isNumber: true},
|
||||
{ prop: 'balance', label: '变动后余额' , isNumber: true, width:'120' },
|
||||
//现有余额
|
||||
// { prop: 'currentBalance', label: '现有余额' },
|
||||
//状态
|
||||
// { prop: 'status', label: '状态' },
|
||||
//创建时间
|
||||
{ prop: 'createTime', label: '创建时间' },
|
||||
{ prop: 'createTime', label: '创建时间' , width:'180' },
|
||||
//钱包类型
|
||||
{ prop: 'walletType', label: '钱包类型' },
|
||||
{ prop: 'walletType', label: '钱包类型', width:'120' },
|
||||
]
|
||||
|
|
@ -2,12 +2,18 @@
|
|||
<div class="rechange-check table_form-container">
|
||||
<!-- 搜索区域:默认把当天 0 点到当前时间写入时间输入框 -->
|
||||
<RechangeSearch
|
||||
:buttonLoading="loading"
|
||||
:buttonLoading="loading"
|
||||
:search-form="searchForm"
|
||||
:search-options="searchOptions"
|
||||
@search="handleSearch"
|
||||
@reset="handleReset"
|
||||
>
|
||||
<!-- 渠道下拉框插槽 -->
|
||||
<template #channel_id>
|
||||
<el-select v-model="searchForm.channel_id" placeholder="请选择渠道" clearable style="width: 200px;">
|
||||
<el-option v-for="item in channelOptions" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</template>
|
||||
<template #button>
|
||||
<el-button type="primary" plain @click="handleExport">导出</el-button>
|
||||
</template>
|
||||
|
|
@ -58,7 +64,7 @@ import Table from '@/components/common/Table.vue'
|
|||
import { usePageLoading } from '@/composables/useLoading'
|
||||
import RechangePagination from '@/components/common/Pagination.vue'
|
||||
import { exportToExcel } from '@/utils/exportToExcel'
|
||||
import { getRechargeCheckListApi, reviewRechargeOrder } from '@/api/modules/capital/rechargeCheck'
|
||||
import { getRechargeCheckListApi, reviewRechargeOrder, getRechargeChannelOptions } from '@/api/modules/capital/rechargeCheck'
|
||||
import { rechangeCheckSearch, rechangeCheckTableColumns } from './options'
|
||||
import { getRecentSevenDays } from '@/utils/handleTime.ts'
|
||||
|
||||
|
|
@ -77,10 +83,31 @@ interface TableRow {
|
|||
rechangeTime: string
|
||||
}
|
||||
|
||||
// 渠道选项数据结构
|
||||
interface ChannelOption {
|
||||
id: number
|
||||
name: string
|
||||
channel_code: string
|
||||
}
|
||||
|
||||
// 渠道下拉选项
|
||||
const channelOptions = ref<ChannelOption[]>([])
|
||||
|
||||
// 获取渠道选项
|
||||
const getChannelOptions = async () => {
|
||||
try {
|
||||
const res = await getRechargeChannelOptions() as unknown as ChannelOption[]
|
||||
channelOptions.value = res || []
|
||||
} catch (error) {
|
||||
console.error('获取渠道选项失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 搜索表单结构:与审核接口的查询参数一一对应。
|
||||
interface SearchFormData {
|
||||
orderNo: string
|
||||
userName: string
|
||||
channel_id: number | string
|
||||
startTime: string
|
||||
endTime: string
|
||||
}
|
||||
|
|
@ -105,6 +132,7 @@ const initTime = getRecentSevenDays()
|
|||
const createDefaultSearchForm = (): SearchFormData => ({
|
||||
orderNo: '',
|
||||
userName: '',
|
||||
channel_id: '',
|
||||
startTime: initTime.start,
|
||||
endTime: initTime.end,
|
||||
})
|
||||
|
|
@ -135,6 +163,7 @@ const getList = async () => {
|
|||
start_time: searchForm.value.startTime || initTime.start,
|
||||
end_time: searchForm.value.endTime || initTime.end,
|
||||
user_name: searchForm.value.userName || null,
|
||||
channel_id: searchForm.value.channel_id || null,
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
@ -169,6 +198,7 @@ const getList = async () => {
|
|||
|
||||
// 页面初始化时加载一次真实列表。
|
||||
onMounted(() => {
|
||||
getChannelOptions()
|
||||
getList()
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,14 @@ export const rechangeCheckSearch = [
|
|||
placeholder: '请输入用户名',
|
||||
width: '200px',
|
||||
},
|
||||
{
|
||||
prop: 'channel_id',
|
||||
label: '渠道',
|
||||
type: 'select' as const,
|
||||
placeholder: '请选择渠道',
|
||||
width: '200px',
|
||||
slot: true,
|
||||
},
|
||||
{
|
||||
prop: 'startTime',
|
||||
label: '开始时间',
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ export const internalFormItem = [
|
|||
// 转出账号
|
||||
{ prop: 'transferOutAccount', label: '转出账号', type: 'select' as const, placeholder: '请选择转出账号', width: '150px', labelPosition: 'top' as const },
|
||||
// 转入账号
|
||||
{ prop: 'transferInAccount', label: '转入账号', type: 'input' as const, placeholder: '请输入转入账号', width: '150px', labelPosition: 'top' as const },
|
||||
{ prop: 'transferInAccount', label: '转入账号', type: 'select' as const, placeholder: '请选择转入账号', width: '150px', labelPosition: 'top' as const },
|
||||
// 转账金额
|
||||
{ prop: 'transferAmount', label: '转账金额', type: 'input' as const, placeholder: '请输入转账金额', width: '150px', labelPosition: 'top' as const },
|
||||
// 备注
|
||||
|
|
@ -15,7 +15,7 @@ export const internalFormItem = [
|
|||
|
||||
export const externalFormItem = [
|
||||
// 转入账号
|
||||
{ prop: 'transferInAccount', label: '转入账号', type: 'select' as const, placeholder: '请选择转入账号', width: '150px', labelPosition: 'top' as const },
|
||||
{ prop: 'transferInAccount', label: '转入账号', type: 'input' as const, placeholder: '请输入转入账号', width: '150px', labelPosition: 'top' as const },
|
||||
// 转账金额
|
||||
{ prop: 'transferAmount', label: '转账金额', type: 'input' as const, placeholder: '请输入转账金额', width: '150px', labelPosition: 'top' as const },
|
||||
// 备注
|
||||
|
|
|
|||
|
|
@ -1,7 +1,18 @@
|
|||
<template>
|
||||
<div class="withdraw-check table_form-container">
|
||||
<!-- 搜索区域:复用项目内搜索组件 -->
|
||||
<WithdrawSearch :search-form="searchForm" :search-options="searchOptions" @search="handleSearch" @reset="handleReset" />
|
||||
<WithdrawSearch :search-form="searchForm" :search-options="searchOptions" @search="handleSearch" @reset="handleReset">
|
||||
<!-- 渠道下拉框插槽 -->
|
||||
<template #channel_id>
|
||||
<el-select v-model="searchForm.channel_id" placeholder="请选择渠道" clearable style="width: 200px;">
|
||||
<el-option v-for="item in channelOptions" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</template>
|
||||
<!-- 导出按钮插槽 -->
|
||||
<template #button>
|
||||
<el-button type="primary" @click="handleExport">导出</el-button>
|
||||
</template>
|
||||
</WithdrawSearch>
|
||||
|
||||
<!-- 列表区域:使用公共 Table 组件 -->
|
||||
<Table
|
||||
|
|
@ -44,7 +55,15 @@ import Table from '@/components/common/Table.vue'
|
|||
import { usePageLoading } from '@/composables/useLoading'
|
||||
import WithdrawPagination from '@/components/common/Pagination.vue'
|
||||
import { withdrawCheckSearch, withdrawCheckTableColumns } from './options'
|
||||
import { getWithdrawReviewList, withdrawReviewOrder } from '@/api/modules/capital/withdraw'
|
||||
import { getWithdrawReviewList, withdrawReviewOrder, getWithdrawChannelOptions } from '@/api/modules/capital/withdraw'
|
||||
import { exportToExcel } from '@/utils/exportToExcel'
|
||||
|
||||
// 渠道选项数据结构
|
||||
interface ChannelOption {
|
||||
id: number
|
||||
name: string
|
||||
channel_code: string
|
||||
}
|
||||
|
||||
// 表格单行数据结构
|
||||
interface TableRow {
|
||||
|
|
@ -109,10 +128,24 @@ interface TransformedTableRow {
|
|||
created_at: string
|
||||
}
|
||||
|
||||
// 渠道下拉选项
|
||||
const channelOptions = ref<ChannelOption[]>([])
|
||||
|
||||
// 获取渠道选项
|
||||
const getChannelOptions = async () => {
|
||||
try {
|
||||
const res = await getWithdrawChannelOptions() as unknown as ChannelOption[]
|
||||
channelOptions.value = res || []
|
||||
} catch (error) {
|
||||
console.error('获取渠道选项失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 搜索配置和表格配置
|
||||
const searchOptions = ref(withdrawCheckSearch)
|
||||
const searchForm = ref({
|
||||
user_name: '',
|
||||
channel_id: '' as number | string,
|
||||
timeRange: [] as string[]
|
||||
})
|
||||
|
||||
|
|
@ -182,7 +215,8 @@ const getList = async () => {
|
|||
page_size: pageSize.value,
|
||||
start_time: start_time || undefined,
|
||||
end_time: end_time || undefined,
|
||||
user_name: searchForm.value.user_name || undefined
|
||||
user_name: searchForm.value.user_name || undefined,
|
||||
channel_id: searchForm.value.channel_id || undefined
|
||||
}) as unknown as ListResponse
|
||||
|
||||
tableData.value = transformTableData(res.data || [])
|
||||
|
|
@ -197,6 +231,7 @@ const getList = async () => {
|
|||
|
||||
// 页面初始化时加载一次列表
|
||||
onMounted(() => {
|
||||
getChannelOptions()
|
||||
getList()
|
||||
})
|
||||
|
||||
|
|
@ -210,6 +245,7 @@ const handleSearch = () => {
|
|||
const handleReset = () => {
|
||||
searchForm.value = {
|
||||
user_name: '',
|
||||
channel_id: '',
|
||||
timeRange: getDefaultTimeRange()
|
||||
}
|
||||
currentPage.value = 1
|
||||
|
|
@ -301,8 +337,12 @@ const handleReject = async (row?: TableRow) => {
|
|||
}
|
||||
|
||||
// 导出
|
||||
const handleExport = () => {
|
||||
ElMessage.info('导出功能开发中')
|
||||
const handleExport = async () => {
|
||||
await exportToExcel({
|
||||
tableData: tableData.value,
|
||||
columns: withdrawCheckTableColumns,
|
||||
fileName: '提现审核列表'
|
||||
})
|
||||
}
|
||||
|
||||
// 分页变化
|
||||
|
|
|
|||
|
|
@ -8,6 +8,15 @@ export const withdrawCheckSearch = [
|
|||
placeholder: '请输入账户持有人',
|
||||
width: '280px'
|
||||
},
|
||||
{
|
||||
// 渠道
|
||||
prop: 'channel_id',
|
||||
label: '渠道',
|
||||
type: 'select' as const,
|
||||
placeholder: '请选择渠道',
|
||||
width: '200px',
|
||||
slot: true
|
||||
},
|
||||
// {
|
||||
// // 时间范围选择
|
||||
// prop: 'timeRange',
|
||||
|
|
|
|||
Loading…
Reference in New Issue