From 44e43d81f36e69cac143972fa9e0c5e42595dd7a Mon Sep 17 00:00:00 2001 From: Songsl <2431955898@qq.com> Date: Sun, 26 Apr 2026 15:34:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=98=E6=AC=BE=EF=BC=8C=E5=AD=98=E6=AC=BE?= =?UTF-8?q?=E6=B8=A0=E9=81=93=EF=BC=8C=E5=85=85=E5=80=BC=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/capital/rechangeChanl.ts | 18 + .../{system => capital}/rechargeCheck.ts | 4 + src/api/modules/order/rechange.ts | 13 + src/api/modules/system/rechargeOrder.ts | 6 - src/components/common/Form.vue | 6 +- src/components/common/Table.vue | 114 ++++-- src/utils/handleTime.ts | 32 ++ src/views/capital/rechangeChanl/index.vue | 188 ++++++++- src/views/capital/rechangeChanl/options.ts | 67 +++- src/views/capital/rechangeCheck/index.vue | 365 +++++++++--------- src/views/capital/rechangeCheck/options.ts | 66 ++-- src/views/mould/handleFee/index.vue | 4 +- src/views/order/rechange/index.vue | 267 +++++++------ src/views/order/rechange/options.ts | 104 ++--- 14 files changed, 799 insertions(+), 455 deletions(-) create mode 100644 src/api/modules/capital/rechangeChanl.ts rename src/api/modules/{system => capital}/rechargeCheck.ts (57%) create mode 100644 src/api/modules/order/rechange.ts delete mode 100644 src/api/modules/system/rechargeOrder.ts create mode 100644 src/utils/handleTime.ts diff --git a/src/api/modules/capital/rechangeChanl.ts b/src/api/modules/capital/rechangeChanl.ts new file mode 100644 index 0000000..63189d4 --- /dev/null +++ b/src/api/modules/capital/rechangeChanl.ts @@ -0,0 +1,18 @@ +import { request } from '@/api' + +// 获取入金渠道列表 +export const getChannelList = () => { + return request.get('/channel/getChannelList') +} +// 创建入金渠道列表 +export const createChannel = (params: any) => { + return request.post('/channel/createChannel', { ...params }) +} +// 编辑入金渠道列表 +export const editChannel = (params: any) => { + return request.post('/channel/editChannel', { ...params }) +} +// 删除入金渠道列表 +export const delChannel = (params: any) => { + return request.post('/channel/delChannel', { ...params }) +} diff --git a/src/api/modules/system/rechargeCheck.ts b/src/api/modules/capital/rechargeCheck.ts similarity index 57% rename from src/api/modules/system/rechargeCheck.ts rename to src/api/modules/capital/rechargeCheck.ts index 1a0f8e0..137cda9 100644 --- a/src/api/modules/system/rechargeCheck.ts +++ b/src/api/modules/capital/rechargeCheck.ts @@ -4,3 +4,7 @@ import { request } from '@/api'; export const getRechargeCheckListApi = (params: any) => { return request.get('/user/rechargeReviewList', { ...params }) } +// 充值审核 +export const reviewRechargeOrder = (params: any) => { + return request.post('/user/reviewRechargeOrder', { ...params }) +} diff --git a/src/api/modules/order/rechange.ts b/src/api/modules/order/rechange.ts new file mode 100644 index 0000000..0d6b76b --- /dev/null +++ b/src/api/modules/order/rechange.ts @@ -0,0 +1,13 @@ +import { request } from '@/api' + +// 获取充值订单列表 +export const getRechargeOrderListApi = (params: any) => { + return request.get('/user/rechargeList', { ...params }) +} + +// 审核充值订单 +export const reviewRechargeOrder = (params: any) => { + return request.post('/user/reviewRechargeOrder', { ...params }) +} + + diff --git a/src/api/modules/system/rechargeOrder.ts b/src/api/modules/system/rechargeOrder.ts deleted file mode 100644 index a27cfff..0000000 --- a/src/api/modules/system/rechargeOrder.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { request } from '@/api'; - -// 获取充值订单列表 -export const getRechargeOrderListApi = (params: any) => { - return request.get('/user/rechargeList', { ...params }) -} diff --git a/src/components/common/Form.vue b/src/components/common/Form.vue index 5210e66..d889e70 100644 --- a/src/components/common/Form.vue +++ b/src/components/common/Form.vue @@ -30,7 +30,7 @@ show-password type="password" /> - + @@ -175,6 +177,8 @@ interface FormItem { clearable?: boolean disabledDate?: (time: Date) => boolean isRange?: boolean + controls?: boolean + align?: string } interface Props { diff --git a/src/components/common/Table.vue b/src/components/common/Table.vue index 636dccb..ad38b52 100644 --- a/src/components/common/Table.vue +++ b/src/components/common/Table.vue @@ -1,70 +1,106 @@ diff --git a/src/utils/handleTime.ts b/src/utils/handleTime.ts new file mode 100644 index 0000000..de95861 --- /dev/null +++ b/src/utils/handleTime.ts @@ -0,0 +1,32 @@ +/** + * 获取近七天的开始和结束时间 + * @param format 日期格式,默认 'YYYY-MM-DD HH:mm:ss' + * YYYY - 年, MM - 月, DD - 日, HH - 时, mm - 分, ss - 秒 + * @returns { start: string, end: string } + */ +export const getRecentSevenDays = (format = 'YYYY-MM-DD HH:mm:ss'):{ start: string, end: string } => { + const now = new Date() + const sevenDaysAgo = new Date(now) + sevenDaysAgo.setDate(now.getDate() - 7) + + const formatDateTime = (date: Date) => { + const tokens: Record = { + YYYY: String(date.getFullYear()), + MM: String(date.getMonth() + 1).padStart(2, '0'), + DD: String(date.getDate()).padStart(2, '0'), + HH: String(date.getHours()).padStart(2, '0'), + mm: String(date.getMinutes()).padStart(2, '0'), + ss: String(date.getSeconds()).padStart(2, '0'), + } + let result = format + for (const [token, value] of Object.entries(tokens)) { + result = result.replace(token, value) + } + return result + } + + return { + start: formatDateTime(sevenDaysAgo), + end: formatDateTime(now), + } +} diff --git a/src/views/capital/rechangeChanl/index.vue b/src/views/capital/rechangeChanl/index.vue index 7c59e97..c5aeb38 100644 --- a/src/views/capital/rechangeChanl/index.vue +++ b/src/views/capital/rechangeChanl/index.vue @@ -1,34 +1,188 @@ diff --git a/src/views/capital/rechangeChanl/options.ts b/src/views/capital/rechangeChanl/options.ts index ba2b4d8..ed1b8d2 100644 --- a/src/views/capital/rechangeChanl/options.ts +++ b/src/views/capital/rechangeChanl/options.ts @@ -1,9 +1,60 @@ export const tableColumns = [ - //序号 - { label: '序号', prop: 'index' }, - //存款渠道名称 - { label: '存款渠道名称', prop: 'depositChannelName' }, - //状态 - { label: '状态', slotName: 'status' }, - -] \ No newline at end of file + //序号 + { label: '序号', type: 'index', width: 60, align: 'center' }, + //存款渠道名称 + { label: '渠道名称', prop: 'name' }, + //存款渠道费用 + { label: '渠道费用', prop: 'channel_fee' }, + //存款渠道类型 + { label: '类型', prop: 'typeStr' }, + // 接口地址 + { label: '接口地址', prop: 'api_url' }, + // 接口appid + { label: '接口appid', prop: 'api_appid' }, + { label: '状态', prop: 'statusStr' }, +] + +export const formItemsData = [ + { label: '渠道名称', prop: 'name', type: 'input', placeholder: '请输入渠道名称' }, + { + label: '渠道费用', + prop: 'channel_fee', + type: 'number', + min: 0, + max: 999999, + controls: false, + placeholder: '请输入渠道费用', + + }, + { + label: '类型', + prop: 'type', + type: 'select', + placeholder: '请选择类型', + }, // 类型:1法币,2数字货币 + { label: '接口地址', prop: 'api_url', type: 'input', placeholder: '请输入接口地址' }, + { label: '接口appid', prop: 'api_appid', type: 'input', placeholder: '请输入接口appid' }, + { label: '接口密钥', prop: 'api_key', type: 'input', placeholder: '请输入接口密钥' }, + { label: '状态', prop: 'status', type: 'radio' }, +] + +export const formRulesData = { + name: [{ required: true, message: '请输入渠道名称', trigger: ['change'] }], + channel_fee: [{ required: true, message: '请输入渠道费用', trigger: ['change'] }], + type: [{ required: true, message: '请选择类型', trigger: ['change'] }], + api_url: [{ required: true, message: '请输入接口地址', trigger: ['change'] }], + api_appid: [{ required: true, message: '请输入接口appid', trigger: ['change'] }], + api_key: [{ required: true, message: '请输入接口密钥', trigger: ['change'] }], + status: [{ required: true, message: '请选择状态', trigger: ['change'] }], +} + +export const optionsMapData = { + type: [ + { label: '法币', value: 1 }, + { label: '数字货币', value: 2 }, + ], + status: [ + { label: '启用', value: 1 }, + { label: '禁用', value: 2 }, + ], +} diff --git a/src/views/capital/rechangeCheck/index.vue b/src/views/capital/rechangeCheck/index.vue index e89f84d..aa70d52 100644 --- a/src/views/capital/rechangeCheck/index.vue +++ b/src/views/capital/rechangeCheck/index.vue @@ -1,36 +1,59 @@ diff --git a/src/views/capital/rechangeCheck/options.ts b/src/views/capital/rechangeCheck/options.ts index b0dfcde..f60e5a6 100644 --- a/src/views/capital/rechangeCheck/options.ts +++ b/src/views/capital/rechangeCheck/options.ts @@ -1,37 +1,39 @@ // 搜索区域配置:按充值审核接口的实际查询参数保留订单号、用户名、开始时间、结束时间。 export const rechangeCheckSearch = [ - { - prop: 'orderNo', - label: '订单号', - type: 'input' as const, - placeholder: '请输入流水号', - width: '220px', - }, - { - prop: 'userName', - label: '用户名称', - type: 'input' as const, - placeholder: '请输入用户名', - width: '200px', - }, - { - prop: 'startTime', - label: '开始时间', - type: 'date' as const, - dateType: 'datetime' as const, - valueFormat: 'YYYY-MM-DD HH:mm:ss', - placeholder: '请选择开始时间', - width: '220px', - }, - { - prop: 'endTime', - label: '结束时间', - type: 'date' as const, - dateType: 'datetime' as const, - valueFormat: 'YYYY-MM-DD HH:mm:ss', - placeholder: '请选择结束时间', - width: '220px', - }, + { + prop: 'orderNo', + label: '订单号', + type: 'input' as const, + placeholder: '请输入流水号', + width: '220px', + }, + { + prop: 'userName', + label: '用户名称', + type: 'input' as const, + placeholder: '请输入用户名', + width: '200px', + }, + { + prop: 'startTime', + label: '开始时间', + type: 'date' as const, + dateType: 'datetime' as const, + valueFormat: 'YYYY-MM-DD HH:mm:ss', + placeholder: '请选择开始时间', + clearable: false, + width: '260px', + }, + { + prop: 'endTime', + label: '结束时间', + type: 'date' as const, + dateType: 'datetime' as const, + valueFormat: 'YYYY-MM-DD HH:mm:ss', + placeholder: '请选择结束时间', + clearable: false, + width: '260px', + }, ] // 表格列配置:返回数据与 `rechargeOrder` 一致,因此按同一份结构展示。 diff --git a/src/views/mould/handleFee/index.vue b/src/views/mould/handleFee/index.vue index b9413f0..bd608b5 100644 --- a/src/views/mould/handleFee/index.vue +++ b/src/views/mould/handleFee/index.vue @@ -79,7 +79,7 @@ diff --git a/src/views/order/rechange/options.ts b/src/views/order/rechange/options.ts index 4cf3d75..1428aed 100644 --- a/src/views/order/rechange/options.ts +++ b/src/views/order/rechange/options.ts @@ -1,60 +1,60 @@ // 充值订单搜索项:按接口参数保留订单号、用户名称、状态、结束时间、开始时间。 export const search = [ - { - prop: 'orderNo', - label: '订单号', - type: 'input' as const, - placeholder: '请输入流水号', - width: '210px', - }, - { - prop: 'userName', - label: '用户名称', - type: 'input' as const, - placeholder: '请输入用户名', - width: '190px', - }, - { - prop: 'status', - label: '状态', - type: 'select' as const, - placeholder: '请选择状态', - width: '140px', - options: [ - { label: '未审核', value: '1' }, - { label: '未付款', value: '2' }, - { label: '已付款', value: '3' }, - { label: '驳回', value: '4' }, - ], - }, - { - prop: 'startTime', - label: '开始时间', - type: 'date' as const, - dateType: 'date' as const, - valueFormat: 'YYYY-MM-DD', - placeholder: '请选择开始时间', - width: '150px', - }, - { - prop: 'endTime', - label: '结束时间', - type: 'date' as const, - dateType: 'date' as const, - valueFormat: 'YYYY-MM-DD', - placeholder: '请选择结束时间', - width: '150px', - }, - + { + prop: 'trade_id', + label: '订单号', + type: 'input' as const, + placeholder: '请输入流水号', + width: '210px', + }, + { + prop: 'user_name', + label: '用户名称', + type: 'input' as const, + placeholder: '请输入用户名', + width: '190px', + }, + { + prop: 'status', + label: '状态', + type: 'select' as const, + placeholder: '请选择状态', + width: '140px', + options: [ + { label: '未审核', value: '1' }, + { label: '未付款', value: '2' }, + { label: '已付款', value: '3' }, + { label: '驳回', value: '4' }, + ], + }, + { + prop: 'start_time', + label: '开始时间', + type: 'date' as const, + dateType: 'date' as const, + valueFormat: 'YYYY-MM-DD', + placeholder: '请选择开始时间', + width: '260px', + }, + { + prop: 'end_time', + label: '结束时间', + type: 'date' as const, + dateType: 'date' as const, + valueFormat: 'YYYY-MM-DD', + placeholder: '请选择结束时间', + width: '260px', + }, ] // 充值订单表格列:对应接口数据映射后的列表字段。 export const tableColumns = [ - { prop: 'orderNo', label: '订单号', align: 'center' as const }, - { prop: 'currency', label: '充值币种', align: 'center' as const }, - { prop: 'amount', label: '金额', align: 'center' as const }, - { prop: 'statusText', label: '状态', align: 'center' as const }, - { prop: 'rechangeTime', label: '充值时间', align: 'center' as const }, - { prop: 'rechangeAccount', label: '充值账号', align: 'center' as const }, + { prop: 'orderNo', label: '订单号', align: 'center' as const }, + { prop: 'currency', label: '充值币种', align: 'center' as const }, + { prop: 'amount', label: '金额', align: 'center' as const }, + { prop: 'statusText', label: '状态', align: 'center' as const }, + { prop: 'rechangeTime', label: '充值时间', align: 'center' as const }, + { prop: 'rechangeAccount', label: '充值账号', align: 'center' as const }, + { label: '操作', width: '240px', align: 'center' as const, slotName: 'operation' }, ]