zhengyiming
4 天以前 b6d5706fcb871bebc393e71c9402254f54eb2749
src/views/Home/components/InsureOrderInfoView.vue
@@ -1,12 +1,21 @@
<template>
  <LoadingLayout :loading="state.loading">
    <AppScrollContainer>
    <AppContainer>
      <ChunkCell title="">
        <ProForm :model="detail" ref="formRef" label-width="120px" :is-read="true">
          <ProFormCol>
            <ProFormColItem :span="8">
              <ProFormItemV2 label="保单号:" prop="insureBillNo">
                <ProFormText v-model.trim="detail.insureBillNo" />
                <div class="pro-from-item-read-content-wrapper" v-if="!!detail.insureBillNo">
                  {{ detail.insureBillNo }}
                  <el-button
                    type="primary"
                    link
                    @click="handleGoStampFiles(id)"
                    v-if="detail.productOnline && detail.anyPayComplete"
                    >详情</el-button
                  >
                </div>
              </ProFormItemV2>
            </ProFormColItem>
            <ProFormColItem :span="8">
@@ -65,8 +74,11 @@
          </ProFormCol>
        </ProForm>
      </ChunkCell>
      <ChunkCell title="人员信息">
        <template #titleRight v-if="detail.status !== InsurancePolicyStatusEnum.WaitEffect">
      <ChunkCell title="人员信息" class="full-table-chunk">
        <template
          #titleRight
          v-if="detail.status !== InsurancePolicyStatusEnum.WaitEffect && !detail.productOnline"
        >
          <el-button type="primary" @click="handleBatchChange">批改申请</el-button>
        </template>
        <ProTableQueryFilterBar @on-reset="reset">
@@ -82,43 +94,65 @@
            </QueryFilterItem>
          </template>
          <template #btn>
            <template v-if="detail.status === InsurancePolicyStatusEnum.WaitEffect">
              <el-button @click="handleTemplateDownload()" link type="primary">模板下载</el-button>
              <BlFileUpload
                :limitFileSize="10"
                accept="xls,xlsx"
                :showTip="false"
                :show-file-list="false"
                :on-success="handleUploadSuccess"
                style="margin-right: 10px; margin-left: 10px"
            <template v-if="detail.productOnline">
              <el-button
                v-if="detail.auditStatus === InsurancePolicyAuditStatusEnum.Pass"
                @click="handleSupplySubmit()"
                type="primary"
                >补提</el-button
              >
                <template #default>
                  <el-button icon="Plus" type="primary">导入</el-button>
                </template>
              </BlFileUpload>
              <el-button @click="handleClear()" type="primary">清空数据</el-button>
              <template v-if="detail.status !== InsurancePolicyStatusEnum.WaitEffect">
                <el-button @click="handleExport(InsuranceDetailStatusEnum.Effecting)" type="primary"
                  >导出在保人员</el-button
                >
                <el-button @click="handleExport(InsuranceDetailStatusEnum.Fail)" type="primary"
                  >导出错误人员</el-button
                >
                <el-button @click="handleGoStampFiles(id)" type="primary">下载保单</el-button>
                <el-button @click="handleGoDownloadInvoice(id)" type="primary">下载发票</el-button>
              </template>
            </template>
            <template v-else>
              <el-button @click="handleDownloadPerson()" type="primary">下载人员清单</el-button>
              <el-button @click="handleDownloadOrder()" type="primary">下载保单</el-button>
              <template v-if="detail.status === InsurancePolicyStatusEnum.WaitEffect">
                <el-button @click="handleTemplateDownload()" link type="primary"
                  >模板下载</el-button
                >
                <BlFileUpload
                  v-if="detail.auditStatus !== InsurancePolicyAuditStatusEnum.Pass"
                  :limitFileSize="10"
                  accept="xls,xlsx"
                  :showTip="false"
                  :show-file-list="false"
                  :on-success="handleUploadSuccess"
                  style="margin-right: 10px; margin-left: 10px"
                >
                  <template #default>
                    <el-button icon="Plus" type="primary">导入</el-button>
                  </template>
                </BlFileUpload>
                <el-button @click="handleClear()" type="primary">清空数据</el-button>
              </template>
              <template v-else>
                <el-button @click="handleExport(null)" type="primary">下载人员清单</el-button>
                <el-button @click="handleDownloadOrder()" type="primary">下载保单</el-button>
              </template>
            </template>
          </template>
        </ProTableQueryFilterBar>
        <ProTableV2
          v-bind="proTableProps"
          :columns="column"
          :operationBtns="operationBtns"
          :auto-height="false"
          ref="proTable"
          :tableProps="{
            maxHeight: '400px',
          }"
        >
        </ProTableV2>
        <div class="full-table-chunk-table">
          <ProTableV2
            v-bind="proTableProps"
            :columns="column"
            :operationBtns="operationBtns"
            ref="proTable"
          >
          </ProTableV2>
        </div>
      </ChunkCell>
      <ChangePersonInfoDialog v-bind="dialogProps"></ChangePersonInfoDialog>
      <InsureClaimDetailDialog v-bind="dialogInsureClaimProps"></InsureClaimDetailDialog>
    </AppScrollContainer>
      <UploadInsurePersonDialog v-bind="dialogSupplyProps" isSupply />
    </AppContainer>
  </LoadingLayout>
</template>
@@ -151,6 +185,9 @@
  insuranceTypeText,
  InsurancePolicyStatusEnum,
  InsurancePolicyStatusEnumText,
  InsurancePolicyAuditStatusEnum,
  InsuranceDetailStatusEnumText,
  InsuranceDetailStatusEnum,
} from '@/constants';
import ChangePersonInfoDialog from './ChangePersonInfoDialog.vue';
import InsureClaimDetailDialog from './InsureClaimDetailDialog.vue';
@@ -159,6 +196,13 @@
import { useQuery, useQueryClient } from '@tanstack/vue-query';
import { downloadFile, downloadFileByUrl, Message, OrderInputType } from '@bole-core/core';
import { setOSSLink } from '@/utils';
import dayjs from 'dayjs';
import {
  useInsureActions,
  useInsureProductSchemeAllList,
  useUserInsureProductSetting,
} from '@/hooks';
import UploadInsurePersonDialog from './UploadInsurePersonDialog.vue';
defineOptions({
  name: 'InsureOrderInfoView',
@@ -194,6 +238,16 @@
    name: '雇员工种',
  },
  {
    id: '51',
    enCode: 'occupationType',
    name: '职业类型',
  },
  {
    id: '52',
    enCode: 'occupationCode',
    name: '职业码值',
  },
  {
    id: '6',
    enCode: 'userEmploer',
    name: '用工单位',
@@ -222,6 +276,24 @@
    width: 140,
  },
  {
    id: '101',
    enCode: 'payOrder',
    name: '批次号',
    width: 140,
  },
  {
    id: '102',
    enCode: 'status',
    name: '投保状态',
    width: 140,
  },
  {
    id: '103',
    enCode: 'auditRemark',
    name: '备注',
    width: 140,
  },
  {
    id: '11',
    enCode: 'claimCount',
    name: '理赔',
@@ -240,7 +312,9 @@
    },
    extraProps: {
      hide: (row: API.GetInsuranceStaffPageTemplate) =>
        detail.value?.status !== InsurancePolicyStatusEnum.WaitEffect,
        detail.value?.productOnline ||
        detail.value?.status !== InsurancePolicyStatusEnum.WaitEffect ||
        detail.value?.auditStatus === InsurancePolicyAuditStatusEnum.Pass,
    },
  },
  {
@@ -320,7 +394,12 @@
      keyWord: '',
      orderInput: [{ property: 'id', order: OrderInputType.Asc }],
    },
    columnsRenderProps: {},
    columnsRenderProps: {
      status: {
        type: 'enum',
        valueEnum: InsuranceDetailStatusEnumText,
      },
    },
  }
);
@@ -373,29 +452,20 @@
  } catch (error) {}
}
async function handleDownloadPerson() {
  try {
    if (paginationState.total === 0) {
      Message.warnMessage('没有数据可以导出哦~');
      return;
    }
    let res = await insuranceOrderServices.getInsuranceStaffListExport(
      { id: id },
      {
        responseType: 'blob',
        getResponse: true,
      }
    );
    if (res) {
      downloadFile(res.data, `人员清单`, 'xlsx');
    }
  } catch (error) {}
}
function handleDownloadOrder() {
  downloadFileByUrl(setOSSLink(detail.value?.insureBillUrl));
}
const { handleGoDownloadInvoice, handleGoStampFiles } = useInsureActions();
function handleBatchChange() {
  if (
    dayjs(detail.value?.effectEndTime).isBefore(dayjs()) ||
    dayjs(detail.value?.effectEndTime).isSame(dayjs(), 'day')
  ) {
    Message.errorMessage('保险今天到期,无法批改');
    return;
  }
  router.push({
    name: 'BatchChange',
    params: {
@@ -404,6 +474,7 @@
    query: {
      insurerName: detail.value?.insurerName ?? '',
      insureBillNo: detail.value?.insureBillNo ?? '',
      effectEndTime: detail.value?.effectEndTime ?? '',
    },
  });
}
@@ -470,8 +541,82 @@
    });
  } catch (error) {}
}
async function handleExport(status: InsuranceDetailStatusEnum) {
  try {
    if (paginationState.total === 0) {
      Message.warnMessage('没有数据可以导出哦~');
      return;
    }
    let res = await insuranceOrderServices.getInsuranceStaffListExport(
      { insurancePolicyId: id, status: status },
      {
        responseType: 'blob',
        getResponse: true,
      }
    );
    if (res) {
      downloadFile(res.data, `人员清单`, 'xlsx');
    }
  } catch (error) {}
}
const { getInsureProductIdByIdNumber } = useUserInsureProductSetting();
const { getInsureProductSchemeByCode } = useInsureProductSchemeAllList({
  insureProductId: computed(() => getInsureProductIdByIdNumber(detail.value.productIdNumber)),
});
function handleSupplySubmit() {
  handleSupplyAdd({
    serialNum: detail.value.serialNum,
    productIdNumber: detail.value.productIdNumber,
    productSchemeIdNumber: getInsureProductSchemeByCode(detail.value.productSchemeCode)?.idNumber,
    effectStartTime: detail.value.effectStartTime,
  });
}
const {
  dialogProps: dialogSupplyProps,
  handleAdd: handleSupplyAdd,
  editForm: supplyForm,
} = useFormDialog({
  onConfirm: supplySubmit,
  defaultFormParams: {
    serialNum: '',
    url: [] as UploadUserFile[],
    productIdNumber: '',
    productSchemeIdNumber: '',
    effectStartTime: dayjs().add(1, 'day').format('YYYY-MM-DD'),
  },
});
// TODO 补提
async function supplySubmit() {}
</script>
<style lang="scss" scoped>
@use '@/style/common.scss' as *;
.full-table-chunk {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  :deep() {
    .chunk-cell-content {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0;
    }
  }
  .full-table-chunk-table {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }
}
</style>