hl-core 0.0.9-beta.5 → 0.0.9-beta.50
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 +935 -0
- package/api/index.ts +2 -620
- package/api/interceptors.ts +53 -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 +110 -0
- package/components/Form/FormSection.vue +3 -3
- package/components/Form/FormToggle.vue +25 -5
- package/components/Form/ManagerAttachment.vue +150 -86
- package/components/Form/ProductConditionsBlock.vue +59 -6
- package/components/Input/Datepicker.vue +39 -8
- package/components/Input/DynamicInput.vue +23 -0
- package/components/Input/FileInput.vue +25 -5
- package/components/Input/FormInput.vue +2 -4
- 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 +160 -0
- package/components/Layout/Drawer.vue +17 -4
- package/components/Layout/Header.vue +23 -2
- package/components/Layout/Loader.vue +1 -1
- 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 +42 -7
- package/components/Pages/ContragentForm.vue +124 -50
- package/components/Pages/Documents.vue +72 -7
- package/components/Pages/InvoiceInfo.vue +1 -1
- package/components/Pages/MemberForm.vue +369 -100
- package/components/Pages/ProductAgreement.vue +1 -8
- package/components/Pages/ProductConditions.vue +888 -181
- package/components/Panel/PanelHandler.vue +414 -45
- package/components/Panel/PanelSelectItem.vue +17 -2
- package/components/Panel/RightPanelCloser.vue +7 -0
- package/components/Transitions/Animation.vue +28 -0
- package/components/Utilities/Qr.vue +44 -0
- package/composables/axios.ts +1 -0
- package/composables/classes.ts +433 -8
- package/composables/constants.ts +102 -2
- package/composables/fields.ts +328 -0
- package/composables/index.ts +257 -12
- package/composables/styles.ts +29 -16
- package/layouts/default.vue +48 -3
- package/locales/ru.json +480 -14
- package/package.json +27 -24
- package/pages/Token.vue +1 -12
- package/plugins/vuetifyPlugin.ts +2 -0
- package/store/data.store.ts +1190 -248
- package/store/extractStore.ts +17 -0
- package/store/form.store.ts +13 -1
- package/store/member.store.ts +1 -1
- package/store/rules.ts +66 -5
- package/types/enum.ts +43 -0
- package/types/env.d.ts +1 -0
- package/types/form.ts +94 -0
- package/types/index.ts +254 -21
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section class="flex flex-col gap-4 px-[10px]">
|
|
3
|
-
<v-form ref="vForm" @submit="submitForm" class="max-h-[
|
|
4
|
-
<base-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
title="Если лицо, назначенное Выгодоприобретателем, на дату осуществления Страховщиком страховой выплаты не достигло совершеннолетия (восемнадцатилетнего возраста), страховая
|
|
12
|
-
выплата подлежит осуществлению:"
|
|
13
|
-
subtitle="Если несовершеннолетний не достиг возраста 14 лет - законному представителю в соответствии с законодательством Республики Казахстан"
|
|
14
|
-
/>
|
|
15
|
-
</base-form-section>
|
|
3
|
+
<v-form ref="vForm" @submit="submitForm" class="overflow-y-scroll" :class="[!$dataStore.isCalculator && isCalculator && hasCalculated ? 'max-h-[73svh]' : 'max-h-[80svh]']">
|
|
4
|
+
<base-message-block
|
|
5
|
+
v-if="isCalculator"
|
|
6
|
+
class="mt-4"
|
|
7
|
+
:color="$styles.blueBgLight"
|
|
8
|
+
:text="$dataStore.t('preliminaryCalculation')"
|
|
9
|
+
icon="mdi-alert text-[#FCB016]"
|
|
10
|
+
></base-message-block>
|
|
16
11
|
<base-form-section v-if="isUnderwriterRole && $dataStore.hasClientAnketa && $dataStore.isClientAnketaCondition" :title="$dataStore.t('policyholderForm')">
|
|
17
12
|
<base-form-input
|
|
18
13
|
v-model="productConditionsForm.lifeMultiplyClient"
|
|
@@ -37,7 +32,10 @@
|
|
|
37
32
|
<base-form-input v-model="formStore.policyholderForm.age" :label="$dataStore.t('form.age')" :readonly="true" />
|
|
38
33
|
<base-form-input v-model="formStore.policyholderForm.gender.nameRu" class="mb-4" :label="$dataStore.t('form.gender')" :readonly="true" />
|
|
39
34
|
</base-form-section>
|
|
40
|
-
<base-form-section
|
|
35
|
+
<base-form-section
|
|
36
|
+
v-if="isUnderwriterRole && $dataStore.members.insuredApp.has === true && whichProduct !== 'lifebusiness' && whichProduct !== 'gns'"
|
|
37
|
+
:title="$dataStore.t('insuredForm')"
|
|
38
|
+
>
|
|
41
39
|
<div v-for="(insured, index) of formStore.insuredForm" :key="index">
|
|
42
40
|
<base-form-input v-model="insured.longName" :label="$dataStore.t('labels.insurerLongName')" :readonly="true" />
|
|
43
41
|
<base-form-input v-model="insured.job" :label="$dataStore.t('form.job')" :readonly="true" />
|
|
@@ -47,21 +45,21 @@
|
|
|
47
45
|
<base-form-input v-model="insured.gender.nameRu" class="mb-4" :label="$dataStore.t('form.gender')" :readonly="true" />
|
|
48
46
|
</div>
|
|
49
47
|
</base-form-section>
|
|
50
|
-
<base-form-section v-if="isUnderwriterRole" :title="$dataStore.t('recalculationInfo')">
|
|
48
|
+
<base-form-section v-if="isUnderwriterRole && whichProduct !== 'lifebusiness' && whichProduct !== 'gns'" :title="$dataStore.t('recalculationInfo')">
|
|
51
49
|
<base-form-input
|
|
52
50
|
v-model="productConditionsForm.lifeMultiply"
|
|
53
51
|
:maska="$maska.numbers"
|
|
54
52
|
:clearable="isRecalculationDisabled === false"
|
|
55
53
|
:label="$dataStore.t('percent') + `Life Multiply`"
|
|
56
54
|
:readonly="isRecalculationDisabled"
|
|
57
|
-
:rules="$dataStore.rules.recalculationMultiply"
|
|
55
|
+
:rules="whichProduct === 'gons' ? $dataStore.rules.recalculationMultiplyBetween : $dataStore.rules.recalculationMultiply"
|
|
58
56
|
/>
|
|
59
57
|
<base-form-input
|
|
60
58
|
v-model="productConditionsForm.lifeAdditive"
|
|
61
59
|
:maska="$maska.numbers"
|
|
62
60
|
:clearable="isRecalculationDisabled === false"
|
|
63
61
|
:label="$dataStore.t('percent') + `Life Additive`"
|
|
64
|
-
:readonly="
|
|
62
|
+
:readonly="readonlyLifeAdditive"
|
|
65
63
|
:rules="$dataStore.rules.recalculationAdditive"
|
|
66
64
|
/>
|
|
67
65
|
<base-form-input
|
|
@@ -87,21 +85,21 @@
|
|
|
87
85
|
:maska="$maska.numbers"
|
|
88
86
|
:clearable="isRecalculationDisabled === false"
|
|
89
87
|
:label="$dataStore.t('percent') + `Disability Multiply`"
|
|
90
|
-
:readonly="
|
|
91
|
-
:rules="$dataStore.rules.recalculationMultiply"
|
|
88
|
+
:readonly="readonlyDisabilityMultiply"
|
|
89
|
+
:rules="whichProduct === 'gons' ? [] : $dataStore.rules.recalculationMultiply"
|
|
92
90
|
/>
|
|
93
91
|
<base-form-input
|
|
94
92
|
v-model="productConditionsForm.disabilityAdditive"
|
|
95
93
|
:maska="$maska.numbers"
|
|
96
94
|
:clearable="isRecalculationDisabled === false"
|
|
97
95
|
:label="$dataStore.t('percent') + `Disability Additive`"
|
|
98
|
-
:readonly="
|
|
96
|
+
:readonly="readonlyDisabilityAdditive"
|
|
99
97
|
:rules="$dataStore.rules.recalculationAdditive"
|
|
100
98
|
/>
|
|
101
99
|
<base-panel-input
|
|
102
100
|
v-if="hasRiskGroup"
|
|
103
101
|
v-model="productConditionsForm.riskGroup"
|
|
104
|
-
:value="productConditionsForm.riskGroup
|
|
102
|
+
:value="productConditionsForm.riskGroup?.nameRu"
|
|
105
103
|
:label="$dataStore.t('productConditionsForm.riskGroup')"
|
|
106
104
|
:clearable="isRecalculationDisabled === false"
|
|
107
105
|
:readonly="isRecalculationDisabled"
|
|
@@ -109,8 +107,8 @@
|
|
|
109
107
|
@append="openPanel($dataStore.t('productConditionsForm.riskGroup'), $dataStore.riskGroup, 'riskGroup')"
|
|
110
108
|
/>
|
|
111
109
|
</base-form-section>
|
|
112
|
-
<base-form-section :title="
|
|
113
|
-
<div v-if="
|
|
110
|
+
<base-form-section v-if="hasDefault" :title="defaultText">
|
|
111
|
+
<div v-if="isCalculator && ($route.params.taskId === '0' || $dataStore.isCalculator)">
|
|
114
112
|
<base-form-input
|
|
115
113
|
v-model="productConditionsForm.signDate"
|
|
116
114
|
:maska="$maska.date"
|
|
@@ -120,6 +118,7 @@
|
|
|
120
118
|
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
121
119
|
/>
|
|
122
120
|
<base-form-input
|
|
121
|
+
v-if="hasBirthDate"
|
|
123
122
|
v-model="productConditionsForm.birthDate"
|
|
124
123
|
:maska="$maska.date"
|
|
125
124
|
:readonly="isDisabled"
|
|
@@ -129,8 +128,9 @@
|
|
|
129
128
|
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
130
129
|
/>
|
|
131
130
|
<base-panel-input
|
|
131
|
+
v-if="hasGender"
|
|
132
132
|
v-model="productConditionsForm.gender"
|
|
133
|
-
:value="productConditionsForm.gender
|
|
133
|
+
:value="productConditionsForm.gender?.nameRu"
|
|
134
134
|
:readonly="isDisabled"
|
|
135
135
|
:clearable="!isDisabled"
|
|
136
136
|
:label="$dataStore.t('form.gender')"
|
|
@@ -142,15 +142,15 @@
|
|
|
142
142
|
<base-form-input
|
|
143
143
|
v-model="productConditionsForm.coverPeriod"
|
|
144
144
|
:maska="$maska.numbers"
|
|
145
|
-
:readonly="
|
|
145
|
+
:readonly="isDisabledCoverPeriod"
|
|
146
146
|
:clearable="!isDisabled"
|
|
147
147
|
:rules="coverPeriodRule"
|
|
148
|
-
:label="
|
|
148
|
+
:label="coverPeriodLabel"
|
|
149
149
|
/>
|
|
150
150
|
<base-panel-input
|
|
151
151
|
v-if="hasPaymentPeriod"
|
|
152
152
|
v-model="productConditionsForm.paymentPeriod"
|
|
153
|
-
:value="productConditionsForm.paymentPeriod
|
|
153
|
+
:value="productConditionsForm.paymentPeriod?.nameRu"
|
|
154
154
|
:readonly="isDisabled"
|
|
155
155
|
:clearable="!isDisabled"
|
|
156
156
|
:rules="$rules.objectRequired"
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
<base-panel-input
|
|
162
162
|
v-if="hasProcessIndexRate"
|
|
163
163
|
v-model="productConditionsForm.processIndexRate"
|
|
164
|
-
:value="productConditionsForm.processIndexRate
|
|
164
|
+
:value="productConditionsForm.processIndexRate?.nameRu"
|
|
165
165
|
:readonly="isDisabled"
|
|
166
166
|
:clearable="!isDisabled"
|
|
167
167
|
:rules="$rules.objectRequired"
|
|
@@ -169,11 +169,21 @@
|
|
|
169
169
|
append-inner-icon="mdi mdi-chevron-right"
|
|
170
170
|
@append="openPanel($dataStore.t('productConditionsForm.processIndexRate'), $dataStore.processIndexRate, 'processIndexRate', $dataStore.getProcessIndexRate)"
|
|
171
171
|
/>
|
|
172
|
+
<base-form-input
|
|
173
|
+
v-if="hasFixInsSum"
|
|
174
|
+
v-model="productConditionsForm.fixInsSum"
|
|
175
|
+
:readonly="isDisabledFixInsSum"
|
|
176
|
+
:clearable="!isDisabled"
|
|
177
|
+
:rules="fixInsSumRule"
|
|
178
|
+
:label="$dataStore.t('productConditionsForm.fixInsSum')"
|
|
179
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
180
|
+
@input="onInputFixInsSum"
|
|
181
|
+
/>
|
|
172
182
|
<base-form-input
|
|
173
183
|
v-model="productConditionsForm.requestedSumInsured"
|
|
174
184
|
:readonly="isDisabledSum"
|
|
175
|
-
:clearable="!
|
|
176
|
-
:rules="
|
|
185
|
+
:clearable="!isDisabledSum"
|
|
186
|
+
:rules="requestedSumInsuredRule"
|
|
177
187
|
:label="requestedSumInsuredLabel"
|
|
178
188
|
:suffix="$constants.currencySymbols.kzt"
|
|
179
189
|
@input="onInputSum"
|
|
@@ -183,8 +193,8 @@
|
|
|
183
193
|
v-if="hasRequestedSumInsuredInDollar"
|
|
184
194
|
v-model="productConditionsForm.requestedSumInsuredInDollar"
|
|
185
195
|
:readonly="isDisabledSumDollar"
|
|
186
|
-
:clearable="!
|
|
187
|
-
:rules="
|
|
196
|
+
:clearable="!isDisabledSumDollar"
|
|
197
|
+
:rules="requestedSumInsuredRule"
|
|
188
198
|
:label="$dataStore.t('productConditionsForm.requestedSumInsuredInDollar')"
|
|
189
199
|
:suffix="$constants.currencySymbols.usd"
|
|
190
200
|
@input="onInputSumDollar"
|
|
@@ -192,10 +202,10 @@
|
|
|
192
202
|
/>
|
|
193
203
|
<base-form-input
|
|
194
204
|
v-model="productConditionsForm.insurancePremiumPerMonth"
|
|
195
|
-
:readonly="
|
|
196
|
-
:clearable="!
|
|
197
|
-
:rules="
|
|
198
|
-
:label="
|
|
205
|
+
:readonly="insurancePremiumPerMonthDisabled"
|
|
206
|
+
:clearable="!insurancePremiumPerMonthDisabled"
|
|
207
|
+
:rules="insurancePremiumPerMonthRule"
|
|
208
|
+
:label="insurancePremiumPerMonthLabel"
|
|
199
209
|
:suffix="$constants.currencySymbols.kzt"
|
|
200
210
|
@input="onInputInsurancePremiumPerMonth"
|
|
201
211
|
@onClear="onClearPremium"
|
|
@@ -203,9 +213,9 @@
|
|
|
203
213
|
<base-form-input
|
|
204
214
|
v-if="hasInsurancePremiumPerMonthInDollar"
|
|
205
215
|
v-model="productConditionsForm.insurancePremiumPerMonthInDollar"
|
|
206
|
-
:readonly="
|
|
207
|
-
:clearable="!
|
|
208
|
-
:rules="
|
|
216
|
+
:readonly="insurancePremiumPerMonthDisabled"
|
|
217
|
+
:clearable="!insurancePremiumPerMonthDisabled"
|
|
218
|
+
:rules="insurancePremiumPerMonthRule"
|
|
209
219
|
:label="$dataStore.t('productConditionsForm.insurancePremiumAmountInDollar')"
|
|
210
220
|
:suffix="$constants.currencySymbols.usd"
|
|
211
221
|
@input="onInputInsurancePremiumPerMonthInDollar"
|
|
@@ -218,8 +228,54 @@
|
|
|
218
228
|
:label="$dataStore.t('productConditionsForm.dollarExchangeRateNBRK')"
|
|
219
229
|
:suffix="$constants.currencySymbols.kzt"
|
|
220
230
|
/>
|
|
231
|
+
<base-form-input
|
|
232
|
+
v-if="whichProduct === 'gons'"
|
|
233
|
+
v-model="productConditionsForm.totalAmount5"
|
|
234
|
+
:readonly="true"
|
|
235
|
+
:label="$dataStore.t('productConditionsForm.totalAmount5')"
|
|
236
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
237
|
+
/>
|
|
238
|
+
<base-form-input
|
|
239
|
+
v-if="whichProduct === 'gons'"
|
|
240
|
+
v-model="productConditionsForm.statePremium5"
|
|
241
|
+
:readonly="true"
|
|
242
|
+
:label="$dataStore.t('productConditionsForm.statePremium5')"
|
|
243
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
244
|
+
/>
|
|
245
|
+
<base-form-input
|
|
246
|
+
v-if="whichProduct === 'gons'"
|
|
247
|
+
v-model="productConditionsForm.totalAmount7"
|
|
248
|
+
:readonly="true"
|
|
249
|
+
:label="$dataStore.t('productConditionsForm.totalAmount7')"
|
|
250
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
251
|
+
/>
|
|
252
|
+
<base-form-input
|
|
253
|
+
v-if="whichProduct === 'gons'"
|
|
254
|
+
v-model="productConditionsForm.statePremium7"
|
|
255
|
+
:readonly="true"
|
|
256
|
+
:label="$dataStore.t('productConditionsForm.statePremium7')"
|
|
257
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
258
|
+
/>
|
|
259
|
+
<base-form-input
|
|
260
|
+
v-if="hasAgencyPart"
|
|
261
|
+
v-model="productConditionsForm.agentCommission"
|
|
262
|
+
:label="$dataStore.t('productConditionsForm.agencyPart')"
|
|
263
|
+
:readonly="isDisabledAgentCommission"
|
|
264
|
+
:clearable="!isDisabledAgentCommission"
|
|
265
|
+
:rules="$rules.required.concat($rules.numbers, $rules.agentCommission)"
|
|
266
|
+
/>
|
|
267
|
+
<base-panel-input
|
|
268
|
+
v-if="hasProcessGfot"
|
|
269
|
+
v-model="productConditionsForm.processGfot"
|
|
270
|
+
:value="productConditionsForm.processGfot?.nameRu"
|
|
271
|
+
:readonly="isDisabledProcessGfot"
|
|
272
|
+
:clearable="!isDisabledProcessGfot"
|
|
273
|
+
:label="$dataStore.t('productConditionsForm.processGfot')"
|
|
274
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
275
|
+
@append="openPanel($dataStore.t('productConditionsForm.processGfot'), $dataStore.processGfot, 'processGfot', $dataStore.getProcessGfot)"
|
|
276
|
+
/>
|
|
221
277
|
</base-form-section>
|
|
222
|
-
<base-form-section :title="$dataStore.t('calculationAnnuityPayments')"
|
|
278
|
+
<base-form-section v-if="hasAnnuityPayments" :title="$dataStore.t('calculationAnnuityPayments')">
|
|
223
279
|
<base-form-toggle
|
|
224
280
|
v-model="productConditionsForm.additionalConditionAnnuityPayments"
|
|
225
281
|
:title="$dataStore.t('productConditionsForm.guaranteedTermAnnuityPayments')"
|
|
@@ -240,7 +296,7 @@
|
|
|
240
296
|
/>
|
|
241
297
|
<base-panel-input
|
|
242
298
|
v-model="productConditionsForm.typeAnnuityInsurance"
|
|
243
|
-
:value="productConditionsForm.typeAnnuityInsurance
|
|
299
|
+
:value="productConditionsForm.typeAnnuityInsurance?.nameRu"
|
|
244
300
|
:readonly="isDisabled"
|
|
245
301
|
:clearable="!isDisabled"
|
|
246
302
|
:rules="$rules.objectRequired"
|
|
@@ -258,7 +314,7 @@
|
|
|
258
314
|
/>
|
|
259
315
|
<base-panel-input
|
|
260
316
|
v-model="productConditionsForm.periodAnnuityPayment"
|
|
261
|
-
:value="productConditionsForm.periodAnnuityPayment
|
|
317
|
+
:value="productConditionsForm.periodAnnuityPayment?.nameRu"
|
|
262
318
|
:readonly="isDisabled"
|
|
263
319
|
:clearable="!isDisabled"
|
|
264
320
|
:rules="$rules.objectRequired"
|
|
@@ -281,7 +337,135 @@
|
|
|
281
337
|
:label="$dataStore.t('productConditionsForm.amountAnnuityPayments')"
|
|
282
338
|
/>
|
|
283
339
|
</base-form-section>
|
|
284
|
-
<base-form-section v-if="
|
|
340
|
+
<base-form-section v-if="whichProduct === 'lifetrip'" :title="$dataStore.t('generalConditions')">
|
|
341
|
+
<base-panel-input
|
|
342
|
+
v-model="calculatorForm.type"
|
|
343
|
+
:value="calculatorForm.type.nameRu ?? $dataStore.t('form.notChosen')"
|
|
344
|
+
:readonly="isDisabled"
|
|
345
|
+
:clearable="!isDisabled"
|
|
346
|
+
:rules="$rules.objectRequired"
|
|
347
|
+
:label="$dataStore.t('calculatorForm.type')"
|
|
348
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
349
|
+
@append="openPanel($dataStore.t('calculatorForm.type'), [], 'type', $dataStore.getDicTripType)"
|
|
350
|
+
/>
|
|
351
|
+
<base-panel-input
|
|
352
|
+
v-model="calculatorForm.countries"
|
|
353
|
+
:value="calculatorForm?.countries![0]?.nameRu && calculatorForm.countries.length ? countriesComputed : $dataStore.t('form.notChosen')"
|
|
354
|
+
:readonly="isDisabled"
|
|
355
|
+
:clearable="!isDisabled"
|
|
356
|
+
:clear-value="[]"
|
|
357
|
+
:label="$dataStore.t('calculatorForm.countries')"
|
|
358
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
359
|
+
@append="openMultiplePanel($dataStore.t('calculatorForm.countries'), $dataStore.dicAllCountries, 'countries', $dataStore.getDicCountries)"
|
|
360
|
+
/>
|
|
361
|
+
<base-panel-input
|
|
362
|
+
v-model="calculatorForm.amount"
|
|
363
|
+
:value="calculatorForm.amount.nameRu ? calculatorForm.amount.nameRu + $dataStore.currency : $dataStore.t('form.notChosen')"
|
|
364
|
+
:readonly="isDisabled"
|
|
365
|
+
:clearable="!isDisabled"
|
|
366
|
+
:rules="$rules.objectRequired"
|
|
367
|
+
:label="$dataStore.t('calculatorForm.amount')"
|
|
368
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
369
|
+
@append="openPanel($dataStore.t('calculatorForm.amount'), $dataStore.amountArray, 'amount')"
|
|
370
|
+
/>
|
|
371
|
+
<base-panel-input
|
|
372
|
+
v-model="calculatorForm.purpose"
|
|
373
|
+
:value="calculatorForm.purpose.nameRu ?? $dataStore.t('form.notChosen')"
|
|
374
|
+
:readonly="isDisabled"
|
|
375
|
+
:clearable="!isDisabled"
|
|
376
|
+
:rules="$rules.objectRequired"
|
|
377
|
+
:label="$dataStore.t('calculatorForm.purpose')"
|
|
378
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
379
|
+
@append="openPanel($dataStore.t('calculatorForm.purpose'), [], 'purpose', $dataStore.getDicTripPurpose)"
|
|
380
|
+
/>
|
|
381
|
+
<base-panel-input
|
|
382
|
+
v-if="calculatorForm.purpose.code === 'WorkStudy'"
|
|
383
|
+
v-model="calculatorForm.workType"
|
|
384
|
+
:value="calculatorForm.workType.nameRu ?? $dataStore.t('form.notChosen')"
|
|
385
|
+
:readonly="isDisabled"
|
|
386
|
+
:clearable="!isDisabled"
|
|
387
|
+
:rules="$rules.objectRequired"
|
|
388
|
+
:label="$dataStore.t('calculatorForm.workType')"
|
|
389
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
390
|
+
@append="openPanel($dataStore.t('calculatorForm.workType'), [], 'workType', $dataStore.getDicTripWorkType)"
|
|
391
|
+
/>
|
|
392
|
+
<base-panel-input
|
|
393
|
+
v-if="calculatorForm.purpose.code === 'Sport'"
|
|
394
|
+
v-model="calculatorForm.sportsType"
|
|
395
|
+
:value="calculatorForm.sportsType.nameRu ?? $dataStore.t('form.notChosen')"
|
|
396
|
+
:readonly="isDisabled"
|
|
397
|
+
:clearable="!isDisabled"
|
|
398
|
+
:rules="$rules.objectRequired"
|
|
399
|
+
:label="$dataStore.t('calculatorForm.sportsType')"
|
|
400
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
401
|
+
@append="openPanel($dataStore.t('calculatorForm.sportsType'), [], 'sportsType', $dataStore.getDicSportsType)"
|
|
402
|
+
/>
|
|
403
|
+
<base-panel-input
|
|
404
|
+
v-if="calculatorForm.type.code === 'Multiple'"
|
|
405
|
+
v-model="calculatorForm.period"
|
|
406
|
+
:value="calculatorForm.period && calculatorForm.period.nameRu ? calculatorForm.period.nameRu : $dataStore.t('form.notChosen')"
|
|
407
|
+
:readonly="isDisabled"
|
|
408
|
+
:clearable="!isDisabled"
|
|
409
|
+
:rules="$rules.objectRequired"
|
|
410
|
+
:label="$dataStore.t('calculatorForm.period')"
|
|
411
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
412
|
+
@append="openPanel($dataStore.t('calculatorForm.period'), $dataStore.periodArray, 'period')"
|
|
413
|
+
/>
|
|
414
|
+
<base-panel-input
|
|
415
|
+
v-if="calculatorForm.type.code === 'Multiple'"
|
|
416
|
+
v-model="calculatorForm.maxDays"
|
|
417
|
+
:value="calculatorForm.period && calculatorForm.maxDays.nameRu ? calculatorForm.maxDays.nameRu : $dataStore.t('form.notChosen')"
|
|
418
|
+
:readonly="isDisabled"
|
|
419
|
+
:clearable="!isDisabled"
|
|
420
|
+
:rules="$rules.objectRequired"
|
|
421
|
+
:label="$dataStore.t('calculatorForm.maxDays')"
|
|
422
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
423
|
+
@append="openPanel($dataStore.t('calculatorForm.maxDays'), $dataStore.maxDaysFiltered, 'maxDays')"
|
|
424
|
+
/>
|
|
425
|
+
<base-form-input
|
|
426
|
+
v-if="calculatorForm.type.code === 'Single'"
|
|
427
|
+
v-model="calculatorForm.days"
|
|
428
|
+
:readonly="isDisabled || !isCalculator"
|
|
429
|
+
:label="$dataStore.t('calculatorForm.days')"
|
|
430
|
+
:rules="$rules.required"
|
|
431
|
+
/>
|
|
432
|
+
<base-form-input
|
|
433
|
+
v-if="isCalculator && whichProduct === 'lifetrip'"
|
|
434
|
+
v-model="calculatorForm.age"
|
|
435
|
+
:rules="$rules.required"
|
|
436
|
+
:readonly="isDisabledSum"
|
|
437
|
+
:clearable="!isDisabled"
|
|
438
|
+
:label="$dataStore.t('calculatorForm.age')"
|
|
439
|
+
/>
|
|
440
|
+
<base-form-input
|
|
441
|
+
v-if="!isCalculator && whichProduct === 'lifetrip'"
|
|
442
|
+
v-model="calculatorForm.startDate"
|
|
443
|
+
:readonly="isDisabled"
|
|
444
|
+
:clearable="!isDisabled"
|
|
445
|
+
:label="$dataStore.t('calculatorForm.startDate')"
|
|
446
|
+
:rules="$dataStore.rules.required.concat($dataStore.rules.planDate)"
|
|
447
|
+
:maska="$maska.date"
|
|
448
|
+
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
449
|
+
/>
|
|
450
|
+
<base-form-input
|
|
451
|
+
v-if="!isCalculator && calculatorForm.type.code != 'Multiple'"
|
|
452
|
+
v-model="calculatorForm.endDate"
|
|
453
|
+
:readonly="isDisabled"
|
|
454
|
+
:clearable="!isDisabled"
|
|
455
|
+
:label="$dataStore.t('calculatorForm.endDate')"
|
|
456
|
+
:rules="$dataStore.rules.required"
|
|
457
|
+
:maska="$maska.date"
|
|
458
|
+
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
459
|
+
/>
|
|
460
|
+
<base-form-input v-model="calculatorForm.price" :readonly="true" :label="isCalculator ? $dataStore.t('calculatorForm.premium') : $dataStore.t('calculatorForm.price')" />
|
|
461
|
+
</base-form-section>
|
|
462
|
+
<base-form-section v-if="hasDeathInsFromNS" :title="$dataStore.t('generalConditions')">
|
|
463
|
+
<base-form-input v-model="enabled" :readonly="true" :clearable="false" :label="$dataStore.t('form.deathInsFromNS')" />
|
|
464
|
+
</base-form-section>
|
|
465
|
+
<base-form-section v-if="hasDeathInsAnyReason" :title="$dataStore.t('generalConditions')">
|
|
466
|
+
<base-form-input v-model="enabled" :readonly="true" :clearable="false" :label="$dataStore.t('form.deathInsAnyReason')" />
|
|
467
|
+
</base-form-section>
|
|
468
|
+
<base-form-section v-if="isShownAdditionalTerms && additionalTerms && additionalTerms.length" :title="$dataStore.t('productConditionsForm.additional')">
|
|
285
469
|
<div v-for="(term, index) of additionalTerms" :key="index">
|
|
286
470
|
<base-panel-input
|
|
287
471
|
v-if="filterTermConditions(term)"
|
|
@@ -289,15 +473,21 @@
|
|
|
289
473
|
:value="term.coverSumName"
|
|
290
474
|
:readonly="isTermsDisabled"
|
|
291
475
|
:clearable="false"
|
|
292
|
-
:label="term
|
|
476
|
+
:label="coverTypeName(term)"
|
|
293
477
|
append-inner-icon="mdi mdi-chevron-right"
|
|
294
|
-
:suffix="
|
|
295
|
-
|
|
478
|
+
:suffix="
|
|
479
|
+
(whichProduct === 'lifebusiness' || whichProduct === 'gns') && term.coverTypeCode === 6
|
|
480
|
+
? String(term.coverPeriodName ?? '')
|
|
481
|
+
: !!term.amount
|
|
482
|
+
? `${formatTermValue(term.amount)} ${currencySymbolsAddTerm}`
|
|
483
|
+
: ''
|
|
484
|
+
"
|
|
485
|
+
@append="openTermPanel(coverTypeName(term), $dataStore.getAdditionalInsuranceTermsAnswers, term.coverTypeId, index)"
|
|
296
486
|
/>
|
|
297
487
|
</div>
|
|
298
488
|
</base-form-section>
|
|
299
489
|
</v-form>
|
|
300
|
-
<base-btn v-if="!$dataStore.isCalculator &&
|
|
490
|
+
<base-btn v-if="!$dataStore.isCalculator && isCalculator && hasCalculated" :btn="$styles.greenLightBtn" :text="$dataStore.t('buttons.toStatement')" @click="toStatement" />
|
|
301
491
|
<base-btn
|
|
302
492
|
v-if="$dataStore.isCalculator ? true : !isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter())"
|
|
303
493
|
:loading="isCalculating"
|
|
@@ -305,10 +495,10 @@
|
|
|
305
495
|
@click="submitForm"
|
|
306
496
|
/>
|
|
307
497
|
<div v-if="$dataStore.isTask() && $dataStore.isUnderwriter() && !isRecalculationDisabled" class="flex gap-3">
|
|
308
|
-
<base-btn :text="$dataStore.t('buttons.calcSum')" type="submit" @click.prevent="underwriterCalculate('sum')" :loading="isCalculating" />
|
|
498
|
+
<base-btn :text="$dataStore.t('buttons.calcSum')" v-if="hasCalcSum" type="submit" @click.prevent="underwriterCalculate('sum')" :loading="isCalculating" />
|
|
309
499
|
<base-btn :text="$dataStore.t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
|
|
310
500
|
</div>
|
|
311
|
-
<Teleport v-if="isPanelOpen" to="#panel-actions">
|
|
501
|
+
<Teleport v-if="isPanelOpen" to="#right-panel-actions">
|
|
312
502
|
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
313
503
|
<base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
314
504
|
<div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
@@ -324,30 +514,59 @@
|
|
|
324
514
|
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
|
|
325
515
|
</div>
|
|
326
516
|
</Teleport>
|
|
327
|
-
<Teleport v-if="
|
|
517
|
+
<Teleport v-if="isMultiplePanelOpen && calculatorForm.countries !== null" to="#right-panel-actions">
|
|
328
518
|
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
329
519
|
<base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
330
|
-
<
|
|
520
|
+
<v-fade-transition>
|
|
521
|
+
<base-form-section v-if="countriesComputed" class="w-[95%]" :title="$dataStore.t('calculatorForm.selectedCountries')">
|
|
522
|
+
<base-white-block class="text-center" :class="[$styles.textSimple]"> {{ countriesComputed }} </base-white-block>
|
|
523
|
+
</base-form-section>
|
|
524
|
+
</v-fade-transition>
|
|
525
|
+
<div v-if="multiplePanelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
526
|
+
<base-panel-select-item :text="$dataStore.t('buttons.clearOrReset')" @click="calculatorForm.countries = []" false-icon="mdi-close-circle-outline" />
|
|
331
527
|
<base-panel-select-item
|
|
332
|
-
v-for="(item, index) of
|
|
528
|
+
v-for="(item, index) of multiplePanelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
|
|
333
529
|
:key="index"
|
|
334
530
|
:text="(item.nameRu as string)"
|
|
335
|
-
:selected="
|
|
336
|
-
|
|
531
|
+
:selected="calculatorForm.countries && calculatorForm.countries.some(option => option.id === item.id)"
|
|
532
|
+
:disabled="calculatorForm.countries.length >= 3 && !calculatorForm.countries.some(option => option.id === item.id)"
|
|
533
|
+
true-icon="mdi-check-circle-outline"
|
|
534
|
+
@click="selectOption(item)"
|
|
337
535
|
/>
|
|
338
536
|
</div>
|
|
339
537
|
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
|
|
340
538
|
</div>
|
|
341
539
|
</Teleport>
|
|
540
|
+
<Teleport v-if="isTermsPanelOpen" to="#right-panel-actions">
|
|
541
|
+
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
542
|
+
<base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
543
|
+
<div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
544
|
+
<div v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))">
|
|
545
|
+
<v-expansion-panels v-if="panelCodeList.includes(String(item.code)) && (whichProduct === 'lifebusiness' || whichProduct === 'gns')" variant="accordion">
|
|
546
|
+
<v-expansion-panel class="hover:bg-[#f5f8fd]" elevation="0" bg-color="#F3F6FC">
|
|
547
|
+
<v-expansion-panel-title @click="pickTermValue(item)">
|
|
548
|
+
{{ item.nameRu }}
|
|
549
|
+
</v-expansion-panel-title>
|
|
550
|
+
<v-expansion-panel-text class="border-t-[1px] border-t-white cursor-pointer" :class="[$styles.textSimple]" v-for="(i, idx) of subPanelList">
|
|
551
|
+
<base-panel-select-item class="!p-0" :key="idx" :text="(i.nameRu as string)" :selected="i.code === subTermValue" @click="pickSubTermValue(item, i)" />
|
|
552
|
+
</v-expansion-panel-text>
|
|
553
|
+
</v-expansion-panel>
|
|
554
|
+
</v-expansion-panels>
|
|
555
|
+
<base-panel-select-item v-else :key="index" :text="(item.nameRu as string)" :selected="item.nameRu === termValue?.coverSumName" @click="pickTermValue(item)" />
|
|
556
|
+
</div>
|
|
557
|
+
</div>
|
|
558
|
+
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
|
|
559
|
+
</div>
|
|
560
|
+
</Teleport>
|
|
342
561
|
</section>
|
|
343
562
|
</template>
|
|
344
563
|
|
|
345
564
|
<script lang="ts">
|
|
346
|
-
import { Member, Value } from '../../composables/classes';
|
|
565
|
+
import { Member, Value, CountryValue, CalculatorForm } from '../../composables/classes';
|
|
347
566
|
|
|
348
567
|
export default defineComponent({
|
|
349
568
|
props: {
|
|
350
|
-
|
|
569
|
+
isCalculator: {
|
|
351
570
|
type: Boolean,
|
|
352
571
|
default: false,
|
|
353
572
|
},
|
|
@@ -371,16 +590,34 @@ export default defineComponent({
|
|
|
371
590
|
const isTermsPanelOpen = ref<boolean>(false);
|
|
372
591
|
const panelValue = ref<Value>(new Value());
|
|
373
592
|
const termValue = ref<AddCover>();
|
|
593
|
+
const subTermValue = ref<string>('');
|
|
374
594
|
const panelList = ref<Value[]>([]);
|
|
595
|
+
const subPanelList = ref<AddCoverAnswer[] | Value[]>([]);
|
|
375
596
|
const productConditionsForm = formStore.productConditionsForm;
|
|
376
597
|
const currentPanel = ref<keyof typeof productConditionsForm>();
|
|
377
598
|
const currentIndex = ref<number>();
|
|
378
599
|
const searchQuery = ref<string>('');
|
|
379
600
|
const whichSum = ref<'insurancePremiumPerMonth' | 'requestedSumInsured' | ''>('');
|
|
601
|
+
const panelCodeList = ['processcovertypesum', 'fixedinssum'];
|
|
602
|
+
const enabled = 'включено';
|
|
380
603
|
|
|
381
604
|
const additionalTerms = ref<AddCover[]>([]);
|
|
605
|
+
|
|
606
|
+
const isShownAdditionalTerms = computed(() => {
|
|
607
|
+
if (whichProduct.value === 'gons') {
|
|
608
|
+
return false;
|
|
609
|
+
}
|
|
610
|
+
return true;
|
|
611
|
+
});
|
|
612
|
+
|
|
613
|
+
const isMultiplePanelOpen = ref<boolean>(false);
|
|
614
|
+
|
|
615
|
+
const multiplePanelValue = ref<CountryValue>(new CountryValue());
|
|
616
|
+
const multiplePanelList = ref<CountryValue[]>([]);
|
|
617
|
+
const calculatorForm = productConditionsForm.calculatorForm;
|
|
618
|
+
|
|
382
619
|
const isUnderwriterForm = computed(() => {
|
|
383
|
-
if (route.params.taskId === '0 ' || props.
|
|
620
|
+
if (route.params.taskId === '0 ' || props.isCalculator === true) {
|
|
384
621
|
return false;
|
|
385
622
|
} else {
|
|
386
623
|
return formStore.applicationData.statusCode === 'UnderwriterForm';
|
|
@@ -388,20 +625,45 @@ export default defineComponent({
|
|
|
388
625
|
});
|
|
389
626
|
const isDisabled = computed(() => (dataStore.isCalculator ? false : !memberStore.isStatementEditible('productConditionsForm')));
|
|
390
627
|
const isTermsDisabled = computed(() => {
|
|
391
|
-
if (
|
|
628
|
+
if (whichProduct.value === 'gons') {
|
|
392
629
|
return true;
|
|
393
630
|
}
|
|
631
|
+
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && dataStore.isUnderwriter()) {
|
|
632
|
+
return false;
|
|
633
|
+
}
|
|
394
634
|
return isDisabled.value;
|
|
395
635
|
});
|
|
396
|
-
const isTask = computed(() => (route.params.taskId === '0' && props.
|
|
397
|
-
const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm);
|
|
636
|
+
const isTask = computed(() => (route.params.taskId === '0' && props.isCalculator === true) || dataStore.isTask());
|
|
637
|
+
const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm || formStore.canBeClaimed === true);
|
|
398
638
|
const isUnderwriterRole = computed(() => dataStore.isUnderwriter() || dataStore.isAdmin() || dataStore.isSupport());
|
|
399
|
-
const
|
|
400
|
-
const
|
|
401
|
-
|
|
639
|
+
const insurancePremiumPerMonthRule = computed(() => (!!productConditionsForm.insurancePremiumPerMonth ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
640
|
+
const insurancePremiumPerMonthDisabled = computed(() => {
|
|
641
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
642
|
+
return true;
|
|
643
|
+
}
|
|
644
|
+
if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
|
|
645
|
+
return false;
|
|
646
|
+
}
|
|
647
|
+
return isDisabled.value;
|
|
648
|
+
});
|
|
649
|
+
const requestedSumInsuredRule = computed(() => (!!productConditionsForm.requestedSumInsured ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
650
|
+
const fixInsSumRule = computed(() => (!!productConditionsForm.fixInsSum ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
402
651
|
const amountAnnuityPayments = computed(() => (!!productConditionsForm.amountAnnuityPayments ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
652
|
+
const hasCalculated = computed(() => {
|
|
653
|
+
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && productConditionsForm.requestedSumInsured === null) {
|
|
654
|
+
return !!productConditionsForm.insurancePremiumPerMonth;
|
|
655
|
+
}
|
|
656
|
+
return !!productConditionsForm.requestedSumInsured && !!productConditionsForm.insurancePremiumPerMonth;
|
|
657
|
+
});
|
|
403
658
|
const hasProcessIndexRate = computed(() => {
|
|
404
|
-
if (
|
|
659
|
+
if (
|
|
660
|
+
whichProduct.value === 'gons' ||
|
|
661
|
+
whichProduct.value === 'halykkazyna' ||
|
|
662
|
+
whichProduct.value === 'liferenta' ||
|
|
663
|
+
whichProduct.value === 'lifebusiness' ||
|
|
664
|
+
whichProduct.value === 'amuletlife' ||
|
|
665
|
+
whichProduct.value === 'gns'
|
|
666
|
+
) {
|
|
405
667
|
return false;
|
|
406
668
|
}
|
|
407
669
|
return true;
|
|
@@ -436,6 +698,24 @@ export default defineComponent({
|
|
|
436
698
|
}
|
|
437
699
|
return true;
|
|
438
700
|
});
|
|
701
|
+
const readonlyLifeAdditive = computed(() => {
|
|
702
|
+
if (whichProduct.value === 'gons') {
|
|
703
|
+
return true;
|
|
704
|
+
}
|
|
705
|
+
return isRecalculationDisabled.value;
|
|
706
|
+
});
|
|
707
|
+
const readonlyDisabilityMultiply = computed(() => {
|
|
708
|
+
if (whichProduct.value === 'gons') {
|
|
709
|
+
return true;
|
|
710
|
+
}
|
|
711
|
+
return isRecalculationDisabled.value;
|
|
712
|
+
});
|
|
713
|
+
const readonlyDisabilityAdditive = computed(() => {
|
|
714
|
+
if (whichProduct.value === 'gons') {
|
|
715
|
+
return true;
|
|
716
|
+
}
|
|
717
|
+
return isRecalculationDisabled.value;
|
|
718
|
+
});
|
|
439
719
|
const hasAdbAdditive = computed(() => {
|
|
440
720
|
if (whichProduct.value === 'gons') {
|
|
441
721
|
return false;
|
|
@@ -454,6 +734,30 @@ export default defineComponent({
|
|
|
454
734
|
}
|
|
455
735
|
return false;
|
|
456
736
|
});
|
|
737
|
+
const hasBirthDate = computed(() => {
|
|
738
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
739
|
+
return false;
|
|
740
|
+
}
|
|
741
|
+
return true;
|
|
742
|
+
});
|
|
743
|
+
const hasGender = computed(() => {
|
|
744
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
745
|
+
return false;
|
|
746
|
+
}
|
|
747
|
+
return true;
|
|
748
|
+
});
|
|
749
|
+
const hasAgencyPart = computed(() => {
|
|
750
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
751
|
+
return true;
|
|
752
|
+
}
|
|
753
|
+
return false;
|
|
754
|
+
});
|
|
755
|
+
const hasProcessGfot = computed(() => {
|
|
756
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
757
|
+
return true;
|
|
758
|
+
}
|
|
759
|
+
return false;
|
|
760
|
+
});
|
|
457
761
|
const coverPeriodRule = computed(() => {
|
|
458
762
|
const baseCondition = dataStore.rules.required.concat(dataStore.rules.numbers);
|
|
459
763
|
if (whichProduct.value === 'gons') {
|
|
@@ -462,6 +766,9 @@ export default defineComponent({
|
|
|
462
766
|
if (whichProduct.value === 'halykkazyna') {
|
|
463
767
|
return baseCondition.concat(dataStore.rules.coverPeriodFrom2to20);
|
|
464
768
|
}
|
|
769
|
+
if (whichProduct.value === 'amuletlife') {
|
|
770
|
+
return baseCondition.concat(dataStore.rules.coverPeriodFrom1or5to15);
|
|
771
|
+
}
|
|
465
772
|
return baseCondition;
|
|
466
773
|
});
|
|
467
774
|
const currencySymbolsAddTerm = computed(() => {
|
|
@@ -474,30 +781,135 @@ export default defineComponent({
|
|
|
474
781
|
if (whichProduct.value === 'halykkazyna') {
|
|
475
782
|
return dataStore.t('productConditionsForm.requestedSumInsuredInTenge');
|
|
476
783
|
}
|
|
784
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
785
|
+
return dataStore.t('productConditionsForm.totalRequestedSumInsured');
|
|
786
|
+
}
|
|
477
787
|
return dataStore.t('productConditionsForm.requestedSumInsured');
|
|
478
788
|
});
|
|
789
|
+
const coverPeriodLabel = computed(() => {
|
|
790
|
+
if (whichProduct.value === 'gons') {
|
|
791
|
+
return dataStore.t('productConditionsForm.coverPeriodFrom3to20');
|
|
792
|
+
}
|
|
793
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
794
|
+
return dataStore.t('productConditionsForm.coverPeriodMonth');
|
|
795
|
+
}
|
|
796
|
+
return dataStore.t('productConditionsForm.coverPeriod');
|
|
797
|
+
});
|
|
798
|
+
const insurancePremiumPerMonthLabel = computed(() => {
|
|
799
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
800
|
+
return dataStore.t('productConditionsForm.totalInsurancePremiumAmountWithCommission');
|
|
801
|
+
}
|
|
802
|
+
return dataStore.t('productConditionsForm.insurancePremiumAmount');
|
|
803
|
+
});
|
|
804
|
+
const isDisabledFixInsSum = computed(() => {
|
|
805
|
+
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && productConditionsForm.processGfot.id !== null) {
|
|
806
|
+
return true;
|
|
807
|
+
}
|
|
808
|
+
if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
|
|
809
|
+
return false;
|
|
810
|
+
}
|
|
811
|
+
return isDisabled.value;
|
|
812
|
+
});
|
|
479
813
|
const isDisabledSum = computed(() => {
|
|
480
814
|
if (whichProduct.value === 'halykkazyna') {
|
|
481
815
|
return true;
|
|
482
816
|
}
|
|
817
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
818
|
+
return true;
|
|
819
|
+
}
|
|
820
|
+
if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
|
|
821
|
+
return false;
|
|
822
|
+
}
|
|
483
823
|
return isDisabled.value;
|
|
484
824
|
});
|
|
485
825
|
const isDisabledSumDollar = computed(() => {
|
|
486
826
|
if (whichProduct.value === 'halykkazyna') {
|
|
487
827
|
return true;
|
|
488
828
|
}
|
|
829
|
+
if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
|
|
830
|
+
return false;
|
|
831
|
+
}
|
|
832
|
+
return isDisabled.value;
|
|
833
|
+
});
|
|
834
|
+
const countriesComputed = computed(() => {
|
|
835
|
+
let message = '';
|
|
836
|
+
for (let country in calculatorForm.countries) {
|
|
837
|
+
message += calculatorForm.countries[country as any].nameRu + ', ';
|
|
838
|
+
}
|
|
839
|
+
return message.slice(0, -2);
|
|
840
|
+
});
|
|
841
|
+
const isDisabledCoverPeriod = computed(() => {
|
|
842
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
843
|
+
return true;
|
|
844
|
+
}
|
|
489
845
|
return isDisabled.value;
|
|
490
846
|
});
|
|
847
|
+
const hasDefault = computed(() => {
|
|
848
|
+
if (whichProduct.value === 'lifetrip') {
|
|
849
|
+
return false;
|
|
850
|
+
}
|
|
851
|
+
return true;
|
|
852
|
+
});
|
|
853
|
+
const isDisabledProcessGfot = computed(() => {
|
|
854
|
+
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && !!productConditionsForm.fixInsSum) {
|
|
855
|
+
return true;
|
|
856
|
+
}
|
|
857
|
+
if (dataStore.isUnderwriter()) {
|
|
858
|
+
return false;
|
|
859
|
+
}
|
|
860
|
+
return isDisabled.value;
|
|
861
|
+
});
|
|
862
|
+
const isDisabledAgentCommission = computed(() => {
|
|
863
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns' || dataStore.isUnderwriter()) {
|
|
864
|
+
return false;
|
|
865
|
+
}
|
|
866
|
+
return isDisabled.value;
|
|
867
|
+
});
|
|
868
|
+
const hasCalcSum = computed(() => {
|
|
869
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
870
|
+
return false;
|
|
871
|
+
}
|
|
872
|
+
return true;
|
|
873
|
+
});
|
|
874
|
+
const hasFixInsSum = computed(() => {
|
|
875
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
876
|
+
return true;
|
|
877
|
+
}
|
|
878
|
+
return false;
|
|
879
|
+
});
|
|
880
|
+
const hasDeathInsFromNS = computed(() => {
|
|
881
|
+
if (whichProduct.value === 'gns') {
|
|
882
|
+
return true;
|
|
883
|
+
}
|
|
884
|
+
return false;
|
|
885
|
+
});
|
|
886
|
+
const hasDeathInsAnyReason = computed(() => {
|
|
887
|
+
if (whichProduct.value === 'lifebusiness') {
|
|
888
|
+
return true;
|
|
889
|
+
}
|
|
890
|
+
return false;
|
|
891
|
+
});
|
|
892
|
+
const defaultText = computed(() => {
|
|
893
|
+
if (whichProduct.value === 'gns' || whichProduct.value === 'lifebusiness') {
|
|
894
|
+
return dataStore.t('clients.form.calculation');
|
|
895
|
+
}
|
|
896
|
+
return dataStore.t('generalConditions');
|
|
897
|
+
});
|
|
491
898
|
|
|
492
899
|
const formatTermValue = (term: number) => {
|
|
493
900
|
if (term !== null) {
|
|
494
|
-
|
|
901
|
+
const termNumber = Number(term);
|
|
902
|
+
return Number.isInteger(termNumber) ? dataStore.getNumberWithSpaces(termNumber) : dataStore.getNumberWithDot(termNumber);
|
|
495
903
|
}
|
|
496
904
|
return null;
|
|
497
905
|
};
|
|
498
906
|
|
|
499
907
|
const toStatement = async () => {
|
|
500
908
|
const statementItem = dataStore.menuItems.find(i => i.id === 'statement');
|
|
909
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
910
|
+
await router.push({ name: 'taskId-NewApp', params: route.params, query: { tab: 'statement' } });
|
|
911
|
+
return;
|
|
912
|
+
}
|
|
501
913
|
if (statementItem) {
|
|
502
914
|
dataStore.menu.selectedItem = statementItem;
|
|
503
915
|
await router.replace({
|
|
@@ -511,30 +923,112 @@ export default defineComponent({
|
|
|
511
923
|
};
|
|
512
924
|
|
|
513
925
|
const pickPanelValue = (item: Value) => {
|
|
514
|
-
dataStore.
|
|
926
|
+
dataStore.rightPanel.open = false;
|
|
515
927
|
isPanelOpen.value = false;
|
|
928
|
+
isMultiplePanelOpen.value = false;
|
|
929
|
+
if (item.id === null) {
|
|
930
|
+
calculatorForm.countries = [];
|
|
931
|
+
}
|
|
516
932
|
if (!currentPanel.value) return;
|
|
517
|
-
|
|
518
|
-
|
|
933
|
+
if (whichProduct.value === 'lifetrip') {
|
|
934
|
+
// @ts-ignore
|
|
935
|
+
calculatorForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
936
|
+
} else {
|
|
937
|
+
// @ts-ignore
|
|
938
|
+
productConditionsForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
939
|
+
}
|
|
519
940
|
};
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
941
|
+
const selectOption = (value: CountryValue) => {
|
|
942
|
+
if (calculatorForm.countries !== null) {
|
|
943
|
+
if (value.id == 0) {
|
|
944
|
+
calculatorForm.countries = [];
|
|
945
|
+
return (dataStore.dicCountries = dataStore.dicAllCountries);
|
|
946
|
+
}
|
|
947
|
+
if (calculatorForm.countries.some((option: CountryValue) => option.id == value.id)) {
|
|
948
|
+
calculatorForm.countries = calculatorForm.countries.filter((obj: CountryValue) => obj.id !== value.id);
|
|
949
|
+
dataStore.dicCountries = dataStore.dicAllCountries;
|
|
950
|
+
} else {
|
|
951
|
+
dataStore.dicCountries = dataStore.dicAllCountries.filter(i =>
|
|
952
|
+
i.id == 0 || (value.countryTypeCode == '1' && i.countryTypeCode == value.countryTypeCode) || (value.countryTypeCode != '1' && i.countryTypeCode != '1') ? true : false,
|
|
953
|
+
);
|
|
954
|
+
if (value.countryTypeCode == 1) {
|
|
955
|
+
dataStore.showToaster('success', dataStore.t('toaster.shengenZoneCondition'), 3000);
|
|
956
|
+
formStore.insuredForm.length = 1;
|
|
957
|
+
}
|
|
958
|
+
if (calculatorForm.countries.length < 3) {
|
|
959
|
+
calculatorForm.countries.push(value);
|
|
960
|
+
} else if (calculatorForm.countries.length >= 3) {
|
|
961
|
+
closeMultiplePanel();
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
};
|
|
966
|
+
const pickTermValue = async (item: Value) => {
|
|
967
|
+
if (!panelCodeList.includes(item.code as string)) {
|
|
968
|
+
dataStore.rightPanel.open = false;
|
|
969
|
+
isTermsPanelOpen.value = false;
|
|
970
|
+
}
|
|
524
971
|
if (typeof currentIndex.value !== 'number') return;
|
|
972
|
+
|
|
973
|
+
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && item.code === 'processcovertypesum') {
|
|
974
|
+
if (item.id !== additionalTerms.value[currentIndex.value].coverSumId) {
|
|
975
|
+
additionalTerms.value[currentIndex.value].coverPeriodCode = null;
|
|
976
|
+
additionalTerms.value[currentIndex.value].coverPeriodId = null;
|
|
977
|
+
additionalTerms.value[currentIndex.value].coverPeriodName = null;
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
|
|
525
981
|
additionalTerms.value[currentIndex.value].coverSumId = item.id as string;
|
|
526
982
|
additionalTerms.value[currentIndex.value].coverSumName = item.nameRu as string;
|
|
983
|
+
|
|
984
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
985
|
+
if (termValue.value && item.code === 'fixedinssum') {
|
|
986
|
+
if (termValue.value.coverTypeCode === 11) {
|
|
987
|
+
subPanelList.value = constants.fixInsAmount.slice(0, 5);
|
|
988
|
+
} else {
|
|
989
|
+
subPanelList.value = constants.fixInsAmount;
|
|
990
|
+
}
|
|
991
|
+
subTermValue.value = String(termValue.value.amount);
|
|
992
|
+
} else {
|
|
993
|
+
additionalTerms.value[currentIndex.value].amount = 0;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
if (termValue.value && termValue.value.coverTypeCode === 6 && item.code === 'processcovertypesum') {
|
|
997
|
+
const response = await dataStore.getProcessCoverTypePeriod(termValue.value.coverTypeId);
|
|
998
|
+
if (response) {
|
|
999
|
+
subPanelList.value = response;
|
|
1000
|
+
subTermValue.value = termValue.value.coverPeriodCode as string;
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
if (termValue.value && termValue.value.coverTypeCode === 6 && item.code !== 'processcovertypesum') {
|
|
1005
|
+
additionalTerms.value[currentIndex.value].coverPeriodCode = null;
|
|
1006
|
+
additionalTerms.value[currentIndex.value].coverPeriodId = null;
|
|
1007
|
+
additionalTerms.value[currentIndex.value].coverPeriodName = null;
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
527
1010
|
};
|
|
528
1011
|
|
|
529
1012
|
const openPanel = async (title: string, list: Value[], key: string, asyncFunction?: Function, filterKey?: string) => {
|
|
530
|
-
if (!isDisabled.value || (key === 'riskGroup' && !isRecalculationDisabled.value)) {
|
|
1013
|
+
if (!isDisabled.value || (key === 'riskGroup' && !isRecalculationDisabled.value) || (key === 'processGfot' && !isDisabledProcessGfot.value)) {
|
|
1014
|
+
if (key === 'amount') {
|
|
1015
|
+
if (calculatorForm.type.nameRu === null || !calculatorForm.countries || (calculatorForm.countries && calculatorForm.countries.length === 0)) {
|
|
1016
|
+
return dataStore.showToaster('error', dataStore.t('toaster.noAmountBeforeTypeAndCountries'), 2000);
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
if (key === 'maxDays') {
|
|
1020
|
+
if (calculatorForm.period.code === null) {
|
|
1021
|
+
return dataStore.showToaster('error', dataStore.t('toaster.noMaxDaysBeforePeriod'), 2000);
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
531
1024
|
searchQuery.value = '';
|
|
532
1025
|
currentPanel.value = key as keyof typeof productConditionsForm;
|
|
533
1026
|
isPanelOpen.value = true;
|
|
534
1027
|
isTermsPanelOpen.value = false;
|
|
535
1028
|
dataStore.panelAction = null;
|
|
536
|
-
dataStore.
|
|
537
|
-
dataStore.
|
|
1029
|
+
dataStore.rightPanel.open = true;
|
|
1030
|
+
dataStore.rightPanel.title = title;
|
|
1031
|
+
isMultiplePanelOpen.value = false;
|
|
538
1032
|
|
|
539
1033
|
let newList = list;
|
|
540
1034
|
if (asyncFunction) {
|
|
@@ -542,32 +1036,73 @@ export default defineComponent({
|
|
|
542
1036
|
newList = await asyncFunction(filterKey, formStore.productConditionsFormKey);
|
|
543
1037
|
}
|
|
544
1038
|
panelList.value = filterList(newList, key);
|
|
545
|
-
|
|
546
|
-
|
|
1039
|
+
if (whichProduct.value === 'lifetrip') {
|
|
1040
|
+
// @ts-ignore
|
|
1041
|
+
panelValue.value = calculatorForm[currentPanel.value];
|
|
1042
|
+
} else {
|
|
1043
|
+
// @ts-ignore
|
|
1044
|
+
panelValue.value = productConditionsForm[currentPanel.value];
|
|
1045
|
+
}
|
|
547
1046
|
isPanelLoading.value = false;
|
|
548
1047
|
} else {
|
|
549
1048
|
dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
|
|
550
1049
|
}
|
|
551
1050
|
};
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
1051
|
+
const openMultiplePanel = async (title: string, list: CountryValue[], key: string, asyncFunction?: Function, filterKey?: string) => {
|
|
1052
|
+
if (!isDisabled.value || !isRecalculationDisabled.value) {
|
|
1053
|
+
isPanelOpen.value = false;
|
|
1054
|
+
isMultiplePanelOpen.value = true;
|
|
1055
|
+
isPanelLoading.value = true;
|
|
1056
|
+
let newList = list;
|
|
1057
|
+
if (asyncFunction !== null) {
|
|
1058
|
+
// @ts-ignore
|
|
1059
|
+
newList = await asyncFunction(filterKey, formStore.productConditionsFormKey);
|
|
1060
|
+
}
|
|
1061
|
+
if (newList[0].nameRu !== null) {
|
|
1062
|
+
// @ts-ignore
|
|
1063
|
+
newList.unshift(new CountryValue(0, null));
|
|
557
1064
|
}
|
|
1065
|
+
|
|
1066
|
+
dataStore.panelAction = null;
|
|
1067
|
+
dataStore.rightPanel.open = true;
|
|
1068
|
+
dataStore.rightPanel.title = title;
|
|
1069
|
+
|
|
1070
|
+
// @ts-ignore
|
|
1071
|
+
multiplePanelList.value = filterList(newList, key);
|
|
1072
|
+
// @ts-ignore
|
|
1073
|
+
multiplePanelValue.value = calculatorForm[currentPanel.value];
|
|
1074
|
+
isPanelLoading.value = false;
|
|
1075
|
+
} else {
|
|
1076
|
+
dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'), 2000);
|
|
558
1077
|
}
|
|
1078
|
+
};
|
|
1079
|
+
const closeMultiplePanel = (item?: CountryValue) => {
|
|
1080
|
+
dataStore.rightPanel.open = false;
|
|
1081
|
+
isMultiplePanelOpen.value = false;
|
|
1082
|
+
if (!currentPanel.value) return;
|
|
1083
|
+
// @ts-ignore
|
|
1084
|
+
calculatorForm[currentPanel.value] = item?.nameRu === null ? new Value() : item;
|
|
1085
|
+
};
|
|
1086
|
+
|
|
1087
|
+
const filterList = (list: Value[], key: string) => {
|
|
1088
|
+
// if (whichProduct.value === 'baiterek') {
|
|
1089
|
+
// if (dataStore.isManagerHalykBank()) {
|
|
1090
|
+
// if (key === 'paymentPeriod') return list.filter(i => i.code !== 'single');
|
|
1091
|
+
// }
|
|
1092
|
+
// }
|
|
559
1093
|
return list;
|
|
560
1094
|
};
|
|
561
1095
|
|
|
562
1096
|
const openTermPanel = async (title: string, asyncFunction: Function, questionId: string, index: number) => {
|
|
563
|
-
if (!isDisabled.value) {
|
|
1097
|
+
if (!isDisabled.value || ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && dataStore.isUnderwriter())) {
|
|
564
1098
|
searchQuery.value = '';
|
|
565
1099
|
currentIndex.value = index;
|
|
566
1100
|
isPanelOpen.value = false;
|
|
1101
|
+
isMultiplePanelOpen.value = false;
|
|
567
1102
|
isTermsPanelOpen.value = true;
|
|
568
1103
|
dataStore.panelAction = null;
|
|
569
|
-
dataStore.
|
|
570
|
-
dataStore.
|
|
1104
|
+
dataStore.rightPanel.open = true;
|
|
1105
|
+
dataStore.rightPanel.title = title;
|
|
571
1106
|
|
|
572
1107
|
let newList;
|
|
573
1108
|
if (asyncFunction) {
|
|
@@ -583,6 +1118,23 @@ export default defineComponent({
|
|
|
583
1118
|
}
|
|
584
1119
|
};
|
|
585
1120
|
|
|
1121
|
+
const pickSubTermValue = (item: any, subItem: any) => {
|
|
1122
|
+
dataStore.rightPanel.open = false;
|
|
1123
|
+
isTermsPanelOpen.value = false;
|
|
1124
|
+
subTermValue.value = item.code as string;
|
|
1125
|
+
if (typeof currentIndex.value !== 'number') return;
|
|
1126
|
+
|
|
1127
|
+
if (item.code === 'fixedinssum') {
|
|
1128
|
+
additionalTerms.value[currentIndex.value].amount = Number(subItem.code);
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
if (item.code === 'processcovertypesum') {
|
|
1132
|
+
additionalTerms.value[currentIndex.value].coverPeriodCode = subItem.code as string;
|
|
1133
|
+
additionalTerms.value[currentIndex.value].coverPeriodId = subItem.id as string;
|
|
1134
|
+
additionalTerms.value[currentIndex.value].coverPeriodName = subItem.nameRu as string;
|
|
1135
|
+
}
|
|
1136
|
+
};
|
|
1137
|
+
|
|
586
1138
|
const underwriterCalculate = async (type: 'sum' | 'premium') => {
|
|
587
1139
|
if (!type) return;
|
|
588
1140
|
if (type === 'sum') {
|
|
@@ -645,6 +1197,15 @@ export default defineComponent({
|
|
|
645
1197
|
}
|
|
646
1198
|
};
|
|
647
1199
|
|
|
1200
|
+
const onInputFixInsSum = (event: Event) => {
|
|
1201
|
+
if (event.target && 'value' in event.target && event.target.value) {
|
|
1202
|
+
const calculatedFixInsSum = getNumber(event.target.value as string);
|
|
1203
|
+
if (calculatedFixInsSum) {
|
|
1204
|
+
productConditionsForm.fixInsSum = dataStore.getNumberWithSpaces(productConditionsForm.fixInsSum);
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
};
|
|
1208
|
+
|
|
648
1209
|
const onInputSumDollar = (event: Event) => {
|
|
649
1210
|
if (event.target && 'value' in event.target && event.target.value && dataStore.currencies.usd) {
|
|
650
1211
|
whichSum.value = 'requestedSumInsured';
|
|
@@ -682,6 +1243,12 @@ export default defineComponent({
|
|
|
682
1243
|
productConditionsForm.requestedSumInsuredInDollar = null;
|
|
683
1244
|
productConditionsForm.insurancePremiumPerMonth = null;
|
|
684
1245
|
productConditionsForm.insurancePremiumPerMonthInDollar = null;
|
|
1246
|
+
if (whichProduct.value === 'lifetrip') {
|
|
1247
|
+
Object.keys(calculatorForm).forEach(key => {
|
|
1248
|
+
//@ts-ignore
|
|
1249
|
+
calculatorForm[key] = new CalculatorForm()[key];
|
|
1250
|
+
});
|
|
1251
|
+
}
|
|
685
1252
|
};
|
|
686
1253
|
|
|
687
1254
|
const filterTermConditions = (term: AddCover) => {
|
|
@@ -691,88 +1258,123 @@ export default defineComponent({
|
|
|
691
1258
|
return true;
|
|
692
1259
|
};
|
|
693
1260
|
|
|
1261
|
+
const coverTypeName = (term: AddCover) => {
|
|
1262
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1263
|
+
return String(term.coverTypeNameRu);
|
|
1264
|
+
}
|
|
1265
|
+
return term.coverTypeName;
|
|
1266
|
+
};
|
|
1267
|
+
|
|
694
1268
|
const submitForm = async () => {
|
|
695
1269
|
vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
696
1270
|
if (v.valid) {
|
|
697
|
-
if (
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
1271
|
+
if (whichProduct.value === 'lifetrip') {
|
|
1272
|
+
if (calculatorForm.type.code === 'Single' && calculatorForm.startDate && calculatorForm.endDate) {
|
|
1273
|
+
const formattedStartDate = formatDate(calculatorForm.startDate);
|
|
1274
|
+
const formattedEndDate = formatDate(calculatorForm.endDate);
|
|
1275
|
+
if (formattedStartDate && formattedEndDate && formattedStartDate.getTime() > formattedEndDate.getTime()) {
|
|
1276
|
+
return dataStore.showToaster('error', dataStore.t('toaster.startMoreEnd'));
|
|
1277
|
+
}
|
|
701
1278
|
}
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
1279
|
+
if (dataStore.isTask()) {
|
|
1280
|
+
await dataStore.calculatePrice(route.params.taskId as string);
|
|
1281
|
+
} else {
|
|
1282
|
+
await dataStore.calculatePrice();
|
|
1283
|
+
}
|
|
1284
|
+
} else {
|
|
1285
|
+
if (whichSum.value === 'requestedSumInsured') {
|
|
1286
|
+
productConditionsForm.insurancePremiumPerMonth = null;
|
|
1287
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
1288
|
+
productConditionsForm.insurancePremiumPerMonthInDollar = null;
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
if (whichSum.value === 'insurancePremiumPerMonth') {
|
|
1292
|
+
productConditionsForm.requestedSumInsured = null;
|
|
1293
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
1294
|
+
productConditionsForm.requestedSumInsuredInDollar = null;
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
if (productConditionsForm.requestedSumInsured !== '' && productConditionsForm.requestedSumInsured != null) {
|
|
1298
|
+
productConditionsForm.insurancePremiumPerMonth = null;
|
|
1299
|
+
if (props.isCalculator) whichSum.value = 'requestedSumInsured';
|
|
1300
|
+
}
|
|
1301
|
+
if (productConditionsForm.insurancePremiumPerMonth !== '' && productConditionsForm.insurancePremiumPerMonth != null) {
|
|
1302
|
+
productConditionsForm.requestedSumInsured = null;
|
|
1303
|
+
if (props.isCalculator) whichSum.value = 'insurancePremiumPerMonth';
|
|
707
1304
|
}
|
|
708
|
-
}
|
|
709
|
-
if (productConditionsForm.requestedSumInsured !== '' && productConditionsForm.requestedSumInsured != null) {
|
|
710
|
-
productConditionsForm.insurancePremiumPerMonth = null;
|
|
711
|
-
if (props.isRecalculation) whichSum.value = 'requestedSumInsured';
|
|
712
|
-
}
|
|
713
|
-
if (productConditionsForm.insurancePremiumPerMonth !== '' && productConditionsForm.insurancePremiumPerMonth != null) {
|
|
714
|
-
productConditionsForm.requestedSumInsured = null;
|
|
715
|
-
if (props.isRecalculation) whichSum.value = 'insurancePremiumPerMonth';
|
|
716
|
-
}
|
|
717
1305
|
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
1306
|
+
if (!whichSum.value && isUnderwriterForm.value === false) {
|
|
1307
|
+
dataStore.showToaster('error', dataStore.t('toaster.emptyProductConditions'));
|
|
1308
|
+
return;
|
|
1309
|
+
}
|
|
722
1310
|
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
1311
|
+
if (
|
|
1312
|
+
whichProduct.value === 'gons' &&
|
|
1313
|
+
(formStore.applicationData.statusCode === 'EditForm' || formStore.applicationData.statusCode === 'StartForm') &&
|
|
1314
|
+
getNumber(productConditionsForm.requestedSumInsured as string)! >= 10_000_000
|
|
1315
|
+
) {
|
|
1316
|
+
dataStore.showToaster('info', dataStore.t('toaster.calcSumForUnder'), 6000);
|
|
1317
|
+
}
|
|
1318
|
+
if (isUnderwriterForm.value) {
|
|
1319
|
+
type recalculationInfo = {
|
|
1320
|
+
lifeMultiply: string | null | number;
|
|
1321
|
+
lifeAdditive: string | null | number;
|
|
1322
|
+
lifeMultiplyClient?: string | number | null;
|
|
1323
|
+
lifeAdditiveClient?: string | number | null;
|
|
1324
|
+
adbMultiply: string | null | number;
|
|
1325
|
+
adbAdditive: string | null | number;
|
|
1326
|
+
disabilityMultiply: string | null | number;
|
|
1327
|
+
disabilityAdditive: string | null | number;
|
|
1328
|
+
amount?: string | number | null;
|
|
1329
|
+
premium?: string | number | null;
|
|
1330
|
+
riskGroup?: string | string | number | null;
|
|
1331
|
+
};
|
|
1332
|
+
const recalculationData: recalculationInfo = (({ lifeMultiply, lifeAdditive, adbMultiply, adbAdditive, disabilityMultiply, disabilityAdditive }) => ({
|
|
1333
|
+
lifeMultiply,
|
|
1334
|
+
lifeAdditive,
|
|
1335
|
+
adbMultiply,
|
|
1336
|
+
adbAdditive,
|
|
1337
|
+
disabilityMultiply,
|
|
1338
|
+
disabilityAdditive,
|
|
1339
|
+
}))(productConditionsForm);
|
|
1340
|
+
Object.keys(recalculationData).forEach(key => {
|
|
1341
|
+
// @ts-ignore
|
|
1342
|
+
recalculationData[key] = formatProcents(recalculationData[key]);
|
|
1343
|
+
});
|
|
1344
|
+
recalculationData.lifeMultiplyClient = dataStore.isClientAnketaCondition
|
|
1345
|
+
? formStore.productConditionsForm.lifeMultiplyClient === null
|
|
1346
|
+
? null
|
|
1347
|
+
: formatProcents(formStore.productConditionsForm.lifeMultiplyClient)
|
|
1348
|
+
: null;
|
|
1349
|
+
recalculationData.lifeAdditiveClient = dataStore.isClientAnketaCondition
|
|
1350
|
+
? formStore.productConditionsForm.lifeAdditiveClient === null
|
|
1351
|
+
? null
|
|
1352
|
+
: formatProcents(formStore.productConditionsForm.lifeAdditiveClient)
|
|
1353
|
+
: null;
|
|
1354
|
+
recalculationData.amount = Number((productConditionsForm.requestedSumInsured as string)?.replace(/\s/g, ''));
|
|
1355
|
+
recalculationData.premium = Number((productConditionsForm.insurancePremiumPerMonth as string)?.replace(/\s/g, ''));
|
|
1356
|
+
recalculationData.riskGroup = productConditionsForm.riskGroup?.id ? productConditionsForm.riskGroup.id : 1;
|
|
1357
|
+
isCalculating.value = true;
|
|
1358
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1359
|
+
await dataStore.calculate(route.params.taskId as string);
|
|
1360
|
+
additionalTerms.value = formStore.additionalInsuranceTerms;
|
|
1361
|
+
} else {
|
|
1362
|
+
await dataStore.reCalculate(formStore.applicationData.processInstanceId, recalculationData, route.params.taskId as string, whichSum.value);
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
762
1365
|
isCalculating.value = true;
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
await dataStore.calculate(route.params.taskId as string);
|
|
773
|
-
additionalTerms.value = formStore.additionalInsuranceTerms;
|
|
1366
|
+
if (props.isCalculator) {
|
|
1367
|
+
//@ts-ignore
|
|
1368
|
+
await dataStore.calculateWithoutApplication(true, whichProduct.value);
|
|
1369
|
+
additionalTerms.value = formStore.additionalInsuranceTermsWithout;
|
|
1370
|
+
} else {
|
|
1371
|
+
if (dataStore.isProcessEditable(formStore.applicationData.statusCode)) {
|
|
1372
|
+
await dataStore.calculate(route.params.taskId as string);
|
|
1373
|
+
additionalTerms.value = formStore.additionalInsuranceTerms;
|
|
1374
|
+
}
|
|
774
1375
|
}
|
|
775
1376
|
}
|
|
1377
|
+
|
|
776
1378
|
isCalculating.value = false;
|
|
777
1379
|
} else {
|
|
778
1380
|
const errors = document.querySelector('.v-input--error');
|
|
@@ -797,38 +1399,49 @@ export default defineComponent({
|
|
|
797
1399
|
};
|
|
798
1400
|
|
|
799
1401
|
onMounted(async () => {
|
|
800
|
-
if (props.
|
|
1402
|
+
if (props.isCalculator === true) {
|
|
801
1403
|
if (dataStore.isCalculator) {
|
|
802
1404
|
clearFields();
|
|
803
1405
|
}
|
|
804
|
-
if (
|
|
805
|
-
(
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
1406
|
+
if (whichProduct.value !== 'lifetrip') {
|
|
1407
|
+
if (
|
|
1408
|
+
(dataStore.isCalculator || route.params.taskId === '0') &&
|
|
1409
|
+
productConditionsForm.requestedSumInsured === null &&
|
|
1410
|
+
productConditionsForm.insurancePremiumPerMonth === null
|
|
1411
|
+
) {
|
|
1412
|
+
// @ts-ignore
|
|
1413
|
+
const defaultData = await dataStore.getDefaultCalculationData(true, whichProduct.value);
|
|
1414
|
+
if (!defaultData) {
|
|
1415
|
+
dataStore.showToaster('error', 'Отсутствуют базовые данные');
|
|
1416
|
+
return;
|
|
1417
|
+
}
|
|
1418
|
+
formStore.additionalInsuranceTermsWithout = defaultData.addCovers;
|
|
1419
|
+
productConditionsForm.requestedSumInsured = defaultData.amount;
|
|
1420
|
+
productConditionsForm.insurancePremiumPerMonth = defaultData.premium;
|
|
1421
|
+
const indexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
|
|
1422
|
+
if (indexRate) productConditionsForm.processIndexRate = indexRate;
|
|
1423
|
+
const paymendPeriod = dataStore.processPaymentPeriod.find(i => i.id === defaultData.paymentPeriodId);
|
|
1424
|
+
if (paymendPeriod) productConditionsForm.paymentPeriod = paymendPeriod;
|
|
1425
|
+
if (defaultData.signDate) {
|
|
1426
|
+
productConditionsForm.signDate = reformatDate(defaultData.signDate);
|
|
1427
|
+
}
|
|
1428
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1429
|
+
productConditionsForm.coverPeriod = defaultData.insTermInMonth ?? null;
|
|
1430
|
+
productConditionsForm.insurancePremiumPerMonth = null;
|
|
1431
|
+
}
|
|
814
1432
|
}
|
|
815
|
-
formStore.additionalInsuranceTermsWithout = defaultData.addCovers;
|
|
816
|
-
productConditionsForm.requestedSumInsured = defaultData.amount;
|
|
817
|
-
productConditionsForm.insurancePremiumPerMonth = defaultData.premium;
|
|
818
|
-
const indexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
|
|
819
|
-
if (indexRate) productConditionsForm.processIndexRate = indexRate;
|
|
820
|
-
const paymendPeriod = dataStore.processPaymentPeriod.find(i => i.id == defaultData.paymentPeriodId);
|
|
821
|
-
if (paymendPeriod) productConditionsForm.paymentPeriod = paymendPeriod;
|
|
822
|
-
productConditionsForm.signDate = reformatDate(defaultData.signDate);
|
|
823
1433
|
}
|
|
824
1434
|
}
|
|
825
|
-
additionalTerms.value = props.
|
|
1435
|
+
additionalTerms.value = props.isCalculator ? formStore.additionalInsuranceTermsWithout : formStore.additionalInsuranceTerms;
|
|
826
1436
|
if (!!productConditionsForm.insurancePremiumPerMonth) {
|
|
827
1437
|
whichSum.value = 'insurancePremiumPerMonth';
|
|
828
1438
|
}
|
|
829
1439
|
if (!!productConditionsForm.requestedSumInsured) {
|
|
830
1440
|
whichSum.value = 'requestedSumInsured';
|
|
831
1441
|
}
|
|
1442
|
+
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && !productConditionsForm.requestedSumInsured) {
|
|
1443
|
+
whichSum.value = 'requestedSumInsured';
|
|
1444
|
+
}
|
|
832
1445
|
if (dataStore.isCalculator) {
|
|
833
1446
|
dataStore.processCode = constants.products[whichProduct.value as keyof typeof constants.products];
|
|
834
1447
|
await dataStore.getProcessPaymentPeriod();
|
|
@@ -838,6 +1451,13 @@ export default defineComponent({
|
|
|
838
1451
|
if (kazynaPaymentPeriod) productConditionsForm.paymentPeriod = kazynaPaymentPeriod;
|
|
839
1452
|
await dataStore.getCurrencies();
|
|
840
1453
|
}
|
|
1454
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1455
|
+
productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(
|
|
1456
|
+
formStore.lfb.clients.reduce((sum: number, i: any) => {
|
|
1457
|
+
return sum + Number(i.insSum);
|
|
1458
|
+
}, 0),
|
|
1459
|
+
);
|
|
1460
|
+
}
|
|
841
1461
|
});
|
|
842
1462
|
|
|
843
1463
|
watch(
|
|
@@ -859,9 +1479,9 @@ export default defineComponent({
|
|
|
859
1479
|
},
|
|
860
1480
|
);
|
|
861
1481
|
watch(
|
|
862
|
-
() => dataStore.
|
|
1482
|
+
() => dataStore.rightPanel.open,
|
|
863
1483
|
() => {
|
|
864
|
-
if (dataStore.
|
|
1484
|
+
if (dataStore.rightPanel.open === false) {
|
|
865
1485
|
isPanelOpen.value = false;
|
|
866
1486
|
isTermsPanelOpen.value = false;
|
|
867
1487
|
dataStore.panelAction = null;
|
|
@@ -870,6 +1490,57 @@ export default defineComponent({
|
|
|
870
1490
|
{ immediate: true },
|
|
871
1491
|
);
|
|
872
1492
|
|
|
1493
|
+
if (whichProduct.value === 'lifetrip') {
|
|
1494
|
+
watch(
|
|
1495
|
+
() => calculatorForm.type,
|
|
1496
|
+
async val => {
|
|
1497
|
+
if (val.code === 'Multiple') {
|
|
1498
|
+
await dataStore.getPeriod();
|
|
1499
|
+
calculatorForm.period = new Value();
|
|
1500
|
+
calculatorForm.endDate = null;
|
|
1501
|
+
}
|
|
1502
|
+
if (calculatorForm.countries?.length != 0) {
|
|
1503
|
+
await dataStore.getTripInsuredAmount();
|
|
1504
|
+
}
|
|
1505
|
+
},
|
|
1506
|
+
);
|
|
1507
|
+
watch(
|
|
1508
|
+
() => calculatorForm.countries,
|
|
1509
|
+
async val => {
|
|
1510
|
+
if (val?.length && val.every(option => option.id != 0) && calculatorForm.type?.nameRu != null) {
|
|
1511
|
+
await dataStore.getTripInsuredAmount();
|
|
1512
|
+
}
|
|
1513
|
+
},
|
|
1514
|
+
{ deep: true },
|
|
1515
|
+
);
|
|
1516
|
+
|
|
1517
|
+
watch(
|
|
1518
|
+
() => calculatorForm.period,
|
|
1519
|
+
val => {
|
|
1520
|
+
if (val) {
|
|
1521
|
+
dataStore.maxDaysFiltered = dataStore.maxDaysAllArray.filter(days => days.code == val.code);
|
|
1522
|
+
calculatorForm.maxDays = new Value();
|
|
1523
|
+
}
|
|
1524
|
+
},
|
|
1525
|
+
);
|
|
1526
|
+
|
|
1527
|
+
watch(
|
|
1528
|
+
() => calculatorForm.startDate,
|
|
1529
|
+
val => {
|
|
1530
|
+
if (val !== null && val.length === 10 && calculatorForm.endDate != null && calculatorForm.endDate.length === 10) {
|
|
1531
|
+
calculatorForm.days = productConditionsForm.getSingleTripDays();
|
|
1532
|
+
}
|
|
1533
|
+
},
|
|
1534
|
+
);
|
|
1535
|
+
watch(
|
|
1536
|
+
() => calculatorForm.endDate,
|
|
1537
|
+
val => {
|
|
1538
|
+
if (val !== null && val.length === 10 && calculatorForm.startDate != null && calculatorForm.startDate.length === 10) {
|
|
1539
|
+
calculatorForm.days = productConditionsForm.getSingleTripDays();
|
|
1540
|
+
}
|
|
1541
|
+
},
|
|
1542
|
+
);
|
|
1543
|
+
}
|
|
873
1544
|
return {
|
|
874
1545
|
// State
|
|
875
1546
|
formStore,
|
|
@@ -880,21 +1551,30 @@ export default defineComponent({
|
|
|
880
1551
|
isCalculating,
|
|
881
1552
|
isPanelLoading,
|
|
882
1553
|
isPanelOpen,
|
|
1554
|
+
isMultiplePanelOpen,
|
|
883
1555
|
isTermsPanelOpen,
|
|
884
1556
|
panelValue,
|
|
885
1557
|
termValue,
|
|
886
1558
|
panelList,
|
|
1559
|
+
multiplePanelList,
|
|
1560
|
+
multiplePanelValue,
|
|
887
1561
|
searchQuery,
|
|
888
1562
|
whichSum,
|
|
889
1563
|
Value,
|
|
1564
|
+
calculatorForm,
|
|
1565
|
+
subPanelList,
|
|
1566
|
+
subTermValue,
|
|
1567
|
+
panelCodeList,
|
|
1568
|
+
enabled,
|
|
890
1569
|
|
|
891
1570
|
// Computed
|
|
892
1571
|
isTask,
|
|
893
1572
|
isDisabled,
|
|
894
1573
|
isTermsDisabled,
|
|
895
1574
|
isUnderwriterForm,
|
|
896
|
-
|
|
897
|
-
|
|
1575
|
+
insurancePremiumPerMonthRule,
|
|
1576
|
+
insurancePremiumPerMonthDisabled,
|
|
1577
|
+
requestedSumInsuredRule,
|
|
898
1578
|
isRecalculationDisabled,
|
|
899
1579
|
isUnderwriterRole,
|
|
900
1580
|
hasProcessIndexRate,
|
|
@@ -903,24 +1583,47 @@ export default defineComponent({
|
|
|
903
1583
|
hasInsurancePremiumPerMonthInDollar,
|
|
904
1584
|
hasCurrency,
|
|
905
1585
|
hasAdbMultiply,
|
|
1586
|
+
readonlyLifeAdditive,
|
|
1587
|
+
readonlyDisabilityMultiply,
|
|
1588
|
+
readonlyDisabilityAdditive,
|
|
906
1589
|
hasAdbAdditive,
|
|
907
1590
|
hasRiskGroup,
|
|
908
1591
|
hasCalculated,
|
|
909
1592
|
hasAnnuityPayments,
|
|
1593
|
+
hasAgencyPart,
|
|
1594
|
+
hasProcessGfot,
|
|
910
1595
|
currencySymbolsAddTerm,
|
|
911
1596
|
amountAnnuityPayments,
|
|
912
1597
|
requestedSumInsuredLabel,
|
|
913
1598
|
isDisabledSum,
|
|
914
1599
|
isDisabledSumDollar,
|
|
1600
|
+
countriesComputed,
|
|
1601
|
+
hasBirthDate,
|
|
1602
|
+
hasGender,
|
|
1603
|
+
coverPeriodLabel,
|
|
1604
|
+
insurancePremiumPerMonthLabel,
|
|
1605
|
+
isDisabledCoverPeriod,
|
|
1606
|
+
hasDefault,
|
|
1607
|
+
isDisabledProcessGfot,
|
|
1608
|
+
isShownAdditionalTerms,
|
|
1609
|
+
hasCalcSum,
|
|
1610
|
+
isDisabledAgentCommission,
|
|
1611
|
+
hasFixInsSum,
|
|
1612
|
+
isDisabledFixInsSum,
|
|
1613
|
+
defaultText,
|
|
1614
|
+
hasDeathInsFromNS,
|
|
1615
|
+
hasDeathInsAnyReason,
|
|
915
1616
|
|
|
916
1617
|
// Rules
|
|
917
1618
|
coverPeriodRule,
|
|
1619
|
+
fixInsSumRule,
|
|
918
1620
|
|
|
919
1621
|
// Functions
|
|
920
1622
|
submitForm,
|
|
921
1623
|
pickPanelValue,
|
|
922
1624
|
pickTermValue,
|
|
923
1625
|
openPanel,
|
|
1626
|
+
openMultiplePanel,
|
|
924
1627
|
openTermPanel,
|
|
925
1628
|
pickCalculation,
|
|
926
1629
|
underwriterCalculate,
|
|
@@ -936,6 +1639,10 @@ export default defineComponent({
|
|
|
936
1639
|
clearFields,
|
|
937
1640
|
formatTermValue,
|
|
938
1641
|
filterTermConditions,
|
|
1642
|
+
selectOption,
|
|
1643
|
+
coverTypeName,
|
|
1644
|
+
pickSubTermValue,
|
|
1645
|
+
onInputFixInsSum,
|
|
939
1646
|
};
|
|
940
1647
|
},
|
|
941
1648
|
});
|