| | |
| | | <script setup lang="ts"> |
| | | import { ProDialog, toThousand } from '@bole-core/components'; |
| | | import { usePortraitTable } from '@/hooks'; |
| | | import * as userServices from '@/services/api/user'; |
| | | import { useQuery } from '@tanstack/vue-query'; |
| | | import { EnumWalletTransactionStatusText } from '@/constants'; |
| | | |
| | | defineOptions({ |
| | | name: 'FinanceDetailDialog', |
| | | }); |
| | | |
| | | type Form = { |
| | | name?: string; |
| | | id?: string; |
| | | }; |
| | | |
| | | const visible = defineModel({ type: Boolean }); |
| | |
| | | (e: 'onCancel'): void; |
| | | }>(); |
| | | |
| | | const { data: detail, refetch } = useQuery({ |
| | | queryKey: ['userResumeServices/getUserResume', form.value.id], |
| | | queryFn: async () => { |
| | | return await userServices.getPersonalUserTransaction({ id: form.value.id }); |
| | | }, |
| | | placeholderData: () => ({} as API.GetPersonalUserTransactionQueryResult), |
| | | enabled: computed(() => !!form.value.id), |
| | | }); |
| | | |
| | | watch( |
| | | () => form.value.id, |
| | | (val) => { |
| | | if (val) { |
| | | refetch(); |
| | | } |
| | | } |
| | | ); |
| | | |
| | | const { portraitTableProps } = usePortraitTable({ |
| | | data: form, |
| | | data: detail, |
| | | columns: [ |
| | | { |
| | | label: '付款人账户', |
| | | key: 'name', |
| | | type: 'text', |
| | | key: 'payerAccount', |
| | | }, |
| | | { |
| | | label: '收款人账户', |
| | | key: 'name', |
| | | type: 'text', |
| | | key: 'receiveAccount', |
| | | }, |
| | | { |
| | | label: '付款人名称', |
| | | key: 'name', |
| | | type: 'text', |
| | | key: 'payerName', |
| | | }, |
| | | { |
| | | label: '收款人名称', |
| | | key: 'name', |
| | | type: 'text', |
| | | key: 'receiveName', |
| | | }, |
| | | { |
| | | label: '付款人开户行', |
| | | key: 'name', |
| | | type: 'text', |
| | | key: 'payerBank', |
| | | }, |
| | | { |
| | | label: '收款人开户行', |
| | | key: 'name', |
| | | type: 'text', |
| | | key: 'receiveBank', |
| | | }, |
| | | { |
| | | label: '币种', |
| | | key: 'name', |
| | | type: 'text', |
| | | key: 'currency', |
| | | }, |
| | | { |
| | | label: '交易金额', |
| | | key: 'name', |
| | | key: 'actualAmount', |
| | | type: 'money', |
| | | }, |
| | | { |
| | | label: '用途', |
| | | key: 'name', |
| | | type: 'text', |
| | | key: 'purpose', |
| | | }, |
| | | { |
| | | label: '摘要', |
| | | key: 'name', |
| | | type: 'text', |
| | | key: 'failReason', |
| | | }, |
| | | { |
| | | label: '交易时间', |
| | | key: 'name', |
| | | type: 'text', |
| | | key: 'transDate', |
| | | type: 'date', |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | }, |
| | | { |
| | | label: '交易状态', |
| | | key: 'name', |
| | | type: 'text', |
| | | key: 'transactionStatus', |
| | | type: 'enum', |
| | | valueEnum: EnumWalletTransactionStatusText, |
| | | }, |
| | | ], |
| | | }); |