From 4fb3fd42d84118df5b4508ac3cc37e480760373d Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期三, 02 七月 2025 17:11:41 +0800 Subject: [PATCH] fix: 江佑保系统健壮性修复 --- src/views/Home/Home.vue | 271 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 239 insertions(+), 32 deletions(-) diff --git a/src/views/Home/Home.vue b/src/views/Home/Home.vue index 29afe92..ddd83ce 100644 --- a/src/views/Home/Home.vue +++ b/src/views/Home/Home.vue @@ -26,6 +26,15 @@ </QueryFilterItem> <QueryFilterItem> <FieldRadio + v-model="extraParamState.auditStatus" + :value-enum="InsurancePolicyAuditStatusEnumText" + buttonStyle + showAllBtn + @change="getList()" + /> + </QueryFilterItem> + <QueryFilterItem> + <FieldRadio v-model="extraParamState.status" :value-enum="InsurancePolicyStatusEnumText" buttonStyle @@ -44,14 +53,26 @@ </QueryFilterItem> </template> <template #btn> + <el-button + @click="handleDownloadOccupationType()" + type="primary" + style="margin-right: 10px" + link + >鑱屼笟绫诲瀷瀵圭収琛�</el-button + > <el-button @click="handleDownload()" type="primary" style="margin-right: 10px" link >妯℃澘涓嬭浇</el-button > - - <el-button @click="handleUpload()" type="primary" style="margin-right: 10px" - >瀵煎叆</el-button + <el-button @click="handleOpenInstructions()" type="primary" style="margin-right: 10px" + >瀵煎叆鎶曚繚浜哄憳</el-button > - + <!-- <el-button + v-if="AppType === 'jx'" + @click="handleUpload()" + type="primary" + style="margin-right: 10px" + >澶ф壒閲忔暟鎹鍏�</el-button + > --> <el-button @click="getInsurancePageExport()" type="primary" link>瀵煎嚭淇濆崟鍒楄〃</el-button> <el-button @click="getInsuranceStaffPageExport()" type="primary" link >瀵煎嚭鍦ㄤ繚浜哄憳</el-button @@ -68,10 +89,29 @@ rowKey: 'id', }" > + <template #auditStatus="{ row }"> + <el-tooltip + class="box-item" + effect="dark" + :content="row.auditRemark" + placement="top" + v-if="row.auditStatus === InsurancePolicyAuditStatusEnum.Reject && row.auditRemark" + popper-class="max-width-popper" + > + <div style="display: inline-flex; align-items: center; color: inherit"> + {{ InsurancePolicyAuditStatusEnumText[row.auditStatus] }} + <el-icon size="16" color="#3a71ff"><QuestionFilled /></el-icon> + </div> + </el-tooltip> + <el-text v-else style="color: inherit"> + {{ InsurancePolicyAuditStatusEnumText[row.auditStatus] }} + </el-text> + </template> </ProTableV2> </AppContainer> <UploadInsurePersonDialog v-bind="dialogProps" /> <UploadStampFileDialog v-bind="dialogStampFileProps" /> + <InsureInstructionsDialog v-bind="dialogInstructionsProps" /> </LoadingLayout> </template> @@ -90,22 +130,39 @@ SearchInput, FieldRadio, XLSXUtils, + useDialog, } from '@bole-core/components'; import * as insuranceOrderServices from '@/services/api/InsuranceOrder'; import { Message, OrderInputType, downloadFileByUrl } from '@bole-core/core'; import { columns } from './constants'; import UploadInsurePersonDialog from './components/UploadInsurePersonDialog.vue'; import UploadStampFileDialog from './components/UploadStampFileDialog.vue'; -import { format, downloadFile, setOSSLink, toThousand, convertApi2FormUrl } from '@/utils'; +import { + format, + downloadFile, + setOSSLink, + toThousand, + convertApi2FormUrl, + convertFormUrl2Api, +} from '@/utils'; import { ModelValueType } from 'element-plus'; import { InsuranceOrderTempPath, insuranceTypeText, InsurancePolicyStatusEnumText, InsurancePolicyStatusEnum, + AppType, + InsurancePolicyAuditStatusEnumText, + InsurancePolicyAuditStatusEnum, + InsurancePolicyProductIdNumberEnum, + InsurancePolicyListPayStatusEnum, + InsurancePolicyListPayStatusEnumText, + InsuranceOccupationTypeTempPath, } from '@/constants'; import dayjs from 'dayjs'; import _ from 'lodash'; +import InsureInstructionsDialog from './components/InsureInstructionsDialog.vue'; +// import { Recorder } from '@/utils/record'; defineOptions({ name: 'Home', @@ -130,7 +187,8 @@ onClick: (role) => handleBatch(role), }, extraProps: { - hide: (row: API.GetInsurancePageOutput) => row.status !== InsurancePolicyStatusEnum.Effecting, + hide: (row: API.GetInsurancePageOutput) => + row.productOnline || row.status !== InsurancePolicyStatusEnum.Effecting, }, }, { @@ -155,10 +213,56 @@ onClick: (role) => handleDownloadInsureFile(role), }, extraProps: { - hide: (row: API.GetInsurancePageOutput) => - row.status === InsurancePolicyStatusEnum.WaitEffect, + hide: (row: API.GetInsurancePageOutput) => row.productOnline || !row.insureBillUrl, }, }, + { + data: { + enCode: 'payBtn', + name: '鏀粯', + }, + emits: { + onClick: (role) => handlePay(role), + }, + extraProps: { + hide: (row: API.GetInsurancePageOutput) => + row.payStatus != InsurancePolicyListPayStatusEnum.WaitPay, + }, + }, + { + data: { + enCode: 'stampFilesBtn', + name: '淇濆崟涓嬭浇', + }, + emits: { + onClick: (role) => handleGoStampFiles(role), + }, + extraProps: { + hide: (row: API.GetInsurancePageOutput) => !(row.productOnline && row.anyPayComplete), + }, + }, + { + data: { + enCode: 'downloadInvoiceBtn', + name: '鍙戠エ涓嬭浇', + }, + emits: { + onClick: (role) => handleGoDownloadInvoice(role), + }, + extraProps: { + hide: (row: API.GetInsurancePageOutput) => !(row.productOnline && row.anyPayComplete), + }, + }, + + // { + // data: { + // enCode: 'standarEndoBtn', + // name: '鐢宠閫�淇�', + // }, + // emits: { + // onClick: (role) => handleStandarEndo(role), + // }, + // }, ]).filter(Boolean); const BaseState = { @@ -166,11 +270,22 @@ }; const state = reactive({ ...BaseState }); +// const recorder = ref(new Recorder()); onMounted(async () => { await getList(); state.loading = false; + // handleOpenInstructions(); + + // setTimeout(() => { + // // recorder.value.init(); + // recorder.value.replaySession('9cb24e5a-0423-4dcd-abd5-fa7a4117cadc'); + // }, 3000); }); + +// onUnmounted(() => { +// recorder.value.stopRecordingAndSave(); +// }); const { getDataSource: getList, @@ -194,6 +309,7 @@ creationDate: [] as unknown as ModelValueType, condition: '', status: '' as any as InsurancePolicyStatusEnum, + auditStatus: '' as any as InsurancePolicyAuditStatusEnum, insurancePeriod: '', }, columnsRenderProps: { @@ -212,6 +328,7 @@ formatter: (row: API.GetInsurancePageOutput) => row.amount == null ? '' : toThousand(row.amount), }, + payStatus: { type: 'enum', valueEnum: InsurancePolicyListPayStatusEnumText }, }, } ); @@ -228,6 +345,7 @@ condition: extraParamState.condition, insurancePeriod: extraParamState.insurancePeriod, status: extraParamState.status, + auditStatus: extraParamState.auditStatus, }; return params; } @@ -237,15 +355,18 @@ defaultFormParams: { serialNum: '', url: [] as UploadUserFile[], + productIdNumber: '', + productSchemeIdNumber: '', + effectStartTime: dayjs().add(1, 'day').format('YYYY-MM-DD'), }, closeAfterConfirm: false, }); 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) { @@ -263,34 +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) {} } -function handleUpload() { +const { dialogProps: dialogInstructionsProps, dialogState: dialogInstructionsState } = useDialog({ + onConfirm: handleUpload, +}); + +function handleOpenInstructions() { + dialogInstructionsState.dialogVisible = true; +} + +async function handleUpload() { handleAdd({ serialNum: `${dayjs().format('YYYYMMDD')}${_.random(0, 9999).toString().padStart(4, '0')}`, url: [] as UploadUserFile[], @@ -331,6 +480,10 @@ downloadFile(res.data, `鍦ㄤ繚浜哄憳瀵煎嚭`, 'xlsx'); } } catch (error) {} +} + +function handleDownloadOccupationType() { + downloadFileByUrl(InsuranceOccupationTypeTempPath, '鑱屼笟绫诲瀷瀵圭収琛�'); } function handleDownload() { @@ -374,7 +527,7 @@ try { let params: API.UploadInsuranceStampFilesInput = { insurancePolicyId: stampFileForm.id, - listFiles: stampFileForm.url?.map((x) => x.path) ?? [], + listFiles: convertFormUrl2Api(stampFileForm.url), }; let res = await insuranceOrderServices.uploadInsuranceStampFiles(params); if (res) { @@ -403,6 +556,13 @@ }); } function handleBatch(row: API.GetInsurancePageOutput) { + if ( + dayjs(row.effectEndTime).isBefore(dayjs()) || + dayjs(row.effectEndTime).isSame(dayjs(), 'day') + ) { + Message.errorMessage('淇濋櫓浠婂ぉ鍒版湡锛屾棤娉曟壒鏀�'); + return; + } router.push({ name: 'BatchChange', params: { @@ -411,7 +571,54 @@ query: { insurerName: row.insurerName ?? '', insureBillNo: row.insureBillNo ?? '', + effectEndTime: row.effectEndTime ?? '', }, }); } + +async function handleStandarEndo(row: API.GetInsurancePageOutput) { + try { + await Message.deleteMessage('鏄惁鐢宠閫�淇�?'); + let params = { + id: row.id, + }; + // let res = await userServices.deleteRole(params); + // if (res) { + // Message.successMessage('鎿嶄綔鎴愬姛'); + // getList(paginationState.pageIndex); + // } + } catch (error) {} +} + +async function handleGoStampFiles(row: API.GetInsurancePageOutput) { + try { + router.push({ + name: 'InsurancePolicyStampFiles', + params: { + id: row.id, + }, + }); + } catch (error) {} +} + +function handlePay(row: API.GetInsurancePageOutput) { + router.push({ + name: 'InsurePayDetail', + params: { + id: row.id, + }, + }); +} + +async function handleGoDownloadInvoice(row: API.GetInsurancePageOutput) { + try { + await insuranceOrderServices.getInvoiceId({ id: row.id }); + router.push({ + name: 'InsureDownloadInvoice', + params: { + id: row.id, + }, + }); + } catch (error) {} +} </script> -- Gitblit v1.9.1