From 089f6058826ac067061b6ed4958baff50f9bdac9 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期二, 29 七月 2025 17:40:17 +0800
Subject: [PATCH] fix: 新增生煎保(短期方案)

---
 src/views/Home/Home.vue |   73 ++++++++++++++++++++++++++++--------
 1 files changed, 56 insertions(+), 17 deletions(-)

diff --git a/src/views/Home/Home.vue b/src/views/Home/Home.vue
index d0dce4a..822087a 100644
--- a/src/views/Home/Home.vue
+++ b/src/views/Home/Home.vue
@@ -18,7 +18,7 @@
           <QueryFilterItem>
             <FieldRadio
               v-model="extraParamState.insurancePeriod"
-              :value-enum="insuranceTypeText"
+              :value-enum="insuranceTypeTextForFilter"
               buttonStyle
               showAllBtn
               @change="getList()"
@@ -160,11 +160,13 @@
   InsurancePolicyListPayStatusEnum,
   InsurancePolicyListPayStatusEnumText,
   InsuranceOccupationTypeTempPath,
+  InsurancePeriodEnum,
+  insuranceTypeTextForFilter,
 } from '@/constants';
 import dayjs from 'dayjs';
 import _ from 'lodash';
 import InsureInstructionsDialog from './components/InsureInstructionsDialog.vue';
-import { useUserInsureProductSetting } from '@/hooks';
+import { useInsureProductSchemeAllList, useUserInsureProductSetting } from '@/hooks';
 // import { Recorder } from '@/utils/record';
 
 defineOptions({
@@ -219,19 +221,19 @@
       hide: (row: API.GetInsurancePageOutput) => row.productOnline || !row.insureBillUrl,
     },
   },
-  {
-    data: {
-      enCode: 'payBtn',
-      name: '鏀粯',
-    },
-    emits: {
-      onClick: (role) => handlePay(role),
-    },
-    extraProps: {
-      hide: (row: API.GetInsurancePageOutput) =>
-        row.payStatus != InsurancePolicyListPayStatusEnum.WaitPay,
-    },
-  },
+  // {
+  //   data: {
+  //     enCode: 'payBtn',
+  //     name: '鏀粯',
+  //   },
+  //   emits: {
+  //     onClick: (role) => handlePay(role),
+  //   },
+  //   extraProps: {
+  //     hide: (row: API.GetInsurancePageOutput) =>
+  //       row.payStatus != InsurancePolicyListPayStatusEnum.WaitPay,
+  //   },
+  // },
   {
     data: {
       enCode: 'stampFilesBtn',
@@ -266,6 +268,19 @@
   //     onClick: (role) => handleStandarEndo(role),
   //   },
   // },
+  {
+    data: {
+      enCode: 'submitAuditBtn',
+      name: '鎻愪氦瀹℃牳',
+    },
+    emits: {
+      onClick: (role) => handleSubmitAuditBtn(role),
+    },
+    extraProps: {
+      hide: (row: API.GetInsurancePageOutput) =>
+        row.auditStatus != InsurancePolicyAuditStatusEnum.WaitAdd,
+    },
+  },
 ]).filter(Boolean);
 
 const BaseState = {
@@ -361,6 +376,7 @@
     productIdNumber: '',
     productSchemeIdNumber: '',
     effectStartTime: dayjs().add(1, 'day').format('YYYY-MM-DD'),
+    effectEndTime: '',
   },
   closeAfterConfirm: false,
 });
@@ -389,6 +405,12 @@
   } catch (error) {}
 }
 
+const { isSjbAccount, getInsureProductIdByIdNumber } = useUserInsureProductSetting();
+
+const { getInsureProductSchemeByIdNumber } = useInsureProductSchemeAllList({
+  insureProductId: computed(() => getInsureProductIdByIdNumber(editForm.productIdNumber)),
+});
+
 async function importInsStaffToList() {
   try {
     let params: API.ImportInsStaffToListFrontInput = {
@@ -398,6 +420,12 @@
       productSchemeIdNumber: editForm.productSchemeIdNumber,
       effectStartTime: editForm.effectStartTime,
     };
+    const currentInsureProductScheme = getInsureProductSchemeByIdNumber(
+      editForm.productSchemeIdNumber
+    );
+    if (currentInsureProductScheme?.period === InsurancePeriodEnum['1-29D']) {
+      params.effectEndTime = editForm.effectEndTime;
+    }
     let res = await insuranceOrderServices.importInsStaffToList(params, {
       timeout: 60 * 1000 * 10,
       customErrorHandler(error) {
@@ -452,8 +480,6 @@
 const { dialogProps: dialogInstructionsProps, dialogState: dialogInstructionsState } = useDialog({
   onConfirm: handleUpload,
 });
-
-const { isSjbAccount } = useUserInsureProductSetting();
 
 function handleOpenInstructions() {
   if (isSjbAccount.value) {
@@ -650,4 +676,17 @@
     });
   } catch (error) {}
 }
+
+async function handleSubmitAuditBtn(row: API.GetInsurancePageOutput) {
+  try {
+    let params: API.InsurancePolicyAuditInput = {
+      insurancePolicyId: row.id,
+    };
+    let res = await insuranceOrderServices.insurancePolicyAddAudit(params);
+    if (res) {
+      Message.successMessage('涓婁紶鎴愬姛');
+      getList(paginationState.pageIndex);
+    }
+  } catch (error) {}
+}
 </script>

--
Gitblit v1.9.1