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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

279 lines
5.6 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
},
{
title: '支付金额(元)',
dataIndex: 'amount',
width: 120,
customRender: ({ text }) => {
return `${Number.parseFloat(text || 0 / 100).toFixed(2)}`
},
2 years ago
},
{
title: '手续金额(元)',
dataIndex: 'channelFeeAmount',
width: 120,
customRender: ({ text }) => {
return `${Number.parseFloat(text || 0 / 100).toFixed(2)}`
},
2 years ago
},
{
title: '退款金额(元)',
dataIndex: 'refundAmount',
width: 120,
customRender: ({ text }) => {
return `${Number.parseFloat(text || 0 / 100).toFixed(2)}`
},
2 years ago
},
2 years ago
{
title: '订单号',
children: [
{
title: '商户',
dataIndex: 'merchantOrderId',
width: 120,
},
{
title: '支付',
dataIndex: 'no',
width: 120,
},
{
title: '渠道',
dataIndex: 'channelOrderNo',
width: 160,
},
],
},
2 years ago
{
title: '支付状态',
dataIndex: 'status',
width: 100,
customRender: ({ text }) => {
return useRender.renderDict(text, DICT_TYPE.PAY_ORDER_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
},
2 years ago
{
title: '支付应用',
dataIndex: 'appName',
width: 100,
},
{
title: '商品标题',
dataIndex: 'subject',
width: 180,
},
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
]
export const searchFormSchema: FormSchema[] = [
{
2 years ago
label: '应用编号',
field: 'appId',
2 years ago
component: 'ApiSelect',
componentProps: {
2 years ago
api: () => getAppList(),
labelField: 'name',
valueField: 'id',
2 years ago
},
colProps: { span: 8 },
2 years ago
},
{
2 years ago
label: '支付渠道',
2 years ago
field: 'channelCode',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.PAY_CHANNEL_CODE_TYPE),
2 years ago
},
colProps: { span: 8 },
2 years ago
},
{
2 years ago
label: '商户单号',
2 years ago
field: 'merchantOrderId',
component: 'Input',
colProps: { span: 8 },
2 years ago
},
{
2 years ago
label: '支付单号',
field: 'no',
component: 'Input',
colProps: { span: 8 },
},
{
label: '渠道单号',
2 years ago
field: 'channelOrderNo',
component: 'Input',
colProps: { span: 8 },
2 years ago
},
{
label: '支付状态',
field: 'status',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.PAY_ORDER_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: 'merchantOrderId',
2 years ago
},
{
2 years ago
label: '支付单号',
field: 'no',
2 years ago
render: (curVal) => {
return useRender.renderTag(curVal)
},
2 years ago
},
{
2 years ago
label: '应用编号',
field: 'appId',
},
{
label: '应用名称',
field: 'appName',
2 years ago
},
{
2 years ago
label: '支付状态',
field: 'status',
2 years ago
render: (curVal) => {
2 years ago
return useRender.renderDict(curVal, DICT_TYPE.PAY_ORDER_STATUS)
},
2 years ago
},
{
label: '支付金额',
field: 'amount',
render: (curVal) => {
return `${Number.parseFloat(curVal || 0 / 100).toFixed(2)}`
},
2 years ago
},
{
label: '手续费',
field: 'channelFeeAmount',
render: (curVal) => {
return `${Number.parseFloat(curVal || 0 / 100).toFixed(2)}`
},
2 years ago
},
{
label: '手续费比例',
field: 'channelFeeRate',
render: (curVal) => {
return `${Number.parseFloat(curVal || 0 / 100).toFixed(2)}%`
},
2 years ago
},
{
2 years ago
label: '支付时间',
field: 'successTime',
2 years ago
render: (curVal) => {
2 years ago
return useRender.renderDate(curVal)
},
2 years ago
},
{
2 years ago
label: '失效时间',
field: 'expireTime',
2 years ago
render: (curVal) => {
2 years ago
return useRender.renderDate(curVal)
},
2 years ago
},
{
label: '创建时间',
field: 'createTime',
render: (curVal) => {
return useRender.renderDate(curVal)
},
2 years ago
},
{
2 years ago
label: '更新时间',
field: 'updateTime',
2 years ago
render: (curVal) => {
return useRender.renderDate(curVal)
},
2 years ago
},
{
2 years ago
label: '商品标题',
field: 'subject',
2 years ago
},
{
2 years ago
label: '商品描述',
field: 'body',
2 years ago
},
{
label: '支付渠道',
2 years ago
field: 'channelCode',
render: (curVal) => {
return useRender.renderDict(curVal, DICT_TYPE.PAY_CHANNEL_CODE)
},
2 years ago
},
{
2 years ago
label: '支付 IP',
field: 'userIp',
2 years ago
},
{
2 years ago
label: '渠道单号',
field: 'channelOrderNo',
2 years ago
render: (curVal) => {
2 years ago
return useRender.renderTag(curVal)
},
2 years ago
},
{
2 years ago
label: '渠道用户',
field: 'channelUserId',
2 years ago
},
{
label: '退款金额',
2 years ago
field: 'refundPrice',
2 years ago
render: (curVal) => {
2 years ago
return `${Number.parseFloat(`${curVal / 100}`).toFixed(2)}`
},
2 years ago
},
{
2 years ago
label: '通知 URL',
field: 'notifyUrl',
2 years ago
},
{
label: '支付通道异步回调内容',
2 years ago
field: 'extension.channelNotifyData',
},
2 years ago
]