diff --git a/apps/web-antd/src/api/pay/order/index.ts b/apps/web-antd/src/api/pay/order/index.ts index 984a5d1f..31ba880d 100644 --- a/apps/web-antd/src/api/pay/order/index.ts +++ b/apps/web-antd/src/api/pay/order/index.ts @@ -6,8 +6,13 @@ export namespace PayOrderApi { /** 支付订单信息 */ export interface Order { id: number; + no: string; + price: number; + channelFeePrice: number; + refundPrice: number; merchantId: number; appId: number; + appName: string; channelId: number; channelCode: string; merchantOrderId: string; @@ -29,7 +34,9 @@ export namespace PayOrderApi { refundAmount: number; channelUserId: string; channelOrderNo: string; + channelNotifyData: string; createTime: Date; + updateTime: Date; } /** 支付订单分页请求 */ diff --git a/apps/web-antd/src/views/pay/app/index.vue b/apps/web-antd/src/views/pay/app/index.vue index 28ac5148..5116d91b 100644 --- a/apps/web-antd/src/views/pay/app/index.vue +++ b/apps/web-antd/src/views/pay/app/index.vue @@ -71,7 +71,7 @@ const gridOptions: VxeGridProps = { keyField: 'id', }, // 表格全局唯一表示 保存列配置需要用到 - id: 'system-notifyMessage-index', + id: 'pay-app-index', }; const [BasicTable, tableApi] = useVbenVxeGrid({ diff --git a/apps/web-antd/src/views/pay/app/modules/channel/AlipayChannelForm.vue b/apps/web-antd/src/views/pay/app/modules/channel/AlipayChannelForm.vue index 972a6093..a188ce67 100644 --- a/apps/web-antd/src/views/pay/app/modules/channel/AlipayChannelForm.vue +++ b/apps/web-antd/src/views/pay/app/modules/channel/AlipayChannelForm.vue @@ -49,7 +49,7 @@ const [BasicModal, modalApi] = useVbenModal({ modalApi.modalLoading(true); const { id, payCode } = modalApi.getData() as { - id?: string; + id?: number; payCode?: string; }; diff --git a/apps/web-antd/src/views/pay/order/data.ts b/apps/web-antd/src/views/pay/order/data.ts new file mode 100644 index 00000000..6874bed0 --- /dev/null +++ b/apps/web-antd/src/views/pay/order/data.ts @@ -0,0 +1,144 @@ +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; + +import { DICT_TYPE, getDictOptions } from '#/utils/dict'; + +export const querySchema: FormSchemaGetter = () => [ + { + 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 const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '编号', + field: 'id', + }, + { + title: '支付金额', + field: 'price', + slots: { + default: ({ row }) => { + return `¥${(row.price || 0 / 100).toFixed(2)}`; + }, + }, + }, + { + title: '退款金额', + field: 'refundPrice', + slots: { + default: ({ row }) => { + return `¥${(row.refundPrice || 0 / 100).toFixed(2)}`; + }, + }, + }, + { + title: '手续金额', + field: 'channelFeePrice', + slots: { + default: ({ row }) => { + return `¥${(row.channelFeePrice || 0 / 100).toFixed(2)}`; + }, + }, + }, + { + 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', + minWidth: 180, + formatter: 'formatDateTime', + }, + { + title: '支付应用', + field: 'appName', + }, + { + title: '商品标题', + field: 'subject', + }, + { + field: 'action', + fixed: 'right', + slots: { default: 'action' }, + title: '操作', + minWidth: 80, + }, +]; diff --git a/apps/web-antd/src/views/pay/order/index.vue b/apps/web-antd/src/views/pay/order/index.vue index 83f695e4..0a751cb0 100644 --- a/apps/web-antd/src/views/pay/order/index.vue +++ b/apps/web-antd/src/views/pay/order/index.vue @@ -1,13 +1,89 @@ - + - - 该功能支持 Vue3 + element-plus 版本! - - - - 可参考 - https://github.com/yudaocode/yudao-ui-admin-vue3/blob/master/src/views/pay/order/index - 代码,pull request 贡献给我们! - + + + + {{ $t('ui.actionTitle.detail') }} + + + + + 商户 {{ row.merchantOrderId }} + + + 支付 {{ row.no }} + + + 渠道 + {{ row.channelOrderNo }} + + + + diff --git a/apps/web-antd/src/views/pay/order/modules/OrderDetail.vue b/apps/web-antd/src/views/pay/order/modules/OrderDetail.vue new file mode 100644 index 00000000..e76be463 --- /dev/null +++ b/apps/web-antd/src/views/pay/order/modules/OrderDetail.vue @@ -0,0 +1,125 @@ + + + + + + {{ detailData?.merchantOrderId }} + + + {{ detailData?.no }} + + + {{ detailData?.appId }} + + + {{ detailData?.appName }} + + + + + + + ¥{{ (detailData?.price || 0 / 100.0).toFixed(2) }} + + + + + ¥{{ (detailData?.channelFeePrice || 0 / 100.0).toFixed(2) }} + + + + {{ (detailData?.channelFeeRate || 0 / 100.0).toFixed(2) }}% + + + {{ formatDateTime(detailData?.successTime) }} + + + {{ formatDateTime(detailData?.expireTime) }} + + + {{ formatDateTime(detailData?.createTime) }} + + + {{ formatDateTime(detailData?.updateTime) }} + + + + + + {{ detailData?.subject }} + + + {{ detailData?.body }} + + + + + + {{ detailData?.userIp }} + + + + {{ detailData?.channelOrderNo }} + + + + {{ detailData?.channelUserId }} + + + + ¥{{ (detailData?.refundPrice || 0 / 100.0).toFixed(2) }} + + + + {{ detailData?.notifyUrl }} + + + + + + {{ detailData?.channelNotifyData }} + + + + diff --git a/packages/locales/src/langs/zh-CN/ui.json b/packages/locales/src/langs/zh-CN/ui.json index 953a07bb..e5e6a05e 100644 --- a/packages/locales/src/langs/zh-CN/ui.json +++ b/packages/locales/src/langs/zh-CN/ui.json @@ -16,7 +16,8 @@ "delete": "删除{0}", "view": "查看{0}", "import": "导入", - "export": "导出" + "export": "导出", + "detail": "详情" }, "actionMessage": { "deleteConfirm": "确定删除 {0} 吗?",
+ 商户 {{ row.merchantOrderId }} +
+ 支付 {{ row.no }} +
+ 渠道 + {{ row.channelOrderNo }} +