|  |  |  | 
|---|
|  |  |  | </ProTableV2> | 
|---|
|  |  |  | </ChunkCell> | 
|---|
|  |  |  | <ChangePersonInfoDialog v-bind="dialogProps"></ChangePersonInfoDialog> | 
|---|
|  |  |  | <InsureClaimDetailDialog v-bind="dialogInsureClaimProps"></InsureClaimDetailDialog> | 
|---|
|  |  |  | </AppScrollContainer> | 
|---|
|  |  |  | </LoadingLayout> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | 
|---|
|  |  |  | 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'; | 
|---|
|  |  |  | import dayjs from 'dayjs'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | defineOptions({ | 
|---|
|  |  |  | name: 'InsureOrderInfoView', | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | id: '11', | 
|---|
|  |  |  | enCode: 'serialNumber', | 
|---|
|  |  |  | enCode: 'claimCount', | 
|---|
|  |  |  | name: '理赔', | 
|---|
|  |  |  | width: 100, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | 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), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | ]); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | async function handleClear() { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | if (paginationState.total === 0) { | 
|---|
|  |  |  | Message.warnMessage('没有需要清空的数据~'); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | await Message.tipMessage('是否清空人员信息'); | 
|---|
|  |  |  | let res = await insuranceOrderServices.clearInsuranceStaffData({ | 
|---|
|  |  |  | id: id, | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 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) {} | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function handleBatchChange() { | 
|---|
|  |  |  | if ( | 
|---|
|  |  |  | dayjs(detail.value?.effectEndTime).isBefore(dayjs()) || | 
|---|
|  |  |  | dayjs(detail.value?.effectEndTime).isSame(dayjs(), 'day') | 
|---|
|  |  |  | ) { | 
|---|
|  |  |  | Message.errorMessage('保险今天到期,无法批改'); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | router.push({ | 
|---|
|  |  |  | name: 'BatchChange', | 
|---|
|  |  |  | params: { | 
|---|
|  |  |  | 
|---|
|  |  |  | query: { | 
|---|
|  |  |  | insurerName: detail.value?.insurerName ?? '', | 
|---|
|  |  |  | insureBillNo: detail.value?.insureBillNo ?? '', | 
|---|
|  |  |  | effectEndTime: detail.value?.effectEndTime ?? '', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | } 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> | 
|---|
|  |  |  |  | 
|---|