From 23093df749742fe98fcee61cf0fe00957aa176d1 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期一, 07 七月 2025 09:43:51 +0800
Subject: [PATCH] Merge branch 'dev-2.2.1' of http://120.26.58.240:8888/r/JYBIndependentFront into dev-2.2.1

---
 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