wupengfei
2025-03-20 b2b1ba0ec2e5c45cf4f37b0fcea6e23fe36f9b47
feat: init
2个文件已修改
127 ■■■■ 已修改文件
src/views/Home/Home.vue 102 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Home/constants/index.ts 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Home/Home.vue
@@ -24,7 +24,7 @@
              @change="getList()"
            />
          </QueryFilterItem>
          <QueryFilterItem v-if="isJYB">
          <QueryFilterItem>
            <FieldRadio
              v-model="extraParamState.insuranceType"
              :value-enum="insuranceTypeText"
@@ -37,7 +37,7 @@
            <SearchInput
              v-model="extraParamState.keyword"
              style="width: 260px"
              :placeholder="keywordText"
              placeholder="姓名/身份证/单位/保单号等"
              @on-click-search="getList"
            >
            </SearchInput>
@@ -66,7 +66,6 @@
          </BlFileUpload>
          <el-button
            v-if="isJYB"
            @click="handleEnterpriseBatchRefund()"
            type="primary"
            style="margin-right: 10px"
@@ -85,7 +84,7 @@
        v-bind="proTableProps"
        :columns="HomeColumns"
        :operationBtns="operationBtns"
        :show-column-check="isJYB"
        :show-column-check="true"
        :column-selectable="columnSelectable"
        ref="proTable"
        :table-props="{
@@ -130,12 +129,10 @@
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';
@@ -145,25 +142,7 @@
});
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: '保单下载',
@@ -176,13 +155,6 @@
    },
  },
]).filter(Boolean);
const keywordText = computed(() => {
  if (isJYB) {
    return '姓名/身份证/单位/保单号等';
  }
  return '姓名/身份证/合同单位等';
});
const columnSelectable = (row: API.InsuranceOrderListOutput) => {
  return row.onJobFlag === '增员';
@@ -237,7 +209,7 @@
        format: 'YYYY/MM/DD',
      },
    },
    showSummary: AppType === 'rz' || isJYB,
    showSummary: true,
    summaryPropertys: [
      {
        property: 'table-operation',
@@ -268,44 +240,25 @@
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'],
@@ -356,16 +309,11 @@
}
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
  ) {
src/views/Home/constants/index.ts
@@ -1,17 +1,10 @@
import { defineColumns } from '@bole-core/components';
import { AppType, isJYB } from '@/constants';
export const HomeColumns = defineColumns([
  {
    id: '1',
    enCode: 'channel',
    name: '渠道',
    width: 160,
  },
  AppType === 'rz' && {
    id: '2',
    enCode: 'salesmanName',
    name: '业务员姓名',
    width: 160,
  },
  {
@@ -44,7 +37,7 @@
    name: '实际工作单位',
    width: 160,
  },
  isJYB && {
  {
    id: '8',
    enCode: 'workAddress',
    name: '用工地点',
@@ -74,13 +67,13 @@
    name: '投保方案',
    width: 160,
  },
  isJYB && {
  {
    id: '13',
    enCode: 'insuranceType',
    name: '投保方式',
    width: 160,
  },
  (AppType === 'rz' || isJYB) && {
  {
    id: '14',
    enCode: 'orderNo',
    name: '保单号',
@@ -102,18 +95,6 @@
    id: '17',
    enCode: 'age',
    name: '年龄',
    width: 160,
  },
  AppType !== 'other' && {
    id: '18',
    enCode: 'idCardCheckResult',
    name: '身份证校验',
    width: 160,
  },
  AppType !== 'other' && {
    id: '19',
    enCode: 'idCardRepeatResult',
    name: '身份证是否重复',
    width: 160,
  },
  {