| | |
| | | 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, |
| | | }; |
| | | } |