From 7c86889e5177ae0da77fd75f298fabe9971b2822 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期一, 30 六月 2025 14:34:28 +0800 Subject: [PATCH] feat: v2.2 --- src/views/Home/components/InsureOrderInfoView.vue | 194 +++++++++++++++++++++++++++++++++++++----------- 1 files changed, 149 insertions(+), 45 deletions(-) diff --git a/src/views/Home/components/InsureOrderInfoView.vue b/src/views/Home/components/InsureOrderInfoView.vue index 18afc27..4aef872 100644 --- a/src/views/Home/components/InsureOrderInfoView.vue +++ b/src/views/Home/components/InsureOrderInfoView.vue @@ -1,12 +1,21 @@ <template> <LoadingLayout :loading="state.loading"> - <AppScrollContainer> + <AppContainer> <ChunkCell title=""> <ProForm :model="detail" ref="formRef" label-width="120px" :is-read="true"> <ProFormCol> <ProFormColItem :span="8"> <ProFormItemV2 label="淇濆崟鍙�:" prop="insureBillNo"> - <ProFormText v-model.trim="detail.insureBillNo" /> + <div class="pro-from-item-read-content-wrapper" v-if="!!detail.insureBillNo"> + {{ detail.insureBillNo }} + <el-button + type="primary" + link + @click="handleGoStampFiles" + v-if="detail.productOnline && detail.anyPayComplete" + >璇︽儏</el-button + > + </div> </ProFormItemV2> </ProFormColItem> <ProFormColItem :span="8"> @@ -35,12 +44,14 @@ <ProFormCol> <ProFormColItem :span="8"> <ProFormItemV2 label="鍙備繚鏈烘瀯:" prop="insuranceOrg"> - <ProFormRadio v-model="detail.insuranceOrg" :value-enum="InsuredInstitutionEnum" /> + <!-- <ProFormRadio v-model="detail.insuranceOrg" :value-enum="InsuredInstitutionEnum" /> --> + <ProFormText v-model.trim="detail.insuranceOrg" /> </ProFormItemV2> </ProFormColItem> <ProFormColItem :span="8"> <ProFormItemV2 label="鎶曚繚鏂规:" prop="insuranceScheme"> - <ProFormRadio v-model="detail.insuranceScheme" :value-enum="InsuranceSchemeEnum" /> + <!-- <ProFormRadio v-model="detail.insuranceScheme" :value-enum="InsuranceSchemeEnum" /> --> + <ProFormText v-model.trim="detail.insuranceScheme" /> </ProFormItemV2> </ProFormColItem> <ProFormColItem :span="8"> @@ -63,7 +74,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> @@ -83,6 +94,7 @@ <template v-if="detail.status === InsurancePolicyStatusEnum.WaitEffect"> <el-button @click="handleTemplateDownload()" link type="primary">妯℃澘涓嬭浇</el-button> <BlFileUpload + v-if="detail.auditStatus !== InsurancePolicyAuditStatusEnum.Pass" :limitFileSize="10" accept="xls,xlsx" :showTip="false" @@ -98,24 +110,28 @@ </template> <template v-else> <el-button @click="handleDownloadPerson()" type="primary">涓嬭浇浜哄憳娓呭崟</el-button> - <el-button @click="handleDownloadOrder()" type="primary">涓嬭浇淇濆崟</el-button> + <template v-if="detail.productOnline"> + <el-button v-if="detail.anyPayComplete" @click="handleGoStampFiles()" type="primary" + >涓嬭浇淇濆崟</el-button + > + </template> + <el-button v-else @click="handleDownloadOrder()" type="primary">涓嬭浇淇濆崟</el-button> </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> - </AppScrollContainer> + <InsureClaimDetailDialog v-bind="dialogInsureClaimProps"></InsureClaimDetailDialog> + </AppContainer> </LoadingLayout> </template> @@ -141,20 +157,23 @@ useFormDialog, BlFileUpload, UploadUserFile, + XLSXUtils, } from '@bole-core/components'; import { InsuranceOrderTempPath, insuranceTypeText, - InsuredInstitutionEnum, - InsuranceSchemeEnum, InsurancePolicyStatusEnum, InsurancePolicyStatusEnumText, + InsurancePolicyAuditStatusEnum, } 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', @@ -190,6 +209,16 @@ name: '闆囧憳宸ョ', }, { + id: '51', + enCode: 'occupationType', + name: '鑱屼笟绫诲瀷', + }, + { + id: '52', + enCode: 'occupationCode', + name: '鑱屼笟鐮佸��', + }, + { id: '6', enCode: 'userEmploer', name: '鐢ㄥ伐鍗曚綅', @@ -219,7 +248,7 @@ }, { id: '11', - enCode: 'serialNumber', + enCode: 'claimCount', name: '鐞嗚禂', width: 100, }, @@ -236,7 +265,8 @@ }, extraProps: { hide: (row: API.GetInsuranceStaffPageTemplate) => - detail.value?.status !== InsurancePolicyStatusEnum.WaitEffect, + detail.value?.status !== InsurancePolicyStatusEnum.WaitEffect || + detail.value?.auditStatus === InsurancePolicyAuditStatusEnum.Pass, }, }, { @@ -245,11 +275,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), }, }, ]); @@ -325,6 +355,10 @@ } async function handleClear() { try { + if (paginationState.total === 0) { + Message.warnMessage('娌℃湁闇�瑕佹竻绌虹殑鏁版嵁~'); + return; + } await Message.tipMessage('鏄惁娓呯┖浜哄憳淇℃伅'); let res = await insuranceOrderServices.clearInsuranceStaffData({ id: id, @@ -337,18 +371,31 @@ } async function handleUploadSuccess(response: UploadUserFile) { try { - // let res = await insuranceOrderServices.importInsuranceOrderData(response.url, { - // getResponse: true, - // responseType: 'blob', - // }); - // 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) {} } @@ -374,11 +421,32 @@ downloadFileByUrl(setOSSLink(detail.value?.insureBillUrl)); } +function handleGoStampFiles() { + router.push({ + name: 'InsurancePolicyStampFiles', + params: { + id: id, + }, + }); +} + function handleBatchChange() { + if ( + dayjs(detail.value?.effectEndTime).isBefore(dayjs()) || + dayjs(detail.value?.effectEndTime).isSame(dayjs(), 'day') + ) { + Message.errorMessage('淇濋櫓浠婂ぉ鍒版湡锛屾棤娉曟壒鏀�'); + return; + } router.push({ name: 'BatchChange', params: { id: id, + }, + query: { + insurerName: detail.value?.insurerName ?? '', + insureBillNo: detail.value?.insureBillNo ?? '', + effectEndTime: detail.value?.effectEndTime ?? '', }, }); } @@ -421,19 +489,55 @@ } 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> <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