| | |
| | | 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 = { |
| | |
| | | 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, |
| | | }; |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | /** 补提 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, |
| | |
| | | // @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', { |
| | |
| | | key?: string; |
| | | } |
| | | |
| | | interface FillInsStaffToListFrontInput { |
| | | /** 保单Id */ |
| | | insurancePolicyId?: string; |
| | | url?: string; |
| | | } |
| | | |
| | | type FinanceTypeEnum = 10 | 20; |
| | | |
| | | interface GetEffectingStaffListInput { |
| | |
| | | auditRemark?: string; |
| | | /** 保险产品IdNumber */ |
| | | productIdNumber?: string; |
| | | /** 方案代码 */ |
| | | productSchemeCode?: string; |
| | | /** 是否走线上流程 */ |
| | | productOnline?: boolean; |
| | | payStatus?: InsurancePolicyListPayStatusEnum; |
| | |
| | | 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 { |
| | | /** 方案代码(可选) |
| | | 保司提供实际方案代码,非见费下为必传 */ |
| | | 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; |
| | | /** 职业代码(可选) */ |
| | | occupationCode?: string; |
| | | } |
| | | |
| | | interface ProposalInputRequestBodyInsuredType { |
| | | /** 标的标签(必需) |
| | | 0-产品附加要素(产品层级)、1-标的类型(方案层级)、2-标的附加要素(被保人层级) */ |
| | | flag?: number; |
| | | /** 标的类型名称(必需) */ |
| | | insuredTypeName?: string; |
| | | /** 要素代码(必需) */ |
| | | factorCode?: string; |
| | | /** 标的类型代码(必需) */ |
| | | insuredTypeCode?: string; |
| | | /** 要素名称(必需) */ |
| | | factorName?: string; |
| | | /** 要素值(必需) |
| | | 当factorCode为FWDZ,factorName为房屋地址时,factorValue传参为json字符串,格式为: |
| | | "{"factorProvince":"120000","detailAddress":"天津市-天津市-红桥区","factorCity":"120100","factorCounty":"120106","houseAddress":"测试地址"}" */ |
| | | factorValue?: string; |
| | | /** 属性(必需) |
| | | 固定值:{"codeTable":"CD000049"} */ |
| | | attribute?: string; |
| | | } |
| | | |
| | | interface ProposalInputRequestBodyPlanDetail { |
| | | /** 方案代码 */ |
| | | planCode?: string; |
| | | /** 份数 */ |
| | | copies?: number; |
| | | /** 方案名称 */ |
| | | planName?: string; |
| | | } |
| | | |
| | | interface ProposalInputRequestBodyPolicyExtra { |
| | | /** 拓展字段代码(必需) */ |
| | | 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; |
| | | /** 职业代码 */ |
| | | occupationCode?: string; |
| | | /** 职业类别 */ |
| | | occupationType?: string; |
| | | } |
| | | |
| | | interface ProposalInputRequestBodyPolicyInsured { |
| | | /** 方案代码(必需) */ |
| | | 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; |
| | | /** 职业代码(可选) */ |
| | | occupationCode?: string; |
| | | /** 鹊桥专用因子(可选) |
| | | 非必须,特殊情况需传值 示例:{"FL0078":"N"} */ |
| | | factorMap?: string; |
| | | /** 保单起期(可选,批量出单必须) */ |
| | | startTime?: string; |
| | | /** 保单止期(可选,批量出单必须) */ |
| | | endTime?: string; |
| | | } |
| | | |
| | | interface ProposalInputRequestBodyTrade { |
| | | /** 支付成功跳转地址(可选) |
| | | 见费必传 */ |
| | | returnUrl?: string; |
| | | /** 微信小程序支付appId(可选) |
| | | 微信小程序对应的appId,小程序签约并支付场景传递 */ |
| | | appId?: string; |
| | | /** 微信小程序支付openID(可选) |
| | | 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; |
| | |
| | | } else if (res === InsurancePolicyStatusEnum.OutTimeEffect) { |
| | | await Message.tipMessage('该批次保单已失效,请修改批次号后重新导入'); |
| | | } else if (res === InsurancePolicyStatusEnum.WaitEffect) { |
| | | if (isSjbAccount.value) { |
| | | await Message.tipMessage('存在相同的批次号,请修改批次号后重新导入'); |
| | | } else { |
| | | await Message.tipMessage('存在相同的批次号,是否覆盖?'); |
| | | importInsStaffToList(); |
| | | } |
| | | } else { |
| | | importInsStaffToList(); |
| | | } |
| | |
| | | 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'; |
| | |
| | | name: '下载', |
| | | }, |
| | | emits: { onClick: (role) => handleDownload(role) }, |
| | | extraProps: { |
| | | hide: (row: API.InsurancePolicyPayDto) => !row.policyOssUrl, |
| | | }, |
| | | // extraProps: { |
| | | // hide: (row: API.InsurancePolicyPayDto) => !row.policyOssUrl, |
| | | // }, |
| | | }, |
| | | ]); |
| | | |
| | |
| | | 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> |
| | |
| | | </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"> |
| | |
| | | dialogProps: dialogSupplyProps, |
| | | handleAdd: handleSupplyAdd, |
| | | editForm: supplyForm, |
| | | dialogState: dialogSupplyState, |
| | | } = useFormDialog({ |
| | | onConfirm: supplySubmit, |
| | | defaultFormParams: { |
| | |
| | | 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> |
| | |
| | | productSchemeIdNumber: string; |
| | | effectStartTime: string; |
| | | }; |
| | | //是否是补提 |
| | | isSupply?: boolean; |
| | | }; |
| | | |