| | |
| | | @change="getList()" |
| | | /> |
| | | </QueryFilterItem> |
| | | <QueryFilterItem v-if="isJYB"> |
| | | <QueryFilterItem> |
| | | <FieldRadio |
| | | v-model="extraParamState.insuranceType" |
| | | :value-enum="insuranceTypeText" |
| | |
| | | <SearchInput |
| | | v-model="extraParamState.keyword" |
| | | style="width: 260px" |
| | | :placeholder="keywordText" |
| | | placeholder="姓名/身份证/单位/保单号等" |
| | | @on-click-search="getList" |
| | | > |
| | | </SearchInput> |
| | |
| | | </BlFileUpload> |
| | | |
| | | <el-button |
| | | v-if="isJYB" |
| | | @click="handleEnterpriseBatchRefund()" |
| | | type="primary" |
| | | style="margin-right: 10px" |
| | |
| | | v-bind="proTableProps" |
| | | :columns="HomeColumns" |
| | | :operationBtns="operationBtns" |
| | | :show-column-check="isJYB" |
| | | :show-column-check="true" |
| | | :column-selectable="columnSelectable" |
| | | ref="proTable" |
| | | :table-props="{ |
| | |
| | | import { ModelValueType } from 'element-plus'; |
| | | import { useQueryClient } from '@tanstack/vue-query'; |
| | | import { |
| | | AppType, |
| | | InsuranceOrderTempPath, |
| | | JYBInsuranceOrderTempPath, |
| | | OnJobFlagEnumText, |
| | | insuranceTypeText, |
| | | isJYB, |
| | | } from '@/constants'; |
| | | import dayjs from 'dayjs'; |
| | | import _ from 'lodash'; |
| | |
| | | }); |
| | | |
| | | const operationBtns = defineOperationBtns([ |
| | | // { |
| | | // data: { |
| | | // enCode: 'checkBtn', |
| | | // name: '理赔', |
| | | // }, |
| | | // emits: { |
| | | // onClick: (role) => goDetail(role), |
| | | // }, |
| | | // }, |
| | | AppType === 'rz' && { |
| | | data: { |
| | | enCode: 'uploadBtn', |
| | | name: '上传材料', |
| | | }, |
| | | emits: { |
| | | onClick: (role) => openDialog(role), |
| | | }, |
| | | }, |
| | | isJYB && { |
| | | { |
| | | data: { |
| | | enCode: 'downloadBtn', |
| | | name: '保单下载', |
| | |
| | | }, |
| | | }, |
| | | ]).filter(Boolean); |
| | | |
| | | const keywordText = computed(() => { |
| | | if (isJYB) { |
| | | return '姓名/身份证/单位/保单号等'; |
| | | } |
| | | return '姓名/身份证/合同单位等'; |
| | | }); |
| | | |
| | | const columnSelectable = (row: API.InsuranceOrderListOutput) => { |
| | | return row.onJobFlag === '增员'; |
| | |
| | | format: 'YYYY/MM/DD', |
| | | }, |
| | | }, |
| | | showSummary: AppType === 'rz' || isJYB, |
| | | showSummary: true, |
| | | summaryPropertys: [ |
| | | { |
| | | property: 'table-operation', |
| | |
| | | |
| | | async function handleUploadSuccess(response: UploadUserFile) { |
| | | try { |
| | | if (AppType === 'one') { |
| | | let res = await insuranceOrderServices.checkImportInsuranceOrderData(response.url); |
| | | if (res) { |
| | | let checkRes = await insuranceOrderServices.importInsuranceOrderData(response.url, { |
| | | getResponse: true, |
| | | responseType: 'blob', |
| | | }); |
| | | if (checkRes?.data?.size) { |
| | | Message.tipMessage('存在错误数据,是否导出?') |
| | | .then(() => { |
| | | downloadFile(checkRes.data, `错误人员名单`, 'xlsx'); |
| | | }) |
| | | .catch(() => { |
| | | getList(paginationState.pageIndex); |
| | | }); |
| | | } |
| | | } |
| | | } else { |
| | | 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: '备注', |
| | | // }, |
| | | // }); |
| | | } |
| | | 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'], |
| | |
| | | } |
| | | |
| | | function handleDownload() { |
| | | if (isJYB) { |
| | | downloadFileByUrl(JYBInsuranceOrderTempPath, '保单导入模板'); |
| | | } else { |
| | | downloadFileByUrl(InsuranceOrderTempPath, '保单导入模板'); |
| | | } |
| | | downloadFileByUrl(JYBInsuranceOrderTempPath, '保单导入模板'); |
| | | } |
| | | |
| | | function handleRowStyle(data: { row: API.InsuranceOrderListOutput; rowIndex: number }) { |
| | | if ( |
| | | isJYB && |
| | | 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 |
| | | ) { |