49 lines
2.3 KiB
TypeScript
49 lines
2.3 KiB
TypeScript
import { h, ref } from 'vue';
|
|
import { NTag } from 'naive-ui';
|
|
import { FormSchema } from '@/components/Form';
|
|
import { useDictStore } from '@/store/modules/dict';
|
|
import { defRangeShortcuts } from '@/utils/dateUtil';
|
|
import { renderImageGroup } from '@/utils';
|
|
|
|
const dict = useDictStore();
|
|
|
|
export const schemas = ref<FormSchema[]>([
|
|
{ field: 'rechargeNo', component: 'NInput', label: '订单号', componentProps: { clearable: true } },
|
|
{ field: 'username', component: 'NInput', label: '用户名', componentProps: { clearable: true } },
|
|
{ field: 'mobile', component: 'NInput', label: '手机号', componentProps: { placeholder: '精确查询', clearable: true } },
|
|
{ field: 'channelName', component: 'NInput', label: '支付方式', componentProps: { clearable: true } },
|
|
{ field: 'createdAt', component: 'NDatePicker', label: '筛选时间', componentProps: { type: 'datetimerange', clearable: true, shortcuts: defRangeShortcuts() } },
|
|
]);
|
|
|
|
const tag = (type, value) =>
|
|
h(NTag, { type: dict.getType(type, value), bordered: false }, { default: () => dict.getLabel(type, value) || '-' });
|
|
const yuan = (value) => `¥${((value || 0) / 100).toFixed(2)}`;
|
|
|
|
export const columns = [
|
|
{ title: '订单号', key: 'rechargeNo', width: 210 },
|
|
{ title: '真实姓名', key: 'realNameMask', width: 110 },
|
|
{
|
|
title: '备注',
|
|
key: 'reviewReason',
|
|
width: 180,
|
|
ellipsis: { tooltip: true },
|
|
render: (row) => row.reviewReason || row.remark || dict.getLabel('rechargeStatus', row.rechargeStatus) || '-',
|
|
},
|
|
{ title: '手机号', key: 'mobile', width: 130 },
|
|
{ title: '用户余额', key: 'availableAmount', width: 120, render: (row) => yuan(row.availableAmount) },
|
|
{ title: '交易金额', key: 'requestAmount', width: 120, render: (row) => yuan(row.requestAmount) },
|
|
{
|
|
title: '打款凭证',
|
|
key: 'voucherAttachmentIds',
|
|
width: 110,
|
|
render: (row) => renderImageGroup(row.voucherAttachmentIds),
|
|
},
|
|
{ title: '添加时间', key: 'createdAt', width: 180 },
|
|
{ title: '支付方式', key: 'channelName', width: 120 },
|
|
{ title: '类型', key: 'rechargeType', width: 100, render: (row) => tag('rechargeType', row.rechargeType) },
|
|
{ title: '处理时间', key: 'reviewedAt', width: 180 },
|
|
];
|
|
|
|
export const loadOptions = () =>
|
|
dict.loadOptions(['rechargeStatus', 'rechargeType', 'financeDecision', 'recharge_reject_reason']);
|