From c6347278c9d0ede1d88680f9c80f863bca53bb5f Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期二, 01 四月 2025 16:38:22 +0800 Subject: [PATCH] fix: bug --- src/views/Home/components/InsureOrderInfoView.vue | 92 +++++++++++++++++++++++++++++---------------- 1 files changed, 59 insertions(+), 33 deletions(-) diff --git a/src/views/Home/components/InsureOrderInfoView.vue b/src/views/Home/components/InsureOrderInfoView.vue index 0da1dc1..ef51a0f 100644 --- a/src/views/Home/components/InsureOrderInfoView.vue +++ b/src/views/Home/components/InsureOrderInfoView.vue @@ -117,6 +117,7 @@ </ProTableV2> </ChunkCell> <ChangePersonInfoDialog v-bind="dialogProps"></ChangePersonInfoDialog> + <InsureClaimDetailDialog v-bind="dialogInsureClaimProps"></InsureClaimDetailDialog> </AppScrollContainer> </LoadingLayout> </template> @@ -143,17 +144,18 @@ useFormDialog, BlFileUpload, UploadUserFile, + XLSXUtils, } from '@bole-core/components'; import { InsuranceOrderTempPath, insuranceTypeText, - InsuredInstitutionEnum, - InsuranceSchemeEnum, InsurancePolicyStatusEnum, InsurancePolicyStatusEnumText, } from '@/constants'; 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, }, @@ -247,11 +249,11 @@ name: '鐞嗚禂璇︽儏', }, emits: { - onClick: (role) => handleInsureClaimDetail(role), + onClick: (role) => handleDetail(role), }, 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) {} } @@ -392,6 +404,7 @@ query: { insurerName: detail.value?.insurerName ?? '', insureBillNo: detail.value?.insureBillNo ?? '', + effectEndTime: detail.value?.effectEndTime ?? '', }, }); } @@ -434,16 +447,29 @@ } catch (error) {} } -function handleInsureClaimDetail(row: API.GetInsuranceStaffPageTemplate) { - router.push({ - name: 'InsuranceClaimDetail', - params: { +const { dialogProps: dialogInsureClaimProps, handleEdit: handleInsureClaimEdit } = useFormDialog({ + defaultFormParams: { + id: '', + routeId: '', + staffList: [] as API.InsuranceClaimDetailOutput[], + }, +}); + +async function getInsuranceClaimDetailList(id: string) { + try { + return await insuranceClaimServices.getInsuranceClaimDetailList({ id: id }); + } catch (error) {} +} + +async function handleDetail(row: API.GetInsuranceStaffPageTemplate) { + try { + const res = await getInsuranceClaimDetailList(row.id); + handleInsureClaimEdit({ id: row.id, - }, - query: { - fromRoute: 'InsuranceOrderDetail', - }, - }); + staffList: res, + routeId: id, + }); + } catch (error) {} } </script> -- Gitblit v1.9.1