From 98b88860d68494a81007a2a1737dfd37a4b70c99 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期三, 02 七月 2025 16:59:46 +0800
Subject: [PATCH] fix: 江佑保系统健壮性修复

---
 src/services/api/typings.d.ts                     |   40 ++++++++++--
 src/views/Home/components/InsureOrderInfoView.vue |   11 ++-
 src/views/Home/Home.vue                           |   69 ++++++++++++++--------
 src/services/api/InsuranceOrder.ts                |   10 +-
 4 files changed, 89 insertions(+), 41 deletions(-)

diff --git a/src/services/api/InsuranceOrder.ts b/src/services/api/InsuranceOrder.ts
index 4fdcf30..7e369e6 100644
--- a/src/services/api/InsuranceOrder.ts
+++ b/src/services/api/InsuranceOrder.ts
@@ -386,15 +386,15 @@
 
 /** 鏂板淇濆崟瀵煎叆 POST /api/InsuranceOrder/ImportInsStaffToList */
 export async function importInsStaffToList(
-  // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟swagger榛樿娌℃湁鐢熸垚瀵硅薄)
-  params: API.APIimportInsStaffToListParams,
+  body: API.ImportInsStaffToListFrontInput,
   options?: API.RequestConfig
 ) {
-  return request<API.ImportInsStaffAnalysisList[]>('/api/InsuranceOrder/ImportInsStaffToList', {
+  return request<API.ImportInsStaffToListOutput>('/api/InsuranceOrder/ImportInsStaffToList', {
     method: 'POST',
-    params: {
-      ...params,
+    headers: {
+      'Content-Type': 'application/json',
     },
+    data: body,
     ...(options || {}),
   });
 }
diff --git a/src/services/api/typings.d.ts b/src/services/api/typings.d.ts
index 65eef95..c168d1b 100644
--- a/src/services/api/typings.d.ts
+++ b/src/services/api/typings.d.ts
@@ -367,13 +367,6 @@
     id?: string;
   }
 
-  interface APIimportInsStaffToListParams {
-    url?: string;
-    serialNum?: string;
-    productIdNumber?: string;
-    productSchemeIdNumber?: string;
-  }
-
   interface APIsearchParams {
     filter?: string;
     sorting?: string;
@@ -620,6 +613,8 @@
     /** 浜у搧鍚嶇О */
     productName: string;
     status?: InsureProductSettingStatusEnum;
+    /** 鎶曚繚浜烘暟涓婇檺 */
+    maxCount: number;
   }
 
   interface CreateOrUpdateRoleInput {
@@ -970,6 +965,11 @@
     phone?: string;
     claimCount?: number;
     creationTime?: string;
+    /** 鎶曚繚鎵规鍙� */
+    payOrder?: string;
+    status?: InsuranceDetailStatusEnum;
+    /** 澶囨敞 */
+    auditRemark?: string;
   }
 
   interface GetInsuranceStaffPageTemplatePageOutput {
@@ -1312,6 +1312,26 @@
     isNormal?: boolean;
   }
 
+  interface ImportInsStaffToListFrontInput {
+    serialNum?: string;
+    url?: string;
+    /** 淇濋櫓浜у搧IdNumber */
+    productIdNumber?: string;
+    /** 淇濋櫓浜у搧鏂规Id */
+    productSchemeIdNumber?: string;
+    /** 淇濆崟鐢熸晥鏃堕棿 */
+    effectStartTime?: string;
+  }
+
+  interface ImportInsStaffToListOutput {
+    /** 鎬讳汉鏁� */
+    importAllCount?: number;
+    /** 宸插鍏ヤ汉鏁� */
+    successCount?: number;
+    /** 瀵煎叆澶辫触鍒楄〃 */
+    errorList?: ImportInsStaffAnalysisList[];
+  }
+
   type InsuranceClaimAttachmentBusinessTypeEnum = 10 | 20 | 30 | 40 | 50;
 
   interface InsuranceClaimAttachmentOutput {
@@ -1437,6 +1457,8 @@
     month?: number;
     count?: number;
   }
+
+  type InsuranceDetailStatusEnum = 10 | 12 | 14 | 20 | 30;
 
   interface InsuranceOrderListOutput {
     id?: string;
@@ -1569,7 +1591,7 @@
     invoiceDownloadOssUrl?: string;
   }
 
-  type InsurancePolicyPayStatusEnum = 1 | 2;
+  type InsurancePolicyPayStatusEnum = 1 | 2 | -1;
 
   type InsurancePolicyStatusEnum = 10 | 20 | 30;
 
@@ -1702,6 +1724,8 @@
     status?: InsureProductSettingStatusEnum;
     /** 鍒涘缓鏃堕棿 */
     creationTime?: string;
+    /** 鎶曚繚浜烘暟涓婇檺 */
+    maxCount?: number;
   }
 
   interface InsureProductSettingDtoPageOutput {
diff --git a/src/views/Home/Home.vue b/src/views/Home/Home.vue
index 031a9e2..ddd83ce 100644
--- a/src/views/Home/Home.vue
+++ b/src/views/Home/Home.vue
@@ -111,7 +111,7 @@
     </AppContainer>
     <UploadInsurePersonDialog v-bind="dialogProps" />
     <UploadStampFileDialog v-bind="dialogStampFileProps" />
-    <InsureInstructionsDialog v-bind="dialogInstructionsProps" @onConfirm="handleUpload" />
+    <InsureInstructionsDialog v-bind="dialogInstructionsProps" />
   </LoadingLayout>
 </template>
 
@@ -364,9 +364,9 @@
 
 async function checkInrancesSerialNumStatus() {
   try {
-    let params: API.APIimportInsStaffToListParams = {
+    let params: API.APIcheckInrancesSerialNumStatusParams = {
       serialNum: editForm.serialNum,
-      url: editForm.url?.[0]?.path,
+      // url: editForm.url?.[0]?.path,
     };
     let res = await insuranceOrderServices.checkInrancesSerialNumStatus(params);
     if (res === InsurancePolicyStatusEnum.Effecting) {
@@ -384,43 +384,62 @@
 
 async function importInsStaffToList() {
   try {
-    let params: API.APIimportInsStaffToListParams = {
+    let params: API.ImportInsStaffToListFrontInput = {
       serialNum: editForm.serialNum,
       url: editForm.url?.[0]?.path,
       productIdNumber: editForm.productIdNumber,
       productSchemeIdNumber: editForm.productSchemeIdNumber,
       effectStartTime: editForm.effectStartTime,
     };
-    let res = await insuranceOrderServices.importInsStaffToList(params);
-    if (res.length > 0) {
-      await Message.tipMessage('瀛樺湪閿欒鏁版嵁锛屾槸鍚﹀鍑猴紵');
-      XLSXUtils.exportToXLSX({
-        workbookDataList: res,
-        fileName: '閿欒浜哄憳鍚嶅崟',
-        workbookHeaderMap: {
-          name: '闆囧憳濮撳悕',
-          sex: '鎬у埆',
-          certType: '璇佷欢绫诲瀷',
-          certNo: '璇佷欢鍙风爜',
-          jobName: '闆囧憳宸ョ',
-          useEmploer: '鐢ㄥ伐鍗曚綅',
-          address: '鐢ㄥ伐鍦扮偣',
-          note: '澶囨敞',
-        },
-      });
+    let res = await insuranceOrderServices.importInsStaffToList(params, {
+      timeout: 60 * 1000 * 10,
+    });
+    if (res) {
+      dialogState.dialogVisible = false;
+      getList(paginationState.pageIndex);
+      // await Message.tipMessage('瀛樺湪閿欒鏁版嵁锛屾槸鍚﹀鍑猴紵');
+      if (res.errorList.length > 0) {
+        await Message.tipMessage(
+          `鎬绘姇淇濅汉鏁�${res.importAllCount}浜猴紝鎶曚繚鎴愬姛${res.successCount}浜猴紝鎶曚繚澶辫触${res.errorList.length}浜烘槸鍚﹀鍑烘姇淇濆け璐ヤ汉鍛樻竻鍗曪紵`,
+          {
+            confirmButtonText: '瀵煎嚭',
+          }
+        );
+        XLSXUtils.exportToXLSX({
+          workbookDataList: res.errorList,
+          fileName: '閿欒浜哄憳鍚嶅崟',
+          workbookHeaderMap: {
+            name: '闆囧憳濮撳悕',
+            sex: '鎬у埆',
+            certType: '璇佷欢绫诲瀷',
+            certNo: '璇佷欢鍙风爜',
+            jobName: '闆囧憳宸ョ',
+            useEmploer: '鐢ㄥ伐鍗曚綅',
+            address: '鐢ㄥ伐鍦扮偣',
+            note: '澶囨敞',
+          },
+        });
+      } else {
+        await Message.tipMessage(
+          `鎬绘姇淇濅汉鏁�${res.importAllCount}浜猴紝鎶曚繚鎴愬姛${res.successCount}浜篳,
+          {
+            showCancelButton: false,
+          }
+        );
+      }
     }
-    dialogState.dialogVisible = false;
-    getList(paginationState.pageIndex);
   } catch (error) {}
 }
 
-const { dialogProps: dialogInstructionsProps, dialogState: dialogInstructionsState } = useDialog();
+const { dialogProps: dialogInstructionsProps, dialogState: dialogInstructionsState } = useDialog({
+  onConfirm: handleUpload,
+});
 
 function handleOpenInstructions() {
   dialogInstructionsState.dialogVisible = true;
 }
 
-function handleUpload() {
+async function handleUpload() {
   handleAdd({
     serialNum: `${dayjs().format('YYYYMMDD')}${_.random(0, 9999).toString().padStart(4, '0')}`,
     url: [] as UploadUserFile[],
diff --git a/src/views/Home/components/InsureOrderInfoView.vue b/src/views/Home/components/InsureOrderInfoView.vue
index f95d235..cac8745 100644
--- a/src/views/Home/components/InsureOrderInfoView.vue
+++ b/src/views/Home/components/InsureOrderInfoView.vue
@@ -249,7 +249,7 @@
   },
   {
     id: '101',
-    enCode: 'serialNum',
+    enCode: 'payOrder',
     name: '鎵规鍙�',
     width: 140,
   },
@@ -261,7 +261,7 @@
   },
   {
     id: '103',
-    enCode: 'remark',
+    enCode: 'auditRemark',
     name: '澶囨敞',
     width: 140,
   },
@@ -365,7 +365,12 @@
       keyWord: '',
       orderInput: [{ property: 'id', order: OrderInputType.Asc }],
     },
-    columnsRenderProps: {},
+    columnsRenderProps: {
+      status: {
+        type: 'enum',
+        valueEnum: InsurancePolicyStatusEnumText,
+      },
+    },
   }
 );
 

--
Gitblit v1.9.1