zhengyiming
2025-07-29 ac452fd9dd2b7703a81374d171df3604fae78b7a
src/views/Home/components/InsureOrderInfoView.vue
@@ -60,6 +60,22 @@
              </ProFormItemV2>
            </ProFormColItem>
          </ProFormCol>
          <ProFormCol v-if="detail.productOnline">
            <ProFormColItem :span="8">
              <ProFormItemV2 label="总保费:" prop="amount">
                <ProFormInputNumber v-model="detail.amount" unit="元" formatValue="money" />
              </ProFormItemV2>
            </ProFormColItem>
            <ProFormColItem :span="8">
              <ProFormItemV2 label="总保额:" prop="sumInsured">
                <ProFormInputNumber
                  v-model.trim="detail.sumInsured"
                  unit="元"
                  formatValue="money"
                />
              </ProFormItemV2>
            </ProFormColItem>
          </ProFormCol>
          <ProFormCol>
            <ProFormColItem :span="8">
              <ProFormItemV2 label="投保人:" prop="insurerName">
@@ -101,13 +117,28 @@
                type="primary"
                >补提</el-button
              >
              <el-button @click="handleExport(InsuranceDetailStatusEnum.Effecting)" type="primary"
                >导出在保人员</el-button
              >
              <el-button @click="handleExport(InsuranceDetailStatusEnum.Fail)" type="primary"
                >导出错误人员</el-button
              >
              <template v-if="detail.auditStatus === InsurancePolicyAuditStatusEnum.WaitAdd">
                <BlFileUpload
                  :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-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>
@@ -311,10 +342,16 @@
      onClick: (role) => handleChangeInfo(role),
    },
    extraProps: {
      hide: (row: API.GetInsuranceStaffPageTemplate) =>
        detail.value?.productOnline ||
        detail.value?.status !== InsurancePolicyStatusEnum.WaitEffect ||
        detail.value?.auditStatus === InsurancePolicyAuditStatusEnum.Pass,
      hide: (row: API.GetInsuranceStaffPageTemplate) => {
        if (detail.value?.productOnline) {
          return detail.value?.auditStatus !== InsurancePolicyAuditStatusEnum.WaitAdd;
        } else {
          return (
            detail.value?.status !== InsurancePolicyStatusEnum.WaitEffect ||
            detail.value?.auditStatus === InsurancePolicyAuditStatusEnum.Pass
          );
        }
      },
    },
  },
  {
@@ -430,21 +467,23 @@
      url: response.url,
    });
    if (res?.length > 0) {
      await Message.tipMessage('存在错误数据,是否导出?');
      XLSXUtils.exportToXLSX({
        workbookDataList: res,
        fileName: '错误人员名单',
        workbookHeaderMap: {
          name: '雇员姓名',
          sex: '性别',
          certType: '证件类型',
          certNo: '证件号码',
          jobName: '雇员工种',
          useEmploer: '用工单位',
          address: '用工地点',
          note: '备注',
        },
      });
      try {
        await Message.tipMessage('存在错误数据,是否导出?');
        XLSXUtils.exportToXLSX({
          workbookDataList: res,
          fileName: '错误人员名单',
          workbookHeaderMap: {
            name: '雇员姓名',
            sex: '性别',
            certType: '证件类型',
            certNo: '证件号码',
            jobName: '雇员工种',
            useEmploer: '用工单位',
            address: '用工地点',
            note: '备注',
          },
        });
      } catch (error) {}
    }
    queryClient.invalidateQueries({
      queryKey: ['insuranceOrderServices/getInsuranceStaffList'],
@@ -573,6 +612,7 @@
    productIdNumber: detail.value.productIdNumber,
    productSchemeIdNumber: getInsureProductSchemeByCode(detail.value.productSchemeCode)?.idNumber,
    effectStartTime: detail.value.effectStartTime,
    effectEndTime: detail.value.effectEndTime,
  });
}
@@ -580,6 +620,7 @@
  dialogProps: dialogSupplyProps,
  handleAdd: handleSupplyAdd,
  editForm: supplyForm,
  dialogState: dialogSupplyState,
} = useFormDialog({
  onConfirm: supplySubmit,
  defaultFormParams: {
@@ -588,11 +629,58 @@
    productIdNumber: '',
    productSchemeIdNumber: '',
    effectStartTime: dayjs().add(1, 'day').format('YYYY-MM-DD'),
    effectEndTime: '',
  },
  closeAfterConfirm: false,
});
// TODO 补提
async function supplySubmit() {}
async function supplySubmit() {
  try {
    let params: API.FillInsStaffToListFrontInput = {
      insurancePolicyId: id,
      url: supplyForm.url?.[0]?.path,
    };
    let res = await insuranceOrderServices.fillInsStaffToList(params, {
      timeout: 60 * 1000 * 10,
    });
    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) {}
      dialogSupplyState.dialogVisible = false;
      getInsuranceStaffList(paginationState.pageIndex);
    }
  } catch (error) {}
}
</script>
<style lang="scss" scoped>