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/views/Home/components/InsureOrderInfoView.vue |  108 ++++++++++++++++++++++++++++-------------------------
 1 files changed, 57 insertions(+), 51 deletions(-)

diff --git a/src/views/Home/components/InsureOrderInfoView.vue b/src/views/Home/components/InsureOrderInfoView.vue
index 229edc5..8772799 100644
--- a/src/views/Home/components/InsureOrderInfoView.vue
+++ b/src/views/Home/components/InsureOrderInfoView.vue
@@ -11,7 +11,7 @@
                   <el-button
                     type="primary"
                     link
-                    @click="handleGoStampFiles"
+                    @click="handleGoStampFiles(id)"
                     v-if="detail.productOnline && detail.anyPayComplete"
                     >璇︽儏</el-button
                   >
@@ -75,7 +75,10 @@
         </ProForm>
       </ChunkCell>
       <ChunkCell title="浜哄憳淇℃伅" class="full-table-chunk">
-        <template #titleRight v-if="detail.status !== InsurancePolicyStatusEnum.WaitEffect">
+        <template
+          #titleRight
+          v-if="detail.status !== InsurancePolicyStatusEnum.WaitEffect && !detail.productOnline"
+        >
           <el-button type="primary" @click="handleBatchChange">鎵规敼鐢宠</el-button>
         </template>
         <ProTableQueryFilterBar @on-reset="reset">
@@ -92,34 +95,41 @@
           </template>
           <template #btn>
             <template v-if="detail.status === InsurancePolicyStatusEnum.WaitEffect">
-              <el-button @click="handleTemplateDownload()" link type="primary">妯℃澘涓嬭浇</el-button>
-              <BlFileUpload
-                v-if="
-                  detail.auditStatus !== InsurancePolicyAuditStatusEnum.Pass &&
-                  !detail.productOnline
-                "
-                :limitFileSize="10"
-                accept="xls,xlsx"
-                :showTip="false"
-                :show-file-list="false"
-                :on-success="handleUploadSuccess"
-                style="margin-right: 10px; margin-left: 10px"
-              >
-                <template #default>
-                  <el-button icon="Plus" type="primary">瀵煎叆</el-button>
-                </template>
-              </BlFileUpload>
-              <el-button @click="handleClear()" type="primary">瀵煎嚭鎶曚繚閿欒浜哄憳娓呭崟</el-button>
-              <el-button @click="handleClear()" type="primary">娓呯┖鏁版嵁</el-button>
+              <template v-if="!detail.productOnline">
+                <el-button @click="handleTemplateDownload()" link type="primary"
+                  >妯℃澘涓嬭浇</el-button
+                >
+                <BlFileUpload
+                  v-if="detail.auditStatus !== InsurancePolicyAuditStatusEnum.Pass"
+                  :limitFileSize="10"
+                  accept="xls,xlsx"
+                  :showTip="false"
+                  :show-file-list="false"
+                  :on-success="handleUploadSuccess"
+                  style="margin-right: 10px; margin-left: 10px"
+                >
+                  <template #default>
+                    <el-button icon="Plus" type="primary">瀵煎叆</el-button>
+                  </template>
+                </BlFileUpload>
+                <el-button @click="handleClear()" type="primary">娓呯┖鏁版嵁</el-button>
+              </template>
             </template>
             <template v-else>
-              <el-button @click="handleDownloadPerson()" type="primary">涓嬭浇浜哄憳娓呭崟</el-button>
               <template v-if="detail.productOnline">
-                <el-button v-if="detail.anyPayComplete" @click="handleGoStampFiles()" type="primary"
-                  >涓嬭浇淇濆崟</el-button
+                <el-button @click="handleExport(InsuranceDetailStatusEnum.Effecting)" type="primary"
+                  >瀵煎嚭鍦ㄤ繚浜哄憳</el-button
                 >
+                <el-button @click="handleExport(InsuranceDetailStatusEnum.Fail)" type="primary"
+                  >瀵煎嚭閿欒浜哄憳</el-button
+                >
+                <el-button @click="handleGoStampFiles(id)" type="primary">涓嬭浇淇濆崟</el-button>
+                <el-button @click="handleGoDownloadInvoice(id)" type="primary">涓嬭浇鍙戠エ</el-button>
               </template>
-              <el-button v-else @click="handleDownloadOrder()" type="primary">涓嬭浇淇濆崟</el-button>
+              <template v-else>
+                <el-button @click="handleExport(null)" type="primary">涓嬭浇浜哄憳娓呭崟</el-button>
+                <el-button @click="handleDownloadOrder()" type="primary">涓嬭浇淇濆崟</el-button>
+              </template>
             </template>
           </template>
         </ProTableQueryFilterBar>
@@ -170,6 +180,7 @@
   InsurancePolicyStatusEnumText,
   InsurancePolicyAuditStatusEnum,
   InsuranceDetailStatusEnumText,
+  InsuranceDetailStatusEnum,
 } from '@/constants';
 import ChangePersonInfoDialog from './ChangePersonInfoDialog.vue';
 import InsureClaimDetailDialog from './InsureClaimDetailDialog.vue';
@@ -179,6 +190,7 @@
 import { downloadFile, downloadFileByUrl, Message, OrderInputType } from '@bole-core/core';
 import { setOSSLink } from '@/utils';
 import dayjs from 'dayjs';
+import { useInsureActions } from '@/hooks';
 
 defineOptions({
   name: 'InsureOrderInfoView',
@@ -428,36 +440,11 @@
   } catch (error) {}
 }
 
-async function handleDownloadPerson() {
-  try {
-    if (paginationState.total === 0) {
-      Message.warnMessage('娌℃湁鏁版嵁鍙互瀵煎嚭鍝');
-      return;
-    }
-    let res = await insuranceOrderServices.getInsuranceStaffListExport(
-      { id: id },
-      {
-        responseType: 'blob',
-        getResponse: true,
-      }
-    );
-    if (res) {
-      downloadFile(res.data, `浜哄憳娓呭崟`, 'xlsx');
-    }
-  } catch (error) {}
-}
 function handleDownloadOrder() {
   downloadFileByUrl(setOSSLink(detail.value?.insureBillUrl));
 }
 
-function handleGoStampFiles() {
-  router.push({
-    name: 'InsurancePolicyStampFiles',
-    params: {
-      id: id,
-    },
-  });
-}
+const { handleGoDownloadInvoice, handleGoStampFiles } = useInsureActions();
 
 function handleBatchChange() {
   if (
@@ -542,6 +529,25 @@
     });
   } catch (error) {}
 }
+
+async function handleExport(status: InsuranceDetailStatusEnum) {
+  try {
+    if (paginationState.total === 0) {
+      Message.warnMessage('娌℃湁鏁版嵁鍙互瀵煎嚭鍝');
+      return;
+    }
+    let res = await insuranceOrderServices.getInsuranceStaffListExport(
+      { insurancePolicyId: id, status: status },
+      {
+        responseType: 'blob',
+        getResponse: true,
+      }
+    );
+    if (res) {
+      downloadFile(res.data, `浜哄憳娓呭崟`, 'xlsx');
+    }
+  } catch (error) {}
+}
 </script>
 
 <style lang="scss" scoped>

--
Gitblit v1.9.1