From 5664a1a616df498cba58b9a8e63a91ac0ba96bab Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期二, 01 七月 2025 13:44:55 +0800
Subject: [PATCH] feat: add rrweb

---
 src/views/Home/Home.vue |  115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 110 insertions(+), 5 deletions(-)

diff --git a/src/views/Home/Home.vue b/src/views/Home/Home.vue
index ab3685d..3bc4ade 100644
--- a/src/views/Home/Home.vue
+++ b/src/views/Home/Home.vue
@@ -53,6 +53,13 @@
           </QueryFilterItem>
         </template>
         <template #btn>
+          <el-button
+            @click="handleDownloadOccupationType()"
+            type="primary"
+            style="margin-right: 10px"
+            link
+            >鑱屼笟绫诲瀷瀵圭収琛�</el-button
+          >
           <el-button @click="handleDownload()" type="primary" style="margin-right: 10px" link
             >妯℃澘涓嬭浇</el-button
           >
@@ -87,8 +94,9 @@
             class="box-item"
             effect="dark"
             :content="row.auditRemark"
-            placement="top-start"
+            placement="top"
             v-if="row.auditStatus === InsurancePolicyAuditStatusEnum.Reject && row.auditRemark"
+            popper-class="max-width-popper"
           >
             <div style="display: inline-flex; align-items: center; color: inherit">
               {{ InsurancePolicyAuditStatusEnumText[row.auditStatus] }}
@@ -103,6 +111,7 @@
     </AppContainer>
     <UploadInsurePersonDialog v-bind="dialogProps" />
     <UploadStampFileDialog v-bind="dialogStampFileProps" />
+    <InsureInstructionsDialog v-bind="dialogInstructionsProps" />
   </LoadingLayout>
 </template>
 
@@ -121,6 +130,7 @@
   SearchInput,
   FieldRadio,
   XLSXUtils,
+  useDialog,
 } from '@bole-core/components';
 import * as insuranceOrderServices from '@/services/api/InsuranceOrder';
 import { Message, OrderInputType, downloadFileByUrl } from '@bole-core/core';
@@ -138,9 +148,14 @@
   InsurancePolicyAuditStatusEnumText,
   InsurancePolicyAuditStatusEnum,
   InsurancePolicyProductIdNumberEnum,
+  InsurancePolicyListPayStatusEnum,
+  InsurancePolicyListPayStatusEnumText,
+  InsuranceOccupationTypeTempPath,
 } from '@/constants';
 import dayjs from 'dayjs';
 import _ from 'lodash';
+import InsureInstructionsDialog from './components/InsureInstructionsDialog.vue';
+// import { Recorder } from '@/utils/record';
 
 defineOptions({
   name: 'Home',
@@ -166,8 +181,7 @@
     },
     extraProps: {
       hide: (row: API.GetInsurancePageOutput) =>
-        row.productIdNumber === InsurancePolicyProductIdNumberEnum.SJB ||
-        row.status !== InsurancePolicyStatusEnum.Effecting,
+        row.productOnline || row.status !== InsurancePolicyStatusEnum.Effecting,
     },
   },
   {
@@ -180,7 +194,6 @@
     },
     extraProps: {
       hide: (row: API.GetInsurancePageOutput) =>
-        row.auditStatus !== InsurancePolicyAuditStatusEnum.Pass ||
         row.status !== InsurancePolicyStatusEnum.WaitEffect,
     },
   },
@@ -193,9 +206,47 @@
       onClick: (role) => handleDownloadInsureFile(role),
     },
     extraProps: {
-      hide: (row: API.GetInsurancePageOutput) => !row.insureBillUrl,
+      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: 'stampFilesBtn',
+      name: '淇濆崟涓嬭浇',
+    },
+    emits: {
+      onClick: (role) => handleGoStampFiles(role),
+    },
+    extraProps: {
+      hide: (row: API.GetInsurancePageOutput) => !(row.productOnline && row.anyPayComplete),
+    },
+  },
+  {
+    data: {
+      enCode: 'downloadInvoiceBtn',
+      name: '鍙戠エ涓嬭浇',
+    },
+    emits: {
+      onClick: (role) => handleGoDownloadInvoice(role),
+    },
+    extraProps: {
+      hide: (row: API.GetInsurancePageOutput) => !(row.productOnline && row.anyPayComplete),
+    },
+  },
+
   // {
   //   data: {
   //     enCode: 'standarEndoBtn',
@@ -212,11 +263,22 @@
 };
 
 const state = reactive({ ...BaseState });
+// const recorder = ref(new Recorder());
 
 onMounted(async () => {
   await getList();
   state.loading = false;
+  handleOpenInstructions();
+
+  // setTimeout(() => {
+  //   // recorder.value.init();
+  //   recorder.value.replaySession('9cb24e5a-0423-4dcd-abd5-fa7a4117cadc');
+  // }, 3000);
 });
+
+// onUnmounted(() => {
+//   recorder.value.stopRecordingAndSave();
+// });
 
 const {
   getDataSource: getList,
@@ -259,6 +321,7 @@
         formatter: (row: API.GetInsurancePageOutput) =>
           row.amount == null ? '' : toThousand(row.amount),
       },
+      payStatus: { type: 'enum', valueEnum: InsurancePolicyListPayStatusEnumText },
     },
   }
 );
@@ -342,6 +405,12 @@
   } catch (error) {}
 }
 
+const { dialogProps: dialogInstructionsProps, dialogState: dialogInstructionsState } = useDialog();
+
+function handleOpenInstructions() {
+  dialogInstructionsState.dialogVisible = true;
+}
+
 function handleUpload() {
   handleAdd({
     serialNum: `${dayjs().format('YYYYMMDD')}${_.random(0, 9999).toString().padStart(4, '0')}`,
@@ -383,6 +452,10 @@
       downloadFile(res.data, `鍦ㄤ繚浜哄憳瀵煎嚭`, 'xlsx');
     }
   } catch (error) {}
+}
+
+function handleDownloadOccupationType() {
+  downloadFileByUrl(InsuranceOccupationTypeTempPath, '鑱屼笟绫诲瀷瀵圭収琛�');
 }
 
 function handleDownload() {
@@ -488,4 +561,36 @@
     // }
   } catch (error) {}
 }
+
+async function handleGoStampFiles(row: API.GetInsurancePageOutput) {
+  try {
+    router.push({
+      name: 'InsurancePolicyStampFiles',
+      params: {
+        id: row.id,
+      },
+    });
+  } catch (error) {}
+}
+
+function handlePay(row: API.GetInsurancePageOutput) {
+  router.push({
+    name: 'InsurePayDetail',
+    params: {
+      id: row.id,
+    },
+  });
+}
+
+async function handleGoDownloadInvoice(row: API.GetInsurancePageOutput) {
+  try {
+    await insuranceOrderServices.getInvoiceId({ id: row.id });
+    router.push({
+      name: 'InsureDownloadInvoice',
+      params: {
+        id: row.id,
+      },
+    });
+  } catch (error) {}
+}
 </script>

--
Gitblit v1.9.1