From 95f2d1c9bbc8d4e84b750704e95a31d6aa9b100d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=83=E8=B4=A7?= <252048765@qq.com> Date: Sat, 5 Jul 2025 07:10:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=85=B6=E4=BB=96=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-ele/src/adapter/vxe-table.ts | 32 +- .../components/description/description.vue | 77 ++++ .../src/components/description/index.ts | 3 + .../src/components/description/typing.ts | 27 ++ .../components/description/use-description.ts | 71 ++++ .../src/components/dict-tag/dict-tag.vue | 2 +- apps/web-ele/src/views/pay/cashier/data.ts | 81 ++++ apps/web-ele/src/views/pay/cashier/index.vue | 389 ++++++++++++++++++ apps/web-ele/src/views/pay/demo/order/data.ts | 94 +++++ .../src/views/pay/demo/order/index.vue | 153 +++++++ .../src/views/pay/demo/order/modules/form.vue | 55 +++ .../src/views/pay/demo/withdraw/data.ts | 124 ++++++ .../src/views/pay/demo/withdraw/index.vue | 144 +++++++ .../views/pay/demo/withdraw/modules/form.vue | 55 +++ apps/web-ele/src/views/pay/notify/data.ts | 168 ++++++++ apps/web-ele/src/views/pay/notify/index.vue | 81 ++++ .../src/views/pay/notify/modules/detail.vue | 101 +++++ apps/web-ele/src/views/pay/order/data.ts | 255 ++++++++++++ apps/web-ele/src/views/pay/order/index.vue | 115 ++++++ .../src/views/pay/order/modules/detail.vue | 56 +++ apps/web-ele/src/views/pay/refund/data.ts | 254 ++++++++++++ apps/web-ele/src/views/pay/refund/index.vue | 103 +++++ .../src/views/pay/refund/modules/detail.vue | 73 ++++ apps/web-ele/src/views/pay/transfer/data.ts | 274 ++++++++++++ apps/web-ele/src/views/pay/transfer/index.vue | 103 +++++ .../src/views/pay/transfer/modules/detail.vue | 57 +++ .../src/views/pay/wallet/balance/data.ts | 86 ++++ .../src/views/pay/wallet/balance/index.vue | 82 ++++ .../pay/wallet/balance/modules/detail.vue | 40 ++ .../views/pay/wallet/rechargePackage/data.ts | 119 ++++++ .../pay/wallet/rechargePackage/index.vue | 127 ++++++ .../wallet/rechargePackage/modules/form.vue | 98 +++++ .../src/views/pay/wallet/transaction/data.ts | 40 ++ .../views/pay/wallet/transaction/index.vue | 61 +++ 34 files changed, 3585 insertions(+), 15 deletions(-) create mode 100644 apps/web-ele/src/components/description/description.vue create mode 100644 apps/web-ele/src/components/description/index.ts create mode 100644 apps/web-ele/src/components/description/typing.ts create mode 100644 apps/web-ele/src/components/description/use-description.ts create mode 100644 apps/web-ele/src/views/pay/cashier/data.ts create mode 100644 apps/web-ele/src/views/pay/cashier/index.vue create mode 100644 apps/web-ele/src/views/pay/demo/order/data.ts create mode 100644 apps/web-ele/src/views/pay/demo/order/index.vue create mode 100644 apps/web-ele/src/views/pay/demo/order/modules/form.vue create mode 100644 apps/web-ele/src/views/pay/demo/withdraw/data.ts create mode 100644 apps/web-ele/src/views/pay/demo/withdraw/index.vue create mode 100644 apps/web-ele/src/views/pay/demo/withdraw/modules/form.vue create mode 100644 apps/web-ele/src/views/pay/notify/data.ts create mode 100644 apps/web-ele/src/views/pay/notify/index.vue create mode 100644 apps/web-ele/src/views/pay/notify/modules/detail.vue create mode 100644 apps/web-ele/src/views/pay/order/data.ts create mode 100644 apps/web-ele/src/views/pay/order/index.vue create mode 100644 apps/web-ele/src/views/pay/order/modules/detail.vue create mode 100644 apps/web-ele/src/views/pay/refund/data.ts create mode 100644 apps/web-ele/src/views/pay/refund/index.vue create mode 100644 apps/web-ele/src/views/pay/refund/modules/detail.vue create mode 100644 apps/web-ele/src/views/pay/transfer/data.ts create mode 100644 apps/web-ele/src/views/pay/transfer/index.vue create mode 100644 apps/web-ele/src/views/pay/transfer/modules/detail.vue create mode 100644 apps/web-ele/src/views/pay/wallet/balance/data.ts create mode 100644 apps/web-ele/src/views/pay/wallet/balance/index.vue create mode 100644 apps/web-ele/src/views/pay/wallet/balance/modules/detail.vue create mode 100644 apps/web-ele/src/views/pay/wallet/rechargePackage/data.ts create mode 100644 apps/web-ele/src/views/pay/wallet/rechargePackage/index.vue create mode 100644 apps/web-ele/src/views/pay/wallet/rechargePackage/modules/form.vue create mode 100644 apps/web-ele/src/views/pay/wallet/transaction/data.ts create mode 100644 apps/web-ele/src/views/pay/wallet/transaction/index.vue diff --git a/apps/web-ele/src/adapter/vxe-table.ts b/apps/web-ele/src/adapter/vxe-table.ts index d160c3c9b..1abd4e865 100644 --- a/apps/web-ele/src/adapter/vxe-table.ts +++ b/apps/web-ele/src/adapter/vxe-table.ts @@ -10,7 +10,7 @@ import { setupVbenVxeTable, useVbenVxeGrid, } from '@vben/plugins/vxe-table'; -import { isFunction, isString } from '@vben/utils'; +import { erpCountInputFormatter, erpNumberFormatter, formatPast2, isFunction, isString } from '@vben/utils'; import { ElButton, ElImage, ElPopconfirm, ElSwitch } from 'element-plus'; @@ -267,21 +267,25 @@ setupVbenVxeTable({ // 添加数量格式化,例如金额 // TODO @xingyu:建议金额,和数量分开哈;原因是,有些团队希望金额,单独控制; - vxeUI.formats.add('formatNumber', { - cellFormatMethod({ cellValue }, digits = 2) { - if (cellValue === null || cellValue === undefined) { - return ''; - } - if (isString(cellValue)) { - cellValue = Number.parseFloat(cellValue); - } - // 如果非 number,则直接返回空串 - if (Number.isNaN(cellValue)) { - return ''; - } - return cellValue.toFixed(digits); + vxeUI.formats.add('formatPast2', { + tableCellFormatMethod({ cellValue }) { + return formatPast2(cellValue); }, }); + + // add by 星语:数量格式化,例如说:金额 + vxeUI.formats.add('formatNumber', { + tableCellFormatMethod({ cellValue }) { + return erpCountInputFormatter(cellValue); + }, + }); + + vxeUI.formats.add('formatAmount2', { + tableCellFormatMethod({ cellValue }, digits = 2) { + return `${erpNumberFormatter(cellValue, digits)}元`; + }, + }); + }, useVbenForm, }); diff --git a/apps/web-ele/src/components/description/description.vue b/apps/web-ele/src/components/description/description.vue new file mode 100644 index 000000000..78efe72d3 --- /dev/null +++ b/apps/web-ele/src/components/description/description.vue @@ -0,0 +1,77 @@ + diff --git a/apps/web-ele/src/components/description/index.ts b/apps/web-ele/src/components/description/index.ts new file mode 100644 index 000000000..a707c4865 --- /dev/null +++ b/apps/web-ele/src/components/description/index.ts @@ -0,0 +1,3 @@ +export { default as Description } from './description.vue'; +export * from './typing'; +export { useDescription } from './use-description'; diff --git a/apps/web-ele/src/components/description/typing.ts b/apps/web-ele/src/components/description/typing.ts new file mode 100644 index 000000000..5a6e64751 --- /dev/null +++ b/apps/web-ele/src/components/description/typing.ts @@ -0,0 +1,27 @@ +import type { DescriptionProps } from 'element-plus'; + +import type { CSSProperties, VNode } from 'vue'; + +// TODO @puhui999:【content】这个纠结下;1)vben2.0 是 render;https://doc.vvbin.cn/components/desc.html#usage 2) +// TODO @puhui999:vben2.0 还有 sapn【done】、labelMinWidth、contentMinWidth +// TODO @puhui999:【hidden】这个纠结下;1)vben2.0 是 show; +export interface DescriptionItemSchema { + label: string | VNode; // 内容的描述 + field?: string; // 对应 data 中的字段名 + content?: ((data: any) => string | VNode) | string | VNode; // 自定义需要展示的内容,比如说 dict-tag + span?: number; // 包含列的数量 + labelStyle?: CSSProperties; // 自定义标签样式 + contentStyle?: CSSProperties; // 自定义内容样式 + hidden?: ((data: any) => boolean) | boolean; // 是否显示 +} + +// TODO @puhui999:vben2.0 还有 title【done】、bordered【done】d、useCollapse、collapseOptions +// TODO @puhui999:from 5.0:bordered 默认为 true +// TODO @puhui999:from 5.0:column 默认为 lg: 3, md: 3, sm: 2, xl: 3, xs: 1, xxl: 4 +// TODO @puhui999:from 5.0:size 默认为 small;有 'default', 'middle', 'small', undefined +// TODO @puhui999:from 5.0:useCollapse 默认为 true +export interface DescriptionsOptions { + data?: Record; // 数据 + schema?: DescriptionItemSchema[]; // 描述项配置 + componentProps?: DescriptionProps; // antd Descriptions 组件参数 +} diff --git a/apps/web-ele/src/components/description/use-description.ts b/apps/web-ele/src/components/description/use-description.ts new file mode 100644 index 000000000..5140a88c1 --- /dev/null +++ b/apps/web-ele/src/components/description/use-description.ts @@ -0,0 +1,71 @@ +import type { DescriptionsOptions } from './typing'; + +import { defineComponent, h, isReactive, reactive, watch } from 'vue'; + +import { Description } from './index'; + +/** 描述列表 api 定义 */ +class DescriptionApi { + private state = reactive>({}); + + constructor(options: DescriptionsOptions) { + this.state = { ...options }; + } + + getState(): DescriptionsOptions { + return this.state as DescriptionsOptions; + } + + // TODO @puhui999:【setState】纠结下:1)vben2.0 是 data https://doc.vvbin.cn/components/desc.html#usage; + setState(newState: Partial) { + this.state = { ...this.state, ...newState }; + } +} + +export type ExtendedDescriptionApi = DescriptionApi; + +export function useDescription(options: DescriptionsOptions) { + const IS_REACTIVE = isReactive(options); + const api = new DescriptionApi(options); + // 扩展API + const extendedApi: ExtendedDescriptionApi = api as never; + const Desc = defineComponent({ + name: 'UseDescription', + inheritAttrs: false, + setup(_, { attrs, slots }) { + // 合并props和attrs到state + api.setState({ ...attrs }); + + return () => + h( + Description, + { + ...api.getState(), + ...attrs, + }, + slots, + ); + }, + }); + + // 响应式支持 + if (IS_REACTIVE) { + watch( + () => options.schema, + (newSchema) => { + api.setState({ schema: newSchema }); + }, + { immediate: true, deep: true }, + ); + + watch( + () => options.data, + (newData) => { + api.setState({ data: newData }); + }, + { immediate: true, deep: true }, + ); + } + + return [Desc, extendedApi] as const; +} diff --git a/apps/web-ele/src/components/dict-tag/dict-tag.vue b/apps/web-ele/src/components/dict-tag/dict-tag.vue index ec1ac1364..358daf920 100644 --- a/apps/web-ele/src/components/dict-tag/dict-tag.vue +++ b/apps/web-ele/src/components/dict-tag/dict-tag.vue @@ -78,7 +78,7 @@ const dictTag = computed(() => { diff --git a/apps/web-ele/src/views/pay/cashier/data.ts b/apps/web-ele/src/views/pay/cashier/data.ts new file mode 100644 index 000000000..0918a6f10 --- /dev/null +++ b/apps/web-ele/src/views/pay/cashier/data.ts @@ -0,0 +1,81 @@ +import { + SvgAlipayAppIcon, + SvgAlipayBarIcon, + SvgAlipayPcIcon, + SvgAlipayQrIcon, + SvgAlipayWapIcon, + SvgMockIcon, + SvgWalletIcon, + SvgWxAppIcon, + SvgWxBarIcon, + SvgWxLiteIcon, + SvgWxNativeIcon, + SvgWxPubIcon, +} from '@vben/icons'; + +export const channelsAlipay = [ + { + name: '支付宝 PC 网站支付', + icon: SvgAlipayPcIcon, + code: 'alipay_pc', + }, + { + name: '支付宝 Wap 网站支付', + icon: SvgAlipayWapIcon, + code: 'alipay_wap', + }, + { + name: '支付宝 App 网站支付', + icon: SvgAlipayAppIcon, + code: 'alipay_app', + }, + { + name: '支付宝扫码支付', + icon: SvgAlipayQrIcon, + code: 'alipay_qr', + }, + { + name: '支付宝条码支付', + icon: SvgAlipayBarIcon, + code: 'alipay_bar', + }, +]; +export const channelsWechat = [ + { + name: '微信公众号支付', + icon: SvgWxPubIcon, + code: 'wx_pub', + }, + { + name: '微信小程序支付', + icon: SvgWxLiteIcon, + code: 'wx_lite', + }, + { + name: '微信 App 支付', + icon: SvgWxAppIcon, + code: 'wx_app', + }, + { + name: '微信扫码支付', + icon: SvgWxNativeIcon, + code: 'wx_native', + }, + { + name: '微信条码支付', + icon: SvgWxBarIcon, + code: 'wx_bar', + }, +]; +export const channelsMock = [ + { + name: '钱包支付', + icon: SvgWalletIcon, + code: 'wallet', + }, + { + name: '模拟支付', + icon: SvgMockIcon, + code: 'mock', + }, +]; diff --git a/apps/web-ele/src/views/pay/cashier/index.vue b/apps/web-ele/src/views/pay/cashier/index.vue new file mode 100644 index 000000000..e00b58037 --- /dev/null +++ b/apps/web-ele/src/views/pay/cashier/index.vue @@ -0,0 +1,389 @@ + + diff --git a/apps/web-ele/src/views/pay/demo/order/data.ts b/apps/web-ele/src/views/pay/demo/order/data.ts new file mode 100644 index 000000000..9dde3e144 --- /dev/null +++ b/apps/web-ele/src/views/pay/demo/order/data.ts @@ -0,0 +1,94 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { DICT_TYPE } from '#/utils'; + +/** 新增/修改的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Input', + fieldName: 'id', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + component: 'Select', + fieldName: 'spuId', + label: '商品', + rules: 'required', + componentProps: { + options: [ + { label: '华为手机 --- 1.00元', value: 1, price: 1 }, + { label: '小米电视 --- 10.00元', value: 2, price: 10 }, + { label: '苹果手表 --- 100.00元', value: 3, price: 100 }, + { label: '华硕笔记本 --- 1000.00元', value: 4, price: 1000 }, + { label: '蔚来汽车 --- 200000.00元', value: 5, price: 200_000 }, + ], + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '订单编号', + }, + { + field: 'userId', + title: '用户编号', + }, + { + field: 'spuName', + title: '商品名字', + }, + { + field: 'price', + title: '支付价格', + formatter: 'formatAmount2', + }, + { + field: 'refundPrice', + title: '退款金额', + formatter: 'formatAmount2', + }, + { + field: 'createTime', + title: '创建时间', + formatter: 'formatDateTime', + }, + { + field: 'payOrderId', + title: '支付单号', + }, + { + field: 'payStatus', + title: '是否支付', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING }, + }, + }, + { + field: 'payTime', + title: '支付时间', + formatter: 'formatDateTime', + }, + { + field: 'refundTime', + title: '退款时间', + slots: { default: 'refundTime' }, + }, + { + title: '操作', + width: 200, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-ele/src/views/pay/demo/order/index.vue b/apps/web-ele/src/views/pay/demo/order/index.vue new file mode 100644 index 000000000..28c196f2d --- /dev/null +++ b/apps/web-ele/src/views/pay/demo/order/index.vue @@ -0,0 +1,153 @@ + + + diff --git a/apps/web-ele/src/views/pay/demo/order/modules/form.vue b/apps/web-ele/src/views/pay/demo/order/modules/form.vue new file mode 100644 index 000000000..9820b2988 --- /dev/null +++ b/apps/web-ele/src/views/pay/demo/order/modules/form.vue @@ -0,0 +1,55 @@ + + + diff --git a/apps/web-ele/src/views/pay/demo/withdraw/data.ts b/apps/web-ele/src/views/pay/demo/withdraw/data.ts new file mode 100644 index 000000000..bd2ee6169 --- /dev/null +++ b/apps/web-ele/src/views/pay/demo/withdraw/data.ts @@ -0,0 +1,124 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { DICT_TYPE } from '#/utils'; + +/** 新增/修改的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Input', + fieldName: 'id', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + component: 'Input', + fieldName: 'subject', + label: '提现标题', + rules: 'required', + }, + { + component: 'InputNumber', + fieldName: 'price', + label: '提现金额', + rules: 'required', + componentProps: { + min: 1, + precision: 2, + step: 0.01, + }, + }, + { + component: 'Select', + fieldName: 'type', + label: '提现类型', + rules: 'required', + componentProps: { + options: [ + { label: '支付宝', value: 1 }, + { label: '微信余额', value: 2 }, + { label: '钱包余额', value: 3 }, + ], + }, + }, + { + component: 'Input', + fieldName: 'userName', + label: '收款人姓名', + rules: 'required', + }, + { + component: 'Input', + fieldName: 'userAccount', + label: '收款人账号', + rules: 'required', + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '提现单编号', + }, + { + field: 'subject', + title: '提现标题', + }, + { + field: 'type', + title: '提现类型', + slots: { default: 'type' }, + }, + { + field: 'price', + title: '提现金额', + formatter: 'formatAmount2', + }, + { + field: 'userName', + title: '收款人姓名', + }, + { + field: 'userAccount', + title: '收款人账号', + }, + { + field: 'status', + title: '提现状态', + slots: { default: 'status' }, + }, + { + field: 'payTransferId', + title: '转账单号', + }, + { + field: 'transferChannelCode', + title: '转账渠道', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.PAY_CHANNEL_CODE }, + }, + }, + { + field: 'transferTime', + title: '转账时间', + formatter: 'formatDateTime', + }, + { + field: 'transferErrorMsg', + title: '转账失败原因', + }, + { + title: '操作', + width: 130, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-ele/src/views/pay/demo/withdraw/index.vue b/apps/web-ele/src/views/pay/demo/withdraw/index.vue new file mode 100644 index 000000000..d52834026 --- /dev/null +++ b/apps/web-ele/src/views/pay/demo/withdraw/index.vue @@ -0,0 +1,144 @@ + + + diff --git a/apps/web-ele/src/views/pay/demo/withdraw/modules/form.vue b/apps/web-ele/src/views/pay/demo/withdraw/modules/form.vue new file mode 100644 index 000000000..dae1422c2 --- /dev/null +++ b/apps/web-ele/src/views/pay/demo/withdraw/modules/form.vue @@ -0,0 +1,55 @@ + + + diff --git a/apps/web-ele/src/views/pay/notify/data.ts b/apps/web-ele/src/views/pay/notify/data.ts new file mode 100644 index 000000000..4d28b5217 --- /dev/null +++ b/apps/web-ele/src/views/pay/notify/data.ts @@ -0,0 +1,168 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { getAppList } from '#/api/pay/app'; +import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils'; + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'appId', + label: '应用编号', + component: 'ApiSelect', + componentProps: { + api: async () => { + const data = await getAppList(); + return data.map((item) => ({ + label: item.name, + value: item.id, + })); + }, + autoSelect: 'first', + placeholder: '请选择数据源', + }, + }, + { + fieldName: 'type', + label: '通知类型', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.PAY_NOTIFY_TYPE, 'number'), + }, + }, + { + fieldName: 'dataId', + label: '关联编号', + component: 'Input', + }, + { + fieldName: 'status', + label: '通知状态', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.PAY_NOTIFY_STATUS, 'number'), + }, + }, + { + fieldName: 'merchantOrderId', + label: '商户订单编号', + component: 'Input', + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + allowClear: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '任务编号', + }, + { + field: 'appName', + title: '应用编号', + }, + { + field: 'merchantOrderId', + title: '商户订单编号', + }, + { + field: 'type', + title: '通知类型', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.PAY_NOTIFY_TYPE }, + }, + }, + { + field: 'dataId', + title: '关联编号', + }, + { + field: 'status', + title: '通知状态', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.PAY_NOTIFY_STATUS }, + }, + }, + { + field: 'lastExecuteTime', + title: '最后通知时间', + formatter: 'formatDateTime', + }, + { + field: 'nextNotifyTime', + title: '下次通知时间', + formatter: 'formatDateTime', + }, + { + field: 'notifyTimes', + title: '通知次数', + cellRender: { + name: 'CellTag', + props: { + type: 'success', + content: '{notifyTimes} / {maxNotifyTimes}', + }, + }, + }, + { + title: '操作', + width: 80, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 详情列表的字段 */ +export const detailColumns = [ + { + title: '日志编号', + dataIndex: 'id', + key: 'id', + width: 120, + ellipsis: false, + }, + { + title: '通知状态', + dataIndex: 'status', + key: 'status', + width: 120, + ellipsis: false, + }, + { + title: '通知次数', + dataIndex: 'notifyTimes', + key: 'notifyTimes', + width: 120, + ellipsis: false, + }, + { + title: '通知时间', + dataIndex: 'lastExecuteTime', + key: 'lastExecuteTime', + width: 120, + ellipsis: false, + }, + { + title: '响应结果', + dataIndex: 'response', + key: 'response', + width: 120, + ellipsis: false, + }, +]; diff --git a/apps/web-ele/src/views/pay/notify/index.vue b/apps/web-ele/src/views/pay/notify/index.vue new file mode 100644 index 000000000..c84082453 --- /dev/null +++ b/apps/web-ele/src/views/pay/notify/index.vue @@ -0,0 +1,81 @@ + + diff --git a/apps/web-ele/src/views/pay/notify/modules/detail.vue b/apps/web-ele/src/views/pay/notify/modules/detail.vue new file mode 100644 index 000000000..ff73f2139 --- /dev/null +++ b/apps/web-ele/src/views/pay/notify/modules/detail.vue @@ -0,0 +1,101 @@ + + + diff --git a/apps/web-ele/src/views/pay/order/data.ts b/apps/web-ele/src/views/pay/order/data.ts new file mode 100644 index 000000000..4638f161d --- /dev/null +++ b/apps/web-ele/src/views/pay/order/data.ts @@ -0,0 +1,255 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { DescriptionItemSchema } from '#/components/description'; +import type { PayOrderApi } from '#/api/pay/order'; + +import { h } from 'vue'; + +import { erpPriceInputFormatter, formatDateTime } from '@vben/utils'; + +import { ElTag } from 'element-plus'; + +import { DictTag } from '#/components/dict-tag'; +import { DICT_TYPE, getDictOptions } from '#/utils'; + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Input', + fieldName: 'appId', + label: '应用编号', + componentProps: { + placeholder: '请输入应用编号', + }, + }, + { + component: 'Select', + fieldName: 'channelCode', + label: '支付渠道', + componentProps: { + placeholder: '请选择开启状态', + options: getDictOptions(DICT_TYPE.PAY_CHANNEL_CODE, 'string'), + }, + }, + { + component: 'Input', + fieldName: 'merchantOrderId', + label: '商户单号', + componentProps: { + placeholder: '请输入商户单号', + }, + }, + { + component: 'Input', + fieldName: 'no', + label: '支付单号', + componentProps: { + placeholder: '请输入支付单号', + }, + }, + { + component: 'Input', + fieldName: 'channelOrderNo', + label: '渠道单号', + componentProps: { + placeholder: '请输入渠道单号', + }, + }, + { + component: 'Select', + fieldName: 'status', + label: '支付状态', + componentProps: { + placeholder: '请选择支付状态', + options: getDictOptions(DICT_TYPE.PAY_ORDER_STATUS, 'number'), + }, + }, + { + component: 'RangePicker', + fieldName: 'createTime', + label: '创建时间', + componentProps: { + placeholder: ['开始日期', '结束日期'], + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { type: 'checkbox', width: 60 }, + { + title: '编号', + field: 'id', + }, + { + title: '支付金额', + field: 'price', + formatter: 'formatAmount2', + }, + { + title: '退款金额', + field: 'refundPrice', + formatter: 'formatAmount2', + }, + { + title: '手续金额', + field: 'channelFeePrice', + formatter: 'formatAmount2', + }, + { + title: '订单号', + field: 'no', + slots: { + default: 'no', + }, + }, + { + title: '支付状态', + field: 'status', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.PAY_ORDER_STATUS }, + }, + }, + { + title: '支付渠道', + field: 'channelCode', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.PAY_CHANNEL_CODE }, + }, + }, + { + title: '支付时间', + field: 'successTime', + formatter: 'formatDateTime', + }, + { + title: '支付应用', + field: 'appName', + }, + { + title: '商品标题', + field: 'subject', + }, + { + title: '操作', + width: 100, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 详情的字段 */ +export function useDetailSchema(): DescriptionItemSchema[] { + return [ + { + field: 'merchantOrderId', + label: '商户单号', + }, + { + field: 'no', + label: '支付单号', + }, + { + field: 'appId', + label: '应用编号', + }, + { + field: 'appName', + label: '应用名称', + }, + { + field: 'status', + label: '支付状态', + content: (data: PayOrderApi.Order) => + h(DictTag, { + type: DICT_TYPE.PAY_ORDER_STATUS, + value: data?.status, + }), + }, + { + field: 'price', + label: '支付金额', + content: (data: PayOrderApi.Order) => `¥${erpPriceInputFormatter(data?.price)}`, + }, + { + field: 'channelFeePrice', + label: '手续费', + content: (data: PayOrderApi.Order) => `¥${erpPriceInputFormatter(data?.channelFeePrice)}`, + }, + { + field: 'channelFeeRate', + label: '手续费比例', + content: (data: PayOrderApi.Order) => `${erpPriceInputFormatter(data?.channelFeeRate)}%`, + }, + { + field: 'successTime', + label: '支付时间', + content: (data: PayOrderApi.Order) => formatDateTime(data?.successTime) as string, + }, + { + field: 'expireTime', + label: '失效时间', + content: (data: PayOrderApi.Order) => formatDateTime(data?.expireTime) as string, + }, + { + field: 'createTime', + label: '创建时间', + content: (data: PayOrderApi.Order) => formatDateTime(data?.createTime) as string, + }, + { + field: 'updateTime', + label: '更新时间', + content: (data: PayOrderApi.Order) => formatDateTime(data?.updateTime) as string, + }, + { + field: 'subject', + label: '商品标题', + }, + { + field: 'body', + label: '商品描述', + }, + { + field: 'channelCode', + label: '支付渠道', + content: (data: PayOrderApi.Order) => + h(DictTag, { + type: DICT_TYPE.PAY_CHANNEL_CODE, + value: data?.channelCode, + }), + }, + { + field: 'userIp', + label: '支付 IP', + }, + { + field: 'channelOrderNo', + label: '渠道单号', + content: (data: PayOrderApi.Order) => + h(ElTag, { color: 'green' }, () => data?.channelOrderNo || ''), + }, + { + field: 'channelUserId', + label: '渠道用户', + }, + { + field: 'refundPrice', + label: '退款金额', + content: (data: PayOrderApi.Order) => `¥${erpPriceInputFormatter(data?.refundPrice)}`, + }, + { + field: 'notifyUrl', + label: '通知 URL', + }, + { + field: 'channelNotifyData', + label: '支付通道异步回调内容', + }, + ]; +} diff --git a/apps/web-ele/src/views/pay/order/index.vue b/apps/web-ele/src/views/pay/order/index.vue new file mode 100644 index 000000000..73d543e2d --- /dev/null +++ b/apps/web-ele/src/views/pay/order/index.vue @@ -0,0 +1,115 @@ + + + diff --git a/apps/web-ele/src/views/pay/order/modules/detail.vue b/apps/web-ele/src/views/pay/order/modules/detail.vue new file mode 100644 index 000000000..1ea6f89b1 --- /dev/null +++ b/apps/web-ele/src/views/pay/order/modules/detail.vue @@ -0,0 +1,56 @@ + + diff --git a/apps/web-ele/src/views/pay/refund/data.ts b/apps/web-ele/src/views/pay/refund/data.ts new file mode 100644 index 000000000..fdf384a95 --- /dev/null +++ b/apps/web-ele/src/views/pay/refund/data.ts @@ -0,0 +1,254 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { DescriptionItemSchema } from '#/components/description'; + +import { h } from 'vue'; + +import { fenToYuan, formatDateTime } from '@vben/utils'; + +import { ElTag } from 'element-plus'; + +import { getAppList } from '#/api/pay/app'; +import { DictTag } from '#/components/dict-tag'; +import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils'; + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'appId', + label: '应用编号', + component: 'ApiSelect', + componentProps: { + api: async () => { + const data = await getAppList(); + return data.map((item) => ({ + label: item.name, + value: item.id, + })); + }, + autoSelect: 'first', + placeholder: '请选择数据源', + }, + }, + { + fieldName: 'channelCode', + label: '退款渠道', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.PAY_CHANNEL_CODE, 'string'), + }, + }, + { + fieldName: 'merchantOrderId', + label: '商户支付单号', + component: 'Input', + }, + { + fieldName: 'merchantRefundId', + label: '商户退款单号', + component: 'Input', + }, + { + fieldName: 'channelOrderNo', + label: '渠道支付单号', + component: 'Input', + }, + { + fieldName: 'channelRefundNo', + label: '渠道退款单号', + component: 'Input', + }, + { + fieldName: 'status', + label: '退款状态', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.PAY_REFUND_STATUS, 'number'), + }, + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + allowClear: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '编号', + }, + { + field: 'merchantRefundId', + title: '退款订单号', + }, + { + field: 'channelRefundNo', + title: '渠道退款单号', + }, + { + field: 'payPrice', + title: '支付金额', + formatter: 'formatAmount2', + }, + { + field: 'refundPrice', + title: '退款金额', + formatter: 'formatAmount2', + }, + { + field: 'status', + title: '退款状态', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.PAY_REFUND_STATUS }, + }, + }, + { + field: 'createTime', + title: '创建时间', + formatter: 'formatDateTime', + }, + { + title: '操作', + width: 100, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 详情页的字段 */ +export function useBaseDetailSchema(): DescriptionItemSchema[] { + return [ + { + field: 'merchantRefundId', + label: '商户退款单号', + content: (data) => + h(ElTag, {}, () => { + return data?.merchantRefundId || '-'; + }), + }, + { + field: 'channelRefundNo', + label: '渠道退款单号', + content: (data) => + h(ElTag, {}, () => { + return data?.channelRefundNo || '-'; + }), + }, + { + field: 'merchantOrderId', + label: '商户支付单号', + content: (data) => + h(ElTag, {}, () => { + return data?.merchantOrderId || '-'; + }), + }, + { + field: 'channelOrderNo', + label: '渠道支付单号', + content: (data) => + h(ElTag, {}, () => { + return data?.channelOrderNo || '-'; + }), + }, + { + field: 'appId', + label: '应用编号', + }, + { + field: 'appName', + label: '应用名称', + }, + { + field: 'payPrice', + label: '支付金额', + content: (data) => + h(ElTag, { color: 'success' }, () => { + return fenToYuan(data.payPrice || 0); + }), + }, + { + field: 'refundPrice', + label: '退款金额', + content: (data) => + h(ElTag, { color: 'red' }, () => { + return fenToYuan(data.refundPrice || 0); + }), + }, + { + field: 'status', + label: '退款状态', + content: (data) => + h(DictTag, { + type: DICT_TYPE.PAY_REFUND_STATUS, + value: data?.status, + }), + }, + { + field: 'successTime', + label: '退款时间', + content: (data) => formatDateTime(data.successTime) as string, + }, + { + field: 'createTime', + label: '创建时间', + content: (data) => formatDateTime(data.createTime) as string, + }, + { + field: 'updateTime', + label: '更新时间', + content: (data) => formatDateTime(data.updateTime) as string, + }, + ]; +} + +/** 详情页的字段 */ +export function useChannelDetailSchema(): DescriptionItemSchema[] { + return [ + { + field: 'channelCode', + label: '退款渠道', + content: (data) => + h(DictTag, { + type: DICT_TYPE.PAY_CHANNEL_CODE, + value: data?.channelCode, + }), + }, + { + field: 'reason', + label: '退款原因', + }, + { + field: 'userIp', + label: '退款 IP', + }, + { + field: 'notifyUrl', + label: '通知 URL', + }, + { + field: 'channelErrorCode', + label: '渠道错误码', + }, + { + field: 'channelErrorMsg', + label: '渠道错误码描述', + }, + { + field: 'channelNotifyData', + label: '支付通道异步回调内容', + }, + ]; +} diff --git a/apps/web-ele/src/views/pay/refund/index.vue b/apps/web-ele/src/views/pay/refund/index.vue new file mode 100644 index 000000000..6ad912e85 --- /dev/null +++ b/apps/web-ele/src/views/pay/refund/index.vue @@ -0,0 +1,103 @@ + + diff --git a/apps/web-ele/src/views/pay/refund/modules/detail.vue b/apps/web-ele/src/views/pay/refund/modules/detail.vue new file mode 100644 index 000000000..226d7bf3b --- /dev/null +++ b/apps/web-ele/src/views/pay/refund/modules/detail.vue @@ -0,0 +1,73 @@ + + + diff --git a/apps/web-ele/src/views/pay/transfer/data.ts b/apps/web-ele/src/views/pay/transfer/data.ts new file mode 100644 index 000000000..b59ae2f12 --- /dev/null +++ b/apps/web-ele/src/views/pay/transfer/data.ts @@ -0,0 +1,274 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { DescriptionItemSchema } from '#/components/description'; + +import { h } from 'vue'; + +import { erpPriceInputFormatter, formatDateTime } from '@vben/utils'; + +import { ElTag } from 'element-plus'; + +import { DictTag } from '#/components/dict-tag'; +import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils'; + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'no', + label: '转账单号', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入转账单号', + }, + }, + { + fieldName: 'channelCode', + label: '转账渠道', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.PAY_CHANNEL_CODE), + allowClear: true, + placeholder: '请选择支付渠道', + }, + }, + { + fieldName: 'merchantTransferId', + label: '商户单号', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入商户单号', + }, + }, + { + fieldName: 'type', + label: '类型', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.PAY_TRANSFER_TYPE), + allowClear: true, + placeholder: '请选择类型', + }, + }, + { + fieldName: 'status', + label: '转账状态', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.PAY_TRANSFER_STATUS), + allowClear: true, + placeholder: '请选择转账状态', + }, + }, + { + fieldName: 'userName', + label: '收款人姓名', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入收款人姓名', + }, + }, + { + fieldName: 'accountNo', + label: '收款人账号', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入收款人账号', + }, + }, + { + fieldName: 'channelTransferNo', + label: '渠道单号', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入渠道单号', + }, + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + allowClear: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '编号', + }, + { + field: 'createTime', + title: '创建时间', + formatter: 'formatDateTime', + }, + { + field: 'appName', + title: '支付应用', + }, + { + field: 'price', + title: '转账金额', + formatter: 'formatAmount2', + }, + { + field: 'status', + title: '转账状态', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.PAY_TRANSFER_STATUS }, + }, + }, + { + field: 'type', + title: '类型', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.PAY_TRANSFER_TYPE }, + }, + }, + { + field: 'channelCode', + title: '支付渠道', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.PAY_CHANNEL_CODE }, + }, + }, + { + field: 'merchantTransferId', + title: '商户单号', + }, + { + field: 'channelTransferNo', + title: '渠道单号', + }, + { + field: 'userName', + title: '收款人姓名', + }, + { + field: 'accountNo', + title: '收款人账号', + }, + { + title: '操作', + width: 120, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 详情的配置 */ +export function useDetailSchema(): DescriptionItemSchema[] { + return [ + { + field: 'id', + label: '编号', + }, + { + field: 'merchantTransferId', + label: '商户单号', + content: (data) => { + return h(ElTag, { + color: 'blue', + content: data?.merchantTransferId, + }); + }, + }, + { + field: 'no', + label: '转账单号', + content: (data) => { + return h(ElTag, { + color: 'blue', + content: data?.no, + }); + }, + }, + { + field: 'appId', + label: '应用编号', + }, + { + field: 'status', + label: '转账状态', + content: (data) => + h(DictTag, { + type: DICT_TYPE.PAY_TRANSFER_STATUS, + value: data?.status, + }), + }, + { + field: 'price', + label: '转账金额', + content: (data) => { + return h(ElTag, { + color: 'blue', + content: `¥${erpPriceInputFormatter(data?.price)}`, + }); + }, + }, + { + field: 'successTime', + label: '转账时间', + content: (data) => formatDateTime(data?.successTime) as string, + }, + { + field: 'createTime', + label: '创建时间', + content: (data) => formatDateTime(data?.createTime) as string, + }, + { + field: 'userName', + label: '收款人姓名', + }, + { + field: 'userAccount', + label: '收款人账号', + }, + { + field: 'channelCode', + label: '支付渠道', + content: (data) => + h(DictTag, { + type: DICT_TYPE.PAY_CHANNEL_CODE, + value: data?.channelCode, + }), + }, + { + field: 'channelCode', + label: '支付 IP', + }, + { + field: 'channelTransferNo', + label: '渠道单号', + content: (data) => { + return h(ElTag, { + color: 'blue', + content: data?.channelTransferNo, + }); + }, + }, + { + field: 'notifyUrl', + label: '通知 URL', + }, + { + field: 'channelNotifyData', + label: '转账渠道通知内容', + }, + ]; +} diff --git a/apps/web-ele/src/views/pay/transfer/index.vue b/apps/web-ele/src/views/pay/transfer/index.vue new file mode 100644 index 000000000..10b540c64 --- /dev/null +++ b/apps/web-ele/src/views/pay/transfer/index.vue @@ -0,0 +1,103 @@ + + + diff --git a/apps/web-ele/src/views/pay/transfer/modules/detail.vue b/apps/web-ele/src/views/pay/transfer/modules/detail.vue new file mode 100644 index 000000000..79868c194 --- /dev/null +++ b/apps/web-ele/src/views/pay/transfer/modules/detail.vue @@ -0,0 +1,57 @@ + + + diff --git a/apps/web-ele/src/views/pay/wallet/balance/data.ts b/apps/web-ele/src/views/pay/wallet/balance/data.ts new file mode 100644 index 000000000..59d064c5e --- /dev/null +++ b/apps/web-ele/src/views/pay/wallet/balance/data.ts @@ -0,0 +1,86 @@ +import type { VxeTableGridOptions } from '@vben/plugins/vxe-table'; + +import type { VbenFormSchema } from '#/adapter/form'; + +import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils'; + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'userId', + label: '用户编号', + component: 'Input', + }, + { + fieldName: 'userType', + label: '用户类型', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.USER_TYPE, 'number'), + }, + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { + allowClear: true, + ...getRangePickerDefaultProps(), + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + title: '编号', + field: 'id', + }, + { + title: '用户编号', + field: 'userId', + }, + { + title: '用户类型', + field: 'userType', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.USER_TYPE }, + }, + }, + { + title: '余额', + field: 'balance', + formatter: 'formatAmount2', + }, + { + title: '累计支出', + field: 'totalExpense', + formatter: 'formatAmount2', + }, + { + title: '累计充值', + field: 'totalRecharge', + formatter: 'formatAmount2', + }, + { + title: '冻结金额', + field: 'freezePrice', + formatter: 'formatAmount2', + }, + { + title: '创建时间', + field: 'createTime', + formatter: 'formatDateTime', + }, + { + title: '操作', + field: 'actions', + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-ele/src/views/pay/wallet/balance/index.vue b/apps/web-ele/src/views/pay/wallet/balance/index.vue new file mode 100644 index 000000000..ea38835b9 --- /dev/null +++ b/apps/web-ele/src/views/pay/wallet/balance/index.vue @@ -0,0 +1,82 @@ + + + diff --git a/apps/web-ele/src/views/pay/wallet/balance/modules/detail.vue b/apps/web-ele/src/views/pay/wallet/balance/modules/detail.vue new file mode 100644 index 000000000..1fa710207 --- /dev/null +++ b/apps/web-ele/src/views/pay/wallet/balance/modules/detail.vue @@ -0,0 +1,40 @@ + + diff --git a/apps/web-ele/src/views/pay/wallet/rechargePackage/data.ts b/apps/web-ele/src/views/pay/wallet/rechargePackage/data.ts new file mode 100644 index 000000000..d365a6f73 --- /dev/null +++ b/apps/web-ele/src/views/pay/wallet/rechargePackage/data.ts @@ -0,0 +1,119 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils'; + +/** 新增/修改的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'name', + label: '套餐名', + component: 'Input', + rules: 'required', + }, + { + fieldName: 'payPrice', + label: '支付金额(元)', + component: 'InputNumber', + rules: 'required', + componentProps: { + min: 0, + precision: 2, + step: 0.01, + }, + }, + { + fieldName: 'bonusPrice', + label: '赠送金额(元)', + component: 'InputNumber', + rules: 'required', + componentProps: { + min: 0, + precision: 2, + step: 0.01, + }, + }, + { + fieldName: 'status', + label: '开启状态', + component: 'RadioGroup', + rules: 'required', + componentProps: { + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + }, + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'name', + label: '套餐名称', + component: 'Input', + }, + { + fieldName: 'status', + label: '状态', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + }, + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { + allowClear: true, + ...getRangePickerDefaultProps(), + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '编号', + }, + { + field: 'name', + title: '套餐名称', + }, + { + field: 'payPrice', + title: '支付金额', + formatter: 'formatAmount2', + }, + { + field: 'bonusPrice', + title: '赠送金额', + formatter: 'formatAmount2', + }, + { + field: 'status', + title: '状态', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.COMMON_STATUS }, + }, + }, + { + field: 'createTime', + title: '创建时间', + formatter: 'formatDateTime', + }, + { + title: '操作', + width: 130, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-ele/src/views/pay/wallet/rechargePackage/index.vue b/apps/web-ele/src/views/pay/wallet/rechargePackage/index.vue new file mode 100644 index 000000000..8a1513f35 --- /dev/null +++ b/apps/web-ele/src/views/pay/wallet/rechargePackage/index.vue @@ -0,0 +1,127 @@ + + + diff --git a/apps/web-ele/src/views/pay/wallet/rechargePackage/modules/form.vue b/apps/web-ele/src/views/pay/wallet/rechargePackage/modules/form.vue new file mode 100644 index 000000000..7c594595e --- /dev/null +++ b/apps/web-ele/src/views/pay/wallet/rechargePackage/modules/form.vue @@ -0,0 +1,98 @@ + + + diff --git a/apps/web-ele/src/views/pay/wallet/transaction/data.ts b/apps/web-ele/src/views/pay/wallet/transaction/data.ts new file mode 100644 index 000000000..2fe7a7279 --- /dev/null +++ b/apps/web-ele/src/views/pay/wallet/transaction/data.ts @@ -0,0 +1,40 @@ +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '编号', + width: 80, + }, + { + field: 'walletId', + title: '钱包编号', + width: 100, + }, + { + field: 'title', + title: '关联业务标题', + width: 200, + }, + { + field: 'price', + title: '交易金额', + width: 120, + formatter: ({ cellValue }) => `${cellValue / 100} 元`, + }, + { + field: 'balance', + title: '钱包余额', + width: 120, + formatter: ({ cellValue }) => `${cellValue / 100} 元`, + }, + { + field: 'createTime', + title: '交易时间', + width: 180, + formatter: 'formatDateTime', + }, + ]; +} diff --git a/apps/web-ele/src/views/pay/wallet/transaction/index.vue b/apps/web-ele/src/views/pay/wallet/transaction/index.vue new file mode 100644 index 000000000..dafb495cd --- /dev/null +++ b/apps/web-ele/src/views/pay/wallet/transaction/index.vue @@ -0,0 +1,61 @@ + + +