zhengyiming
2025-10-14 efb39fe52a9829815bb0b82fb5b920cd3b552c2f
fix: 修改投保方式
1个文件已添加
2个文件已修改
75 ■■■■■ 已修改文件
src/views/Home/Home.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Home/components/InsureLineModeSelectDialog.vue 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Home/constants/index.ts 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Home/Home.vue
@@ -113,6 +113,7 @@
    <UploadInsurePersonDialog v-bind="dialogProps" />
    <UploadStampFileDialog v-bind="dialogStampFileProps" />
    <InsureInstructionsDialog v-bind="dialogInstructionsProps" />
    <InsureLineModeSelectDialog v-bind="dialogLineModeSelectProps" />
  </LoadingLayout>
</template>
@@ -135,7 +136,7 @@
} from '@bole-core/components';
import * as insuranceOrderServices from '@/services/api/InsuranceOrder';
import { Message, OrderInputType, downloadFileByUrl } from '@bole-core/core';
import { columns } from './constants';
import { columns, InsureLineMode } from './constants';
import UploadInsurePersonDialog from './components/UploadInsurePersonDialog.vue';
import UploadStampFileDialog from './components/UploadStampFileDialog.vue';
import {
@@ -166,6 +167,7 @@
import dayjs from 'dayjs';
import _ from 'lodash';
import InsureInstructionsDialog from './components/InsureInstructionsDialog.vue';
import InsureLineModeSelectDialog from './components/InsureLineModeSelectDialog.vue';
import { useInsureProductSchemeAllList, useUserInsureProductSetting } from '@/hooks';
// import { Recorder } from '@/utils/record';
@@ -485,13 +487,27 @@
  } catch (error) {}
}
const { dialogProps: dialogLineModeSelectProps, dialogState: dialogLineModeSelectState } =
  useDialog({
    onConfirm: handleLineModeSelect,
  });
async function handleLineModeSelect(mode: InsureLineMode) {
  if (mode === InsureLineMode.OnLine) {
    dialogInstructionsState.dialogVisible = true;
  } else {
    handleUpload();
  }
}
const { dialogProps: dialogInstructionsProps, dialogState: dialogInstructionsState } = useDialog({
  onConfirm: handleUpload,
});
function handleOpenInstructions() {
  if (isSjbAccount.value) {
    dialogInstructionsState.dialogVisible = true;
    // dialogInstructionsState.dialogVisible = true;
    dialogLineModeSelectState.dialogVisible = true;
  } else {
    handleUpload();
  }
src/views/Home/components/InsureLineModeSelectDialog.vue
New file
@@ -0,0 +1,50 @@
<template>
  <ProDialog title="选择投保方式" v-model="visible" destroy-on-close draggable width="400px">
    <div class="button-item" style="margin-bottom: 40px">
      <el-button type="primary" plain @click="handleConfirm(InsureLineMode.OnLine)"
        >线上投保</el-button
      >
    </div>
    <div class="button-item">
      <el-button type="primary" plain @click="handleConfirm(InsureLineMode.OffLine)"
        >线下投保</el-button
      >
    </div>
  </ProDialog>
</template>
<script setup lang="ts">
import { ProDialog, ProForm } from '@bole-core/components';
import { InsureLineMode } from '../constants';
defineOptions({
  name: 'InsureLineModeSelectDialog',
});
// type Props = {};
// const props = withDefaults(defineProps<Props>(), {});
const visible = defineModel({ type: Boolean });
const emit = defineEmits<{
  (e: 'onConfirm', mode: InsureLineMode): void;
}>();
function handleConfirm(mode: InsureLineMode) {
  emit('onConfirm', mode);
}
</script>
<style scoped lang="scss">
.button-item {
  text-align: center;
  :deep() {
    .el-button {
      margin: 0 auto;
      width: 200px;
    }
  }
}
</style>
src/views/Home/constants/index.ts
@@ -212,3 +212,8 @@
    name: '支付日期',
  },
]);
export enum InsureLineMode {
  OnLine = 10,
  OffLine = 20,
}