From f6748abe2ad85f0600f905f22f92f53e603b885d Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期一, 07 七月 2025 14:45:26 +0800 Subject: [PATCH] fix: 江佑保系统健壮性修复 --- src/views/Home/components/UploadInsurePersonDialog.vue | 1 src/services/api/TaiPing.ts | 12 + src/services/api/typings.d.ts | 282 +++++++++++++++++++++++++++++++++++ src/views/Home/components/InsureOrderInfoView.vue | 67 ++++++++ src/views/Home/InsurancePolicyStampFiles.vue | 21 -- src/hooks/insuranceClaim.ts | 20 ++ src/views/Home/Home.vue | 8 src/services/api/InsuranceOrder.ts | 15 + 8 files changed, 406 insertions(+), 20 deletions(-) diff --git a/src/hooks/insuranceClaim.ts b/src/hooks/insuranceClaim.ts index 7e60a39..47f22ba 100644 --- a/src/hooks/insuranceClaim.ts +++ b/src/hooks/insuranceClaim.ts @@ -1,5 +1,6 @@ import * as insuranceClaimServices from '@/services/api/InsuranceClaim'; import * as insuranceOrderServices from '@/services/api/InsuranceOrder'; +import { downloadFileByUrl, setOSSLink } from '@/utils'; import { useQuery, useQueryClient } from '@tanstack/vue-query'; type UseInsuranceOrderMaterialListOptions = { @@ -81,3 +82,22 @@ handleGoStampFiles, }; } + +export function useDownloadPolicyFileId() { + async function handleDownload(row: API.InsurancePolicyPayDto) { + try { + if (row.policyOssUrl) { + downloadFileByUrl(setOSSLink(row.policyOssUrl), `淇濆崟_${row.channelOrderNo}`); + } else { + let res = await insuranceOrderServices.downloadPolicyFileId({ id: row.id }); + if (res) { + window.open(res, '_blank'); + } + } + } catch (error) {} + } + + return { + handleDownload, + }; +} diff --git a/src/services/api/InsuranceOrder.ts b/src/services/api/InsuranceOrder.ts index d7fb3a0..ad9fcb9 100644 --- a/src/services/api/InsuranceOrder.ts +++ b/src/services/api/InsuranceOrder.ts @@ -136,6 +136,21 @@ }); } +/** 琛ユ彁 POST /api/InsuranceOrder/FillInsStaffToList */ +export async function fillInsStaffToList( + body: API.FillInsStaffToListFrontInput, + options?: API.RequestConfig +) { + return request<API.ImportInsStaffToListOutput>('/api/InsuranceOrder/FillInsStaffToList', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + /** 鏍规嵁韬唤璇佸彿鍜屾姤妗堟棩鏈熸煡璇㈠湪淇濅俊鎭� POST /api/InsuranceOrder/GetEffectingStaffList */ export async function getEffectingStaffList( body: API.GetEffectingStaffListInput, diff --git a/src/services/api/TaiPing.ts b/src/services/api/TaiPing.ts index c0153a7..98f44c4 100644 --- a/src/services/api/TaiPing.ts +++ b/src/services/api/TaiPing.ts @@ -2,6 +2,18 @@ // @ts-ignore import { request } from '@/utils/request'; +/** 涓�姝ュ嚭鍗� POST /api/TaiPing/Proposal */ +export async function proposal(body: API.ProposalInput, options?: API.RequestConfig) { + return request<API.ProposalOutput>('/api/TaiPing/Proposal', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + /** 澶钩淇濋櫓鎵夸繚鎴愬姛閫氱煡 POST /api/TaiPing/Success */ export async function success(body: Record<string, any>, options?: API.RequestConfig) { return request<any>('/api/TaiPing/Success', { diff --git a/src/services/api/typings.d.ts b/src/services/api/typings.d.ts index 52bdf50..145b5c3 100644 --- a/src/services/api/typings.d.ts +++ b/src/services/api/typings.d.ts @@ -806,6 +806,12 @@ key?: string; } + interface FillInsStaffToListFrontInput { + /** 淇濆崟Id */ + insurancePolicyId?: string; + url?: string; + } + type FinanceTypeEnum = 10 | 20; interface GetEffectingStaffListInput { @@ -935,6 +941,8 @@ auditRemark?: string; /** 淇濋櫓浜у搧IdNumber */ productIdNumber?: string; + /** 鏂规浠g爜 */ + productSchemeCode?: string; /** 鏄惁璧扮嚎涓婃祦绋� */ productOnline?: boolean; payStatus?: InsurancePolicyListPayStatusEnum; @@ -1989,6 +1997,280 @@ isRequired?: boolean; } + interface ProposalInput { + sign?: ProposalInputSign; + request?: ProposalInputRequest; + } + + interface ProposalInputRequest { + head?: ProposalInputRequestHead; + body?: ProposalInputRequestBody; + } + + interface ProposalInputRequestBody { + commonPlan?: ProposalInputRequestBodyCommonPlan; + /** 鏂规璇︽儏 */ + planDetails?: ProposalInputRequestBodyPlanDetail[]; + policyHolder?: ProposalInputRequestBodyPolicyHolder; + /** 琚繚浜轰俊鎭� */ + policyInsureds?: ProposalInputRequestBodyPolicyInsured[]; + /** 闄勫睘琚繚闄╀汉淇℃伅 */ + extraPolicyInsureds?: ProposalInputRequestBodyExtraPolicyInsured[]; + insuredType?: ProposalInputRequestBodyInsuredType; + trade?: ProposalInputRequestBodyTrade; + /** 鎷撳睍鑺傜偣 */ + policyExtra?: ProposalInputRequestBodyPolicyExtra[]; + } + + interface ProposalInputRequestBodyCommonPlan { + /** 鎶曚繚鏃堕棿 */ + operateDate?: string; + /** 璧蜂繚鏃堕棿 */ + startTime?: string; + /** 缁堜繚鏃堕棿 */ + endTime?: string; + /** 甯佸埆 */ + currency?: string; + /** 鎬讳繚棰� */ + sumInsured?: string; + /** 鎬讳繚璐� */ + sumSignPremium?: string; + } + + interface ProposalInputRequestBodyExtraPolicyInsured { + /** 鏂规浠g爜锛堝彲閫夛級 +淇濆徃鎻愪緵瀹為檯鏂规浠g爜锛岄潪瑙佽垂涓嬩负蹇呬紶 */ + planCode?: string; + /** 瀹㈡埛瑙掕壊锛堝繀闇�锛� +鏋氫妇鍊�: 1, 2, 3, 4 */ + role?: string; + /** 涓庢姇淇濅汉鍏崇郴锛堝繀闇�锛� +鏋氫妇鍊�: 1, 2, 3, 4, 5, 6, 7, 8, 9 */ + relationToAppnt?: string; + /** 瀹㈡埛绫诲瀷锛堝繀闇�锛� +鏋氫妇鍊�: 1, 2 */ + type?: string; + /** 琚繚浜哄悕绉帮紙蹇呴渶锛� */ + name?: string; + /** 璇佷欢绫诲瀷锛堝繀闇�锛� +鏋氫妇鍊�: 01, 02, 04, 05, 06, 07, 08, 09, 10, 13, 14, 16, 17, 18, 19, 20 */ + certType?: string; + /** 璇佷欢鍙风爜锛堝繀闇�锛� */ + certNo?: string; + /** 鎬у埆锛堝繀闇�锛� +鏋氫妇鍊�: 1, 2 */ + gender?: string; + /** 鍑虹敓鏃ユ湡锛堝繀闇�锛� +鏍煎紡: yyyy-MM-dd */ + birthday?: string; + /** 骞撮緞锛堝繀闇�锛� +鑼冨洿: 0-100 */ + age?: number; + /** 涓庝富琚繚闄╀汉鍏崇郴锛堝彲閫夛級 +鏋氫妇鍊�: 1, 2, 3, 4, 5, 6, 7, 8 */ + relationToMainInsured?: string; + /** 鏈夋棤绀句繚锛堝彲閫夛級 +鏋氫妇鍊�: Y, N */ + socialInsuFlag?: string; + /** 璇︾粏鍦板潃锛堝彲閫夛級 */ + address?: string; + /** 閭锛堝彲閫夛級 */ + email?: string; + /** 鎵嬫満鍙凤紙鍙�夛級 */ + mobile?: string; + /** 鑱屼笟浠g爜锛堝彲閫夛級 */ + occupationCode?: string; + } + + interface ProposalInputRequestBodyInsuredType { + /** 鏍囩殑鏍囩锛堝繀闇�锛� +0-浜у搧闄勫姞瑕佺礌(浜у搧灞傜骇)銆�1-鏍囩殑绫诲瀷锛堟柟妗堝眰绾э級銆�2-鏍囩殑闄勫姞瑕佺礌锛堣淇濅汉灞傜骇锛� */ + flag?: number; + /** 鏍囩殑绫诲瀷鍚嶇О锛堝繀闇�锛� */ + insuredTypeName?: string; + /** 瑕佺礌浠g爜锛堝繀闇�锛� */ + factorCode?: string; + /** 鏍囩殑绫诲瀷浠g爜锛堝繀闇�锛� */ + insuredTypeCode?: string; + /** 瑕佺礌鍚嶇О锛堝繀闇�锛� */ + factorName?: string; + /** 瑕佺礌鍊硷紙蹇呴渶锛� +褰揻actorCode涓篎WDZ锛宖actorName涓烘埧灞嬪湴鍧�鏃讹紝factorValue浼犲弬涓簀son瀛楃涓诧紝鏍煎紡涓猴細 +"{"factorProvince":"120000","detailAddress":"澶╂触甯�-澶╂触甯�-绾㈡ˉ鍖�","factorCity":"120100","factorCounty":"120106","houseAddress":"娴嬭瘯鍦板潃"}" */ + factorValue?: string; + /** 灞炴�э紙蹇呴渶锛� +鍥哄畾鍊硷細{"codeTable":"CD000049"} */ + attribute?: string; + } + + interface ProposalInputRequestBodyPlanDetail { + /** 鏂规浠g爜 */ + planCode?: string; + /** 浠芥暟 */ + copies?: number; + /** 鏂规鍚嶇О */ + planName?: string; + } + + interface ProposalInputRequestBodyPolicyExtra { + /** 鎷撳睍瀛楁浠g爜锛堝繀闇�锛� */ + extraCode?: string; + /** 鎷撳睍瀛楁鍚嶇О锛堝繀闇�锛� */ + extraName?: string; + /** 鎷撳睍瀛楁鍊硷紙蹇呴渶锛� */ + extraValue?: string; + } + + interface ProposalInputRequestBodyPolicyHolder { + /** 瀹㈡埛瑙掕壊 */ + role?: string; + /** 瀹㈡埛绫诲瀷 */ + type?: string; + /** 鎶曚繚浜哄悕绉� */ + name?: string; + /** 璇佷欢绫诲瀷 */ + certType?: string; + /** 璇佷欢鍙风爜 */ + certNo?: string; + /** 鎬у埆 */ + gender?: string; + /** 鍑虹敓鏃ユ湡 */ + birthday?: string; + /** 鎵嬫満鍙风爜 */ + mobile?: string; + /** 閭鍦板潃 */ + email?: string; + /** 骞撮緞 */ + age?: string; + /** 鍦板潃 */ + address?: string; + /** 鑱旂郴浜哄鍚� */ + linkerName?: string; + /** 鑱旂郴浜虹數璇� */ + linkerMobile?: string; + /** 鑱屼笟浠g爜 */ + occupationCode?: string; + /** 鑱屼笟绫诲埆 */ + occupationType?: string; + } + + interface ProposalInputRequestBodyPolicyInsured { + /** 鏂规浠g爜锛堝繀闇�锛� */ + planCode?: string; + /** 瀹㈡埛瑙掕壊锛堝繀闇�锛� +鏋氫妇鍊�: 1, 2, 3, 4 */ + role?: string; + /** 涓庢姇淇濅汉鍏崇郴锛堝繀闇�锛� +鎶曚繚浜烘槸鍥綋鏃讹紝琚繚浜轰笌鎶曚繚浜哄叧绯诲彧鑳芥槸6(闆囦剑)銆�7(鍔冲姟)鎴�8(鍏朵粬) +鏋氫妇鍊�: 1, 2, 3, 4, 5, 6, 7, 8, 9 */ + relationToAppnt?: string; + /** 瀹㈡埛绫诲瀷锛堝繀闇�锛� +鏋氫妇鍊�: 1, 2 */ + type?: string; + /** 琚繚浜哄悕绉帮紙蹇呴渶锛� */ + name?: string; + /** 璇佷欢绫诲瀷锛堝繀闇�锛� +鏋氫妇鍊�: 01, 02, 04, 05, 06, 07, 08, 09, 10, 13, 14, 16, 17, 18, 19, 20 +榛樿鍊�: 01 */ + certType?: string; + /** 璇佷欢鍙风爜锛堝繀闇�锛� */ + certNo?: string; + /** 鎬у埆锛堝繀闇�锛� +鏋氫妇鍊�: 1, 2 */ + gender?: string; + /** 鍑虹敓鏃ユ湡锛堝繀闇�锛� +鏍煎紡: yyyy-MM-dd */ + birthday?: string; + /** 骞撮緞锛堝繀闇�锛� +鑼冨洿: 0-100 */ + age?: number; + /** 涓庝富琚繚闄╀汉鍏崇郴锛堝彲閫夛級 +鏋氫妇鍊�: 1, 2, 3, 4, 5, 6, 7, 8 */ + relationToMainInsured?: string; + /** 鏈夋棤绀句繚锛堝彲閫夛級 +鏋氫妇鍊�: Y, N +榛樿鍊�: N */ + socialInsuFlag?: string; + /** 璇︾粏鍦板潃锛堝彲閫夛級 */ + address?: string; + /** 閭锛堝彲閫夛級 */ + email?: string; + /** 鎵嬫満鍙凤紙鍙�夛級 */ + mobile?: string; + /** 鑱屼笟绫诲瀷 */ + occupationType?: string; + /** 鑱屼笟浠g爜锛堝彲閫夛級 */ + occupationCode?: string; + /** 楣婃ˉ涓撶敤鍥犲瓙锛堝彲閫夛級 +闈炲繀椤�,鐗规畩鎯呭喌闇�浼犲�� 绀轰緥:{"FL0078":"N"} */ + factorMap?: string; + /** 淇濆崟璧锋湡锛堝彲閫夛紝鎵归噺鍑哄崟蹇呴』锛� */ + startTime?: string; + /** 淇濆崟姝㈡湡锛堝彲閫夛紝鎵归噺鍑哄崟蹇呴』锛� */ + endTime?: string; + } + + interface ProposalInputRequestBodyTrade { + /** 鏀粯鎴愬姛璺宠浆鍦板潃锛堝彲閫夛級 +瑙佽垂蹇呬紶 */ + returnUrl?: string; + /** 寰俊灏忕▼搴忔敮浠榓ppId锛堝彲閫夛級 +寰俊灏忕▼搴忓搴旂殑appId锛屽皬绋嬪簭绛剧害骞舵敮浠樺満鏅紶閫� */ + appId?: string; + /** 寰俊灏忕▼搴忔敮浠榦penID锛堝彲閫夛級 +openID 寰俊openid锛屽皬绋嬪簭绛剧害骞舵敮浠樺満鏅紶閫� */ + openId?: string; + } + + interface ProposalInputRequestHead { + /** 绗笁鏂硅鍗曞彿 */ + channelOrderNo?: string; + /** 鍟嗘埛缂栫爜 */ + agencyCode?: string; + /** 鍟嗗搧缂栫爜 */ + productCode?: string; + /** 涓氬姟绫诲瀷 */ + businessType?: string; + applyTime?: string; + /** 瀛愬晢鎴风紪鐮� */ + subAgencyCode?: string; + } + + interface ProposalInputSign { + /** 绛惧悕 */ + signature?: string; + } + + interface ProposalOutput { + /** 绛惧悕锛堝繀闇�锛� */ + signature?: string; + response?: ProposalResponse; + } + + interface ProposalResponse { + /** 鐘舵�佺爜锛堝繀闇�锛� +200涓烘垚鍔�,鍏朵粬涓哄紓甯� +鏋氫妇鍊�: -1,200,400,404,408,9999,10021-10042,40001,50001-50022,60001-60002,70000-70012,80002-80003,81001-81101,82001,84001,85001-85004,86001-86002,87001-87003,88001,90001,91001-91002,92001,93001,94001,100010-100012,200001,800001-800009 +榛樿鍊�: 200 */ + code?: number; + /** 鐘舵�佹秷鎭紙鍙�夛級 */ + message?: string; + /** 鏃堕棿鎴筹紙蹇呴渶锛� */ + timestamp?: number; + data?: ProposalResponseData; + } + + interface ProposalResponseData { + /** 鎶曚繚鍗曞彿锛堝彲閫夛級 */ + proposalNo?: string; + /** 鏀粯鐭摼锛堝彲閫夛級 */ + payUrl?: string; + /** 鏀粯闀块摼锛堝彲閫夛級 */ + longPayUrl?: string; + /** 鏀粯娴佹按鍙凤紙鍙�夛級 */ + payRegistrationNo?: string; + } + interface ProviderInfoDto { providerName?: string; providerKey?: string; diff --git a/src/views/Home/Home.vue b/src/views/Home/Home.vue index de84ceb..eb93ebe 100644 --- a/src/views/Home/Home.vue +++ b/src/views/Home/Home.vue @@ -377,8 +377,12 @@ } else if (res === InsurancePolicyStatusEnum.OutTimeEffect) { await Message.tipMessage('璇ユ壒娆′繚鍗曞凡澶辨晥锛岃淇敼鎵规鍙峰悗閲嶆柊瀵煎叆'); } else if (res === InsurancePolicyStatusEnum.WaitEffect) { - await Message.tipMessage('瀛樺湪鐩稿悓鐨勬壒娆″彿锛屾槸鍚﹁鐩栵紵'); - importInsStaffToList(); + if (isSjbAccount.value) { + await Message.tipMessage('瀛樺湪鐩稿悓鐨勬壒娆″彿锛岃淇敼鎵规鍙峰悗閲嶆柊瀵煎叆'); + } else { + await Message.tipMessage('瀛樺湪鐩稿悓鐨勬壒娆″彿锛屾槸鍚﹁鐩栵紵'); + importInsStaffToList(); + } } else { importInsStaffToList(); } diff --git a/src/views/Home/InsurancePolicyStampFiles.vue b/src/views/Home/InsurancePolicyStampFiles.vue index 34343a4..91492e6 100644 --- a/src/views/Home/InsurancePolicyStampFiles.vue +++ b/src/views/Home/InsurancePolicyStampFiles.vue @@ -22,7 +22,7 @@ ProTableV2Props, defineOperationBtns, } from '@bole-core/components'; -import { useAccess, useInsurancePolicyPay } from '@/hooks'; +import { useAccess, useDownloadPolicyFileId, useInsurancePolicyPay } from '@/hooks'; import { paginateList, downloadFileByUrl, setOSSLink, downloadFile } from '@/utils'; import { InsurancePolicyStampFilesColumns } from './constants'; import * as insuranceOrderServices from '@/services/api/InsuranceOrder'; @@ -38,9 +38,9 @@ name: '涓嬭浇', }, emits: { onClick: (role) => handleDownload(role) }, - extraProps: { - hide: (row: API.InsurancePolicyPayDto) => !row.policyOssUrl, - }, + // extraProps: { + // hide: (row: API.InsurancePolicyPayDto) => !row.policyOssUrl, + // }, }, ]); @@ -53,16 +53,5 @@ sumSignPremium: { type: 'money' }, }; -async function handleDownload(row: API.InsurancePolicyPayDto) { - try { - if (row.policyOssUrl) { - downloadFileByUrl(setOSSLink(row.policyOssUrl), `淇濆崟_${row.channelOrderNo}`); - } else { - let res = await insuranceOrderServices.downloadPolicyFileId({ id: row.id }); - if (res) { - window.open(res, '_blank'); - } - } - } catch (error) {} -} +const { handleDownload } = useDownloadPolicyFileId(); </script> diff --git a/src/views/Home/components/InsureOrderInfoView.vue b/src/views/Home/components/InsureOrderInfoView.vue index ff3d989..4d9e8a6 100644 --- a/src/views/Home/components/InsureOrderInfoView.vue +++ b/src/views/Home/components/InsureOrderInfoView.vue @@ -60,6 +60,22 @@ </ProFormItemV2> </ProFormColItem> </ProFormCol> + <ProFormCol v-if="detail.productOnline"> + <ProFormColItem :span="8"> + <ProFormItemV2 label="鎬讳繚璐�:" prop="amount"> + <ProFormInputNumber v-model="detail.amount" unit="鍏�" formatValue="money" /> + </ProFormItemV2> + </ProFormColItem> + <ProFormColItem :span="8"> + <ProFormItemV2 label="鎬讳繚棰�:" prop="sumInsured"> + <ProFormInputNumber + v-model.trim="detail.sumInsured" + unit="鍏�" + formatValue="money" + /> + </ProFormItemV2> + </ProFormColItem> + </ProFormCol> <ProFormCol> <ProFormColItem :span="8"> <ProFormItemV2 label="鎶曚繚浜�:" prop="insurerName"> @@ -580,6 +596,7 @@ dialogProps: dialogSupplyProps, handleAdd: handleSupplyAdd, editForm: supplyForm, + dialogState: dialogSupplyState, } = useFormDialog({ onConfirm: supplySubmit, defaultFormParams: { @@ -589,10 +606,56 @@ productSchemeIdNumber: '', effectStartTime: dayjs().add(1, 'day').format('YYYY-MM-DD'), }, + closeAfterConfirm: false, }); -// TODO 琛ユ彁 -async function supplySubmit() {} +async function supplySubmit() { + try { + let params: API.FillInsStaffToListFrontInput = { + insurancePolicyId: id, + url: supplyForm.url?.[0]?.path, + }; + let res = await insuranceOrderServices.fillInsStaffToList(params, { + timeout: 60 * 1000 * 10, + }); + if (res) { + // await Message.tipMessage('瀛樺湪閿欒鏁版嵁锛屾槸鍚﹀鍑猴紵'); + try { + 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, + } + ); + } + } catch (error) {} + dialogSupplyState.dialogVisible = false; + getInsuranceStaffList(paginationState.pageIndex); + } + } catch (error) {} +} </script> <style lang="scss" scoped> diff --git a/src/views/Home/components/UploadInsurePersonDialog.vue b/src/views/Home/components/UploadInsurePersonDialog.vue index 6be682b..0bc713f 100644 --- a/src/views/Home/components/UploadInsurePersonDialog.vue +++ b/src/views/Home/components/UploadInsurePersonDialog.vue @@ -122,6 +122,7 @@ productSchemeIdNumber: string; effectStartTime: string; }; + //鏄惁鏄ˉ鎻� isSupply?: boolean; }; -- Gitblit v1.9.1