|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+<template>
|
|
|
2
|
+ <div class="min-h-screen bg-gray-50 p-8">
|
|
|
3
|
+ <div class="mx-auto max-w-7xl">
|
|
|
4
|
+ <!-- 标题区域 -->
|
|
|
5
|
+ <div class="mb-8 bg-white rounded-lg p-6 shadow-sm">
|
|
|
6
|
+ <h1 class="text-3xl font-bold text-gray-900">业务设置</h1>
|
|
|
7
|
+ <p class="mt-2 text-gray-600">在此配置系统的业务规则和相关参数</p>
|
|
|
8
|
+ </div>
|
|
|
9
|
+ <!-- 配置卡片区域 -->
|
|
|
10
|
+ <div class="grid gap-6">
|
|
|
11
|
+ <!-- 多次来电配置 -->
|
|
|
12
|
+ <div class="rounded-lg bg-white p-6 shadow-sm">
|
|
|
13
|
+ <div class="mb-6 flex items-center justify-between">
|
|
|
14
|
+ <div>
|
|
|
15
|
+ <h2 class="text-xl font-semibold text-gray-900">重复来电配置</h2>
|
|
|
16
|
+ <p class="mt-1 text-sm text-gray-500">设置多次来电的触发条件</p>
|
|
|
17
|
+ </div>
|
|
|
18
|
+ <el-button
|
|
|
19
|
+ type="primary"
|
|
|
20
|
+ class="!rounded-button whitespace-nowrap"
|
|
|
21
|
+ @click="saveSettings"
|
|
|
22
|
+ :loading="saving"
|
|
|
23
|
+ >
|
|
|
24
|
+ 保存配置
|
|
|
25
|
+ </el-button>
|
|
|
26
|
+ </div>
|
|
|
27
|
+ <div class="flex items-center space-x-4">
|
|
|
28
|
+ <div class="flex items-center">
|
|
|
29
|
+ <el-input
|
|
|
30
|
+ v-model="dayCount"
|
|
|
31
|
+ type="number"
|
|
|
32
|
+ :min="1"
|
|
|
33
|
+ :max="365"
|
|
|
34
|
+ class="w-24"
|
|
|
35
|
+ @change="validateDayCount"
|
|
|
36
|
+ >
|
|
|
37
|
+ <template #append>天</template>
|
|
|
38
|
+ </el-input>
|
|
|
39
|
+ </div>
|
|
|
40
|
+ <span class="text-gray-600">内超过</span>
|
|
|
41
|
+ <div class="flex items-center">
|
|
|
42
|
+ <el-input
|
|
|
43
|
+ v-model="callCount"
|
|
|
44
|
+ type="number"
|
|
|
45
|
+ :min="1"
|
|
|
46
|
+ :max="100"
|
|
|
47
|
+ class="w-24"
|
|
|
48
|
+ @change="validateCallCount"
|
|
|
49
|
+ >
|
|
|
50
|
+ <template #append>次</template>
|
|
|
51
|
+ </el-input>
|
|
|
52
|
+ </div>
|
|
|
53
|
+ <span class="text-gray-600">来电</span>
|
|
|
54
|
+ </div>
|
|
|
55
|
+ <div class="mt-4 text-sm text-gray-500">
|
|
|
56
|
+ 注:当客户在设定天数内的来电次数超过设定值时,系统将自动标记为重复来电客户。
|
|
|
57
|
+ </div>
|
|
|
58
|
+ </div>
|
|
|
59
|
+ <!-- 保存成功提示 -->
|
|
|
60
|
+ <el-dialog
|
|
|
61
|
+ v-model="showSuccessDialog"
|
|
|
62
|
+ title="保存成功"
|
|
|
63
|
+ width="30%"
|
|
|
64
|
+ :show-close="false"
|
|
|
65
|
+ center
|
|
|
66
|
+ >
|
|
|
67
|
+ <div class="flex items-center justify-center py-4">
|
|
|
68
|
+ <el-icon class="mr-2 text-green-500"><CircleCheckFilled /></el-icon>
|
|
|
69
|
+ <span>配置已成功保存</span>
|
|
|
70
|
+ </div>
|
|
|
71
|
+ <template #footer>
|
|
|
72
|
+ <div class="flex justify-center">
|
|
|
73
|
+ <el-button
|
|
|
74
|
+ type="primary"
|
|
|
75
|
+ class="!rounded-button whitespace-nowrap"
|
|
|
76
|
+ @click="showSuccessDialog = false"
|
|
|
77
|
+ >
|
|
|
78
|
+ 确定
|
|
|
79
|
+ </el-button>
|
|
|
80
|
+ </div>
|
|
|
81
|
+ </template>
|
|
|
82
|
+ </el-dialog>
|
|
|
83
|
+ </div>
|
|
|
84
|
+ </div>
|
|
|
85
|
+ </div>
|
|
|
86
|
+</template>
|
|
|
87
|
+
|
|
|
88
|
+<script lang="ts" setup>
|
|
|
89
|
+import { ref } from "vue";
|
|
|
90
|
+import { ElMessage } from "element-plus";
|
|
|
91
|
+import { CircleCheckFilled } from "@element-plus/icons-vue";
|
|
|
92
|
+const dayCount = ref<number | null>(7);
|
|
|
93
|
+const callCount = ref<number | null>(3);
|
|
|
94
|
+const saving = ref(false);
|
|
|
95
|
+const showSuccessDialog = ref(false);
|
|
|
96
|
+const validateDayCount = (value: number) => {
|
|
|
97
|
+ if (value < 1) {
|
|
|
98
|
+ dayCount.value = 1;
|
|
|
99
|
+ ElMessage.warning("天数不能小于1天");
|
|
|
100
|
+ } else if (value > 365) {
|
|
|
101
|
+ dayCount.value = 365;
|
|
|
102
|
+ ElMessage.warning("天数不能超过365天");
|
|
|
103
|
+ }
|
|
|
104
|
+};
|
|
|
105
|
+const validateCallCount = (value: number) => {
|
|
|
106
|
+ if (value < 1) {
|
|
|
107
|
+ callCount.value = 1;
|
|
|
108
|
+ ElMessage.warning("次数不能小于1次");
|
|
|
109
|
+ } else if (value > 100) {
|
|
|
110
|
+ callCount.value = 100;
|
|
|
111
|
+ ElMessage.warning("次数不能超过100次");
|
|
|
112
|
+ }
|
|
|
113
|
+};
|
|
|
114
|
+const saveSettings = async () => {
|
|
|
115
|
+ if (!dayCount.value || !callCount.value) {
|
|
|
116
|
+ ElMessage.error("请填写完整的配置信息");
|
|
|
117
|
+ return;
|
|
|
118
|
+ }
|
|
|
119
|
+ saving.value = true;
|
|
|
120
|
+ try {
|
|
|
121
|
+ // 模拟保存操作
|
|
|
122
|
+ await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
|
123
|
+ showSuccessDialog.value = true;
|
|
|
124
|
+ } catch (error) {
|
|
|
125
|
+ ElMessage.error("保存失败,请重试");
|
|
|
126
|
+ } finally {
|
|
|
127
|
+ saving.value = false;
|
|
|
128
|
+ }
|
|
|
129
|
+};
|
|
|
130
|
+</script>
|
|
|
131
|
+
|
|
|
132
|
+<style scoped>
|
|
|
133
|
+.el-input-number :deep(.el-input__wrapper) {
|
|
|
134
|
+ padding-right: 0;
|
|
|
135
|
+}
|
|
|
136
|
+.el-input :deep(.el-input__wrapper) {
|
|
|
137
|
+ box-shadow: 0 0 0 1px #e5e7eb inset;
|
|
|
138
|
+}
|
|
|
139
|
+.el-input :deep(.el-input__wrapper):hover {
|
|
|
140
|
+ box-shadow: 0 0 0 1px #d1d5db inset;
|
|
|
141
|
+}
|
|
|
142
|
+.el-input :deep(.el-input__wrapper.is-focus) {
|
|
|
143
|
+ box-shadow: 0 0 0 1px #409eff inset;
|
|
|
144
|
+}
|
|
|
145
|
+.el-input :deep(.el-input-group__append) {
|
|
|
146
|
+ background-color: #f3f4f6;
|
|
|
147
|
+ border-left: 1px solid #e5e7eb;
|
|
|
148
|
+ color: #374151;
|
|
|
149
|
+ padding: 0 12px;
|
|
|
150
|
+}
|
|
|
151
|
+</style>
|
|
|
152
|
+
|