hl-core 0.0.9-beta.9 → 0.0.10-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/base.api.ts +1110 -0
- package/api/index.ts +2 -620
- package/api/interceptors.ts +38 -1
- package/components/Button/Btn.vue +1 -6
- package/components/Complex/MessageBlock.vue +1 -1
- package/components/Complex/Page.vue +1 -1
- package/components/Complex/TextBlock.vue +25 -0
- package/components/Dialog/Dialog.vue +72 -16
- package/components/Dialog/FamilyDialog.vue +3 -1
- package/components/Form/DynamicForm.vue +101 -0
- package/components/Form/FormBlock.vue +12 -3
- package/components/Form/FormData.vue +111 -0
- package/components/Form/FormSection.vue +3 -3
- package/components/Form/FormTextSection.vue +11 -3
- package/components/Form/FormToggle.vue +25 -5
- package/components/Form/ManagerAttachment.vue +178 -89
- package/components/Form/ProductConditionsBlock.vue +59 -6
- package/components/Input/Datepicker.vue +43 -7
- package/components/Input/DynamicInput.vue +25 -0
- package/components/Input/FileInput.vue +25 -5
- package/components/Input/FormInput.vue +9 -4
- package/components/Input/Monthpicker.vue +34 -0
- package/components/Input/PanelInput.vue +6 -1
- package/components/Input/RoundedInput.vue +2 -0
- package/components/Input/RoundedSelect.vue +9 -2
- package/components/Input/SwitchInput.vue +66 -0
- package/components/Input/TextInput.vue +162 -0
- package/components/Layout/Drawer.vue +18 -4
- package/components/Layout/Header.vue +23 -2
- package/components/Layout/Loader.vue +2 -1
- package/components/Layout/SettingsPanel.vue +24 -11
- package/components/Menu/InfoMenu.vue +35 -0
- package/components/Menu/MenuNav.vue +25 -3
- package/components/Pages/Anketa.vue +255 -65
- package/components/Pages/Auth.vue +58 -9
- package/components/Pages/ContragentForm.vue +10 -9
- package/components/Pages/Documents.vue +267 -30
- package/components/Pages/InvoiceInfo.vue +1 -1
- package/components/Pages/MemberForm.vue +775 -102
- package/components/Pages/ProductAgreement.vue +1 -8
- package/components/Pages/ProductConditions.vue +1133 -180
- package/components/Panel/PanelHandler.vue +627 -49
- package/components/Panel/PanelSelectItem.vue +17 -2
- package/components/Panel/RightPanelCloser.vue +7 -0
- package/components/Transitions/Animation.vue +30 -0
- package/components/Utilities/Chip.vue +2 -0
- package/components/Utilities/JsonViewer.vue +2 -2
- package/components/Utilities/Qr.vue +44 -0
- package/composables/axios.ts +1 -0
- package/composables/classes.ts +550 -44
- package/composables/constants.ts +126 -6
- package/composables/fields.ts +330 -0
- package/composables/index.ts +356 -20
- package/composables/styles.ts +23 -6
- package/configs/pwa.ts +63 -0
- package/layouts/clear.vue +21 -0
- package/layouts/default.vue +62 -3
- package/layouts/full.vue +21 -0
- package/locales/ru.json +558 -16
- package/nuxt.config.ts +6 -15
- package/package.json +38 -39
- package/pages/Token.vue +0 -13
- package/plugins/head.ts +26 -0
- package/plugins/vuetifyPlugin.ts +1 -5
- package/store/data.store.ts +1647 -348
- package/store/extractStore.ts +17 -0
- package/store/form.store.ts +13 -1
- package/store/member.store.ts +2 -1
- package/store/rules.ts +97 -3
- package/store/toast.ts +1 -1
- package/tsconfig.json +3 -0
- package/types/enum.ts +82 -0
- package/types/env.d.ts +2 -0
- package/types/form.ts +90 -0
- package/types/index.ts +847 -506
|
@@ -1,55 +1,65 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="rounded-lg border-[1px]" :class="[$styles.whiteBg, disabled && $styles.disabled]">
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class="
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
3
|
+
<v-expansion-panels>
|
|
4
|
+
<v-expansion-panel class="rounded-lg" elevation="0">
|
|
5
|
+
<v-expansion-panel-title :class="[$styles.textTitle, $styles.greenText]">
|
|
6
|
+
{{ $dataStore.t('form.attachManager') }}
|
|
7
|
+
</v-expansion-panel-title>
|
|
8
|
+
<v-expansion-panel-text class="border-t-[1px] no-padding">
|
|
9
|
+
<v-form ref="vForm" class="flex flex-col divide-y">
|
|
10
|
+
<base-panel-input
|
|
11
|
+
v-if="isSaleChanellShown"
|
|
12
|
+
class="pl-1 pt-1"
|
|
13
|
+
v-model="formStore.SaleChanellPolicy"
|
|
14
|
+
:value="formStore.SaleChanellPolicy?.nameRu"
|
|
15
|
+
:readonly="isSaleChanellReadonly"
|
|
16
|
+
:clearable="!isSaleChanellReadonly"
|
|
17
|
+
:label="$dataStore.t('form.salesChanell')"
|
|
18
|
+
:rules="$rules.objectRequired"
|
|
19
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
20
|
+
@append="openPanel('SaleChanellPolicy', $dataStore.t('form.salesChanell'))"
|
|
21
|
+
/>
|
|
22
|
+
<base-panel-input
|
|
23
|
+
v-if="isRegionShown"
|
|
24
|
+
class="pl-1 pt-1"
|
|
25
|
+
v-model="formStore.RegionPolicy"
|
|
26
|
+
:value="formStore.RegionPolicy?.nameRu"
|
|
27
|
+
:readonly="isRegionReadonly"
|
|
28
|
+
:clearable="!isRegionReadonly"
|
|
29
|
+
:label="$dataStore.t('form.Region')"
|
|
30
|
+
:rules="$rules.objectRequired"
|
|
31
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
32
|
+
@append="openPanel('RegionPolicy', $dataStore.t('form.Region'))"
|
|
33
|
+
/>
|
|
34
|
+
<base-panel-input
|
|
35
|
+
v-if="isManagerShown"
|
|
36
|
+
class="pl-1 pt-1"
|
|
37
|
+
v-model="formStore.ManagerPolicy"
|
|
38
|
+
:value="formStore.ManagerPolicy?.nameRu"
|
|
39
|
+
:readonly="isManagerReadonly"
|
|
40
|
+
:clearable="!isManagerReadonly"
|
|
41
|
+
:label="$dataStore.t('form.manager')"
|
|
42
|
+
:rules="$rules.objectRequired"
|
|
43
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
44
|
+
@append="openPanel('ManagerPolicy', $dataStore.t('form.manager'))"
|
|
45
|
+
/>
|
|
46
|
+
<base-panel-input
|
|
47
|
+
v-if="isAgentShown"
|
|
48
|
+
class="pl-1 pt-1"
|
|
49
|
+
v-model="formStore.AgentData"
|
|
50
|
+
:value="formStore.AgentData?.fullName"
|
|
51
|
+
:readonly="isAgentReadonly"
|
|
52
|
+
:clearable="!isAgentReadonly"
|
|
53
|
+
:label="$dataStore.t('form.agent')"
|
|
54
|
+
:rules="$rules.agentDataRequired"
|
|
55
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
56
|
+
@append="openPanel('AgentData', $dataStore.t('form.agent'))"
|
|
57
|
+
/>
|
|
58
|
+
</v-form>
|
|
59
|
+
</v-expansion-panel-text>
|
|
60
|
+
</v-expansion-panel>
|
|
61
|
+
</v-expansion-panels>
|
|
62
|
+
<Teleport v-if="isPanelOpen" to="#right-panel-actions">
|
|
53
63
|
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
54
64
|
<base-rounded-input
|
|
55
65
|
v-model.trim="searchQuery"
|
|
@@ -59,16 +69,34 @@
|
|
|
59
69
|
:append-inner-icon="currentDictName === 'AgentData' ? 'mdi mdi-magnify' : ''"
|
|
60
70
|
@append="searchAgent"
|
|
61
71
|
/>
|
|
62
|
-
<div v-if="
|
|
63
|
-
<div v-
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
<div v-if="isPanelLoading === false" class="w-full">
|
|
73
|
+
<div v-if="currentDictName === 'AgentData'" class="w-full flex flex-col gap-2 p-2">
|
|
74
|
+
<div v-for="(agent, index) of $dataStore[currentDictName]" :key="index">
|
|
75
|
+
<div
|
|
76
|
+
class="flex justify-between p-4 items-center cursor-pointer"
|
|
77
|
+
:class="[$styles.rounded, $styles.blueBgLight, $styles.blueBgLightHover]"
|
|
78
|
+
@click="pickPanelValue(agent)"
|
|
79
|
+
>
|
|
80
|
+
<div class="flex flex-col">
|
|
81
|
+
<span :class="[$styles.textSimple]">{{ $getFullNameShorted(agent.fullName ?? '', 2) }}</span>
|
|
82
|
+
<span :class="[$styles.mutedText]">
|
|
83
|
+
{{ agent.saleChannel ? `${agent.saleChannel} / ${$getFullNameShorted(agent.managerName ?? '', 2)}` : `${agent.managerName}` }} {{ ` ${agent.agentNo}` }}
|
|
84
|
+
</span>
|
|
85
|
+
</div>
|
|
86
|
+
<i
|
|
87
|
+
class="mdi text-xl"
|
|
88
|
+
:class="[agent.agentId === (panelValue as AgentData).agentId ? `mdi-radiobox-marked ${$styles.greenText}` : 'mdi-radiobox-blank text-[#636363]']"
|
|
89
|
+
></i>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
<div v-if="currentDictName === 'ManagerPolicy' || currentDictName === 'RegionPolicy' || currentDictName === 'SaleChanellPolicy'" class="w-full flex flex-col gap-2 p-2">
|
|
94
|
+
<div v-for="(item, index) in $dataStore[currentDictName].filter(i => (i.nameRu as string).toLowerCase().includes(searchQuery.toLowerCase()))" :key="index">
|
|
95
|
+
<base-panel-select-item :key="index" :text="item.nameRu ?? ''" :selected="item.ids === (panelValue as Value).ids" @click="pickPanelValue(item)" />
|
|
96
|
+
</div>
|
|
70
97
|
</div>
|
|
71
98
|
</div>
|
|
99
|
+
|
|
72
100
|
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
|
|
73
101
|
</div>
|
|
74
102
|
</Teleport>
|
|
@@ -77,6 +105,8 @@
|
|
|
77
105
|
|
|
78
106
|
<script lang="ts">
|
|
79
107
|
import { Value } from '../../composables/classes';
|
|
108
|
+
import { watchDebounced } from '@vueuse/core';
|
|
109
|
+
import type { AgentData } from '../../types';
|
|
80
110
|
|
|
81
111
|
export default defineComponent({
|
|
82
112
|
props: {
|
|
@@ -90,29 +120,17 @@ export default defineComponent({
|
|
|
90
120
|
},
|
|
91
121
|
},
|
|
92
122
|
setup(props) {
|
|
123
|
+
type ManagerAttachmentFiels = 'SaleChanellPolicy' | 'RegionPolicy' | 'ManagerPolicy' | 'AgentData';
|
|
124
|
+
type FieldTypes = Value | AgentData;
|
|
93
125
|
const route = useRoute();
|
|
94
126
|
const dataStore = useDataStore();
|
|
95
127
|
const formStore = useFormStore();
|
|
96
128
|
const isPanelOpen = ref<boolean>(false);
|
|
97
129
|
const isPanelLoading = ref<boolean>(false);
|
|
98
|
-
const panelValue = ref<
|
|
130
|
+
const panelValue = ref<FieldTypes>(new Value());
|
|
99
131
|
const searchQuery = ref<string>('');
|
|
100
|
-
const currentDictName = ref<
|
|
132
|
+
const currentDictName = ref<ManagerAttachmentFiels>();
|
|
101
133
|
|
|
102
|
-
const dictList = computed(() => {
|
|
103
|
-
if (!currentDictName.value) {
|
|
104
|
-
return [];
|
|
105
|
-
}
|
|
106
|
-
if (currentDictName.value === 'AgentData') {
|
|
107
|
-
return dataStore[currentDictName.value];
|
|
108
|
-
} else {
|
|
109
|
-
// @ts-ignore
|
|
110
|
-
return dataStore[currentDictName.value].filter((item: Value) => {
|
|
111
|
-
// @ts-ignore
|
|
112
|
-
return item.nameRu ? item.nameRu.toLowerCase().includes(searchQuery.value.toLowerCase()) : item.fullName.toLowerCase().includes(searchQuery.value.toLowerCase());
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
134
|
const isReadonly = computed(
|
|
117
135
|
() =>
|
|
118
136
|
props.disabled ||
|
|
@@ -120,13 +138,44 @@ export default defineComponent({
|
|
|
120
138
|
!dataStore.isInitiator() ||
|
|
121
139
|
(route.params.taskId !== '0' && (!dataStore.isProcessEditable(formStore.applicationData.statusCode) || !dataStore.isTask())),
|
|
122
140
|
);
|
|
123
|
-
|
|
124
|
-
|
|
141
|
+
const isSaleChanellReadonly = computed(() => {
|
|
142
|
+
if (dataStore.isGons) return isReadonly.value && dataStore.isServiceManager();
|
|
143
|
+
return isReadonly.value;
|
|
144
|
+
});
|
|
145
|
+
const isRegionReadonly = computed(() => {
|
|
146
|
+
if (dataStore.isGons) return isReadonly.value && (dataStore.isServiceManager() || dataStore.isAgent());
|
|
147
|
+
return isReadonly.value;
|
|
148
|
+
});
|
|
149
|
+
const isManagerReadonly = computed(() => {
|
|
150
|
+
if (dataStore.isGons) return isReadonly.value && dataStore.isServiceManager();
|
|
151
|
+
return isReadonly.value;
|
|
152
|
+
});
|
|
153
|
+
const isAgentReadonly = computed(() => {
|
|
154
|
+
if (dataStore.isGons || dataStore.isPension) return isReadonly.value && dataStore.isServiceManager();
|
|
155
|
+
return isReadonly.value;
|
|
156
|
+
});
|
|
157
|
+
const isSaleChanellShown = computed(() => {
|
|
158
|
+
if (dataStore.isGons) return dataStore.isServiceManager();
|
|
159
|
+
return true;
|
|
160
|
+
});
|
|
161
|
+
const isRegionShown = computed(() => {
|
|
162
|
+
if (dataStore.isGons) return dataStore.isServiceManager() || dataStore.isAgent();
|
|
163
|
+
return true;
|
|
164
|
+
});
|
|
165
|
+
const isManagerShown = computed(() => {
|
|
166
|
+
if (dataStore.isGons) return dataStore.isServiceManager();
|
|
167
|
+
return true;
|
|
168
|
+
});
|
|
169
|
+
const isAgentShown = computed(() => {
|
|
170
|
+
if (dataStore.isGons || dataStore.isPension) return dataStore.isServiceManager();
|
|
171
|
+
return true;
|
|
172
|
+
});
|
|
173
|
+
const openPanel = async (currentDict: ManagerAttachmentFiels, title: string) => {
|
|
125
174
|
searchQuery.value = '';
|
|
126
175
|
if (dataStore.isTask() && !props.disabled) {
|
|
127
176
|
dataStore.panelAction = null;
|
|
128
|
-
dataStore.
|
|
129
|
-
dataStore.
|
|
177
|
+
dataStore.rightPanel.open = true;
|
|
178
|
+
dataStore.rightPanel.title = title;
|
|
130
179
|
currentDictName.value = currentDict;
|
|
131
180
|
|
|
132
181
|
if (currentDict === 'ManagerPolicy' && formStore.RegionPolicy.ids) {
|
|
@@ -135,7 +184,7 @@ export default defineComponent({
|
|
|
135
184
|
}
|
|
136
185
|
|
|
137
186
|
isPanelOpen.value = true;
|
|
138
|
-
panelValue.value = formStore[currentDict
|
|
187
|
+
panelValue.value = formStore[currentDict];
|
|
139
188
|
isPanelLoading.value = false;
|
|
140
189
|
} else {
|
|
141
190
|
dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
|
|
@@ -150,29 +199,57 @@ export default defineComponent({
|
|
|
150
199
|
}
|
|
151
200
|
};
|
|
152
201
|
|
|
153
|
-
const pickPanelValue = (answer:
|
|
202
|
+
const pickPanelValue = (answer: FieldTypes) => {
|
|
154
203
|
// @ts-ignore
|
|
155
204
|
formStore[currentDictName.value] = answer;
|
|
156
205
|
isPanelOpen.value = false;
|
|
157
|
-
dataStore.
|
|
206
|
+
dataStore.rightPanel.open = false;
|
|
158
207
|
searchQuery.value = '';
|
|
159
208
|
};
|
|
160
209
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
210
|
+
watchDebounced(
|
|
211
|
+
searchQuery,
|
|
212
|
+
async searchQuery => {
|
|
213
|
+
if (searchQuery === null) {
|
|
214
|
+
searchQuery = '';
|
|
215
|
+
}
|
|
216
|
+
if (!!searchQuery && currentDictName.value === 'AgentData') {
|
|
217
|
+
await searchAgent();
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
{ debounce: 1000 },
|
|
221
|
+
);
|
|
166
222
|
|
|
167
223
|
watch(
|
|
168
224
|
() => formStore.RegionPolicy,
|
|
169
225
|
(val, oldVal) => {
|
|
170
226
|
if (val.ids !== oldVal.ids) {
|
|
171
|
-
|
|
227
|
+
if (!dataStore.isGons) {
|
|
228
|
+
formStore.ManagerPolicy = new Value();
|
|
229
|
+
}
|
|
172
230
|
}
|
|
173
231
|
},
|
|
174
232
|
);
|
|
175
233
|
|
|
234
|
+
watch(
|
|
235
|
+
() => dataStore.rightPanel.open,
|
|
236
|
+
() => {
|
|
237
|
+
if (dataStore.rightPanel.open === false) {
|
|
238
|
+
isPanelOpen.value = false;
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
{ immediate: true },
|
|
242
|
+
);
|
|
243
|
+
|
|
244
|
+
onBeforeUnmount(() => {
|
|
245
|
+
if (!isReadonly.value) {
|
|
246
|
+
const areValid = !!formStore.SaleChanellPolicy.nameRu && !!formStore.RegionPolicy.nameRu && !!formStore.ManagerPolicy.nameRu && !!formStore.AgentData.fullName;
|
|
247
|
+
if (areValid) {
|
|
248
|
+
dataStore.setINSISWorkData(false);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
|
|
176
253
|
return {
|
|
177
254
|
// State
|
|
178
255
|
formStore,
|
|
@@ -184,9 +261,15 @@ export default defineComponent({
|
|
|
184
261
|
currentDictName,
|
|
185
262
|
|
|
186
263
|
// Computed
|
|
187
|
-
dictList,
|
|
188
264
|
isReadonly,
|
|
189
|
-
|
|
265
|
+
isSaleChanellReadonly,
|
|
266
|
+
isRegionReadonly,
|
|
267
|
+
isManagerReadonly,
|
|
268
|
+
isAgentReadonly,
|
|
269
|
+
isSaleChanellShown,
|
|
270
|
+
isRegionShown,
|
|
271
|
+
isManagerShown,
|
|
272
|
+
isAgentShown,
|
|
190
273
|
// Functions
|
|
191
274
|
openPanel,
|
|
192
275
|
searchAgent,
|
|
@@ -195,3 +278,9 @@ export default defineComponent({
|
|
|
195
278
|
},
|
|
196
279
|
});
|
|
197
280
|
</script>
|
|
281
|
+
|
|
282
|
+
<style scoped>
|
|
283
|
+
.no-padding :deep(.v-expansion-panel-text__wrapper) {
|
|
284
|
+
padding: 0 !important;
|
|
285
|
+
}
|
|
286
|
+
</style>
|
|
@@ -6,23 +6,48 @@
|
|
|
6
6
|
</p>
|
|
7
7
|
<p v-if="!!subtitle" :class="[$styles.greyText, $styles.textSimple]">{{ subtitle }}</p>
|
|
8
8
|
</div>
|
|
9
|
-
<div class="mt-6 grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
|
|
9
|
+
<div v-if="hasDefault" class="mt-6 grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
|
|
10
10
|
<span v-if="hasSum" :class="[$styles.textSimple]" class="font-medium">{{ $dataStore.t('productConditionsForm.requestedSumInsured') }}</span>
|
|
11
11
|
<span v-if="hasPremium" :class="[$styles.textSimple]" class="font-medium">{{ $dataStore.t('productConditionsForm.insurancePremiumPerMonth') }}</span>
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
<span v-if="hasContractDate" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.contractDate') }}</span>
|
|
14
14
|
<span v-if="hasCoverPeriod" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.coverPeriod') }}</span>
|
|
15
15
|
<span v-if="hasPayPeriod" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.payPeriod') }}</span>
|
|
16
16
|
</div>
|
|
17
|
-
<div class="grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
|
|
17
|
+
<div v-if="hasDefault" class="grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
|
|
18
18
|
<span v-if="hasSum" :class="[amount === null && $styles.emptyBlockCol]">{{ amount }} </span>
|
|
19
19
|
<span v-if="hasPremium" :class="[premium === null && $styles.emptyBlockCol]"> {{ premium }}</span>
|
|
20
20
|
<span v-if="hasPolicyNumber" :class="[policyNumber === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ policyNumber }}</span>
|
|
21
21
|
<span v-if="hasContractDate" :class="[policyNumber === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ contractDate }}</span>
|
|
22
22
|
<span v-if="hasCoverPeriod" :class="[coverPeriod === null && $styles.emptyBlockCol]" class="hidden lg:block">{{ coverPeriod }} </span>
|
|
23
|
-
<span v-if="hasPayPeriod" :class="[paymentPeriod === null && $styles.emptyBlockCol]" class="hidden lg:block">
|
|
24
|
-
|
|
23
|
+
<span v-if="hasPayPeriod" :class="[paymentPeriod === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ paymentPeriod }}</span>
|
|
24
|
+
<div
|
|
25
|
+
class="rounded-br-lg transition-all h-[70px] w-[60px] relative place-self-end"
|
|
26
|
+
:class="[$styles.blueBgLight, $styles.blueBgLightHover, disabled ? $styles.disabled : 'cursor-pointer']"
|
|
27
|
+
@click="!disabled && $emit('onMore', { whichForm: 'productConditions' })"
|
|
28
|
+
>
|
|
29
|
+
<i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"></i>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<div v-if="$dataStore.isLifetrip" class="mt-6 grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
|
|
33
|
+
<span :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('calculatorForm.type') }}</span>
|
|
34
|
+
<span :class="[$styles.textSimple]" class="font-medium">{{ $dataStore.t('calculatorForm.country') }}</span>
|
|
35
|
+
<span :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('calculatorForm.purpose') }}</span>
|
|
36
|
+
<span :class="[$styles.textSimple]" class="font-medium">{{ $dataStore.t('calculatorForm.amount') }}</span>
|
|
37
|
+
<span v-if="hasPolicyNumber" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('buttons.InsuranceContract') }}</span>
|
|
38
|
+
</div>
|
|
39
|
+
<div v-if="$dataStore.isLifetrip" class="grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
|
|
40
|
+
<span :class="[calculatorForm.type.nameRu === null && $styles.emptyBlockCol]" class="hidden lg:block">
|
|
41
|
+
{{ calculatorForm.type.nameRu }}
|
|
25
42
|
</span>
|
|
43
|
+
<span :class="[calculatorForm.price === null && $styles.emptyBlockCol]"> {{ calculatorForm.countries?.length ? countriesComputed : '' }}</span>
|
|
44
|
+
<span :class="[calculatorForm.purpose.nameRu === null && $styles.emptyBlockCol]" class="hidden lg:block">
|
|
45
|
+
{{ calculatorForm.purpose && calculatorForm.purpose.nameRu ? calculatorForm.purpose.nameRu : $dataStore.t('calculatorForm.purpose') }}</span
|
|
46
|
+
>
|
|
47
|
+
<span :class="[calculatorForm.amount && calculatorForm.amount.nameRu ? calculatorForm.amount.nameRu : $dataStore.t('calculatorForm.amount') && $styles.emptyBlockCol]"
|
|
48
|
+
>{{ calculatorForm.amount?.nameRu }}
|
|
49
|
+
</span>
|
|
50
|
+
|
|
26
51
|
<div
|
|
27
52
|
class="rounded-br-lg transition-all h-[70px] w-[60px] relative place-self-end"
|
|
28
53
|
:class="[$styles.blueBgLight, $styles.blueBgLightHover, disabled ? $styles.disabled : 'cursor-pointer']"
|
|
@@ -68,11 +93,17 @@ export default defineComponent({
|
|
|
68
93
|
? formStore.productConditionsForm.paymentPeriod.nameRu
|
|
69
94
|
: null,
|
|
70
95
|
);
|
|
71
|
-
|
|
96
|
+
const calculatorForm = formStore.productConditionsForm.calculatorForm;
|
|
72
97
|
const hasSum = computed(() => {
|
|
98
|
+
if (dataStore.isLifetrip) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
73
101
|
return true;
|
|
74
102
|
});
|
|
75
103
|
const hasPremium = computed(() => {
|
|
104
|
+
if (dataStore.isLifetrip) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
76
107
|
return true;
|
|
77
108
|
});
|
|
78
109
|
const hasPolicyNumber = computed(() => {
|
|
@@ -88,20 +119,40 @@ export default defineComponent({
|
|
|
88
119
|
return false;
|
|
89
120
|
});
|
|
90
121
|
const hasCoverPeriod = computed(() => {
|
|
122
|
+
if (dataStore.isLifetrip) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
91
125
|
if (dataStore.isFinCenter()) {
|
|
92
126
|
return false;
|
|
93
127
|
}
|
|
94
128
|
return true;
|
|
95
129
|
});
|
|
96
130
|
const hasPayPeriod = computed(() => {
|
|
131
|
+
if (dataStore.isLifetrip) {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
97
134
|
if (dataStore.isFinCenter()) {
|
|
98
135
|
return false;
|
|
99
136
|
}
|
|
100
137
|
return true;
|
|
101
138
|
});
|
|
139
|
+
const countriesComputed = computed(() => {
|
|
140
|
+
let message = '';
|
|
141
|
+
for (let country in calculatorForm.countries) {
|
|
142
|
+
message += calculatorForm.countries[country as any].nameRu + ', ';
|
|
143
|
+
}
|
|
144
|
+
return message.slice(0, -2);
|
|
145
|
+
});
|
|
146
|
+
const hasDefault = computed(() => {
|
|
147
|
+
if (dataStore.isLifetrip) {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
return true;
|
|
151
|
+
});
|
|
102
152
|
return {
|
|
103
153
|
// State
|
|
104
154
|
formStore,
|
|
155
|
+
calculatorForm,
|
|
105
156
|
|
|
106
157
|
// Computed
|
|
107
158
|
amount,
|
|
@@ -116,6 +167,8 @@ export default defineComponent({
|
|
|
116
167
|
hasContractDate,
|
|
117
168
|
hasPayPeriod,
|
|
118
169
|
hasCoverPeriod,
|
|
170
|
+
countriesComputed,
|
|
171
|
+
hasDefault,
|
|
119
172
|
};
|
|
120
173
|
},
|
|
121
174
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<vue-date-picker
|
|
3
|
+
class="base-datepicker"
|
|
3
4
|
:model-value="modelValue"
|
|
4
5
|
:clearable="false"
|
|
5
6
|
:disabled="disabled"
|
|
@@ -7,18 +8,20 @@
|
|
|
7
8
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
9
|
locale="ru"
|
|
9
10
|
model-type="dd.MM.yyyy"
|
|
10
|
-
|
|
11
|
-
menu-class-name="!left-[30vw] md:!left-[70vw] lg:!left-[75vw]"
|
|
12
|
-
:teleport="teleport"
|
|
13
|
-
:offset="-50"
|
|
11
|
+
:teleport="true"
|
|
14
12
|
:close-on-scroll="true"
|
|
15
13
|
:enable-time-picker="false"
|
|
14
|
+
:six-weeks="true"
|
|
15
|
+
:min-date="minDate"
|
|
16
16
|
cancel-text="Отменить"
|
|
17
17
|
select-text="Выбрать"
|
|
18
18
|
>
|
|
19
19
|
<template #trigger>
|
|
20
20
|
<v-icon icon="mdi mdi-calendar-blank-outline cursor-pointer" />
|
|
21
21
|
</template>
|
|
22
|
+
<template #action-preview="{ value }">
|
|
23
|
+
{{ reformatDate(value) }}
|
|
24
|
+
</template>
|
|
22
25
|
</vue-date-picker>
|
|
23
26
|
</template>
|
|
24
27
|
|
|
@@ -36,10 +39,43 @@ export default defineComponent({
|
|
|
36
39
|
type: Boolean,
|
|
37
40
|
default: false,
|
|
38
41
|
},
|
|
39
|
-
|
|
40
|
-
type:
|
|
41
|
-
|
|
42
|
+
minDate: {
|
|
43
|
+
type: Date,
|
|
44
|
+
required: false,
|
|
42
45
|
},
|
|
43
46
|
},
|
|
44
47
|
});
|
|
45
48
|
</script>
|
|
49
|
+
|
|
50
|
+
<style>
|
|
51
|
+
:root {
|
|
52
|
+
--dp-menu-min-width: 300px;
|
|
53
|
+
--dp-border-radius: 10px;
|
|
54
|
+
--dp-cell-border-radius: 9999px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.dp__calendar_item .dp__active_date {
|
|
58
|
+
@apply bg-[#A0B3D8];
|
|
59
|
+
}
|
|
60
|
+
.dp__calendar_item .dp__today {
|
|
61
|
+
@apply border-[#A0B3D8];
|
|
62
|
+
}
|
|
63
|
+
.dp__calendar_item .dp__today:not(.dp__active_date) {
|
|
64
|
+
@apply border-[#009C73];
|
|
65
|
+
}
|
|
66
|
+
.dp__overlay_cell_active {
|
|
67
|
+
@apply !bg-[#A0B3D8];
|
|
68
|
+
}
|
|
69
|
+
.dp__action_button {
|
|
70
|
+
@apply h-auto px-3 py-1 text-[14px] rounded-lg;
|
|
71
|
+
}
|
|
72
|
+
.dp__action_cancel {
|
|
73
|
+
@apply hover:border-[#A0B3D8];
|
|
74
|
+
}
|
|
75
|
+
.dp__action_select {
|
|
76
|
+
@apply bg-[#009C73] hover:bg-[#00a277] text-white px-4;
|
|
77
|
+
}
|
|
78
|
+
.dp__selection_preview[title*='/'] {
|
|
79
|
+
@apply rounded-lg border-[1px] px-3 py-1 text-[14px] text-[#009C73];
|
|
80
|
+
}
|
|
81
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-for="(field, fieldIndex) in fields" :key="fieldIndex">
|
|
3
|
+
<base-text-input
|
|
4
|
+
v-if="field.type === 'text' || field.type === 'number'"
|
|
5
|
+
:control="field"
|
|
6
|
+
class="bg-[#fff]"
|
|
7
|
+
:class="{ 'rounded-t-lg': fieldIndex === 0 || fields[fieldIndex - 1].type !== 'text', 'rounded-b-lg': fieldIndex === fields.length - 1 }"
|
|
8
|
+
@onClickField="$emit('onClickField', field)"
|
|
9
|
+
/>
|
|
10
|
+
<base-switch-input v-if="field.type === 'switch'" :field="field" />
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
import type { InputType } from '../../types/form';
|
|
16
|
+
|
|
17
|
+
export default defineComponent({
|
|
18
|
+
props: {
|
|
19
|
+
fields: {
|
|
20
|
+
type: Object as PropType<InputType[]>,
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
@@ -3,17 +3,22 @@
|
|
|
3
3
|
class="file-input"
|
|
4
4
|
:disabled="disabled"
|
|
5
5
|
prepend-icon=""
|
|
6
|
-
append-inner-icon="mdi
|
|
7
|
-
@click:append-inner="$emit('input', $event)"
|
|
6
|
+
:append-inner-icon="`mdi ${icon}`"
|
|
8
7
|
@input="$emit('input', $event)"
|
|
9
8
|
variant="solo"
|
|
10
9
|
show-size
|
|
11
10
|
multiple
|
|
12
|
-
accept=".pdf,.doc,.jpeg,.jpg,.jpg"
|
|
11
|
+
accept=".pdf,.doc,.docx,.jpeg,.jpg,.jpg,.xlsx,.xls"
|
|
13
12
|
truncate-length="15"
|
|
14
13
|
clear-icon="mdi mdi-close"
|
|
15
|
-
:label="
|
|
16
|
-
|
|
14
|
+
:label="label"
|
|
15
|
+
@click:append-inner="$emit('append-inner', $event)"
|
|
16
|
+
@click:clear="$emit('on-clear')"
|
|
17
|
+
>
|
|
18
|
+
<template v-slot:loader>
|
|
19
|
+
<v-progress-linear v-if="loading" color="#A0B3D8" height="3" indeterminate />
|
|
20
|
+
</template>
|
|
21
|
+
</v-file-input>
|
|
17
22
|
</template>
|
|
18
23
|
|
|
19
24
|
<script lang="ts">
|
|
@@ -23,7 +28,22 @@ export default defineComponent({
|
|
|
23
28
|
type: Boolean,
|
|
24
29
|
default: false,
|
|
25
30
|
},
|
|
31
|
+
icon: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'mdi-file-document',
|
|
34
|
+
},
|
|
35
|
+
label: {
|
|
36
|
+
type: String,
|
|
37
|
+
default() {
|
|
38
|
+
return useDataStore().t('labels.chooseDoc');
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
loading: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false,
|
|
44
|
+
},
|
|
26
45
|
},
|
|
46
|
+
emits: ['input', 'append-inner', 'on-clear'],
|
|
27
47
|
});
|
|
28
48
|
</script>
|
|
29
49
|
|