From efb39fe52a9829815bb0b82fb5b920cd3b552c2f Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期二, 14 十月 2025 15:12:34 +0800
Subject: [PATCH] fix: 修改投保方式
---
src/views/Home/components/InsureLineModeSelectDialog.vue | 50 +++++++++++++++++++++++++
src/views/Home/constants/index.ts | 5 ++
src/views/Home/Home.vue | 20 +++++++++-
3 files changed, 73 insertions(+), 2 deletions(-)
diff --git a/src/views/Home/Home.vue b/src/views/Home/Home.vue
index 82ba3f4..b9b7bf6 100644
--- a/src/views/Home/Home.vue
+++ b/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();
}
diff --git a/src/views/Home/components/InsureLineModeSelectDialog.vue b/src/views/Home/components/InsureLineModeSelectDialog.vue
new file mode 100644
index 0000000..f1503f5
--- /dev/null
+++ b/src/views/Home/components/InsureLineModeSelectDialog.vue
@@ -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>
diff --git a/src/views/Home/constants/index.ts b/src/views/Home/constants/index.ts
index d46d36a..4c848ac 100644
--- a/src/views/Home/constants/index.ts
+++ b/src/views/Home/constants/index.ts
@@ -212,3 +212,8 @@
name: '鏀粯鏃ユ湡',
},
]);
+
+export enum InsureLineMode {
+ OnLine = 10,
+ OffLine = 20,
+}
--
Gitblit v1.9.1