| | |
| | | <SearchInput |
| | | v-model="extraParamState.keyword" |
| | | style="width: 260px" |
| | | placeholder="姓名/身份证/单位/保单号等" |
| | | placeholder="单位/保单号/参保机构" |
| | | @on-click-search="getList" |
| | | > |
| | | </SearchInput> |
| | | </QueryFilterItem> |
| | | </template> |
| | | <template #btn> |
| | | <el-button |
| | | @click="handleDownload()" |
| | | icon="Download" |
| | | type="primary" |
| | | style="margin-right: 10px" |
| | | link |
| | | <el-button @click="handleDownload()" type="primary" style="margin-right: 10px" link |
| | | >模板下载</el-button |
| | | > |
| | | |
| | | <BlFileUpload |
| | | :limitFileSize="10" |
| | | accept="xls,xlsx" |
| | | :showTip="false" |
| | | :show-file-list="false" |
| | | :on-success="handleUploadSuccess" |
| | | <el-button @click="handleUpload()" type="primary" style="margin-right: 10px" |
| | | >导入</el-button |
| | | > |
| | | <template #default> |
| | | <el-button icon="Plus" type="primary">导入</el-button> |
| | | </template> |
| | | </BlFileUpload> |
| | | |
| | | <el-button |
| | | @click="handleEnterpriseBatchRefund()" |
| | | type="primary" |
| | | style="margin-right: 10px" |
| | | >批量减员</el-button |
| | | > |
| | | <el-button |
| | | @click="handleExport()" |
| | | icon="Download" |
| | | type="primary" |
| | | style="margin-left: 10px" |
| | | >导出</el-button |
| | | > |
| | | <el-button @click="downloadInsureOrder()" type="primary" link>导出保单列表</el-button> |
| | | <el-button @click="downloadInsurePerson()" type="primary" link>导出在保人员</el-button> |
| | | </template> |
| | | </ProTableQueryFilterBar> |
| | | <ProTableV2 |
| | | v-bind="proTableProps" |
| | | :columns="HomeColumns" |
| | | :columns="columns" |
| | | :operationBtns="operationBtns" |
| | | :show-column-check="true" |
| | | :column-selectable="columnSelectable" |
| | | ref="proTable" |
| | | :table-props="{ |
| | | rowStyle: handleRowStyle, |
| | |
| | | > |
| | | </ProTableV2> |
| | | </AppContainer> |
| | | <UploadMaterialDialog |
| | | v-bind="dialogProps" |
| | | @onAddUpdateMaterial="getList(paginationState.pageIndex)" |
| | | /> |
| | | <BatchDownsizingDialog v-bind="dialogBatchDownsizingProps" /> |
| | | <UploadInsurePersonDialog v-bind="dialogProps" /> |
| | | <UploadStampFileDialog v-bind="dialogStampFileProps" /> |
| | | </LoadingLayout> |
| | | </template> |
| | | |
| | |
| | | useTable, |
| | | useFormDialog, |
| | | FieldDatePicker, |
| | | BlFileUpload, |
| | | defineOperationBtns, |
| | | UploadUserFile, |
| | | XLSXUtils, |
| | | SearchInput, |
| | | FieldRadio, |
| | | } from '@bole-core/components'; |
| | | import * as insuranceOrderServices from '@/services/api/InsuranceOrder'; |
| | | import { Message, OrderInputType, downloadFileByUrl } from '@bole-core/core'; |
| | | import { HomeColumns } from './constants'; |
| | | import UploadMaterialDialog from './components/UploadMaterialDialog.vue'; |
| | | import BatchDownsizingDialog from './components/BatchDownsizingDialog.vue'; |
| | | import { toThousand, format, downloadFile, setOSSLink } from '@/utils'; |
| | | import { omit } from 'lodash'; |
| | | import { columns } from './constants'; |
| | | import UploadInsurePersonDialog from './components/UploadInsurePersonDialog.vue'; |
| | | import UploadStampFileDialog from './components/UploadStampFileDialog.vue'; |
| | | import { format, downloadFile, setOSSLink } from '@/utils'; |
| | | import { ModelValueType } from 'element-plus'; |
| | | import { useQueryClient } from '@tanstack/vue-query'; |
| | | import { |
| | | InsuranceOrderTempPath, |
| | | JYBInsuranceOrderTempPath, |
| | | OnJobFlagEnumText, |
| | | insuranceTypeText, |
| | | } from '@/constants'; |
| | | import { InsuranceOrderTempPath, OnJobFlagEnumText, insuranceTypeText } from '@/constants'; |
| | | import dayjs from 'dayjs'; |
| | | import _ from 'lodash'; |
| | | |
| | |
| | | }); |
| | | |
| | | const operationBtns = defineOperationBtns([ |
| | | { |
| | | data: { |
| | | enCode: 'detailBtn', |
| | | name: '详情', |
| | | }, |
| | | emits: { |
| | | onClick: (role) => handleDetail(role), |
| | | }, |
| | | }, |
| | | { |
| | | data: { |
| | | enCode: 'batchBtn', |
| | | name: '批改', |
| | | }, |
| | | emits: { |
| | | onClick: (role) => handleBatch(role), |
| | | }, |
| | | // extraProps: { |
| | | // hide: (row: API.InsuranceOrderListOutput) => !row.orderBillFile, |
| | | // }, |
| | | }, |
| | | { |
| | | data: { |
| | | enCode: 'uploadStampFileBtn', |
| | | name: '上传盖章文件', |
| | | }, |
| | | emits: { |
| | | onClick: (role) => handleUploadStampFile(role), |
| | | }, |
| | | // extraProps: { |
| | | // hide: (row: API.InsuranceOrderListOutput) => !row.orderBillFile, |
| | | // }, |
| | | }, |
| | | { |
| | | data: { |
| | | enCode: 'downloadBtn', |
| | |
| | | }, |
| | | }, |
| | | ]).filter(Boolean); |
| | | |
| | | const columnSelectable = (row: API.InsuranceOrderListOutput) => { |
| | | return row.onJobFlag === '增员'; |
| | | }; |
| | | |
| | | const BaseState = { |
| | | loading: true, |
| | |
| | | format: 'YYYY/MM/DD', |
| | | }, |
| | | }, |
| | | showSummary: true, |
| | | summaryPropertys: [ |
| | | { |
| | | property: 'table-operation', |
| | | valueKey: 'totalAmount', |
| | | formatter: (v) => `¥${toThousand(v)}`, |
| | | }, |
| | | ], |
| | | } |
| | | ); |
| | | |
| | |
| | | return params; |
| | | } |
| | | |
| | | const queryClient = useQueryClient(); |
| | | |
| | | 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'); |
| | | // XLSXUtils.exportToXLSX({ |
| | | // workbookDataList: res, |
| | | // fileName: '错误人员名单', |
| | | // workbookHeaderMap: { |
| | | // ...omit(Object.fromEntries(HomeColumns.map((x) => [x.enCode, x.name])), [ |
| | | // 'channel', |
| | | // 'salesmanName', |
| | | // 'createTime', |
| | | // ]), |
| | | // erroMsg: '备注', |
| | | // }, |
| | | // }); |
| | | } |
| | | queryClient.invalidateQueries({ |
| | | queryKey: ['insuranceOrderServices/getInsuranceOrderListByOrderRelevance'], |
| | | }); |
| | | getList(); |
| | | } catch (error) {} |
| | | } |
| | | |
| | | const { dialogProps, handleAdd } = useFormDialog({ |
| | | const { dialogProps, handleAdd, editForm } = useFormDialog({ |
| | | onConfirm: uploadInsurePerson, |
| | | defaultFormParams: { |
| | | id: '', |
| | | materialName: '', |
| | | orderNo: '', |
| | | url: [] as UploadUserFile[], |
| | | }, |
| | | }); |
| | | |
| | | function openDialog(row: API.InsuranceOrderListOutput) { |
| | | function handleUpload() { |
| | | handleAdd({ |
| | | id: row.id, |
| | | orderNo: '', |
| | | url: [] as UploadUserFile[], |
| | | }); |
| | | } |
| | | |
| | | const router = useRouter(); |
| | | function goDetail(row: API.InsuranceOrderListOutput) { |
| | | router.push({ |
| | | name: 'InsuranceClaimDetail', |
| | | params: { |
| | | id: row.id, |
| | | }, |
| | | }); |
| | | async function uploadInsurePerson() { |
| | | try { |
| | | let params = { |
| | | orderNo: editForm.orderNo, |
| | | url: editForm.url?.[0]?.path, |
| | | }; |
| | | // let res = await insuranceOrderServices.uploadStampFile(params); |
| | | // if (res) { |
| | | // Message.successMessage('上传成功'); |
| | | // getList(paginationState.pageIndex); |
| | | // } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | const router = useRouter(); |
| | | |
| | | async function handleExport() { |
| | | try { |
| | |
| | | } |
| | | |
| | | function handleDownload() { |
| | | downloadFileByUrl(JYBInsuranceOrderTempPath, '保单导入模板'); |
| | | downloadFileByUrl(InsuranceOrderTempPath, '保单导入模板'); |
| | | } |
| | | |
| | | function handleRowStyle(data: { row: API.InsuranceOrderListOutput; rowIndex: number }) { |
| | | function handleRowStyle(data: { row: API.InsuranceOrderListOutput }) { |
| | | if ( |
| | | dayjs(dayjs(data.row?.insuranceEndTime).format('YYYY-MM-DD')).diff(dayjs(), 'day') >= 0 && |
| | | dayjs(dayjs(data.row?.insuranceEndTime).format('YYYY-MM-DD')).diff(dayjs(), 'day') < 6 |
| | |
| | | } |
| | | } |
| | | |
| | | const proTable = ref<InstanceType<typeof ProTableV2>>(); |
| | | function handleEnterpriseBatchRefund() { |
| | | if (proTableProps.value.tableData.length) { |
| | | const res: API.InsuranceOrderListOutput[] = proTable.value.innerTableRef.getSelectionRows(); |
| | | if (res.length > 0) { |
| | | const orderNos = _.uniq(res.map((x) => x.orderNo)); |
| | | if (orderNos.length > 1) { |
| | | Message.errorMessage('存在不同的保单号,无法批量减员'); |
| | | return; |
| | | } |
| | | handleBatchDownsizing(res); |
| | | } else { |
| | | Message.errorMessage('请先勾选减员人员'); |
| | | } |
| | | } else { |
| | | Message.errorMessage('暂无数据'); |
| | | } |
| | | } |
| | | |
| | | const { |
| | | dialogProps: dialogBatchDownsizingProps, |
| | | handleAdd: handleBatchDownsizingAdd, |
| | | editForm: batchDownsizingForm, |
| | | dialogProps: dialogStampFileProps, |
| | | handleEdit: handleStampFileEdit, |
| | | editForm: stampFileForm, |
| | | } = useFormDialog({ |
| | | onConfirm: downsizingInsuranceOrderData, |
| | | onConfirm: uploadStampFile, |
| | | defaultFormParams: { |
| | | orderNo: '', |
| | | checkOrderNo: '', |
| | | id: '', |
| | | url: [] as UploadUserFile[], |
| | | downsizingInsuranceList: [] as string[], |
| | | }, |
| | | }); |
| | | |
| | | function handleBatchDownsizing(res: API.InsuranceOrderListOutput[]) { |
| | | handleBatchDownsizingAdd({ |
| | | checkOrderNo: res[0]?.orderNo, |
| | | downsizingInsuranceList: res.map((x) => x.id), |
| | | function handleUploadStampFile(row: API.InsuranceOrderListOutput) { |
| | | handleStampFileEdit({ |
| | | id: row.id, |
| | | url: [] as UploadUserFile[], |
| | | }); |
| | | } |
| | | |
| | | async function downsizingInsuranceOrderData() { |
| | | async function uploadStampFile() { |
| | | try { |
| | | let params: API.DownsizingInsuranceOrderData = { |
| | | orderNo: batchDownsizingForm.checkOrderNo, |
| | | downsizingInsuranceList: batchDownsizingForm.downsizingInsuranceList, |
| | | url: batchDownsizingForm.url?.[0]?.path ?? '', |
| | | let params = { |
| | | id: stampFileForm.id, |
| | | url: stampFileForm.url?.[0]?.path, |
| | | }; |
| | | let res = await insuranceOrderServices.downsizingInsuranceOrderDataCheck(params); |
| | | if (res) { |
| | | let downRes = await insuranceOrderServices.downsizingInsuranceOrderData(params, { |
| | | getResponse: true, |
| | | responseType: 'blob', |
| | | }); |
| | | if (downRes?.data?.size) { |
| | | await Message.tipMessage('存在错误数据,是否导出?'); |
| | | downloadFile(downRes.data, `错误人员名单`, 'xlsx'); |
| | | } |
| | | queryClient.invalidateQueries({ |
| | | queryKey: ['insuranceOrderServices/getInsuranceOrderListByOrderRelevance'], |
| | | }); |
| | | getList(paginationState.pageIndex); |
| | | } |
| | | // let res = await insuranceOrderServices.uploadStampFile(params); |
| | | // if (res) { |
| | | // Message.successMessage('上传成功'); |
| | | // getList(paginationState.pageIndex); |
| | | // } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | function handleDownloadOrderNo(row: API.InsuranceOrderListOutput) { |
| | | downloadFileByUrl(setOSSLink(row.orderBillFile)); |
| | | } |
| | | |
| | | function handleDetail(row: API.InsuranceOrderListOutput) { |
| | | router.push({ |
| | | name: 'InsuranceOrderDetail', |
| | | params: { |
| | | id: row.id, |
| | | }, |
| | | }); |
| | | } |
| | | function handleBatch(row: API.InsuranceOrderListOutput) { |
| | | router.push({ |
| | | name: 'BatchChange', |
| | | params: { |
| | | id: row.id, |
| | | }, |
| | | }); |
| | | } |
| | | function downloadInsureOrder() {} |
| | | function downloadInsurePerson() {} |
| | | </script> |