From c55ae1d4b32d84de6ea071ff64a6180d408ba591 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期三, 02 四月 2025 16:57:25 +0800
Subject: [PATCH] fix: bug

---
 src/views/Home/components/InsureOrderInfoView.vue |  130 ++++++++++++++++++++++++++++++-------------
 1 files changed, 90 insertions(+), 40 deletions(-)

diff --git a/src/views/Home/components/InsureOrderInfoView.vue b/src/views/Home/components/InsureOrderInfoView.vue
index 3ce3581..6969481 100644
--- a/src/views/Home/components/InsureOrderInfoView.vue
+++ b/src/views/Home/components/InsureOrderInfoView.vue
@@ -1,6 +1,6 @@
 <template>
   <LoadingLayout :loading="state.loading">
-    <AppScrollContainer>
+    <AppContainer>
       <ChunkCell title="">
         <ProForm :model="detail" ref="formRef" label-width="120px" :is-read="true">
           <ProFormCol>
@@ -65,7 +65,7 @@
           </ProFormCol>
         </ProForm>
       </ChunkCell>
-      <ChunkCell title="浜哄憳淇℃伅">
+      <ChunkCell title="浜哄憳淇℃伅" class="full-table-chunk">
         <template #titleRight v-if="detail.status !== InsurancePolicyStatusEnum.WaitEffect">
           <el-button type="primary" @click="handleBatchChange">鎵规敼鐢宠</el-button>
         </template>
@@ -104,21 +104,19 @@
             </template>
           </template>
         </ProTableQueryFilterBar>
-        <ProTableV2
-          v-bind="proTableProps"
-          :columns="column"
-          :operationBtns="operationBtns"
-          :auto-height="false"
-          ref="proTable"
-          :tableProps="{
-            maxHeight: '400px',
-          }"
-        >
-        </ProTableV2>
+        <div class="full-table-chunk-table">
+          <ProTableV2
+            v-bind="proTableProps"
+            :columns="column"
+            :operationBtns="operationBtns"
+            ref="proTable"
+          >
+          </ProTableV2>
+        </div>
       </ChunkCell>
       <ChangePersonInfoDialog v-bind="dialogProps"></ChangePersonInfoDialog>
       <InsureClaimDetailDialog v-bind="dialogInsureClaimProps"></InsureClaimDetailDialog>
-    </AppScrollContainer>
+    </AppContainer>
   </LoadingLayout>
 </template>
 
@@ -144,6 +142,7 @@
   useFormDialog,
   BlFileUpload,
   UploadUserFile,
+  XLSXUtils,
 } from '@bole-core/components';
 import {
   InsuranceOrderTempPath,
@@ -154,9 +153,11 @@
 import ChangePersonInfoDialog from './ChangePersonInfoDialog.vue';
 import InsureClaimDetailDialog from './InsureClaimDetailDialog.vue';
 import * as insuranceOrderServices from '@/services/api/InsuranceOrder';
+import * as insuranceClaimServices from '@/services/api/InsuranceClaim';
 import { useQuery, useQueryClient } from '@tanstack/vue-query';
 import { downloadFile, downloadFileByUrl, Message, OrderInputType } from '@bole-core/core';
 import { setOSSLink } from '@/utils';
+import dayjs from 'dayjs';
 
 defineOptions({
   name: 'InsureOrderInfoView',
@@ -221,7 +222,7 @@
   },
   {
     id: '11',
-    enCode: 'serialNumber',
+    enCode: 'claimCount',
     name: '鐞嗚禂',
     width: 100,
   },
@@ -251,7 +252,7 @@
     },
     extraProps: {
       hide: (row: API.GetInsuranceStaffPageTemplate) =>
-        !(row.serialNumber && detail.value?.status !== InsurancePolicyStatusEnum.WaitEffect),
+        !(row.claimCount && detail.value?.status !== InsurancePolicyStatusEnum.WaitEffect),
     },
   },
 ]);
@@ -327,6 +328,10 @@
 }
 async function handleClear() {
   try {
+    if (paginationState.total === 0) {
+      Message.warnMessage('娌℃湁闇�瑕佹竻绌虹殑鏁版嵁~');
+      return;
+    }
     await Message.tipMessage('鏄惁娓呯┖浜哄憳淇℃伅');
     let res = await insuranceOrderServices.clearInsuranceStaffData({
       id: id,
@@ -339,25 +344,31 @@
 }
 async function handleUploadSuccess(response: UploadUserFile) {
   try {
-    let res = await insuranceOrderServices.importInsDetailStaffToList(
-      {
-        id: id,
-        url: response.url,
-      },
-      {
-        getResponse: true,
-        responseType: 'blob',
-      }
-    );
-    console.log('res: ', res);
-    // if (res?.data?.size) {
-    //   await Message.tipMessage('瀛樺湪閿欒鏁版嵁锛屾槸鍚﹀鍑猴紵');
-    //   downloadFile(res.data, `閿欒浜哄憳鍚嶅崟`, 'xlsx');
-    // }
-    // queryClient.invalidateQueries({
-    //   queryKey: ['insuranceOrderServices/getInsuranceStaffList'],
-    // });
-    // getInsuranceStaffList();
+    let res = await insuranceOrderServices.importInsDetailStaffToList({
+      id: id,
+      url: response.url,
+    });
+    if (res?.length > 0) {
+      await Message.tipMessage('瀛樺湪閿欒鏁版嵁锛屾槸鍚﹀鍑猴紵');
+      XLSXUtils.exportToXLSX({
+        workbookDataList: res,
+        fileName: '閿欒浜哄憳鍚嶅崟',
+        workbookHeaderMap: {
+          name: '闆囧憳濮撳悕',
+          sex: '鎬у埆',
+          certType: '璇佷欢绫诲瀷',
+          certNo: '璇佷欢鍙风爜',
+          jobName: '闆囧憳宸ョ',
+          useEmploer: '鐢ㄥ伐鍗曚綅',
+          address: '鐢ㄥ伐鍦扮偣',
+          note: '澶囨敞',
+        },
+      });
+    }
+    queryClient.invalidateQueries({
+      queryKey: ['insuranceOrderServices/getInsuranceStaffList'],
+    });
+    getInsuranceStaffList();
   } catch (error) {}
 }
 
@@ -384,6 +395,13 @@
 }
 
 function handleBatchChange() {
+  if (
+    dayjs(detail.value?.effectEndTime).isBefore(dayjs()) ||
+    dayjs(detail.value?.effectEndTime).isSame(dayjs(), 'day')
+  ) {
+    Message.errorMessage('淇濋櫓浠婂ぉ鍒版湡锛屾棤娉曟壒鏀�');
+    return;
+  }
   router.push({
     name: 'BatchChange',
     params: {
@@ -392,6 +410,7 @@
     query: {
       insurerName: detail.value?.insurerName ?? '',
       insureBillNo: detail.value?.insureBillNo ?? '',
+      effectEndTime: detail.value?.effectEndTime ?? '',
     },
   });
 }
@@ -437,16 +456,24 @@
 const { dialogProps: dialogInsureClaimProps, handleEdit: handleInsureClaimEdit } = useFormDialog({
   defaultFormParams: {
     id: '',
-    staffList: [] as API.InsureBatchBillDetailDto[],
+    routeId: '',
+    staffList: [] as API.InsuranceClaimDetailOutput[],
   },
 });
 
-async function handleDetail(row: API.InsureBatchBillDto) {
+async function getInsuranceClaimDetailList(id: string) {
   try {
-    // const res = await getInsureBatchDetail(row.insureBatchBillId);
+    return await insuranceClaimServices.getInsuranceClaimDetailList({ id: id });
+  } catch (error) {}
+}
+
+async function handleDetail(row: API.GetInsuranceStaffPageTemplate) {
+  try {
+    const res = await getInsuranceClaimDetailList(row.id);
     handleInsureClaimEdit({
-      id: row.insureBatchBillId,
-      staffList: [],
+      id: row.id,
+      staffList: res,
+      routeId: id,
     });
   } catch (error) {}
 }
@@ -454,4 +481,27 @@
 
 <style lang="scss" scoped>
 @use '@/style/common.scss' as *;
+
+.full-table-chunk {
+  display: flex;
+  min-height: 0;
+  flex: 1;
+  flex-direction: column;
+
+  :deep() {
+    .chunk-cell-content {
+      display: flex;
+      flex-direction: column;
+      flex: 1;
+      min-height: 0;
+    }
+  }
+
+  .full-table-chunk-table {
+    display: flex;
+    flex-direction: column;
+    flex: 1;
+    min-height: 0;
+  }
+}
 </style>

--
Gitblit v1.9.1