hl-core 0.0.9-beta.9 → 0.0.10-beta.2
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 +1109 -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 +23 -0
- package/components/Dialog/Dialog.vue +70 -16
- package/components/Dialog/FamilyDialog.vue +1 -1
- package/components/Form/DynamicForm.vue +100 -0
- package/components/Form/FormBlock.vue +12 -3
- package/components/Form/FormData.vue +110 -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 +177 -89
- package/components/Form/ProductConditionsBlock.vue +59 -6
- package/components/Input/Datepicker.vue +43 -7
- package/components/Input/DynamicInput.vue +23 -0
- package/components/Input/FileInput.vue +25 -5
- package/components/Input/FormInput.vue +7 -4
- package/components/Input/Monthpicker.vue +34 -0
- package/components/Input/PanelInput.vue +5 -1
- package/components/Input/RoundedSelect.vue +7 -2
- package/components/Input/SwitchInput.vue +64 -0
- package/components/Input/TextInput.vue +160 -0
- package/components/Layout/Drawer.vue +16 -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 +254 -65
- package/components/Pages/Auth.vue +56 -9
- package/components/Pages/ContragentForm.vue +9 -9
- package/components/Pages/Documents.vue +266 -30
- package/components/Pages/InvoiceInfo.vue +1 -1
- package/components/Pages/MemberForm.vue +774 -102
- package/components/Pages/ProductAgreement.vue +1 -8
- package/components/Pages/ProductConditions.vue +1132 -180
- package/components/Panel/PanelHandler.vue +626 -49
- package/components/Panel/PanelSelectItem.vue +17 -2
- package/components/Panel/RightPanelCloser.vue +7 -0
- package/components/Transitions/Animation.vue +28 -0
- package/components/Utilities/JsonViewer.vue +3 -2
- package/components/Utilities/Qr.vue +44 -0
- package/composables/axios.ts +1 -0
- package/composables/classes.ts +501 -14
- package/composables/constants.ts +126 -6
- package/composables/fields.ts +328 -0
- package/composables/index.ts +355 -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 +11 -15
- package/package.json +37 -39
- package/pages/Token.vue +0 -13
- package/plugins/head.ts +26 -0
- package/plugins/vuetifyPlugin.ts +1 -5
- package/store/data.store.ts +1610 -321
- package/store/extractStore.ts +17 -0
- package/store/form.store.ts +13 -1
- package/store/member.store.ts +1 -1
- package/store/rules.ts +97 -3
- package/store/toast.ts +1 -1
- package/types/enum.ts +81 -0
- package/types/env.d.ts +2 -0
- package/types/form.ts +94 -0
- package/types/index.ts +419 -24
|
@@ -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,7 @@
|
|
|
77
105
|
|
|
78
106
|
<script lang="ts">
|
|
79
107
|
import { Value } from '../../composables/classes';
|
|
108
|
+
import { watchDebounced } from '@vueuse/core';
|
|
80
109
|
|
|
81
110
|
export default defineComponent({
|
|
82
111
|
props: {
|
|
@@ -90,29 +119,17 @@ export default defineComponent({
|
|
|
90
119
|
},
|
|
91
120
|
},
|
|
92
121
|
setup(props) {
|
|
122
|
+
type ManagerAttachmentFiels = 'SaleChanellPolicy' | 'RegionPolicy' | 'ManagerPolicy' | 'AgentData';
|
|
123
|
+
type FieldTypes = Value | AgentData;
|
|
93
124
|
const route = useRoute();
|
|
94
125
|
const dataStore = useDataStore();
|
|
95
126
|
const formStore = useFormStore();
|
|
96
127
|
const isPanelOpen = ref<boolean>(false);
|
|
97
128
|
const isPanelLoading = ref<boolean>(false);
|
|
98
|
-
const panelValue = ref<
|
|
129
|
+
const panelValue = ref<FieldTypes>(new Value());
|
|
99
130
|
const searchQuery = ref<string>('');
|
|
100
|
-
const currentDictName = ref<
|
|
131
|
+
const currentDictName = ref<ManagerAttachmentFiels>();
|
|
101
132
|
|
|
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
133
|
const isReadonly = computed(
|
|
117
134
|
() =>
|
|
118
135
|
props.disabled ||
|
|
@@ -120,13 +137,44 @@ export default defineComponent({
|
|
|
120
137
|
!dataStore.isInitiator() ||
|
|
121
138
|
(route.params.taskId !== '0' && (!dataStore.isProcessEditable(formStore.applicationData.statusCode) || !dataStore.isTask())),
|
|
122
139
|
);
|
|
123
|
-
|
|
124
|
-
|
|
140
|
+
const isSaleChanellReadonly = computed(() => {
|
|
141
|
+
if (dataStore.isGons) return isReadonly.value && dataStore.isServiceManager();
|
|
142
|
+
return isReadonly.value;
|
|
143
|
+
});
|
|
144
|
+
const isRegionReadonly = computed(() => {
|
|
145
|
+
if (dataStore.isGons) return isReadonly.value && (dataStore.isServiceManager() || dataStore.isAgent());
|
|
146
|
+
return isReadonly.value;
|
|
147
|
+
});
|
|
148
|
+
const isManagerReadonly = computed(() => {
|
|
149
|
+
if (dataStore.isGons) return isReadonly.value && dataStore.isServiceManager();
|
|
150
|
+
return isReadonly.value;
|
|
151
|
+
});
|
|
152
|
+
const isAgentReadonly = computed(() => {
|
|
153
|
+
if (dataStore.isGons || dataStore.isPension) return isReadonly.value && dataStore.isServiceManager();
|
|
154
|
+
return isReadonly.value;
|
|
155
|
+
});
|
|
156
|
+
const isSaleChanellShown = computed(() => {
|
|
157
|
+
if (dataStore.isGons) return dataStore.isServiceManager();
|
|
158
|
+
return true;
|
|
159
|
+
});
|
|
160
|
+
const isRegionShown = computed(() => {
|
|
161
|
+
if (dataStore.isGons) return dataStore.isServiceManager() || dataStore.isAgent();
|
|
162
|
+
return true;
|
|
163
|
+
});
|
|
164
|
+
const isManagerShown = computed(() => {
|
|
165
|
+
if (dataStore.isGons) return dataStore.isServiceManager();
|
|
166
|
+
return true;
|
|
167
|
+
});
|
|
168
|
+
const isAgentShown = computed(() => {
|
|
169
|
+
if (dataStore.isGons || dataStore.isPension) return dataStore.isServiceManager();
|
|
170
|
+
return true;
|
|
171
|
+
});
|
|
172
|
+
const openPanel = async (currentDict: ManagerAttachmentFiels, title: string) => {
|
|
125
173
|
searchQuery.value = '';
|
|
126
174
|
if (dataStore.isTask() && !props.disabled) {
|
|
127
175
|
dataStore.panelAction = null;
|
|
128
|
-
dataStore.
|
|
129
|
-
dataStore.
|
|
176
|
+
dataStore.rightPanel.open = true;
|
|
177
|
+
dataStore.rightPanel.title = title;
|
|
130
178
|
currentDictName.value = currentDict;
|
|
131
179
|
|
|
132
180
|
if (currentDict === 'ManagerPolicy' && formStore.RegionPolicy.ids) {
|
|
@@ -135,7 +183,7 @@ export default defineComponent({
|
|
|
135
183
|
}
|
|
136
184
|
|
|
137
185
|
isPanelOpen.value = true;
|
|
138
|
-
panelValue.value = formStore[currentDict
|
|
186
|
+
panelValue.value = formStore[currentDict];
|
|
139
187
|
isPanelLoading.value = false;
|
|
140
188
|
} else {
|
|
141
189
|
dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
|
|
@@ -150,29 +198,57 @@ export default defineComponent({
|
|
|
150
198
|
}
|
|
151
199
|
};
|
|
152
200
|
|
|
153
|
-
const pickPanelValue = (answer:
|
|
201
|
+
const pickPanelValue = (answer: FieldTypes) => {
|
|
154
202
|
// @ts-ignore
|
|
155
203
|
formStore[currentDictName.value] = answer;
|
|
156
204
|
isPanelOpen.value = false;
|
|
157
|
-
dataStore.
|
|
205
|
+
dataStore.rightPanel.open = false;
|
|
158
206
|
searchQuery.value = '';
|
|
159
207
|
};
|
|
160
208
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
209
|
+
watchDebounced(
|
|
210
|
+
searchQuery,
|
|
211
|
+
async searchQuery => {
|
|
212
|
+
if (searchQuery === null) {
|
|
213
|
+
searchQuery = '';
|
|
214
|
+
}
|
|
215
|
+
if (!!searchQuery && currentDictName.value === 'AgentData') {
|
|
216
|
+
await searchAgent();
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
{ debounce: 1000 },
|
|
220
|
+
);
|
|
166
221
|
|
|
167
222
|
watch(
|
|
168
223
|
() => formStore.RegionPolicy,
|
|
169
224
|
(val, oldVal) => {
|
|
170
225
|
if (val.ids !== oldVal.ids) {
|
|
171
|
-
|
|
226
|
+
if (!dataStore.isGons) {
|
|
227
|
+
formStore.ManagerPolicy = new Value();
|
|
228
|
+
}
|
|
172
229
|
}
|
|
173
230
|
},
|
|
174
231
|
);
|
|
175
232
|
|
|
233
|
+
watch(
|
|
234
|
+
() => dataStore.rightPanel.open,
|
|
235
|
+
() => {
|
|
236
|
+
if (dataStore.rightPanel.open === false) {
|
|
237
|
+
isPanelOpen.value = false;
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
{ immediate: true },
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
onBeforeUnmount(() => {
|
|
244
|
+
if (!isReadonly.value) {
|
|
245
|
+
const areValid = !!formStore.SaleChanellPolicy.nameRu && !!formStore.RegionPolicy.nameRu && !!formStore.ManagerPolicy.nameRu && !!formStore.AgentData.fullName;
|
|
246
|
+
if (areValid) {
|
|
247
|
+
dataStore.setINSISWorkData(false);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
|
|
176
252
|
return {
|
|
177
253
|
// State
|
|
178
254
|
formStore,
|
|
@@ -184,9 +260,15 @@ export default defineComponent({
|
|
|
184
260
|
currentDictName,
|
|
185
261
|
|
|
186
262
|
// Computed
|
|
187
|
-
dictList,
|
|
188
263
|
isReadonly,
|
|
189
|
-
|
|
264
|
+
isSaleChanellReadonly,
|
|
265
|
+
isRegionReadonly,
|
|
266
|
+
isManagerReadonly,
|
|
267
|
+
isAgentReadonly,
|
|
268
|
+
isSaleChanellShown,
|
|
269
|
+
isRegionShown,
|
|
270
|
+
isManagerShown,
|
|
271
|
+
isAgentShown,
|
|
190
272
|
// Functions
|
|
191
273
|
openPanel,
|
|
192
274
|
searchAgent,
|
|
@@ -195,3 +277,9 @@ export default defineComponent({
|
|
|
195
277
|
},
|
|
196
278
|
});
|
|
197
279
|
</script>
|
|
280
|
+
|
|
281
|
+
<style scoped>
|
|
282
|
+
.no-padding :deep(.v-expansion-panel-text__wrapper) {
|
|
283
|
+
padding: 0 !important;
|
|
284
|
+
}
|
|
285
|
+
</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,23 @@
|
|
|
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
|
+
export default defineComponent({
|
|
16
|
+
props: {
|
|
17
|
+
fields: {
|
|
18
|
+
type: Object as PropType<InputType[]>,
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
</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
|
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
<v-icon
|
|
34
34
|
v-if="appendInnerIcon.includes('mdi-calendar-blank-outline') === false"
|
|
35
35
|
:icon="appendInnerIcon"
|
|
36
|
-
@click="appendInnerIcon.includes('mdi-magnify') ? $emit('append') : !props.readonly && $emit('append')"
|
|
36
|
+
@click="appendInnerIcon.includes('mdi-magnify') || appendInnerIcon.includes('mdi-credit-card-scan') ? $emit('append') : !props.readonly && $emit('append')"
|
|
37
37
|
/>
|
|
38
38
|
<base-datepicker
|
|
39
39
|
v-if="appendInnerIcon.includes('mdi-calendar-blank-outline') && !props.readonly"
|
|
40
40
|
:model-value="modelValue"
|
|
41
|
+
:min-date="minDate"
|
|
41
42
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
42
|
-
:teleport="teleport"
|
|
43
43
|
/>
|
|
44
44
|
</template>
|
|
45
45
|
<template v-if="loading" #loader>
|
|
@@ -114,6 +114,10 @@ export default defineComponent({
|
|
|
114
114
|
type: String,
|
|
115
115
|
default: 'mdi-close',
|
|
116
116
|
},
|
|
117
|
+
minDate: {
|
|
118
|
+
type: Date,
|
|
119
|
+
default: undefined,
|
|
120
|
+
},
|
|
117
121
|
prependIcon: {
|
|
118
122
|
type: String,
|
|
119
123
|
},
|
|
@@ -139,10 +143,9 @@ export default defineComponent({
|
|
|
139
143
|
const submitted = (event: any) => {
|
|
140
144
|
emit('submitted', event);
|
|
141
145
|
};
|
|
142
|
-
|
|
143
146
|
return {
|
|
144
|
-
submitted,
|
|
145
147
|
props,
|
|
148
|
+
submitted,
|
|
146
149
|
};
|
|
147
150
|
},
|
|
148
151
|
});
|