From d54c9c48c0b4f7c609e0aa65671a6c3fd26f94b4 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期五, 04 七月 2025 13:19:29 +0800 Subject: [PATCH] fix: 江佑保系统健壮性修复 --- src/hooks/insuranceClaim.ts | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 52 insertions(+), 0 deletions(-) diff --git a/src/hooks/insuranceClaim.ts b/src/hooks/insuranceClaim.ts index 1f0aaef..7e60a39 100644 --- a/src/hooks/insuranceClaim.ts +++ b/src/hooks/insuranceClaim.ts @@ -29,3 +29,55 @@ refetch, }; } + +type UseInsurancePolicyPayOptions = { + id: MaybeRef<string>; +}; + +export function useInsurancePolicyPay({ id }: UseInsurancePolicyPayOptions) { + const { data: insurancePolicyPayList, isLoading } = useQuery({ + queryKey: ['insuranceOrderServices/getInsurancePolicyPay', id], + queryFn: async () => { + return await insuranceOrderServices.getInsurancePolicyPay({ + id: unref(id), + }); + }, + placeholderData: () => [] as API.InsurancePolicyPayDto[], + }); + + return { + insurancePolicyPayList, + isLoading, + }; +} + +export function useInsureActions() { + const router = useRouter(); + async function handleGoDownloadInvoice(id: string) { + try { + await insuranceOrderServices.getInvoiceId({ id: id }); + router.push({ + name: 'InsureDownloadInvoice', + params: { + id: id, + }, + }); + } catch (error) {} + } + + async function handleGoStampFiles(id: string) { + try { + router.push({ + name: 'InsurancePolicyStampFiles', + params: { + id: id, + }, + }); + } catch (error) {} + } + + return { + handleGoDownloadInvoice, + handleGoStampFiles, + }; +} -- Gitblit v1.9.1