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.

252 lines
5.0 KiB

2 years ago
import { getAppList } from '@/api/pay/app'
import type { DescItem } from '@/components/Description'
import type { BasicColumn, FormSchema } from '@/components/Table'
import { useRender } from '@/components/Table'
2 years ago
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
2 years ago
export const columns: BasicColumn[] = [
{
title: '编号',
dataIndex: 'id',
width: 100,
2 years ago
},
{
2 years ago
title: '支付金额(元)',
dataIndex: 'payPrice',
width: 120,
customRender: ({ text }) => {
return `${Number.parseFloat(`${text / 100}`).toFixed(2)}`
},
},
{
title: '退款金额(元)',
dataIndex: 'refundPrice',
width: 120,
customRender: ({ text }) => {
return `${Number.parseFloat(`${text / 100}`).toFixed(2)}`
},
},
{
title: '退款订单号',
2 years ago
children: [
{
2 years ago
title: '商户',
dataIndex: 'merchantRefundId',
width: 120,
2 years ago
},
{
2 years ago
title: '退款',
dataIndex: 'no',
width: 120,
2 years ago
},
{
2 years ago
title: '渠道',
dataIndex: 'channelRefundNo',
width: 160,
},
],
2 years ago
},
{
title: '支付订单号',
children: [
{
2 years ago
title: '商户',
dataIndex: 'merchantOrderId',
width: 200,
2 years ago
},
{
title: '渠道',
dataIndex: 'channelOrderNo',
2 years ago
width: 100,
},
],
2 years ago
},
{
title: '退款状态',
dataIndex: 'status',
width: 100,
customRender: ({ text }) => {
2 years ago
return useRender.renderDict(text, DICT_TYPE.PAY_REFUND_STATUS)
},
2 years ago
},
{
2 years ago
title: '退款渠道',
dataIndex: 'channelCode',
2 years ago
width: 100,
customRender: ({ text }) => {
2 years ago
return useRender.renderDict(text, DICT_TYPE.PAY_CHANNEL_CODE)
},
2 years ago
},
{
title: '创建时间',
dataIndex: 'createTime',
width: 180,
customRender: ({ text }) => {
return useRender.renderDate(text)
},
2 years ago
},
{
title: '退款成功时间',
dataIndex: 'successTime',
width: 180,
customRender: ({ text }) => {
return useRender.renderDate(text)
},
},
2 years ago
{
title: '支付应用',
dataIndex: 'appName',
width: 100,
},
2 years ago
]
export const searchFormSchema: FormSchema[] = [
{
label: '应用编号',
field: 'appId',
2 years ago
component: 'ApiSelect',
2 years ago
componentProps: {
2 years ago
api: () => getAppList(),
labelField: 'name',
valueField: 'id',
2 years ago
},
colProps: { span: 8 },
2 years ago
},
{
2 years ago
label: '商户支付单号',
field: 'merchantOrderId',
component: 'Input',
colProps: { span: 8 },
2 years ago
},
{
2 years ago
label: '商户退款单号',
field: 'merchantRefundId',
2 years ago
component: 'Input',
colProps: { span: 8 },
2 years ago
},
{
2 years ago
label: '渠道支付单号',
field: 'channelOrderNo',
2 years ago
component: 'Input',
colProps: { span: 8 },
2 years ago
},
{
label: '退款状态',
field: 'status',
component: 'Select',
componentProps: {
2 years ago
options: getDictOptions(DICT_TYPE.PAY_REFUND_STATUS),
2 years ago
},
colProps: { span: 8 },
2 years ago
},
{
label: '创建时间',
field: 'createTime',
component: 'RangePicker',
colProps: { span: 8 },
},
2 years ago
]
export const descSchema: DescItem[] = [
{
2 years ago
label: '商户退款单号',
field: 'merchantRefundId',
2 years ago
},
{
2 years ago
label: '渠道退款单号',
field: 'channelRefundNo',
2 years ago
},
{
2 years ago
label: '商户支付单号',
field: 'merchantOrderId',
2 years ago
},
{
2 years ago
label: '渠道支付单号',
field: 'channelOrderNo',
2 years ago
render: (curVal) => {
return useRender.renderTag(curVal)
},
2 years ago
},
{
2 years ago
label: '应用编号',
field: 'appId',
2 years ago
},
{
2 years ago
label: '应用名称',
field: 'appName',
2 years ago
},
{
2 years ago
label: '支付金额',
field: 'payPrice',
2 years ago
render: (curVal) => {
2 years ago
return `${Number.parseFloat(`${curVal / 100}`).toFixed(2)}`
},
2 years ago
},
{
2 years ago
label: '退款金额',
field: 'refundPrice',
2 years ago
render: (curVal) => {
2 years ago
return `${Number.parseFloat(`${curVal / 100}`).toFixed(2)}`
},
2 years ago
},
{
label: '退款状态',
field: 'status',
render: (curVal) => {
2 years ago
return useRender.renderDict(curVal, DICT_TYPE.PAY_REFUND_STATUS)
},
2 years ago
},
{
label: '创建时间',
field: 'createTime',
render: (curVal) => {
return useRender.renderDate(curVal)
},
2 years ago
},
{
label: '退款成功时间',
field: 'successTime',
render: (curVal) => {
return useRender.renderDate(curVal)
},
2 years ago
},
{
label: '更新时间',
field: 'updateTime',
render: (curVal) => {
return useRender.renderDate(curVal)
},
2 years ago
},
{
2 years ago
label: '退款渠道',
field: 'channelCode',
2 years ago
render: (curVal) => {
2 years ago
return useRender.renderDict(curVal, DICT_TYPE.PAY_CHANNEL_CODE)
},
2 years ago
},
{
2 years ago
label: '退款原因',
field: 'reason',
2 years ago
},
{
2 years ago
label: '退款 IP',
field: 'userIp',
2 years ago
},
{
2 years ago
label: '退款 URL',
field: 'notifyUrl',
2 years ago
},
{
label: '渠道错误码',
field: 'channelErrorCode',
2 years ago
},
{
label: '渠道错误码描述',
2 years ago
field: 'channelErrorMsg',
2 years ago
},
{
2 years ago
label: '支付通道异步回调内容',
field: 'channelNotifyData',
},
2 years ago
]