| | |
| | | <QueryFilterItem> |
| | | <FieldRadio |
| | | v-model="extraParamState.auditStatus" |
| | | :value-enum="InsurancePolicyAuditStatusEnumText" |
| | | :value-enum="InsurancePolicyAuditStatusEnumTextForFilter" |
| | | buttonStyle |
| | | showAllBtn |
| | | @change="getList()" |
| | |
| | | type="primary" |
| | | style="margin-right: 10px" |
| | | link |
| | | v-if="isSjbAccount" |
| | | >职业类型对照表</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 @click="handleOpenInstructions()" type="primary" style="margin-right: 10px" |
| | | >导入投保人员</el-button |
| | | > |
| | | <!-- <el-button |
| | |
| | | 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, |
| | |
| | | InsurancePolicyStatusEnum, |
| | | AppType, |
| | | InsurancePolicyAuditStatusEnumText, |
| | | InsurancePolicyAuditStatusEnumTextForFilter, |
| | | InsurancePolicyAuditStatusEnum, |
| | | InsurancePolicyProductIdNumberEnum, |
| | | InsurancePolicyListPayStatusEnum, |
| | |
| | | import dayjs from 'dayjs'; |
| | | import _ from 'lodash'; |
| | | import InsureInstructionsDialog from './components/InsureInstructionsDialog.vue'; |
| | | import { useUserInsureProductSetting } from '@/hooks'; |
| | | // import { Recorder } from '@/utils/record'; |
| | | |
| | | defineOptions({ |
| | |
| | | onMounted(async () => { |
| | | await getList(); |
| | | state.loading = false; |
| | | handleOpenInstructions(); |
| | | // handleOpenInstructions(); |
| | | |
| | | // setTimeout(() => { |
| | | // // recorder.value.init(); |
| | |
| | | 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) { |
| | |
| | | } 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(); |
| | | } |
| | |
| | | |
| | | 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, |
| | | customErrorHandler(error) { |
| | | if (error?.response?.data?.error?.code === '10001') { |
| | | Message.tipMessage(error.response.data?.error?.message, { |
| | | showCancelButton: false, |
| | | }); |
| | | return true; |
| | | } |
| | | return false; |
| | | }, |
| | | }); |
| | | 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) {} |
| | | dialogState.dialogVisible = false; |
| | | getList(paginationState.pageIndex); |
| | | } |
| | | dialogState.dialogVisible = false; |
| | | getList(paginationState.pageIndex); |
| | | } catch (error) {} |
| | | } |
| | | |
| | | const { dialogProps: dialogInstructionsProps, dialogState: dialogInstructionsState } = useDialog(); |
| | | const { dialogProps: dialogInstructionsProps, dialogState: dialogInstructionsState } = useDialog({ |
| | | onConfirm: handleUpload, |
| | | }); |
| | | |
| | | const { isSjbAccount } = useUserInsureProductSetting(); |
| | | |
| | | function handleOpenInstructions() { |
| | | dialogInstructionsState.dialogVisible = true; |
| | | if (isSjbAccount.value) { |
| | | dialogInstructionsState.dialogVisible = true; |
| | | } else { |
| | | handleUpload(); |
| | | } |
| | | } |
| | | |
| | | function handleUpload() { |
| | | async function handleUpload() { |
| | | handleAdd({ |
| | | serialNum: `${dayjs().format('YYYYMMDD')}${_.random(0, 9999).toString().padStart(4, '0')}`, |
| | | url: [] as UploadUserFile[], |
| | |
| | | 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) { |