hl-core 0.0.9-beta.4 → 0.0.9-beta.41
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 +904 -0
- package/api/index.ts +2 -620
- package/api/interceptors.ts +58 -14
- package/components/Button/Btn.vue +2 -2
- package/components/Complex/MessageBlock.vue +2 -2
- package/components/Complex/Page.vue +1 -1
- package/components/Dialog/Dialog.vue +60 -15
- package/components/Form/DynamicForm.vue +100 -0
- package/components/Form/FormBlock.vue +12 -3
- package/components/Form/FormData.vue +114 -0
- package/components/Form/FormToggle.vue +9 -3
- package/components/Form/ManagerAttachment.vue +150 -86
- package/components/Form/ProductConditionsBlock.vue +59 -6
- package/components/Input/Datepicker.vue +1 -8
- package/components/Input/DynamicInput.vue +23 -0
- package/components/Input/FileInput.vue +16 -4
- package/components/Input/FormInput.vue +1 -3
- package/components/Input/Monthpicker.vue +34 -0
- package/components/Input/PanelInput.vue +5 -1
- package/components/Input/RoundedEmptyField.vue +5 -0
- package/components/Input/RoundedSelect.vue +13 -0
- package/components/Input/SwitchInput.vue +64 -0
- package/components/Input/TextInput.vue +159 -0
- package/components/Layout/Drawer.vue +17 -4
- package/components/Layout/Header.vue +23 -2
- package/components/Layout/SettingsPanel.vue +13 -7
- package/components/Menu/InfoMenu.vue +35 -0
- package/components/Menu/MenuNav.vue +17 -2
- package/components/Pages/Anketa.vue +140 -52
- package/components/Pages/Auth.vue +12 -1
- package/components/Pages/ContragentForm.vue +129 -50
- package/components/Pages/Documents.vue +72 -7
- package/components/Pages/InvoiceInfo.vue +1 -1
- package/components/Pages/MemberForm.vue +269 -96
- package/components/Pages/ProductAgreement.vue +1 -8
- package/components/Pages/ProductConditions.vue +798 -168
- package/components/Panel/PanelHandler.vue +373 -45
- package/components/Panel/PanelSelectItem.vue +17 -2
- package/components/Panel/RightPanelCloser.vue +7 -0
- package/components/Transitions/Animation.vue +28 -0
- package/composables/axios.ts +2 -1
- package/composables/classes.ts +415 -8
- package/composables/constants.ts +65 -2
- package/composables/fields.ts +291 -0
- package/composables/index.ts +58 -5
- package/composables/styles.ts +22 -10
- package/layouts/default.vue +48 -3
- package/locales/ru.json +460 -12
- package/nuxt.config.ts +1 -1
- package/package.json +25 -22
- package/pages/Token.vue +1 -12
- package/plugins/helperFunctionsPlugins.ts +0 -3
- package/plugins/vuetifyPlugin.ts +2 -0
- package/store/data.store.ts +1031 -224
- package/store/extractStore.ts +17 -0
- package/store/form.store.ts +13 -1
- package/store/member.store.ts +1 -1
- package/store/rules.ts +53 -5
- package/types/enum.ts +37 -0
- package/types/form.ts +94 -0
- package/types/index.ts +216 -20
|
@@ -1,55 +1,61 @@
|
|
|
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
|
+
class="pl-1 pt-1"
|
|
12
|
+
v-model="formStore.SaleChanellPolicy"
|
|
13
|
+
:value="formStore.SaleChanellPolicy?.nameRu"
|
|
14
|
+
:readonly="isSaleChanellReadonly"
|
|
15
|
+
:clearable="!isSaleChanellReadonly"
|
|
16
|
+
:label="$dataStore.t('form.salesChanell')"
|
|
17
|
+
:rules="$rules.objectRequired"
|
|
18
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
19
|
+
@append="openPanel('SaleChanellPolicy', $dataStore.t('form.salesChanell'))"
|
|
20
|
+
/>
|
|
21
|
+
<base-panel-input
|
|
22
|
+
class="pl-1 pt-1"
|
|
23
|
+
v-model="formStore.RegionPolicy"
|
|
24
|
+
:value="formStore.RegionPolicy?.nameRu"
|
|
25
|
+
:readonly="isRegionReadonly"
|
|
26
|
+
:clearable="!isRegionReadonly"
|
|
27
|
+
:label="$dataStore.t('form.Region')"
|
|
28
|
+
:rules="$rules.objectRequired"
|
|
29
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
30
|
+
@append="openPanel('RegionPolicy', $dataStore.t('form.Region'))"
|
|
31
|
+
/>
|
|
32
|
+
<base-panel-input
|
|
33
|
+
class="pl-1 pt-1"
|
|
34
|
+
v-model="formStore.ManagerPolicy"
|
|
35
|
+
:value="formStore.ManagerPolicy?.nameRu"
|
|
36
|
+
:readonly="isManagerReadonly"
|
|
37
|
+
:clearable="!isManagerReadonly"
|
|
38
|
+
:label="$dataStore.t('form.manager')"
|
|
39
|
+
:rules="$rules.objectRequired"
|
|
40
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
41
|
+
@append="openPanel('ManagerPolicy', $dataStore.t('form.manager'))"
|
|
42
|
+
/>
|
|
43
|
+
<base-panel-input
|
|
44
|
+
class="pl-1 pt-1"
|
|
45
|
+
v-model="formStore.AgentData"
|
|
46
|
+
:value="formStore.AgentData?.fullName"
|
|
47
|
+
:readonly="isAgentReadonly"
|
|
48
|
+
:clearable="!isAgentReadonly"
|
|
49
|
+
:label="$dataStore.t('form.agent')"
|
|
50
|
+
:rules="$rules.agentDataRequired"
|
|
51
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
52
|
+
@append="openPanel('AgentData', $dataStore.t('form.agent'))"
|
|
53
|
+
/>
|
|
54
|
+
</v-form>
|
|
55
|
+
</v-expansion-panel-text>
|
|
56
|
+
</v-expansion-panel>
|
|
57
|
+
</v-expansion-panels>
|
|
58
|
+
<Teleport v-if="isPanelOpen" to="#right-panel-actions">
|
|
53
59
|
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
54
60
|
<base-rounded-input
|
|
55
61
|
v-model.trim="searchQuery"
|
|
@@ -59,16 +65,34 @@
|
|
|
59
65
|
:append-inner-icon="currentDictName === 'AgentData' ? 'mdi mdi-magnify' : ''"
|
|
60
66
|
@append="searchAgent"
|
|
61
67
|
/>
|
|
62
|
-
<div v-if="
|
|
63
|
-
<div v-
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
<div v-if="isPanelLoading === false" class="w-full">
|
|
69
|
+
<div v-if="currentDictName === 'AgentData'" class="w-full flex flex-col gap-2 p-2">
|
|
70
|
+
<div v-for="(agent, index) of $dataStore[currentDictName]" :key="index">
|
|
71
|
+
<div
|
|
72
|
+
class="flex justify-between p-4 items-center cursor-pointer"
|
|
73
|
+
:class="[$styles.rounded, $styles.blueBgLight, $styles.blueBgLightHover]"
|
|
74
|
+
@click="pickPanelValue(agent)"
|
|
75
|
+
>
|
|
76
|
+
<div class="flex flex-col">
|
|
77
|
+
<span :class="[$styles.textSimple]">{{ $getFullNameShorted(agent.fullName ?? '', 2) }}</span>
|
|
78
|
+
<span :class="[$styles.mutedText]">
|
|
79
|
+
{{ agent.saleChannel ? `${agent.saleChannel} / ${$getFullNameShorted(agent.managerName ?? '', 2)}` : `${agent.managerName}` }}
|
|
80
|
+
</span>
|
|
81
|
+
</div>
|
|
82
|
+
<i
|
|
83
|
+
class="mdi text-xl"
|
|
84
|
+
:class="[agent.agentId === (panelValue as AgentData).agentId ? `mdi-radiobox-marked ${$styles.greenText}` : 'mdi-radiobox-blank text-[#636363]']"
|
|
85
|
+
></i>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
<div v-if="currentDictName === 'ManagerPolicy' || currentDictName === 'RegionPolicy' || currentDictName === 'SaleChanellPolicy'" class="w-full flex flex-col gap-2 p-2">
|
|
90
|
+
<div v-for="(item, index) in $dataStore[currentDictName].filter(i => (i.nameRu as string).toLowerCase().includes(searchQuery.toLowerCase()))" :key="index">
|
|
91
|
+
<base-panel-select-item :key="index" :text="item.nameRu ?? ''" :selected="item.ids === (panelValue as Value).ids" @click="pickPanelValue(item)" />
|
|
92
|
+
</div>
|
|
70
93
|
</div>
|
|
71
94
|
</div>
|
|
95
|
+
|
|
72
96
|
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
|
|
73
97
|
</div>
|
|
74
98
|
</Teleport>
|
|
@@ -77,6 +101,7 @@
|
|
|
77
101
|
|
|
78
102
|
<script lang="ts">
|
|
79
103
|
import { Value } from '../../composables/classes';
|
|
104
|
+
import { watchDebounced } from '@vueuse/core';
|
|
80
105
|
|
|
81
106
|
export default defineComponent({
|
|
82
107
|
props: {
|
|
@@ -90,29 +115,17 @@ export default defineComponent({
|
|
|
90
115
|
},
|
|
91
116
|
},
|
|
92
117
|
setup(props) {
|
|
118
|
+
type ManagerAttachmentFiels = 'SaleChanellPolicy' | 'RegionPolicy' | 'ManagerPolicy' | 'AgentData';
|
|
119
|
+
type FieldTypes = Value | AgentData;
|
|
93
120
|
const route = useRoute();
|
|
94
121
|
const dataStore = useDataStore();
|
|
95
122
|
const formStore = useFormStore();
|
|
96
123
|
const isPanelOpen = ref<boolean>(false);
|
|
97
124
|
const isPanelLoading = ref<boolean>(false);
|
|
98
|
-
const panelValue = ref<
|
|
125
|
+
const panelValue = ref<FieldTypes>(new Value());
|
|
99
126
|
const searchQuery = ref<string>('');
|
|
100
|
-
const currentDictName = ref<
|
|
127
|
+
const currentDictName = ref<ManagerAttachmentFiels>();
|
|
101
128
|
|
|
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
129
|
const isReadonly = computed(
|
|
117
130
|
() =>
|
|
118
131
|
props.disabled ||
|
|
@@ -120,13 +133,29 @@ export default defineComponent({
|
|
|
120
133
|
!dataStore.isInitiator() ||
|
|
121
134
|
(route.params.taskId !== '0' && (!dataStore.isProcessEditable(formStore.applicationData.statusCode) || !dataStore.isTask())),
|
|
122
135
|
);
|
|
136
|
+
const isSaleChanellReadonly = computed(() => {
|
|
137
|
+
if (dataStore.isGons) return isReadonly.value || !dataStore.isServiceManager();
|
|
138
|
+
return isReadonly.value;
|
|
139
|
+
});
|
|
140
|
+
const isRegionReadonly = computed(() => {
|
|
141
|
+
if (dataStore.isGons) return isReadonly.value || !dataStore.isServiceManager();
|
|
142
|
+
return isReadonly.value;
|
|
143
|
+
});
|
|
144
|
+
const isManagerReadonly = computed(() => {
|
|
145
|
+
if (dataStore.isGons) return isReadonly.value || !dataStore.isServiceManager();
|
|
146
|
+
return isReadonly.value;
|
|
147
|
+
});
|
|
148
|
+
const isAgentReadonly = computed(() => {
|
|
149
|
+
if (dataStore.isGons) return isReadonly.value || !dataStore.isAgent();
|
|
150
|
+
return isReadonly.value;
|
|
151
|
+
});
|
|
123
152
|
|
|
124
|
-
const openPanel = async (currentDict:
|
|
153
|
+
const openPanel = async (currentDict: ManagerAttachmentFiels, title: string) => {
|
|
125
154
|
searchQuery.value = '';
|
|
126
155
|
if (dataStore.isTask() && !props.disabled) {
|
|
127
156
|
dataStore.panelAction = null;
|
|
128
|
-
dataStore.
|
|
129
|
-
dataStore.
|
|
157
|
+
dataStore.rightPanel.open = true;
|
|
158
|
+
dataStore.rightPanel.title = title;
|
|
130
159
|
currentDictName.value = currentDict;
|
|
131
160
|
|
|
132
161
|
if (currentDict === 'ManagerPolicy' && formStore.RegionPolicy.ids) {
|
|
@@ -135,7 +164,7 @@ export default defineComponent({
|
|
|
135
164
|
}
|
|
136
165
|
|
|
137
166
|
isPanelOpen.value = true;
|
|
138
|
-
panelValue.value = formStore[currentDict
|
|
167
|
+
panelValue.value = formStore[currentDict];
|
|
139
168
|
isPanelLoading.value = false;
|
|
140
169
|
} else {
|
|
141
170
|
dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
|
|
@@ -150,19 +179,26 @@ export default defineComponent({
|
|
|
150
179
|
}
|
|
151
180
|
};
|
|
152
181
|
|
|
153
|
-
const pickPanelValue = (answer:
|
|
182
|
+
const pickPanelValue = (answer: FieldTypes) => {
|
|
154
183
|
// @ts-ignore
|
|
155
184
|
formStore[currentDictName.value] = answer;
|
|
156
185
|
isPanelOpen.value = false;
|
|
157
|
-
dataStore.
|
|
186
|
+
dataStore.rightPanel.open = false;
|
|
158
187
|
searchQuery.value = '';
|
|
159
188
|
};
|
|
160
189
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
190
|
+
watchDebounced(
|
|
191
|
+
searchQuery,
|
|
192
|
+
async searchQuery => {
|
|
193
|
+
if (searchQuery === null) {
|
|
194
|
+
searchQuery = '';
|
|
195
|
+
}
|
|
196
|
+
if (!!searchQuery && currentDictName.value === 'AgentData') {
|
|
197
|
+
await searchAgent();
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
{ debounce: 1000 },
|
|
201
|
+
);
|
|
166
202
|
|
|
167
203
|
watch(
|
|
168
204
|
() => formStore.RegionPolicy,
|
|
@@ -173,6 +209,25 @@ export default defineComponent({
|
|
|
173
209
|
},
|
|
174
210
|
);
|
|
175
211
|
|
|
212
|
+
watch(
|
|
213
|
+
() => dataStore.rightPanel.open,
|
|
214
|
+
() => {
|
|
215
|
+
if (dataStore.rightPanel.open === false) {
|
|
216
|
+
isPanelOpen.value = false;
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
{ immediate: true },
|
|
220
|
+
);
|
|
221
|
+
|
|
222
|
+
onBeforeUnmount(() => {
|
|
223
|
+
if (!isReadonly.value) {
|
|
224
|
+
const areValid = !!formStore.SaleChanellPolicy.nameRu && !!formStore.RegionPolicy.nameRu && !!formStore.ManagerPolicy.nameRu && !!formStore.AgentData.fullName;
|
|
225
|
+
if (areValid) {
|
|
226
|
+
dataStore.setINSISWorkData(false);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
|
|
176
231
|
return {
|
|
177
232
|
// State
|
|
178
233
|
formStore,
|
|
@@ -184,8 +239,11 @@ export default defineComponent({
|
|
|
184
239
|
currentDictName,
|
|
185
240
|
|
|
186
241
|
// Computed
|
|
187
|
-
dictList,
|
|
188
242
|
isReadonly,
|
|
243
|
+
isSaleChanellReadonly,
|
|
244
|
+
isRegionReadonly,
|
|
245
|
+
isManagerReadonly,
|
|
246
|
+
isAgentReadonly,
|
|
189
247
|
|
|
190
248
|
// Functions
|
|
191
249
|
openPanel,
|
|
@@ -195,3 +253,9 @@ export default defineComponent({
|
|
|
195
253
|
},
|
|
196
254
|
});
|
|
197
255
|
</script>
|
|
256
|
+
|
|
257
|
+
<style scoped>
|
|
258
|
+
.no-padding :deep(.v-expansion-panel-text__wrapper) {
|
|
259
|
+
padding: 0 !important;
|
|
260
|
+
}
|
|
261
|
+
</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
|
});
|
|
@@ -7,10 +7,7 @@
|
|
|
7
7
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
8
|
locale="ru"
|
|
9
9
|
model-type="dd.MM.yyyy"
|
|
10
|
-
|
|
11
|
-
menu-class-name="!left-[30vw] md:!left-[70vw] lg:!left-[75vw]"
|
|
12
|
-
:teleport="teleport"
|
|
13
|
-
:offset="-50"
|
|
10
|
+
:teleport="true"
|
|
14
11
|
:close-on-scroll="true"
|
|
15
12
|
:enable-time-picker="false"
|
|
16
13
|
cancel-text="Отменить"
|
|
@@ -36,10 +33,6 @@ export default defineComponent({
|
|
|
36
33
|
type: Boolean,
|
|
37
34
|
default: false,
|
|
38
35
|
},
|
|
39
|
-
teleport: {
|
|
40
|
-
type: String,
|
|
41
|
-
default: '.v-form',
|
|
42
|
-
},
|
|
43
36
|
},
|
|
44
37
|
});
|
|
45
38
|
</script>
|
|
@@ -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,16 +3,17 @@
|
|
|
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="
|
|
14
|
+
:label="label"
|
|
15
|
+
@click:append-inner="$emit('append-inner', $event)"
|
|
16
|
+
@click:clear="$emit('on-clear')"
|
|
16
17
|
/>
|
|
17
18
|
</template>
|
|
18
19
|
|
|
@@ -23,7 +24,18 @@ export default defineComponent({
|
|
|
23
24
|
type: Boolean,
|
|
24
25
|
default: false,
|
|
25
26
|
},
|
|
27
|
+
icon: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: 'mdi-file-document',
|
|
30
|
+
},
|
|
31
|
+
label: {
|
|
32
|
+
type: String,
|
|
33
|
+
default() {
|
|
34
|
+
return useDataStore().t('labels.chooseDoc');
|
|
35
|
+
},
|
|
36
|
+
},
|
|
26
37
|
},
|
|
38
|
+
emits: ['input', 'append-inner', 'on-clear'],
|
|
27
39
|
});
|
|
28
40
|
</script>
|
|
29
41
|
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
v-if="appendInnerIcon.includes('mdi-calendar-blank-outline') && !props.readonly"
|
|
40
40
|
:model-value="modelValue"
|
|
41
41
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
42
|
-
:teleport="teleport"
|
|
43
42
|
/>
|
|
44
43
|
</template>
|
|
45
44
|
<template v-if="loading" #loader>
|
|
@@ -139,10 +138,9 @@ export default defineComponent({
|
|
|
139
138
|
const submitted = (event: any) => {
|
|
140
139
|
emit('submitted', event);
|
|
141
140
|
};
|
|
142
|
-
|
|
143
141
|
return {
|
|
144
|
-
submitted,
|
|
145
142
|
props,
|
|
143
|
+
submitted,
|
|
146
144
|
};
|
|
147
145
|
},
|
|
148
146
|
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<vue-date-picker
|
|
3
|
+
:model-value="modelValue"
|
|
4
|
+
:clearable="false"
|
|
5
|
+
:disabled="disabled"
|
|
6
|
+
:reaonly="readonly"
|
|
7
|
+
month-picker
|
|
8
|
+
locale="ru"
|
|
9
|
+
format="MM.yyyy"
|
|
10
|
+
:teleport="true"
|
|
11
|
+
:close-on-scroll="true"
|
|
12
|
+
cancel-text="Отменить"
|
|
13
|
+
select-text="Выбрать"
|
|
14
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
15
|
+
/>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script lang="ts">
|
|
19
|
+
export default defineComponent({
|
|
20
|
+
props: {
|
|
21
|
+
modelValue: {
|
|
22
|
+
required: false,
|
|
23
|
+
},
|
|
24
|
+
disabled: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
readonly: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
</script>
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
:suffix="suffix"
|
|
25
25
|
@keyup.enter.prevent="submitted"
|
|
26
26
|
@click:control="!props.readonly && $emit('append')"
|
|
27
|
-
@click:clear="(props.readonly ? false : clearable) && $emit('update:modelValue',
|
|
27
|
+
@click:clear="(props.readonly ? false : clearable) && $emit('update:modelValue', clearValue)"
|
|
28
28
|
@click:append="!props.readonly && $emit('append-out')"
|
|
29
29
|
@click:prepend="!props.readonly && $emit('prepend-out')"
|
|
30
30
|
@click:append-inner="!props.readonly && $emit('append')"
|
|
@@ -50,6 +50,10 @@ export default defineComponent({
|
|
|
50
50
|
type: Boolean,
|
|
51
51
|
default: false,
|
|
52
52
|
},
|
|
53
|
+
clearValue: {
|
|
54
|
+
type: Object,
|
|
55
|
+
default: new Value(),
|
|
56
|
+
},
|
|
53
57
|
clearable: {
|
|
54
58
|
type: Boolean,
|
|
55
59
|
default: true,
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
:placeholder="placeholder"
|
|
8
8
|
:label="label"
|
|
9
9
|
:variant="variant"
|
|
10
|
+
:density="(density as any)"
|
|
11
|
+
:menu-icon="menuIcon"
|
|
10
12
|
:clear-icon="clearIcon"
|
|
11
13
|
:color="color"
|
|
12
14
|
:hint="hint"
|
|
@@ -78,10 +80,18 @@ export default defineComponent({
|
|
|
78
80
|
type: String as PropType<InputVariants>,
|
|
79
81
|
default: 'solo',
|
|
80
82
|
},
|
|
83
|
+
density: {
|
|
84
|
+
type: String,
|
|
85
|
+
default: 'compact',
|
|
86
|
+
},
|
|
81
87
|
color: {
|
|
82
88
|
type: String,
|
|
83
89
|
default: '#009c73',
|
|
84
90
|
},
|
|
91
|
+
menuIcon: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: 'mdi-chevron-down',
|
|
94
|
+
},
|
|
85
95
|
clearIcon: {
|
|
86
96
|
type: String,
|
|
87
97
|
default: 'mdi-close',
|
|
@@ -122,6 +132,9 @@ export default defineComponent({
|
|
|
122
132
|
border: none !important;
|
|
123
133
|
outline: none !important;
|
|
124
134
|
}
|
|
135
|
+
.rounded-select.v-input {
|
|
136
|
+
flex: unset !important;
|
|
137
|
+
}
|
|
125
138
|
.rounded-select .v-label.v-field-label {
|
|
126
139
|
top: 20px;
|
|
127
140
|
}
|