From b697737f281023871227b26b6c9d6c309cd3e899 Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期一, 31 三月 2025 14:23:19 +0800 Subject: [PATCH] feat: 接口对接 --- src/views/Home/components/InsureOrderInfoView.vue | 72 +++++++++++++++++++++++------------- 1 files changed, 46 insertions(+), 26 deletions(-) diff --git a/src/views/Home/components/InsureOrderInfoView.vue b/src/views/Home/components/InsureOrderInfoView.vue index 3ce3581..6e8a5db 100644 --- a/src/views/Home/components/InsureOrderInfoView.vue +++ b/src/views/Home/components/InsureOrderInfoView.vue @@ -144,6 +144,7 @@ useFormDialog, BlFileUpload, UploadUserFile, + XLSXUtils, } from '@bole-core/components'; import { InsuranceOrderTempPath, @@ -154,6 +155,7 @@ 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'; @@ -221,7 +223,7 @@ }, { id: '11', - enCode: 'serialNumber', + enCode: 'claimCount', name: '鐞嗚禂', width: 100, }, @@ -251,7 +253,7 @@ }, extraProps: { hide: (row: API.GetInsuranceStaffPageTemplate) => - !(row.serialNumber && detail.value?.status !== InsurancePolicyStatusEnum.WaitEffect), + !(row.claimCount && detail.value?.status !== InsurancePolicyStatusEnum.WaitEffect), }, }, ]); @@ -327,6 +329,10 @@ } async function handleClear() { try { + if (paginationState.total === 0) { + Message.warnMessage('娌℃湁闇�瑕佹竻绌虹殑鏁版嵁~'); + return; + } await Message.tipMessage('鏄惁娓呯┖浜哄憳淇℃伅'); let res = await insuranceOrderServices.clearInsuranceStaffData({ id: id, @@ -339,25 +345,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) {} } @@ -437,16 +449,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) {} } -- Gitblit v1.9.1