hl-core 0.0.10-beta.5 → 0.0.10-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/README.md +0 -2
- package/api/base.api.ts +327 -137
- package/api/interceptors.ts +3 -5
- package/components/Dialog/Dialog.vue +5 -1
- package/components/Form/DigitalDocument.vue +52 -0
- package/components/Form/FormSource.vue +30 -0
- package/components/Form/ManagerAttachment.vue +60 -11
- package/components/Form/ProductConditionsBlock.vue +12 -6
- package/components/Input/Datepicker.vue +5 -0
- package/components/Input/FileInput.vue +1 -1
- package/components/Input/FormInput.vue +5 -0
- package/components/Input/OtpInput.vue +25 -0
- package/components/Input/RoundedInput.vue +2 -0
- package/components/Input/RoundedSelect.vue +2 -0
- package/components/Input/TextAreaField.vue +71 -0
- package/components/Menu/MenuNav.vue +1 -1
- package/components/Pages/Anketa.vue +207 -176
- package/components/Pages/ContragentForm.vue +1 -1
- package/components/Pages/Documents.vue +436 -64
- package/components/Pages/MemberForm.vue +343 -170
- package/components/Pages/ProductConditions.vue +895 -241
- package/components/Panel/PanelHandler.vue +282 -124
- package/components/Utilities/Chip.vue +1 -1
- package/components/Utilities/JsonViewer.vue +1 -2
- package/composables/classes.ts +121 -20
- package/composables/constants.ts +45 -1
- package/composables/index.ts +333 -8
- package/composables/styles.ts +8 -24
- package/configs/pwa.ts +1 -7
- package/layouts/clear.vue +1 -1
- package/layouts/default.vue +1 -1
- package/layouts/full.vue +1 -1
- package/locales/ru.json +82 -19
- package/nuxt.config.ts +10 -12
- package/package.json +12 -12
- package/plugins/head.ts +7 -1
- package/store/data.store.ts +867 -525
- package/store/member.store.ts +17 -6
- package/store/rules.ts +23 -3
- package/types/enum.ts +40 -2
- package/types/index.ts +110 -56
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<section class="flex flex-col gap-4 px-[10px]">
|
|
3
|
-
<v-form ref="vForm" @submit="submitForm"
|
|
2
|
+
<section v-if="!isLoading" class="flex flex-col gap-4 px-[10px]" :class="[$styles.scrollPage]">
|
|
3
|
+
<v-form ref="vForm" @submit="submitForm">
|
|
4
4
|
<base-message-block
|
|
5
5
|
v-if="isCalculator"
|
|
6
6
|
class="mt-4"
|
|
@@ -36,7 +36,14 @@
|
|
|
36
36
|
<base-form-input v-model="formStore.policyholderForm.gender.nameRu" class="mb-4" :label="$dataStore.t('form.gender')" :readonly="true" />
|
|
37
37
|
</base-form-section>
|
|
38
38
|
<base-form-section
|
|
39
|
-
v-if="
|
|
39
|
+
v-if="
|
|
40
|
+
isUnderwriterRole &&
|
|
41
|
+
$dataStore.members.insuredApp.has === true &&
|
|
42
|
+
whichProduct !== 'lifebusiness' &&
|
|
43
|
+
whichProduct !== 'gns' &&
|
|
44
|
+
whichProduct !== 'pensionannuitynew' &&
|
|
45
|
+
whichProduct !== 'lifetrip'
|
|
46
|
+
"
|
|
40
47
|
:title="$dataStore.t('insuredForm')"
|
|
41
48
|
>
|
|
42
49
|
<div v-for="(insured, index) of formStore.insuredForm" :key="index">
|
|
@@ -49,14 +56,14 @@
|
|
|
49
56
|
</div>
|
|
50
57
|
</base-form-section>
|
|
51
58
|
<base-form-section
|
|
52
|
-
v-if="isUnderwriterRole && whichProduct !== '
|
|
59
|
+
v-if="isUnderwriterRole && whichProduct !== 'pensionannuitynew' && whichProduct !== 'balam' && whichProduct !== 'tumar'"
|
|
53
60
|
:title="$dataStore.t('recalculationInfo')"
|
|
54
61
|
>
|
|
55
62
|
<base-form-input
|
|
56
63
|
v-model="productConditionsForm.lifeMultiply"
|
|
57
64
|
:maska="$maska.numbers"
|
|
58
65
|
:clearable="isRecalculationDisabled === false"
|
|
59
|
-
:label="
|
|
66
|
+
:label="lifeMultiplyLabel"
|
|
60
67
|
:readonly="isRecalculationDisabled"
|
|
61
68
|
:rules="whichProduct === 'gons' ? $dataStore.rules.recalculationMultiplyBetween : $dataStore.rules.recalculationMultiply"
|
|
62
69
|
/>
|
|
@@ -64,7 +71,7 @@
|
|
|
64
71
|
v-model="productConditionsForm.lifeAdditive"
|
|
65
72
|
:maska="$maska.numbers"
|
|
66
73
|
:clearable="isRecalculationDisabled === false"
|
|
67
|
-
:label="
|
|
74
|
+
:label="lifeAdditiveLabel"
|
|
68
75
|
:readonly="readonlyLifeAdditive"
|
|
69
76
|
:rules="$dataStore.rules.recalculationAdditive"
|
|
70
77
|
/>
|
|
@@ -73,7 +80,7 @@
|
|
|
73
80
|
v-model="productConditionsForm.adbMultiply"
|
|
74
81
|
:maska="$maska.numbers"
|
|
75
82
|
:clearable="isRecalculationDisabled === false"
|
|
76
|
-
:label="
|
|
83
|
+
:label="adbMultiplyLabel"
|
|
77
84
|
:readonly="isRecalculationDisabled"
|
|
78
85
|
:rules="$dataStore.rules.recalculationMultiply"
|
|
79
86
|
/>
|
|
@@ -82,7 +89,7 @@
|
|
|
82
89
|
v-model="productConditionsForm.adbAdditive"
|
|
83
90
|
:maska="$maska.numbers"
|
|
84
91
|
:clearable="isRecalculationDisabled === false"
|
|
85
|
-
:label="
|
|
92
|
+
:label="adbAdditiveLabel"
|
|
86
93
|
:readonly="isRecalculationDisabled"
|
|
87
94
|
:rules="$dataStore.rules.recalculationAdditive"
|
|
88
95
|
/>
|
|
@@ -90,11 +97,12 @@
|
|
|
90
97
|
v-model="productConditionsForm.disabilityMultiply"
|
|
91
98
|
:maska="$maska.numbers"
|
|
92
99
|
:clearable="isRecalculationDisabled === false"
|
|
93
|
-
:label="
|
|
100
|
+
:label="disabilityMultiplyLabel"
|
|
94
101
|
:readonly="readonlyDisabilityMultiply"
|
|
95
102
|
:rules="whichProduct === 'gons' ? [] : $dataStore.rules.recalculationMultiply"
|
|
96
103
|
/>
|
|
97
104
|
<base-form-input
|
|
105
|
+
v-if="hasDisabilityAdditive"
|
|
98
106
|
v-model="productConditionsForm.disabilityAdditive"
|
|
99
107
|
:maska="$maska.numbers"
|
|
100
108
|
:clearable="isRecalculationDisabled === false"
|
|
@@ -145,12 +153,23 @@
|
|
|
145
153
|
@append="openPanel($dataStore.t('form.gender'), $dataStore.gender, 'gender')"
|
|
146
154
|
/>
|
|
147
155
|
</div>
|
|
156
|
+
<base-panel-input
|
|
157
|
+
v-if="hasCurrency"
|
|
158
|
+
v-model="productConditionsForm.currency"
|
|
159
|
+
:value="productConditionsForm.currency.nameRu"
|
|
160
|
+
:readonly="isDisabled"
|
|
161
|
+
:clearable="!isDisabled"
|
|
162
|
+
:label="$dataStore.t('agent.currency')"
|
|
163
|
+
:rules="$rules.objectRequired"
|
|
164
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
165
|
+
@append="openPanel($dataStore.t('agent.currency'), currencyListFiltered, 'currency')"
|
|
166
|
+
/>
|
|
148
167
|
<base-form-input
|
|
149
168
|
v-if="hasInsStartDate"
|
|
150
169
|
v-model="productConditionsForm.calcDate"
|
|
151
170
|
:maska="$maska.date"
|
|
152
|
-
:readonly="
|
|
153
|
-
:clearable="!
|
|
171
|
+
:readonly="isDisabledInsStartDate"
|
|
172
|
+
:clearable="!isDisabledInsStartDate"
|
|
154
173
|
:label="$dataStore.t('labels.insuranceStartDate')"
|
|
155
174
|
:rules="$rules.required"
|
|
156
175
|
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
@@ -178,8 +197,8 @@
|
|
|
178
197
|
v-if="hasPaymentPeriod"
|
|
179
198
|
v-model="productConditionsForm.paymentPeriod"
|
|
180
199
|
:value="productConditionsForm.paymentPeriod?.nameRu"
|
|
181
|
-
:readonly="
|
|
182
|
-
:clearable="!
|
|
200
|
+
:readonly="isDisabledPaymentPeriod"
|
|
201
|
+
:clearable="!isDisabledPaymentPeriod"
|
|
183
202
|
:rules="$rules.objectRequired"
|
|
184
203
|
:label="$dataStore.t('productConditionsForm.processPaymentPeriod')"
|
|
185
204
|
append-inner-icon="mdi mdi-chevron-right"
|
|
@@ -196,17 +215,18 @@
|
|
|
196
215
|
append-inner-icon="mdi mdi-chevron-right"
|
|
197
216
|
@append="openPanel($dataStore.t('productConditionsForm.processIndexRate'), $dataStore.processIndexRate, 'processIndexRate', $dataStore.getProcessIndexRate)"
|
|
198
217
|
/>
|
|
218
|
+
<!-- <base-form-input-->
|
|
219
|
+
<!-- v-if="hasFixInsSum"-->
|
|
220
|
+
<!-- v-model="productConditionsForm.fixInsSum"-->
|
|
221
|
+
<!-- :readonly="isDisabledFixInsSum"-->
|
|
222
|
+
<!-- :clearable="!isDisabled"-->
|
|
223
|
+
<!-- :rules="fixInsSumRule"-->
|
|
224
|
+
<!-- :label="$dataStore.t('productConditionsForm.fixInsSum')"-->
|
|
225
|
+
<!-- :suffix="$constants.currencySymbols.kzt"-->
|
|
226
|
+
<!-- @input="onInputFixInsSum"-->
|
|
227
|
+
<!-- />-->
|
|
199
228
|
<base-form-input
|
|
200
|
-
v-if="
|
|
201
|
-
v-model="productConditionsForm.fixInsSum"
|
|
202
|
-
:readonly="isDisabledFixInsSum"
|
|
203
|
-
:clearable="!isDisabled"
|
|
204
|
-
:rules="fixInsSumRule"
|
|
205
|
-
:label="$dataStore.t('productConditionsForm.fixInsSum')"
|
|
206
|
-
:suffix="$constants.currencySymbols.kzt"
|
|
207
|
-
@input="onInputFixInsSum"
|
|
208
|
-
/>
|
|
209
|
-
<base-form-input
|
|
229
|
+
v-if="hasRequestedSumInsured"
|
|
210
230
|
v-model="productConditionsForm.requestedSumInsured"
|
|
211
231
|
:readonly="isDisabledSum"
|
|
212
232
|
:clearable="!isDisabledSum"
|
|
@@ -228,6 +248,7 @@
|
|
|
228
248
|
@onClear="onClearSumDollar"
|
|
229
249
|
/>
|
|
230
250
|
<base-form-input
|
|
251
|
+
v-if="hasInsurancePremiumPerMonth"
|
|
231
252
|
v-model="productConditionsForm.insurancePremiumPerMonth"
|
|
232
253
|
:readonly="insurancePremiumPerMonthDisabled"
|
|
233
254
|
:clearable="!insurancePremiumPerMonthDisabled"
|
|
@@ -237,6 +258,22 @@
|
|
|
237
258
|
@input="onInputInsurancePremiumPerMonth"
|
|
238
259
|
@onClear="onClearPremium"
|
|
239
260
|
/>
|
|
261
|
+
<base-form-input
|
|
262
|
+
v-if="hasPaidOrRefund"
|
|
263
|
+
v-model="productConditionsForm.amountRefunded"
|
|
264
|
+
:readonly="isDisabledSum"
|
|
265
|
+
:clearable="!isDisabledSum"
|
|
266
|
+
:label="$dataStore.t('productConditionsForm.amountRefunded')"
|
|
267
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
268
|
+
/>
|
|
269
|
+
<base-form-input
|
|
270
|
+
v-if="hasPaidOrRefund"
|
|
271
|
+
v-model="productConditionsForm.amountPaid"
|
|
272
|
+
:readonly="insurancePremiumPerMonthDisabled"
|
|
273
|
+
:clearable="!insurancePremiumPerMonthDisabled"
|
|
274
|
+
:label="$dataStore.t('productConditionsForm.amountPaid')"
|
|
275
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
276
|
+
/>
|
|
240
277
|
<base-form-input
|
|
241
278
|
v-if="hasInsurancePremiumPerMonthInDollar"
|
|
242
279
|
v-model="productConditionsForm.insurancePremiumPerMonthInDollar"
|
|
@@ -249,10 +286,10 @@
|
|
|
249
286
|
@onClear="onClearPremiumDollar"
|
|
250
287
|
/>
|
|
251
288
|
<base-form-input
|
|
252
|
-
v-if="
|
|
289
|
+
v-if="hasCurrencySymbols && $dataStore.currencies.usd"
|
|
253
290
|
v-model="$dataStore.currencies.usd"
|
|
254
291
|
:readonly="true"
|
|
255
|
-
:label="
|
|
292
|
+
:label="currencySymbolsLabel"
|
|
256
293
|
:suffix="$constants.currencySymbols.kzt"
|
|
257
294
|
/>
|
|
258
295
|
<base-form-input
|
|
@@ -289,102 +326,192 @@
|
|
|
289
326
|
:label="$dataStore.t('productConditionsForm.agencyPart')"
|
|
290
327
|
:readonly="isDisabledAgentCommission"
|
|
291
328
|
:clearable="!isDisabledAgentCommission"
|
|
292
|
-
:rules="
|
|
329
|
+
:rules="agencyPartRule"
|
|
293
330
|
/>
|
|
294
331
|
</base-form-section>
|
|
295
332
|
<section v-if="whichProduct === 'pensionannuitynew'">
|
|
296
|
-
<base-
|
|
297
|
-
|
|
333
|
+
<base-animation>
|
|
334
|
+
<div
|
|
335
|
+
v-if="(formStore.applicationData.processCode === 19 || formStore.applicationData.processCode === 25) && !isDisabled"
|
|
336
|
+
:class="[$styles.blueBgLight]"
|
|
337
|
+
class="h-[52px] rounded-lg flex items-center justify-end px-2 gap-2 mt-4"
|
|
338
|
+
>
|
|
339
|
+
<base-btn class="max-w-[300px]" :text="$dataStore.t('buttons.copyToClient')" size="sm" @click="copyRedirect" />
|
|
340
|
+
</div>
|
|
341
|
+
</base-animation>
|
|
342
|
+
<base-form-section v-if="formStore.applicationData.statusCode === 'ActuaryForm' && isTask">
|
|
343
|
+
<base-content-block :class="[$styles.textSimple]">
|
|
344
|
+
<h5 class="text-center font-medium mb-4">{{ $dataStore.t('labels.contract') }}</h5>
|
|
345
|
+
<div :class="[$styles.whiteBg, $styles.rounded]" class="p-2 h-12 flex items-center relative">
|
|
346
|
+
<span class="ml-2">Договор {{ formStore.applicationData.processCode === 19 || formStore.applicationData.processCode === 25 ? 'страхования' : 'возврата' }}</span>
|
|
347
|
+
<i
|
|
348
|
+
class="transition-all cursor-pointer mdi mdi-tray-arrow-down pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
|
|
349
|
+
:class="[$styles.greenTextHover]"
|
|
350
|
+
@click="
|
|
351
|
+
$dataStore.generatePDFDocument(
|
|
352
|
+
formStore.applicationData.processCode === 19 ? 'PA_Contract' : formStore.applicationData.processCode === 25 ? 'PAJ_Contract' : 'PA_RefundAgreement',
|
|
353
|
+
'38',
|
|
354
|
+
)
|
|
355
|
+
"
|
|
356
|
+
></i>
|
|
357
|
+
</div>
|
|
358
|
+
</base-content-block>
|
|
359
|
+
</base-form-section>
|
|
360
|
+
<div v-if="formStore.applicationData.processCode === 25" class="flex items-center mt-[14px] h-[48px]">
|
|
361
|
+
<div :class="[$styles.blueBgLight]" class="flex flex-wrap items-center gap-2 p-1 rounded-t-[8px] h-full">
|
|
362
|
+
<div
|
|
363
|
+
class="h-full px-4 py-1 rounded-[8px] cursor-pointer flex items-center"
|
|
364
|
+
:class="[$styles.textSimple, !isSlavePensionForm ? `${$styles.blueBg} ${$styles.whiteText}` : '']"
|
|
365
|
+
@click="$router.replace({ query: { ...$route.query, which: undefined, upd: 'true' } })"
|
|
366
|
+
>
|
|
367
|
+
{{ !!formStore.applicationData.clientApp?.longName ? formStore.applicationData.clientApp?.longName : 'Страхователь' }}
|
|
368
|
+
</div>
|
|
369
|
+
<div
|
|
370
|
+
class="h-full px-4 py-1 rounded-[8px] cursor-pointer flex items-center"
|
|
371
|
+
:class="[$styles.textSimple, isSlavePensionForm ? `${$styles.blueBg} ${$styles.whiteText}` : '']"
|
|
372
|
+
@click="$router.replace({ query: { ...$route.query, which: 'slave', upd: 'true' } })"
|
|
373
|
+
>
|
|
374
|
+
{{ !!formStore.applicationData.slave.clientApp?.longName ? formStore.applicationData.slave.clientApp?.longName : 'Страхователь 2' }}
|
|
375
|
+
</div>
|
|
376
|
+
</div>
|
|
377
|
+
</div>
|
|
378
|
+
<base-form-section v-if="hasContragentData && contragentData">
|
|
379
|
+
<base-panel-input v-model="contragentData.gender" :readonly="true" :clearable="false" :label="$dataStore.t('form.gender')" />
|
|
380
|
+
<base-form-input v-model="contragentData.birthDate" :readonly="true" :clearable="false" :label="$dataStore.t('form.birthDate')" />
|
|
381
|
+
<base-panel-input
|
|
382
|
+
v-if="disabilityGroup"
|
|
383
|
+
v-model="disabilityGroup"
|
|
384
|
+
:value="disabilityGroup?.nameRu"
|
|
385
|
+
:readonly="true"
|
|
386
|
+
:clearable="false"
|
|
387
|
+
:label="$dataStore.t('pension.disabilityGroup')"
|
|
388
|
+
/>
|
|
389
|
+
</base-form-section>
|
|
390
|
+
<base-form-section
|
|
391
|
+
v-if="formStore.applicationData.processCode !== 24"
|
|
392
|
+
:title="$dataStore.t('pension.compulsoryAmount&Prof')"
|
|
393
|
+
:class="[formStore.applicationData.processCode === 25 ? 'mt-0 rounded-tl-none' : '']"
|
|
394
|
+
>
|
|
298
395
|
<base-form-input
|
|
299
|
-
v-model="
|
|
300
|
-
:maska="$maska.numbers"
|
|
396
|
+
v-model="pensionForm.compulsoryContractAmount"
|
|
301
397
|
:readonly="isDisabled || isEnpfSum"
|
|
302
398
|
:clearable="!isDisabled && !isEnpfSum"
|
|
303
399
|
:label="$dataStore.t('pension.compulsoryContractAmount')"
|
|
400
|
+
:rules="$dataStore.rules.sums"
|
|
401
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
402
|
+
@input="onInputPension($event, 'compulsoryContractAmount')"
|
|
403
|
+
@onClear="onClearPension('compulsoryContractAmount')"
|
|
304
404
|
/>
|
|
305
405
|
<base-form-input
|
|
306
|
-
v-model="
|
|
307
|
-
:maska="$maska.numbers"
|
|
406
|
+
v-model="pensionForm.compulsoryProfContractAmount"
|
|
308
407
|
:readonly="isDisabled || isEnpfSum"
|
|
309
408
|
:clearable="!isDisabled && !isEnpfSum"
|
|
310
409
|
:label="$dataStore.t('pension.compulsoryProfContractAmount')"
|
|
410
|
+
:rules="$dataStore.rules.sums"
|
|
411
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
412
|
+
@input="onInputPension($event, 'compulsoryProfContractAmount')"
|
|
413
|
+
@onClear="onClearPension('compulsoryProfContractAmount')"
|
|
311
414
|
/>
|
|
312
415
|
<base-animation>
|
|
313
416
|
<base-form-input
|
|
314
|
-
v-if="
|
|
417
|
+
v-if="pensionForm.compulsoryProfContractAmount && pensionForm.compulsoryProfContractAmount != 0"
|
|
315
418
|
v-model="pensionForm.compulsoryProfMonthCount"
|
|
316
419
|
:maska="$maska.numbers"
|
|
317
|
-
:readonly="isDisabled
|
|
318
|
-
:clearable="!isDisabled
|
|
420
|
+
:readonly="isDisabled"
|
|
421
|
+
:clearable="!isDisabled"
|
|
319
422
|
:label="$dataStore.t('pension.compulsoryProfMonthCount')"
|
|
320
423
|
/>
|
|
321
424
|
</base-animation>
|
|
322
425
|
<base-form-input
|
|
323
|
-
v-model="
|
|
324
|
-
:
|
|
325
|
-
:
|
|
326
|
-
:clearable="!isDisabled"
|
|
426
|
+
v-model="pensionForm.voluntaryContractAmount"
|
|
427
|
+
:readonly="isDisabled || isEnpfSum"
|
|
428
|
+
:clearable="!isDisabled && !isEnpfSum"
|
|
327
429
|
:label="$dataStore.t('pension.voluntaryContractAmount')"
|
|
430
|
+
:rules="$dataStore.rules.sums"
|
|
431
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
432
|
+
@input="onInputPension($event, 'voluntaryContractAmount')"
|
|
433
|
+
@onClear="onClearPension('voluntaryContractAmount')"
|
|
328
434
|
/>
|
|
329
435
|
<base-form-input
|
|
330
|
-
v-model="
|
|
331
|
-
:maska="$maska.numbers"
|
|
436
|
+
v-model="pensionForm.ownFundsRaisAmount"
|
|
332
437
|
:readonly="isDisabled"
|
|
333
438
|
:clearable="!isDisabled"
|
|
334
439
|
:label="$dataStore.t('pension.ownFundsRaisAmount')"
|
|
440
|
+
:rules="$dataStore.rules.sums"
|
|
441
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
442
|
+
@input="onInputPension($event, 'ownFundsRaisAmount')"
|
|
443
|
+
@onClear="onClearPension('ownFundsRaisAmount')"
|
|
335
444
|
/>
|
|
336
445
|
</base-form-section>
|
|
337
|
-
<base-form-section :title="$dataStore.t('pension.companyName')">
|
|
338
|
-
<base-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
446
|
+
<base-form-section v-if="formStore.applicationData.processCode !== 24" :title="$dataStore.t('pension.companyName')">
|
|
447
|
+
<base-btn v-if="!isDisabled" :text="$dataStore.t('buttons.add')" :disabled="isDisabled" size="sm" :btn="$styles.blueBtn" @click="addTransferContract" />
|
|
448
|
+
<section v-for="(contract, index) in transferContracts" class="py-2">
|
|
449
|
+
<base-panel-input
|
|
450
|
+
v-model="contract.transferContractCompany"
|
|
451
|
+
:value="contract.transferContractCompany?.nameRu"
|
|
452
|
+
:label="$dataStore.t('pension.transferContractCompany')"
|
|
453
|
+
:readonly="isDisabled"
|
|
454
|
+
:clearable="!isDisabled"
|
|
455
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
456
|
+
@append="
|
|
457
|
+
openPanel($dataStore.t('pension.transferContractCompany'), $dataStore.transferContractCompanies, 'transferContractCompany', $dataStore.getInsuranceCompanies)
|
|
458
|
+
"
|
|
459
|
+
@click="contractIndex = index"
|
|
460
|
+
/>
|
|
461
|
+
<div class="flex flex-col">
|
|
462
|
+
<base-form-input
|
|
463
|
+
v-model="contract.transferContractDate"
|
|
464
|
+
:maska="$maska.date"
|
|
465
|
+
:label="$dataStore.t('pension.contractDate')"
|
|
466
|
+
:readonly="isDisabled"
|
|
467
|
+
:clearable="!isDisabled"
|
|
468
|
+
:max-date="formatDate(transferMaxDate) ?? undefined"
|
|
469
|
+
:rules="$dataStore.rules.required.concat($dataStore.rules.birthDate)"
|
|
470
|
+
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
471
|
+
/>
|
|
472
|
+
<span v-if="transferMaxDate && !isDisabled" class="px-3 font-light text-sm bg-white py-0 mt-[-5px]" style="color: #a0b3d8 !important"
|
|
473
|
+
>до {{ transferMaxDate }} включительно</span
|
|
474
|
+
>
|
|
475
|
+
</div>
|
|
476
|
+
<base-form-input v-model="contract.transferContractNumber" :label="$dataStore.t('pension.globalId')" :readonly="isDisabled" :clearable="!isDisabled" />
|
|
477
|
+
<base-form-input
|
|
478
|
+
v-model="contract.transferContractRegNumber"
|
|
479
|
+
:label="$dataStore.t('pension.transferRegNumber')"
|
|
480
|
+
:rules="$rules.required"
|
|
481
|
+
:readonly="isDisabled"
|
|
482
|
+
:clearable="!isDisabled"
|
|
483
|
+
/>
|
|
484
|
+
<base-form-input
|
|
485
|
+
v-model="contract.transferContractFirstPaymentDate"
|
|
486
|
+
:maska="$maska.date"
|
|
487
|
+
:label="$dataStore.t('pension.transferContractFirstPaymentDate')"
|
|
488
|
+
:rules="$dataStore.rules.required.concat($dataStore.rules.birthDate)"
|
|
489
|
+
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
490
|
+
:readonly="isDisabled"
|
|
491
|
+
:clearable="!isDisabled"
|
|
492
|
+
/>
|
|
493
|
+
<base-form-input
|
|
494
|
+
v-model="contract.transferContractAmount"
|
|
495
|
+
:label="$dataStore.t('pension.transferContractAmount')"
|
|
496
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
497
|
+
:readonly="isDisabled"
|
|
498
|
+
:clearable="!isDisabled"
|
|
499
|
+
@input="onInputPension($event, 'transferContractAmount', index)"
|
|
500
|
+
@onClear="onClearPension('transferContractAmount', index)"
|
|
501
|
+
/>
|
|
502
|
+
<base-form-toggle v-model="contract.transferContractIsOppv" :disabled="isDisabled" :has-border="false" :title="$dataStore.t('pension.isOPPVTransfer')" />
|
|
503
|
+
<base-btn v-if="!isDisabled" :text="$dataStore.t('buttons.delete')" :disabled="isDisabled" size="sm" :btn="$styles.whiteBtn" @click="removeTransferContract(index)" />
|
|
504
|
+
</section>
|
|
379
505
|
</base-form-section>
|
|
380
506
|
<base-form-section :title="$dataStore.t('pension.paymentTerms')">
|
|
381
507
|
<base-form-input
|
|
382
508
|
v-model="contractDate"
|
|
383
509
|
:maska="$maska.date"
|
|
384
|
-
:rules="!isDisabled ? $rules.required.concat($rules.date) : []"
|
|
385
|
-
:readonly="isDisabled"
|
|
510
|
+
:rules="!isDisabled ? $rules.required.concat($rules.date, [validateContractDate]) : []"
|
|
511
|
+
:readonly="isDisabled || formStore.applicationData.processCode === 24 || isSlavePensionForm"
|
|
386
512
|
:clearable="!isDisabled"
|
|
387
513
|
:min-date="new Date()"
|
|
514
|
+
:max-date="formatDate(maxDate ?? '') ?? undefined"
|
|
388
515
|
:label="$dataStore.t('pension.contractDate')"
|
|
389
516
|
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
390
517
|
/>
|
|
@@ -403,8 +530,24 @@
|
|
|
403
530
|
<base-form-input v-model="pensionForm.frequencyPayments" disabled :label="$dataStore.t('pension.frequencyPayments')" />
|
|
404
531
|
<base-form-input v-model="pensionForm.periodPayments" disabled :label="$dataStore.t('pension.paymentPeriod')" />
|
|
405
532
|
<base-form-input v-model="pensionForm.insuranceProgramType" disabled :label="$dataStore.t('pension.insuranceProgramType')" />
|
|
406
|
-
<base-form-input
|
|
407
|
-
|
|
533
|
+
<base-form-input
|
|
534
|
+
v-if="formStore.applicationData.processCode === 25 && formStore.pensionApp?.slave?.amount"
|
|
535
|
+
:value="totalInsPremium"
|
|
536
|
+
:active="true"
|
|
537
|
+
:label="$dataStore.t('productConditionsForm.totalInsurancePremiumAmount')"
|
|
538
|
+
:disabled="$dataStore.isLoading"
|
|
539
|
+
readonly
|
|
540
|
+
/>
|
|
541
|
+
<base-form-input
|
|
542
|
+
v-model="pensionForm.amount"
|
|
543
|
+
:value="$dataStore.getNumberWithSpaces(pensionForm.amount)"
|
|
544
|
+
@input="onInputPension($event, 'pensionAmount')"
|
|
545
|
+
@onClear="onClearPension('pensionAmount')"
|
|
546
|
+
@change="customPension = true"
|
|
547
|
+
:readonly="isDisabled || formStore.applicationData.processCode !== 25"
|
|
548
|
+
:label="$dataStore.t('pension.pensionAmount')"
|
|
549
|
+
/>
|
|
550
|
+
<base-form-input :value="$dataStore.getNumberWithSpaces(pensionForm.payment)" :active="true" readonly :label="$dataStore.t('pension.pensionPayment')" />
|
|
408
551
|
</base-form-section>
|
|
409
552
|
</section>
|
|
410
553
|
<base-form-section v-if="hasAnnuityPayments" :title="$dataStore.t('calculationAnnuityPayments')">
|
|
@@ -619,17 +762,46 @@
|
|
|
619
762
|
</div>
|
|
620
763
|
</base-form-section>
|
|
621
764
|
</v-form>
|
|
622
|
-
<base-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
765
|
+
<base-animation>
|
|
766
|
+
<base-btn
|
|
767
|
+
v-if="!$dataStore.isCalculator && isCalculator && hasCalculated"
|
|
768
|
+
:btn="$styles.greenLightBtn"
|
|
769
|
+
:text="$dataStore.t('buttons.toStatement')"
|
|
770
|
+
class="min-h-[60px]"
|
|
771
|
+
@click="toStatement"
|
|
772
|
+
/>
|
|
773
|
+
</base-animation>
|
|
774
|
+
<base-animation>
|
|
775
|
+
<base-btn
|
|
776
|
+
v-if="!isDisabled && $dataStore.isPension && isTask"
|
|
777
|
+
:text="$dataStore.t('buttons.calculate')"
|
|
778
|
+
:loading="$dataStore.isLoading"
|
|
779
|
+
class="min-h-[60px]"
|
|
780
|
+
type="submit"
|
|
781
|
+
@click="submitForm"
|
|
782
|
+
/>
|
|
783
|
+
</base-animation>
|
|
784
|
+
<base-animation>
|
|
785
|
+
<base-btn
|
|
786
|
+
v-if="$dataStore.isCalculator ? true : !isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter()) && !$dataStore.isPension"
|
|
787
|
+
:loading="isCalculating"
|
|
788
|
+
class="min-h-[60px]"
|
|
789
|
+
:text="$dataStore.t('buttons.calculate')"
|
|
790
|
+
@click="submitForm"
|
|
791
|
+
/>
|
|
792
|
+
</base-animation>
|
|
630
793
|
<div v-if="$dataStore.isTask() && $dataStore.isUnderwriter() && !isRecalculationDisabled" class="flex gap-3">
|
|
631
|
-
<base-
|
|
632
|
-
|
|
794
|
+
<base-animation>
|
|
795
|
+
<base-btn
|
|
796
|
+
v-if="hasCalcSum"
|
|
797
|
+
class="min-h-[60px]"
|
|
798
|
+
:text="$dataStore.t('buttons.calcSum')"
|
|
799
|
+
type="submit"
|
|
800
|
+
@click.prevent="underwriterCalculate('sum')"
|
|
801
|
+
:loading="isCalculating"
|
|
802
|
+
/>
|
|
803
|
+
</base-animation>
|
|
804
|
+
<base-btn class="min-h-[60px]" :text="$dataStore.t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
|
|
633
805
|
</div>
|
|
634
806
|
<Teleport v-if="isPanelOpen" to="#right-panel-actions">
|
|
635
807
|
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
@@ -692,12 +864,22 @@
|
|
|
692
864
|
</div>
|
|
693
865
|
</Teleport>
|
|
694
866
|
</section>
|
|
867
|
+
<div v-if="isLoading" class="w-full h-[80dvh] flex items-center justify-center"><base-loader :size="50" /></div>
|
|
695
868
|
</template>
|
|
696
869
|
|
|
697
870
|
<script lang="ts">
|
|
698
|
-
import { Member, Value, CountryValue, CalculatorForm } from '../../composables/classes';
|
|
871
|
+
import { Member, Value, CountryValue, CalculatorForm, TransferContract } from '../../composables/classes';
|
|
699
872
|
import type { Projects, AddCover, AddCoverAnswer } from '../../types';
|
|
700
873
|
|
|
874
|
+
type PensionCalculation = {
|
|
875
|
+
compulsoryContractAmount: number | string | null;
|
|
876
|
+
voluntaryContractAmount: number | string | null;
|
|
877
|
+
ownFundsRaisAmount: number | string | null;
|
|
878
|
+
compulsoryProfContractAmount: number | string | null;
|
|
879
|
+
transferContractAmount: number | string | null;
|
|
880
|
+
transferContractCompany: number | string | null;
|
|
881
|
+
};
|
|
882
|
+
|
|
701
883
|
export default defineComponent({
|
|
702
884
|
props: {
|
|
703
885
|
isCalculator: {
|
|
@@ -722,6 +904,7 @@ export default defineComponent({
|
|
|
722
904
|
const isPanelLoading = ref<boolean>(false);
|
|
723
905
|
const isPanelOpen = ref<boolean>(false);
|
|
724
906
|
const isTermsPanelOpen = ref<boolean>(false);
|
|
907
|
+
const isLoading = ref<boolean>(false);
|
|
725
908
|
const panelValue = ref<Value>(new Value());
|
|
726
909
|
const termValue = ref<AddCover>();
|
|
727
910
|
const subTermValue = ref<string>('');
|
|
@@ -734,23 +917,49 @@ export default defineComponent({
|
|
|
734
917
|
const whichSum = ref<'insurancePremiumPerMonth' | 'requestedSumInsured' | ''>('');
|
|
735
918
|
const panelCodeList = ['processcovertypesum', 'fixedinssum'];
|
|
736
919
|
const enabled = 'включено';
|
|
920
|
+
const amountRefunded = ref<string | number | null>(null);
|
|
921
|
+
const amountPaid = ref<string | number | null>(null);
|
|
737
922
|
|
|
738
923
|
const additionalTerms = ref<AddCover[]>([]);
|
|
739
924
|
|
|
740
|
-
const maxDate = ref();
|
|
925
|
+
const maxDate = ref<string | null>();
|
|
926
|
+
const transferMaxDate = ref();
|
|
741
927
|
const dateOfBegin = ref();
|
|
742
|
-
const contractDate = ref();
|
|
743
|
-
const transferContractDate = ref();
|
|
744
|
-
const transferContractFirstPaymentDate = ref();
|
|
745
|
-
const guaranteedPeriodList = Array.from(Array(35), (
|
|
746
|
-
const
|
|
747
|
-
const
|
|
928
|
+
const contractDate = ref<string | null>();
|
|
929
|
+
const transferContractDate = ref<string | null>();
|
|
930
|
+
const transferContractFirstPaymentDate = ref<string | null>();
|
|
931
|
+
const guaranteedPeriodList = Array.from(Array(35), (_, i) => i + 1);
|
|
932
|
+
const isSlavePensionForm = computed(() => route.query.which === 'slave');
|
|
933
|
+
const pensionForm = computedWithControl(
|
|
934
|
+
() => formStore.pensionApp,
|
|
935
|
+
() => (route.query.which === 'slave' ? formStore.pensionApp?.slave : formStore.pensionApp ?? undefined),
|
|
936
|
+
);
|
|
937
|
+
|
|
938
|
+
const insuredForm = isSlavePensionForm.value
|
|
939
|
+
? formStore.applicationData?.slave?.insuredApp && formStore.applicationData?.slave?.insuredApp[0]
|
|
940
|
+
: (formStore.applicationData?.insuredApp && Array.isArray(formStore.applicationData?.insuredApp) && formStore.applicationData?.insuredApp[0]) ?? undefined;
|
|
941
|
+
const disabilityGroup = computed(() => {
|
|
942
|
+
if (!!insuredForm.disabilityGroupId) {
|
|
943
|
+
const disabilityGroup = dataStore.disabilityGroups.find(i => i.id === insuredForm.disabilityGroupId);
|
|
944
|
+
return disabilityGroup;
|
|
945
|
+
}
|
|
946
|
+
});
|
|
947
|
+
const isEnpfSum = pensionForm.value?.isEnpfSum ?? false;
|
|
748
948
|
|
|
949
|
+
const transferContracts = ref<TransferContract[]>([]);
|
|
950
|
+
const contractsValue = ref<Value[]>([]);
|
|
951
|
+
const contractIndex = ref<number>(0);
|
|
749
952
|
const isMultiplePanelOpen = ref<boolean>(false);
|
|
750
953
|
const multiplePanelValue = ref<CountryValue>(new CountryValue());
|
|
751
954
|
const multiplePanelList = ref<CountryValue[]>([]);
|
|
752
955
|
const calculatorForm = productConditionsForm.calculatorForm;
|
|
753
956
|
const minInsSum = computed(() => formStore.lfb.clients && formStore.lfb.clients.reduce((min, item) => Math.min(min, item.insSum), Infinity));
|
|
957
|
+
const contragentData = ref<any>();
|
|
958
|
+
const customPension = ref<boolean>(false);
|
|
959
|
+
const transferSum = ref<number>(0);
|
|
960
|
+
const firstAmount = ref<boolean>(true);
|
|
961
|
+
const isHalykBank = formStore.lfb.policyholder.clientData.iin.replace(/-/g, '') === '940140000385';
|
|
962
|
+
|
|
754
963
|
const isShownAdditionalTerms = computed(() => {
|
|
755
964
|
if (whichProduct.value === 'gons') {
|
|
756
965
|
return false;
|
|
@@ -769,6 +978,9 @@ export default defineComponent({
|
|
|
769
978
|
if (whichProduct.value === 'gons') {
|
|
770
979
|
return true;
|
|
771
980
|
}
|
|
981
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
982
|
+
return true;
|
|
983
|
+
}
|
|
772
984
|
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && dataStore.isUnderwriter()) {
|
|
773
985
|
return false;
|
|
774
986
|
}
|
|
@@ -778,7 +990,13 @@ export default defineComponent({
|
|
|
778
990
|
const isTask = computed(() => (route.params.taskId === '0' && props.isCalculator === true) || dataStore.isTask() || fromIndexPage.value);
|
|
779
991
|
const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm || formStore.canBeClaimed === true);
|
|
780
992
|
const isUnderwriterRole = computed(() => dataStore.isUnderwriter() || dataStore.isAdmin() || dataStore.isSupport());
|
|
781
|
-
const insurancePremiumPerMonthRule = computed(() =>
|
|
993
|
+
const insurancePremiumPerMonthRule = computed(() =>
|
|
994
|
+
!!productConditionsForm.insurancePremiumPerMonth
|
|
995
|
+
? whichProduct.value === 'gons' || whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns'
|
|
996
|
+
? dataStore.rules.required
|
|
997
|
+
: dataStore.rules.required.concat(dataStore.rules.sums)
|
|
998
|
+
: [],
|
|
999
|
+
);
|
|
782
1000
|
const insurancePremiumPerMonthDisabled = computed(() => {
|
|
783
1001
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
784
1002
|
return true;
|
|
@@ -788,12 +1006,21 @@ export default defineComponent({
|
|
|
788
1006
|
}
|
|
789
1007
|
return isDisabled.value;
|
|
790
1008
|
});
|
|
791
|
-
const requestedSumInsuredRule = computed(() =>
|
|
1009
|
+
const requestedSumInsuredRule = computed(() =>
|
|
1010
|
+
!!productConditionsForm.requestedSumInsured ? (whichProduct.value === 'gons' ? dataStore.rules.required : dataStore.rules.required.concat(dataStore.rules.sums)) : [],
|
|
1011
|
+
);
|
|
792
1012
|
const fixInsSumRule = computed(() =>
|
|
793
1013
|
!!productConditionsForm.fixInsSum
|
|
794
1014
|
? dataStore.rules.required.concat(dataStore.rules.sums, dataStore.rules.fixInsSumLimit(getNumber(productConditionsForm.fixInsSum as string), minInsSum.value))
|
|
795
1015
|
: [],
|
|
796
1016
|
);
|
|
1017
|
+
const agencyPartRule = computed(() => {
|
|
1018
|
+
if (formStore.lfb.add || isHalykBank) {
|
|
1019
|
+
return productConditionsForm.agentCommission === 0 ? [] : dataStore.rules.required;
|
|
1020
|
+
} else {
|
|
1021
|
+
return dataStore.rules.required.concat(dataStore.rules.numbers, dataStore.rules.agentCommission);
|
|
1022
|
+
}
|
|
1023
|
+
});
|
|
797
1024
|
const amountAnnuityPayments = computed(() => (!!productConditionsForm.amountAnnuityPayments ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
798
1025
|
const hasCalculated = computed(() => {
|
|
799
1026
|
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && productConditionsForm.requestedSumInsured === null) {
|
|
@@ -802,22 +1029,16 @@ export default defineComponent({
|
|
|
802
1029
|
return !!productConditionsForm.requestedSumInsured && !!productConditionsForm.insurancePremiumPerMonth;
|
|
803
1030
|
});
|
|
804
1031
|
const hasProcessIndexRate = computed(() => {
|
|
805
|
-
if (
|
|
806
|
-
|
|
807
|
-
whichProduct.value === 'halykkazyna' ||
|
|
808
|
-
whichProduct.value === 'liferenta' ||
|
|
809
|
-
whichProduct.value === 'lifebusiness' ||
|
|
810
|
-
whichProduct.value === 'amuletlife' ||
|
|
811
|
-
whichProduct.value === 'gns'
|
|
812
|
-
) {
|
|
813
|
-
return false;
|
|
814
|
-
}
|
|
815
|
-
return true;
|
|
1032
|
+
if (whichProduct.value === 'baiterek' || whichProduct.value === 'bolashak') return true;
|
|
1033
|
+
return false;
|
|
816
1034
|
});
|
|
817
1035
|
const hasPaymentPeriod = computed(() => {
|
|
818
1036
|
if (whichProduct.value === 'halykkazyna') {
|
|
819
1037
|
return false;
|
|
820
1038
|
}
|
|
1039
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1040
|
+
return false;
|
|
1041
|
+
}
|
|
821
1042
|
return true;
|
|
822
1043
|
});
|
|
823
1044
|
const hasCoverPeriod = computed(() => {
|
|
@@ -826,22 +1047,44 @@ export default defineComponent({
|
|
|
826
1047
|
}
|
|
827
1048
|
return true;
|
|
828
1049
|
});
|
|
1050
|
+
|
|
1051
|
+
const hasRequestedSumInsured = computed(() => {
|
|
1052
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1053
|
+
return false;
|
|
1054
|
+
}
|
|
1055
|
+
return true;
|
|
1056
|
+
});
|
|
829
1057
|
const hasRequestedSumInsuredInDollar = computed(() => {
|
|
830
1058
|
if (whichProduct.value === 'halykkazyna') {
|
|
831
1059
|
return true;
|
|
832
1060
|
}
|
|
1061
|
+
if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
|
|
1062
|
+
return true;
|
|
1063
|
+
}
|
|
833
1064
|
return false;
|
|
834
1065
|
});
|
|
1066
|
+
const hasInsurancePremiumPerMonth = computed(() => {
|
|
1067
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1068
|
+
return false;
|
|
1069
|
+
}
|
|
1070
|
+
return true;
|
|
1071
|
+
});
|
|
835
1072
|
const hasInsurancePremiumPerMonthInDollar = computed(() => {
|
|
836
1073
|
if (whichProduct.value === 'halykkazyna') {
|
|
837
1074
|
return true;
|
|
838
1075
|
}
|
|
1076
|
+
if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
|
|
1077
|
+
return true;
|
|
1078
|
+
}
|
|
839
1079
|
return false;
|
|
840
1080
|
});
|
|
841
|
-
const
|
|
1081
|
+
const hasCurrencySymbols = computed(() => {
|
|
842
1082
|
if (whichProduct.value === 'halykkazyna') {
|
|
843
1083
|
return true;
|
|
844
1084
|
}
|
|
1085
|
+
if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
|
|
1086
|
+
return true;
|
|
1087
|
+
}
|
|
845
1088
|
return false;
|
|
846
1089
|
});
|
|
847
1090
|
const hasAdbMultiply = computed(() => {
|
|
@@ -878,6 +1121,15 @@ export default defineComponent({
|
|
|
878
1121
|
if (whichProduct.value === 'gons') {
|
|
879
1122
|
return false;
|
|
880
1123
|
}
|
|
1124
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1125
|
+
return false;
|
|
1126
|
+
}
|
|
1127
|
+
return true;
|
|
1128
|
+
});
|
|
1129
|
+
const hasDisabilityAdditive = computed(() => {
|
|
1130
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1131
|
+
return false;
|
|
1132
|
+
}
|
|
881
1133
|
return true;
|
|
882
1134
|
});
|
|
883
1135
|
const hasAnnuityPayments = computed(() => {
|
|
@@ -944,6 +1196,42 @@ export default defineComponent({
|
|
|
944
1196
|
}
|
|
945
1197
|
return dataStore.t('productConditionsForm.insurancePremiumAmount');
|
|
946
1198
|
});
|
|
1199
|
+
const currencySymbolsLabel = computed(() => {
|
|
1200
|
+
if (whichProduct.value === 'gons') {
|
|
1201
|
+
return dataStore.t('productConditionsForm.exchangeRateSettlementDate');
|
|
1202
|
+
}
|
|
1203
|
+
return dataStore.t('productConditionsForm.dollarExchangeRateNBRK');
|
|
1204
|
+
});
|
|
1205
|
+
const lifeMultiplyLabel = computed(() => {
|
|
1206
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1207
|
+
return dataStore.t('percent') + `Life (смерть по любой причине) multiply`;
|
|
1208
|
+
}
|
|
1209
|
+
return dataStore.t('percent') + `Life Multiply`;
|
|
1210
|
+
});
|
|
1211
|
+
const lifeAdditiveLabel = computed(() => {
|
|
1212
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1213
|
+
return dataStore.t('percent') + `Life (смерть по любой причине) надбавка`;
|
|
1214
|
+
}
|
|
1215
|
+
return dataStore.t('percent') + `Life Additive`;
|
|
1216
|
+
});
|
|
1217
|
+
const disabilityMultiplyLabel = computed(() => {
|
|
1218
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1219
|
+
return dataStore.t('percent') + `Disability (инвалидность, временная утрата тр-ти, стойкая утрата тр-ти)`;
|
|
1220
|
+
}
|
|
1221
|
+
return dataStore.t('percent') + `Disability Multiply`;
|
|
1222
|
+
});
|
|
1223
|
+
const adbMultiplyLabel = computed(() => {
|
|
1224
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1225
|
+
return dataStore.t('percent') + `Accidental life multiply`;
|
|
1226
|
+
}
|
|
1227
|
+
return dataStore.t('percent') + `Adb Multiply`;
|
|
1228
|
+
});
|
|
1229
|
+
const adbAdditiveLabel = computed(() => {
|
|
1230
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1231
|
+
return dataStore.t('percent') + `Accidental life additional надбавка`;
|
|
1232
|
+
}
|
|
1233
|
+
return dataStore.t('percent') + `Adb Additive`;
|
|
1234
|
+
});
|
|
947
1235
|
const isDisabledFixInsSum = computed(() => {
|
|
948
1236
|
if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
|
|
949
1237
|
return false;
|
|
@@ -991,11 +1279,23 @@ export default defineComponent({
|
|
|
991
1279
|
return true;
|
|
992
1280
|
});
|
|
993
1281
|
const isDisabledAgentCommission = computed(() => {
|
|
1282
|
+
if (isHalykBank) {
|
|
1283
|
+
return true;
|
|
1284
|
+
}
|
|
1285
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1286
|
+
return true;
|
|
1287
|
+
}
|
|
994
1288
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns' || dataStore.isUnderwriter()) {
|
|
995
1289
|
return false;
|
|
996
1290
|
}
|
|
997
1291
|
return isDisabled.value;
|
|
998
1292
|
});
|
|
1293
|
+
const isDisabledInsStartDate = computed(() => {
|
|
1294
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1295
|
+
return true;
|
|
1296
|
+
}
|
|
1297
|
+
return isDisabled.value;
|
|
1298
|
+
});
|
|
999
1299
|
const hasCalcSum = computed(() => {
|
|
1000
1300
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1001
1301
|
return false;
|
|
@@ -1003,7 +1303,13 @@ export default defineComponent({
|
|
|
1003
1303
|
return true;
|
|
1004
1304
|
});
|
|
1005
1305
|
const hasFixInsSum = computed(() => {
|
|
1006
|
-
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1306
|
+
if (!formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1307
|
+
return true;
|
|
1308
|
+
}
|
|
1309
|
+
return false;
|
|
1310
|
+
});
|
|
1311
|
+
const hasPaidOrRefund = computed(() => {
|
|
1312
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1007
1313
|
return true;
|
|
1008
1314
|
}
|
|
1009
1315
|
return false;
|
|
@@ -1038,26 +1344,51 @@ export default defineComponent({
|
|
|
1038
1344
|
}
|
|
1039
1345
|
return false;
|
|
1040
1346
|
});
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1347
|
+
const hasCurrency = computed(() => {
|
|
1348
|
+
if (whichProduct.value === 'gons') {
|
|
1349
|
+
return true;
|
|
1350
|
+
}
|
|
1351
|
+
return false;
|
|
1352
|
+
});
|
|
1353
|
+
const hasContragentData = computed(() => {
|
|
1354
|
+
if (whichProduct.value === 'pensionannuitynew') {
|
|
1355
|
+
return true;
|
|
1356
|
+
}
|
|
1357
|
+
return false;
|
|
1358
|
+
});
|
|
1359
|
+
const isDisabledPaymentPeriod = computed(() => {
|
|
1360
|
+
if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
|
|
1361
|
+
return true;
|
|
1362
|
+
}
|
|
1363
|
+
return isDisabled.value;
|
|
1364
|
+
});
|
|
1365
|
+
const currencyListFiltered = computed(() => {
|
|
1366
|
+
return constants.currencyList;
|
|
1049
1367
|
});
|
|
1050
1368
|
|
|
1051
|
-
const
|
|
1052
|
-
|
|
1053
|
-
? (Number(pensionCalculationParams.value.compulsoryContractAmount) ?? 0) +
|
|
1054
|
-
(Number(pensionCalculationParams.value.voluntaryContractAmount) ?? 0) +
|
|
1055
|
-
(Number(pensionCalculationParams.value.ownFundsRaisAmount) ?? 0) +
|
|
1056
|
-
(Number(pensionCalculationParams.value.compulsoryProfContractAmount) ?? 0) +
|
|
1057
|
-
(Number(pensionCalculationParams.value.transferContractAmount) ?? 0)
|
|
1058
|
-
: 0,
|
|
1369
|
+
const totalInsPremium = computed(() =>
|
|
1370
|
+
dataStore.getNumberWithSpaces(formatSpacedNumber(formStore.pensionApp?.amount) + formatSpacedNumber(formStore.pensionApp.slave?.amount)),
|
|
1059
1371
|
);
|
|
1060
1372
|
|
|
1373
|
+
const getContragent = async () => {
|
|
1374
|
+
const data = await dataStore.api.getContragentById(
|
|
1375
|
+
Number(route.query.which !== 'slave' ? formStore.applicationData.clientApp.insisId : formStore.applicationData.slave.clientApp.insisId),
|
|
1376
|
+
);
|
|
1377
|
+
if (data && data.items.length != 0) {
|
|
1378
|
+
contragentData.value = data.items[0];
|
|
1379
|
+
contragentData.value.gender = contragentData.value.gender === 1 ? dataStore.t('pension.male') : dataStore.t('pension.female');
|
|
1380
|
+
contragentData.value.birthDate = reformatDate(contragentData.value.birthDate);
|
|
1381
|
+
}
|
|
1382
|
+
};
|
|
1383
|
+
|
|
1384
|
+
const sumContractsAmount = (transferContracts: TransferContract[]) => {
|
|
1385
|
+
if (!transferContracts || !transferContracts.length) return 0;
|
|
1386
|
+
return transferContracts.reduce((accumulator, currentValue) => {
|
|
1387
|
+
const transferAmount = structuredClone(toRaw(currentValue));
|
|
1388
|
+
return accumulator + Number(String(transferAmount.transferContractAmount).replace(/\s/g, ''));
|
|
1389
|
+
}, 0);
|
|
1390
|
+
};
|
|
1391
|
+
|
|
1061
1392
|
const formatTermValue = (term: number) => {
|
|
1062
1393
|
if (term !== null) {
|
|
1063
1394
|
const termNumber = Number(term);
|
|
@@ -1069,7 +1400,7 @@ export default defineComponent({
|
|
|
1069
1400
|
const toStatement = async () => {
|
|
1070
1401
|
const statementItem = dataStore.menuItems.find(i => i.id === 'statement');
|
|
1071
1402
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1072
|
-
await router.push({ name: 'taskId-NewApp', params: route.params, query: { tab: 'statement' } });
|
|
1403
|
+
await router.push({ name: 'taskId-NewApp', params: route.params, query: { tab: 'statement', add: 'false' } });
|
|
1073
1404
|
return;
|
|
1074
1405
|
}
|
|
1075
1406
|
if (whichProduct.value === 'gons') {
|
|
@@ -1088,7 +1419,7 @@ export default defineComponent({
|
|
|
1088
1419
|
}
|
|
1089
1420
|
};
|
|
1090
1421
|
|
|
1091
|
-
const pickPanelValue = (item: Value) => {
|
|
1422
|
+
const pickPanelValue = async (item: Value) => {
|
|
1092
1423
|
dataStore.rightPanel.open = false;
|
|
1093
1424
|
isPanelOpen.value = false;
|
|
1094
1425
|
isMultiplePanelOpen.value = false;
|
|
@@ -1100,14 +1431,31 @@ export default defineComponent({
|
|
|
1100
1431
|
// @ts-ignore
|
|
1101
1432
|
calculatorForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
1102
1433
|
} else if (whichProduct.value === 'pensionannuitynew') {
|
|
1103
|
-
|
|
1104
|
-
|
|
1434
|
+
if (currentPanel.value === 'transferContractCompany') {
|
|
1435
|
+
transferContracts.value[contractIndex.value].transferContractCompany = item;
|
|
1436
|
+
} else {
|
|
1437
|
+
// @ts-ignore
|
|
1438
|
+
pensionForm.value[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
1439
|
+
}
|
|
1105
1440
|
} else {
|
|
1106
1441
|
// @ts-ignore
|
|
1107
1442
|
productConditionsForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
1108
|
-
if (currentPanel.value === 'paymentPeriod' &&
|
|
1109
|
-
|
|
1110
|
-
|
|
1443
|
+
if (currentPanel.value === 'paymentPeriod' && item.code === 'single') {
|
|
1444
|
+
if (hasProcessIndexRate.value) {
|
|
1445
|
+
const defaultIndexRate = dataStore.processIndexRate.find((i: any) => i.isDefault === true);
|
|
1446
|
+
if (defaultIndexRate) productConditionsForm.processIndexRate = defaultIndexRate;
|
|
1447
|
+
}
|
|
1448
|
+
if (whichProduct.value === 'bolashak') {
|
|
1449
|
+
const termCover = additionalTerms.value?.findIndex(i => i.coverTypeCode === 10);
|
|
1450
|
+
if (termCover !== -1) {
|
|
1451
|
+
const termList = await dataStore.getAdditionalInsuranceTermsAnswers(additionalTerms.value[termCover].coverTypeId);
|
|
1452
|
+
const defaultTermValue = termList?.find(i => i.isDefault === true);
|
|
1453
|
+
if (defaultTermValue) {
|
|
1454
|
+
additionalTerms.value[termCover].coverSumId = String(defaultTermValue.id);
|
|
1455
|
+
additionalTerms.value[termCover].coverSumName = String(defaultTermValue.nameRu);
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1111
1459
|
}
|
|
1112
1460
|
}
|
|
1113
1461
|
};
|
|
@@ -1331,7 +1679,7 @@ export default defineComponent({
|
|
|
1331
1679
|
const calculatedPremiumDollar = getNumber(event.target.value as string);
|
|
1332
1680
|
if (calculatedPremiumDollar) {
|
|
1333
1681
|
productConditionsForm.insurancePremiumPerMonth = dataStore.getNumberWithSpaces(productConditionsForm.insurancePremiumPerMonth);
|
|
1334
|
-
if (whichProduct.value === 'halykkazyna') {
|
|
1682
|
+
if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
|
|
1335
1683
|
if (typeof dataStore.currencies.usd === 'number') {
|
|
1336
1684
|
productConditionsForm.insurancePremiumPerMonthInDollar = dataStore.getNumberWithSpaces(calculatedPremiumDollar / dataStore.currencies.usd);
|
|
1337
1685
|
} else {
|
|
@@ -1359,7 +1707,7 @@ export default defineComponent({
|
|
|
1359
1707
|
const calculatedSumDollar = getNumber(event.target.value as string);
|
|
1360
1708
|
if (calculatedSumDollar) {
|
|
1361
1709
|
productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(productConditionsForm.requestedSumInsured);
|
|
1362
|
-
if (whichProduct.value === 'halykkazyna') {
|
|
1710
|
+
if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
|
|
1363
1711
|
if (typeof dataStore.currencies.usd === 'number') {
|
|
1364
1712
|
productConditionsForm.requestedSumInsuredInDollar = dataStore.getNumberWithSpaces(calculatedSumDollar / dataStore.currencies.usd);
|
|
1365
1713
|
} else {
|
|
@@ -1370,6 +1718,42 @@ export default defineComponent({
|
|
|
1370
1718
|
}
|
|
1371
1719
|
};
|
|
1372
1720
|
|
|
1721
|
+
const onInputPension = (event: Event, key: keyof PensionCalculation | 'pensionAmount', index?: number) => {
|
|
1722
|
+
if (event.target && 'value' in event.target && event.target.value) {
|
|
1723
|
+
const calcCheck = getNumber(event.target.value as string);
|
|
1724
|
+
if (calcCheck) {
|
|
1725
|
+
if (index !== undefined) {
|
|
1726
|
+
transferContracts.value[index].transferContractAmount = dataStore.getNumberWithSpaces(event.target.value) as string;
|
|
1727
|
+
transferSum.value = transferContracts.value.reduce((accumulator, { transferContractAmount }) => (accumulator += formatSpacedNumber(transferContractAmount)), 0);
|
|
1728
|
+
} else if (key === 'pensionAmount') {
|
|
1729
|
+
pensionForm.value.amount = dataStore.getNumberWithSpaces(event.target.value) ?? '0';
|
|
1730
|
+
} else {
|
|
1731
|
+
pensionForm.value[key] = dataStore.getNumberWithSpaces(event.target.value);
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
} else {
|
|
1735
|
+
if (index !== undefined) {
|
|
1736
|
+
transferContracts.value[index].transferContractAmount = 0;
|
|
1737
|
+
transferSum.value = transferContracts.value.reduce((accumulator, { transferContractAmount }) => (accumulator += formatSpacedNumber(transferContractAmount)), 0);
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
if (key !== 'pensionAmount' && !customPension.value) {
|
|
1741
|
+
if (firstAmount.value) {
|
|
1742
|
+
firstAmount.value = false;
|
|
1743
|
+
return;
|
|
1744
|
+
}
|
|
1745
|
+
pensionForm.value.amount =
|
|
1746
|
+
dataStore.getNumberWithSpaces(
|
|
1747
|
+
formatSpacedNumber(pensionForm.value.compulsoryContractAmount) +
|
|
1748
|
+
formatSpacedNumber(pensionForm.value.compulsoryProfContractAmount) +
|
|
1749
|
+
formatSpacedNumber(pensionForm.value.ownFundsRaisAmount) +
|
|
1750
|
+
formatSpacedNumber(pensionForm.value.transferContractAmount) +
|
|
1751
|
+
formatSpacedNumber(pensionForm.value.voluntaryContractAmount) +
|
|
1752
|
+
sumContractsAmount(transferContracts.value),
|
|
1753
|
+
) ?? '';
|
|
1754
|
+
}
|
|
1755
|
+
};
|
|
1756
|
+
|
|
1373
1757
|
const onInputFixInsSum = (event: Event) => {
|
|
1374
1758
|
if (event.target && 'value' in event.target && event.target.value) {
|
|
1375
1759
|
const calculatedFixInsSum = getNumber(event.target.value as string);
|
|
@@ -1394,6 +1778,16 @@ export default defineComponent({
|
|
|
1394
1778
|
productConditionsForm.requestedSumInsuredInDollar = null;
|
|
1395
1779
|
};
|
|
1396
1780
|
|
|
1781
|
+
const onClearPension = (key: keyof PensionCalculation | 'pensionAmount', index?: number) => {
|
|
1782
|
+
if (index) {
|
|
1783
|
+
transferContracts.value[index].transferContractAmount = 0;
|
|
1784
|
+
} else if (key === 'pensionAmount') {
|
|
1785
|
+
pensionForm.value.amount = '0';
|
|
1786
|
+
} else {
|
|
1787
|
+
pensionForm.value[key] = null;
|
|
1788
|
+
}
|
|
1789
|
+
};
|
|
1790
|
+
|
|
1397
1791
|
const onClearSumDollar = () => {
|
|
1398
1792
|
productConditionsForm.requestedSumInsured = null;
|
|
1399
1793
|
};
|
|
@@ -1425,8 +1819,10 @@ export default defineComponent({
|
|
|
1425
1819
|
};
|
|
1426
1820
|
|
|
1427
1821
|
const filterTermConditions = (term: AddCover) => {
|
|
1428
|
-
if (term.coverTypeCode === 10) {
|
|
1429
|
-
|
|
1822
|
+
if (term.coverTypeCode === 10 && !props.isCalculator) {
|
|
1823
|
+
const isSinglePeriod = whichProduct.value === 'bolashak' ? productConditionsForm.paymentPeriod?.code === 'single' : false;
|
|
1824
|
+
const isDifferentClients = !!formStore.insuredForm.find((member: Member) => member.iin === formStore.policyholderForm.iin) === false;
|
|
1825
|
+
return isDifferentClients && !isSinglePeriod;
|
|
1430
1826
|
}
|
|
1431
1827
|
return true;
|
|
1432
1828
|
};
|
|
@@ -1438,6 +1834,47 @@ export default defineComponent({
|
|
|
1438
1834
|
return term.coverTypeName;
|
|
1439
1835
|
};
|
|
1440
1836
|
|
|
1837
|
+
const addTransferContract = () => {
|
|
1838
|
+
transferContracts.value.push(new TransferContract());
|
|
1839
|
+
};
|
|
1840
|
+
|
|
1841
|
+
const removeTransferContract = (index: number) => {
|
|
1842
|
+
transferContracts.value.splice(index, 1);
|
|
1843
|
+
transferSum.value = transferContracts.value.reduce((accumulator, { transferContractAmount }) => (accumulator += formatSpacedNumber(transferContractAmount)), 0);
|
|
1844
|
+
};
|
|
1845
|
+
|
|
1846
|
+
const prepareTransferContracts = (transferContracts: Array<TransferContract>) => {
|
|
1847
|
+
const formatedContracts: Array<TransferContract> = [];
|
|
1848
|
+
if (transferContracts && transferContracts.length) {
|
|
1849
|
+
transferContracts.forEach(i => {
|
|
1850
|
+
formatedContracts.push({
|
|
1851
|
+
...i,
|
|
1852
|
+
transferContractDate: constants.regex.isoDate.test(i.transferContractDate) ? i.transferContractDate : formatDate(i.transferContractDate)?.toISOString() ?? '',
|
|
1853
|
+
transferContractFirstPaymentDate: constants.regex.isoDate.test(i.transferContractFirstPaymentDate)
|
|
1854
|
+
? i.transferContractFirstPaymentDate
|
|
1855
|
+
: formatDate(i.transferContractFirstPaymentDate)?.toISOString() ?? '',
|
|
1856
|
+
// @ts-ignore
|
|
1857
|
+
transferContractCompany:
|
|
1858
|
+
typeof i.transferContractCompany !== 'string' && 'nameRu' in i.transferContractCompany ? String(i.transferContractCompany.nameRu) : i.transferContractCompany,
|
|
1859
|
+
transferContractCompanyId:
|
|
1860
|
+
// @ts-ignore
|
|
1861
|
+
typeof i.transferContractCompany !== 'string' && 'ids' in i.transferContractCompany ? i.transferContractCompany.ids : i.transferContractCompanyId,
|
|
1862
|
+
id: i.id ?? null,
|
|
1863
|
+
transferContractAmount: String(i.transferContractAmount).replace(/\s/g, ''),
|
|
1864
|
+
});
|
|
1865
|
+
});
|
|
1866
|
+
}
|
|
1867
|
+
return formatedContracts;
|
|
1868
|
+
};
|
|
1869
|
+
|
|
1870
|
+
const validateContractDate = (v: any) => {
|
|
1871
|
+
if (v && maxDate.value && formatDate(v) && formatDate(maxDate.value)) {
|
|
1872
|
+
const invalidDate = (formatDate(v) ?? new Date()) > (formatDate(maxDate.value) ?? new Date());
|
|
1873
|
+
if (invalidDate) return 'Дата заключения договора некорректна';
|
|
1874
|
+
}
|
|
1875
|
+
return true;
|
|
1876
|
+
};
|
|
1877
|
+
|
|
1441
1878
|
const submitForm = async () => {
|
|
1442
1879
|
vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
1443
1880
|
if (v.valid) {
|
|
@@ -1445,9 +1882,12 @@ export default defineComponent({
|
|
|
1445
1882
|
if (calculatorForm.type.code === 'Single' && calculatorForm.startDate && calculatorForm.endDate) {
|
|
1446
1883
|
const formattedStartDate = formatDate(calculatorForm.startDate);
|
|
1447
1884
|
const formattedEndDate = formatDate(calculatorForm.endDate);
|
|
1448
|
-
if (formattedStartDate && formattedEndDate && formattedStartDate.getTime()
|
|
1885
|
+
if (formattedStartDate && formattedEndDate && formattedStartDate.getTime() >= formattedEndDate.getTime()) {
|
|
1449
1886
|
return dataStore.showToaster('error', dataStore.t('toaster.startMoreEnd'));
|
|
1450
1887
|
}
|
|
1888
|
+
if (calculatorForm.days !== productConditionsForm.getSingleTripDays()) {
|
|
1889
|
+
return dataStore.showToaster('error', dataStore.t('toaster.daysPickAgain'));
|
|
1890
|
+
}
|
|
1451
1891
|
}
|
|
1452
1892
|
if (dataStore.isTask()) {
|
|
1453
1893
|
await dataStore.calculatePrice(route.params.taskId as string);
|
|
@@ -1455,41 +1895,113 @@ export default defineComponent({
|
|
|
1455
1895
|
await dataStore.calculatePrice();
|
|
1456
1896
|
}
|
|
1457
1897
|
} else if (whichProduct.value === 'pensionannuitynew') {
|
|
1458
|
-
if (
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1898
|
+
if (contractDate.value && maxDate.value && formatDate(contractDate.value) && formatDate(maxDate.value)) {
|
|
1899
|
+
const invalidDate = (formatDate(contractDate.value) ?? new Date()) > (formatDate(maxDate.value) ?? new Date());
|
|
1900
|
+
if (invalidDate) {
|
|
1901
|
+
dataStore.showToaster('error', 'Дата заключения договора некорректна');
|
|
1902
|
+
return;
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
if (transferContracts.value && transferContracts.value.length) {
|
|
1906
|
+
transferContracts.value.forEach(i => {
|
|
1907
|
+
if (formatDate(i.transferContractDate) != null && formatDate(transferMaxDate.value)) {
|
|
1908
|
+
const invalidDate = (formatDate(i.transferContractDate) ?? new Date()) > (formatDate(transferMaxDate.value) ?? new Date());
|
|
1909
|
+
if (invalidDate) {
|
|
1910
|
+
dataStore.showToaster('error', 'Дата заключения договора КСЖ некорректна');
|
|
1911
|
+
return;
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
});
|
|
1467
1915
|
}
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
...
|
|
1471
|
-
|
|
1472
|
-
compulsoryContractAmount:
|
|
1473
|
-
voluntaryContractAmount:
|
|
1474
|
-
ownFundsRaisAmount:
|
|
1475
|
-
compulsoryProfContractAmount:
|
|
1476
|
-
transferContractAmount:
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1916
|
+
if (!pensionForm.value.compulsoryProfContractAmount) pensionForm.value.compulsoryProfMonthCount = null;
|
|
1917
|
+
const pensionData = {
|
|
1918
|
+
...pensionForm.value,
|
|
1919
|
+
...{
|
|
1920
|
+
compulsoryContractAmount: formatSpacedNumber(pensionForm.value.compulsoryContractAmount),
|
|
1921
|
+
voluntaryContractAmount: formatSpacedNumber(pensionForm.value.voluntaryContractAmount),
|
|
1922
|
+
ownFundsRaisAmount: formatSpacedNumber(pensionForm.value.ownFundsRaisAmount),
|
|
1923
|
+
compulsoryProfContractAmount: formatSpacedNumber(pensionForm.value.compulsoryProfContractAmount),
|
|
1924
|
+
transferContractAmount: formatSpacedNumber(pensionForm.value.transferContractAmount),
|
|
1925
|
+
transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
|
|
1926
|
+
},
|
|
1927
|
+
amount: formatSpacedNumber(pensionForm.value.amount),
|
|
1928
|
+
contractDate: formatDate(contractDate.value ?? ''),
|
|
1481
1929
|
};
|
|
1482
|
-
|
|
1930
|
+
const data = isSlavePensionForm.value
|
|
1931
|
+
? {
|
|
1932
|
+
...formStore.pensionApp,
|
|
1933
|
+
transferContracts: prepareTransferContracts(formStore.pensionApp.transferContracts),
|
|
1934
|
+
slave: pensionData,
|
|
1935
|
+
amount: formatSpacedNumber(formStore.pensionApp?.amount),
|
|
1936
|
+
compulsoryContractAmount: formatSpacedNumber(formStore.pensionApp?.compulsoryContractAmount),
|
|
1937
|
+
voluntaryContractAmount: formatSpacedNumber(formStore.pensionApp?.voluntaryContractAmount),
|
|
1938
|
+
ownFundsRaisAmount: formatSpacedNumber(formStore.pensionApp?.ownFundsRaisAmount),
|
|
1939
|
+
compulsoryProfContractAmount: formatSpacedNumber(formStore.pensionApp?.compulsoryProfContractAmount),
|
|
1940
|
+
transferContractAmount: formatSpacedNumber(formStore.pensionApp?.transferContractAmount),
|
|
1941
|
+
transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
|
|
1942
|
+
}
|
|
1943
|
+
: {
|
|
1944
|
+
...pensionData,
|
|
1945
|
+
transferContracts: prepareTransferContracts(transferContracts.value),
|
|
1946
|
+
slave: !!formStore.pensionApp?.slave
|
|
1947
|
+
? {
|
|
1948
|
+
...formStore.pensionApp?.slave,
|
|
1949
|
+
contractDate: pensionData.contractDate,
|
|
1950
|
+
amount: formatSpacedNumber(formStore.pensionApp?.slave?.amount),
|
|
1951
|
+
compulsoryContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.compulsoryContractAmount),
|
|
1952
|
+
voluntaryContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.voluntaryContractAmount),
|
|
1953
|
+
ownFundsRaisAmount: formatSpacedNumber(formStore.pensionApp?.slave?.ownFundsRaisAmount),
|
|
1954
|
+
compulsoryProfContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.compulsoryProfContractAmount),
|
|
1955
|
+
transferContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.transferContractAmount),
|
|
1956
|
+
transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
|
|
1957
|
+
}
|
|
1958
|
+
: null,
|
|
1959
|
+
};
|
|
1960
|
+
if (!!data.slave) {
|
|
1961
|
+
data.slave.transferContracts = prepareTransferContracts(isSlavePensionForm.value ? transferContracts.value : data.slave.transferContracts);
|
|
1962
|
+
const difference = Math.abs(
|
|
1963
|
+
formatSpacedNumber(formStore.pensionApp?.amount) + formatSpacedNumber(formStore.pensionApp?.slave?.amount) - formatSpacedNumber(pensionForm.value.amount),
|
|
1964
|
+
);
|
|
1965
|
+
if (customPension.value) {
|
|
1966
|
+
isSlavePensionForm.value ? (data.slave.amount = formatSpacedNumber(pensionForm.value.amount)) : (data.amount = formatSpacedNumber(pensionForm.value.amount));
|
|
1967
|
+
const customSum = sumPensionData(data) + sumPensionData(data.slave);
|
|
1968
|
+
if (formatSpacedNumber(totalInsPremium.value) !== customSum) {
|
|
1969
|
+
return dataStore.showToaster('error', 'Cтраховая премия не соответсвует общей страховой премии');
|
|
1970
|
+
}
|
|
1971
|
+
if (!isSlavePensionForm.value) {
|
|
1972
|
+
data.slave.amount = difference;
|
|
1973
|
+
} else {
|
|
1974
|
+
data.amount = difference;
|
|
1975
|
+
}
|
|
1976
|
+
} else {
|
|
1977
|
+
const amount = isSlavePensionForm.value ? data.slave.amount : data.amount;
|
|
1978
|
+
if (formatSpacedNumber(pensionForm.value.amount) != amount) {
|
|
1979
|
+
data.slave.amount = sumPensionData(data.slave);
|
|
1980
|
+
data.amount = sumPensionData(data);
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
const isParentValid = validatePensionForm(data, 'Заполните условия первого страхователя');
|
|
1984
|
+
const isSlaveValid = validatePensionForm(data.slave, 'Заполните условия второго страхователя');
|
|
1985
|
+
if (!isParentValid || !isSlaveValid) {
|
|
1986
|
+
return;
|
|
1987
|
+
}
|
|
1988
|
+
await dataStore.setApplication(data, true);
|
|
1989
|
+
customPension.value = false;
|
|
1990
|
+
} else {
|
|
1991
|
+
await dataStore.setApplication(data, true);
|
|
1992
|
+
}
|
|
1993
|
+
await dataStore.getApplicationData(String(route.params.taskId), false, false, false, true);
|
|
1994
|
+
dateOfBegin.value = reformatDate(formStore.applicationData.pensionApp.dateOfBegin);
|
|
1483
1995
|
} else {
|
|
1484
1996
|
if (whichSum.value === 'requestedSumInsured') {
|
|
1485
1997
|
productConditionsForm.insurancePremiumPerMonth = null;
|
|
1486
|
-
if (whichProduct.value === 'halykkazyna') {
|
|
1998
|
+
if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
|
|
1487
1999
|
productConditionsForm.insurancePremiumPerMonthInDollar = null;
|
|
1488
2000
|
}
|
|
1489
2001
|
}
|
|
1490
2002
|
if (whichSum.value === 'insurancePremiumPerMonth') {
|
|
1491
2003
|
productConditionsForm.requestedSumInsured = null;
|
|
1492
|
-
if (whichProduct.value === 'halykkazyna') {
|
|
2004
|
+
if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
|
|
1493
2005
|
productConditionsForm.requestedSumInsuredInDollar = null;
|
|
1494
2006
|
}
|
|
1495
2007
|
}
|
|
@@ -1555,7 +2067,9 @@ export default defineComponent({
|
|
|
1555
2067
|
recalculationData.riskGroup = productConditionsForm.riskGroup?.id ? productConditionsForm.riskGroup.id : 1;
|
|
1556
2068
|
isCalculating.value = true;
|
|
1557
2069
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1558
|
-
|
|
2070
|
+
const setApplicationData = dataStore.getConditionsData();
|
|
2071
|
+
const hasSetApplication = await dataStore.setApplication(setApplicationData);
|
|
2072
|
+
if (hasSetApplication && !isHalykBank) await dataStore.calculate(route.params.taskId as string);
|
|
1559
2073
|
additionalTerms.value = formStore.additionalInsuranceTerms;
|
|
1560
2074
|
} else {
|
|
1561
2075
|
await dataStore.reCalculate(formStore.applicationData.processInstanceId, recalculationData, route.params.taskId as string, whichSum.value);
|
|
@@ -1569,12 +2083,11 @@ export default defineComponent({
|
|
|
1569
2083
|
additionalTerms.value = formStore.additionalInsuranceTermsWithout;
|
|
1570
2084
|
} else {
|
|
1571
2085
|
if (dataStore.isProcessEditable(formStore.applicationData.statusCode)) {
|
|
1572
|
-
await dataStore.calculate(route.params.taskId as string);
|
|
2086
|
+
await dataStore.calculate(route.params.taskId as string, isHalykBank);
|
|
1573
2087
|
additionalTerms.value = formStore.additionalInsuranceTerms;
|
|
1574
2088
|
}
|
|
1575
2089
|
}
|
|
1576
2090
|
}
|
|
1577
|
-
|
|
1578
2091
|
isCalculating.value = false;
|
|
1579
2092
|
} else {
|
|
1580
2093
|
const errors = document.querySelector('.v-input--error');
|
|
@@ -1598,75 +2111,131 @@ export default defineComponent({
|
|
|
1598
2111
|
});
|
|
1599
2112
|
};
|
|
1600
2113
|
|
|
2114
|
+
const validatePensionForm = (data: any, text: string) => {
|
|
2115
|
+
if (!data.amount || !data.guaranteedPeriod) {
|
|
2116
|
+
dataStore.showToaster('error', text);
|
|
2117
|
+
return false;
|
|
2118
|
+
}
|
|
2119
|
+
return true;
|
|
2120
|
+
};
|
|
2121
|
+
|
|
2122
|
+
const sumPensionData = (data: any) => {
|
|
2123
|
+
return (
|
|
2124
|
+
formatSpacedNumber(data.ownFundsRaisAmount) +
|
|
2125
|
+
formatSpacedNumber(data.voluntaryContractAmount) +
|
|
2126
|
+
formatSpacedNumber(data.compulsoryContractAmount) +
|
|
2127
|
+
formatSpacedNumber(data.compulsoryProfContractAmount) +
|
|
2128
|
+
sumContractsAmount(data.transferContracts)
|
|
2129
|
+
);
|
|
2130
|
+
};
|
|
2131
|
+
|
|
1601
2132
|
onMounted(async () => {
|
|
1602
|
-
|
|
2133
|
+
try {
|
|
2134
|
+
if (hasContragentData.value) await getContragent();
|
|
2135
|
+
if (props.isCalculator === true) {
|
|
2136
|
+
isLoading.value = true;
|
|
2137
|
+
if (dataStore.isCalculator) {
|
|
2138
|
+
clearFields();
|
|
2139
|
+
}
|
|
2140
|
+
if (whichProduct.value === 'gons') {
|
|
2141
|
+
formStore.isDisabled.productConditionsForm = false;
|
|
2142
|
+
dataStore.setFormsDisabled(false);
|
|
2143
|
+
}
|
|
2144
|
+
if (whichProduct.value !== 'lifetrip' && whichProduct.value !== 'pensionannuitynew') {
|
|
2145
|
+
if (
|
|
2146
|
+
(dataStore.isCalculator || route.params.taskId === '0' || fromIndexPage.value) &&
|
|
2147
|
+
productConditionsForm.requestedSumInsured === null &&
|
|
2148
|
+
productConditionsForm.insurancePremiumPerMonth === null
|
|
2149
|
+
) {
|
|
2150
|
+
// @ts-ignore
|
|
2151
|
+
const defaultData = await dataStore.getDefaultCalculationData(true, whichProduct.value);
|
|
2152
|
+
if (!defaultData) {
|
|
2153
|
+
dataStore.showToaster('error', 'Отсутствуют базовые данные');
|
|
2154
|
+
return;
|
|
2155
|
+
}
|
|
2156
|
+
formStore.additionalInsuranceTermsWithout = defaultData.addCovers;
|
|
2157
|
+
productConditionsForm.requestedSumInsured = defaultData.amount;
|
|
2158
|
+
productConditionsForm.insurancePremiumPerMonth = defaultData.premium;
|
|
2159
|
+
const indexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
|
|
2160
|
+
if (indexRate) productConditionsForm.processIndexRate = indexRate;
|
|
2161
|
+
const paymendPeriod = dataStore.processPaymentPeriod.find(i => i.id === defaultData.paymentPeriodId);
|
|
2162
|
+
if (paymendPeriod) productConditionsForm.paymentPeriod = paymendPeriod;
|
|
2163
|
+
if (defaultData.signDate) {
|
|
2164
|
+
productConditionsForm.signDate = reformatDate(defaultData.signDate);
|
|
2165
|
+
}
|
|
2166
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
2167
|
+
productConditionsForm.coverPeriod = defaultData.insTermInMonth ?? null;
|
|
2168
|
+
productConditionsForm.insurancePremiumPerMonth = null;
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
}
|
|
2173
|
+
additionalTerms.value = props.isCalculator ? formStore.additionalInsuranceTermsWithout : formStore.additionalInsuranceTerms;
|
|
2174
|
+
if (!!productConditionsForm.insurancePremiumPerMonth) {
|
|
2175
|
+
whichSum.value = 'insurancePremiumPerMonth';
|
|
2176
|
+
}
|
|
2177
|
+
if (!!productConditionsForm.requestedSumInsured) {
|
|
2178
|
+
whichSum.value = 'requestedSumInsured';
|
|
2179
|
+
}
|
|
2180
|
+
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && !productConditionsForm.requestedSumInsured) {
|
|
2181
|
+
whichSum.value = 'requestedSumInsured';
|
|
2182
|
+
}
|
|
1603
2183
|
if (dataStore.isCalculator) {
|
|
1604
|
-
|
|
2184
|
+
dataStore.processCode = constants.products[whichProduct.value as keyof typeof constants.products];
|
|
2185
|
+
await dataStore.getProcessPaymentPeriod();
|
|
1605
2186
|
}
|
|
1606
|
-
if (
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
)
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
2187
|
+
if (
|
|
2188
|
+
formStore.productConditionsForm.requestedSumInsured === null &&
|
|
2189
|
+
formStore.productConditionsForm.insurancePremiumPerMonth === null &&
|
|
2190
|
+
(whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons')
|
|
2191
|
+
) {
|
|
2192
|
+
await dataStore.getCurrencies();
|
|
2193
|
+
}
|
|
2194
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
2195
|
+
const kazynaPaymentPeriod = dataStore.processPaymentPeriod.find(i => i.code === 'single');
|
|
2196
|
+
if (kazynaPaymentPeriod) productConditionsForm.paymentPeriod = kazynaPaymentPeriod;
|
|
2197
|
+
}
|
|
2198
|
+
if (!formStore.lfb.add && !isHalykBank && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
2199
|
+
productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(
|
|
2200
|
+
formStore.lfb.clients.reduce((sum: number, i: any) => {
|
|
2201
|
+
return sum + Number(i.insSum);
|
|
2202
|
+
}, 0),
|
|
2203
|
+
);
|
|
2204
|
+
}
|
|
2205
|
+
if (whichProduct.value === 'pensionannuitynew') {
|
|
2206
|
+
contractDate.value = reformatDate(pensionForm.value.contractDate ?? '');
|
|
2207
|
+
dateOfBegin.value = reformatDate(pensionForm.value.dateOfBegin);
|
|
2208
|
+
transferContractDate.value = reformatDate(pensionForm.value.transferContractDate);
|
|
2209
|
+
transferContractFirstPaymentDate.value = reformatDate(pensionForm.value.transferContractFirstPaymentDate ?? '');
|
|
2210
|
+
maxDate.value = await dataStore.getVariableData(formStore.applicationData.processCode ?? 19);
|
|
2211
|
+
if (!transferContracts.value.length && pensionForm.value.transferContracts && pensionForm.value.transferContracts.length) {
|
|
2212
|
+
pensionForm.value.transferContracts.forEach((contract: TransferContract) => {
|
|
2213
|
+
transferContracts.value.push({
|
|
2214
|
+
...contract,
|
|
2215
|
+
transferContractDate: constants.regex.isoDate.test(contract.transferContractDate) ? reformatDate(contract.transferContractDate)! : contract.transferContractDate,
|
|
2216
|
+
transferContractFirstPaymentDate: constants.regex.isoDate.test(contract.transferContractFirstPaymentDate)
|
|
2217
|
+
? reformatDate(contract.transferContractFirstPaymentDate)!
|
|
2218
|
+
: contract.transferContractFirstPaymentDate,
|
|
2219
|
+
transferContractCompany:
|
|
2220
|
+
typeof contract.transferContractCompany === 'string' ? ({ nameRu: contract.transferContractCompany } as any) : contract.transferContractCompany,
|
|
2221
|
+
transferContractAmount: dataStore.getNumberWithSpaces(contract.transferContractAmount) ?? '',
|
|
2222
|
+
});
|
|
2223
|
+
});
|
|
1632
2224
|
}
|
|
1633
2225
|
}
|
|
1634
|
-
}
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
}
|
|
1639
|
-
if (!!productConditionsForm.requestedSumInsured) {
|
|
1640
|
-
whichSum.value = 'requestedSumInsured';
|
|
1641
|
-
}
|
|
1642
|
-
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && !productConditionsForm.requestedSumInsured) {
|
|
1643
|
-
whichSum.value = 'requestedSumInsured';
|
|
1644
|
-
}
|
|
1645
|
-
if (dataStore.isCalculator) {
|
|
1646
|
-
dataStore.processCode = constants.products[whichProduct.value as keyof typeof constants.products];
|
|
1647
|
-
await dataStore.getProcessPaymentPeriod();
|
|
1648
|
-
}
|
|
1649
|
-
if (whichProduct.value === 'halykkazyna') {
|
|
1650
|
-
const kazynaPaymentPeriod = dataStore.processPaymentPeriod.find(i => i.code === 'single');
|
|
1651
|
-
if (kazynaPaymentPeriod) productConditionsForm.paymentPeriod = kazynaPaymentPeriod;
|
|
1652
|
-
await dataStore.getCurrencies();
|
|
1653
|
-
}
|
|
1654
|
-
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1655
|
-
productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(
|
|
1656
|
-
formStore.lfb.clients.reduce((sum: number, i: any) => {
|
|
1657
|
-
return sum + Number(i.insSum);
|
|
1658
|
-
}, 0),
|
|
1659
|
-
);
|
|
1660
|
-
}
|
|
1661
|
-
if (whichProduct.value === 'pensionannuitynew') {
|
|
1662
|
-
contractDate.value = reformatDate(formStore.applicationData.pensionApp.contractDate);
|
|
1663
|
-
dateOfBegin.value = reformatDate(formStore.applicationData.pensionApp.dateOfBegin);
|
|
1664
|
-
transferContractDate.value = reformatDate(formStore.applicationData.pensionApp.transferContractDate);
|
|
1665
|
-
transferContractFirstPaymentDate.value = reformatDate(formStore.applicationData.pensionApp.transferContractFirstPaymentDate);
|
|
1666
|
-
maxDate.value = await dataStore.getVariableData(formStore.applicationData.processCode ?? 19);
|
|
2226
|
+
} catch (err) {
|
|
2227
|
+
console.log(err);
|
|
2228
|
+
} finally {
|
|
2229
|
+
isLoading.value = false;
|
|
1667
2230
|
}
|
|
1668
2231
|
});
|
|
1669
2232
|
|
|
2233
|
+
watch(
|
|
2234
|
+
() => pensionForm.value?.amount,
|
|
2235
|
+
val => {
|
|
2236
|
+
if (val) pensionForm.value.amount = dataStore.getNumberWithSpaces(val);
|
|
2237
|
+
},
|
|
2238
|
+
);
|
|
1670
2239
|
watch(
|
|
1671
2240
|
() => productConditionsForm.amountOfInsurancePremium,
|
|
1672
2241
|
val => {
|
|
@@ -1697,6 +2266,23 @@ export default defineComponent({
|
|
|
1697
2266
|
{ immediate: true },
|
|
1698
2267
|
);
|
|
1699
2268
|
|
|
2269
|
+
if (hasCurrency.value) {
|
|
2270
|
+
watch(
|
|
2271
|
+
() => productConditionsForm.currency,
|
|
2272
|
+
async val => {
|
|
2273
|
+
if (val.code === 'USD') {
|
|
2274
|
+
if (!dataStore.processPaymentPeriod.length) {
|
|
2275
|
+
await dataStore.getProcessPaymentPeriod();
|
|
2276
|
+
}
|
|
2277
|
+
const paymentPeriod = dataStore.processPaymentPeriod.find(item => item.nameRu === 'единовременно');
|
|
2278
|
+
if (paymentPeriod) {
|
|
2279
|
+
productConditionsForm.paymentPeriod = paymentPeriod;
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
},
|
|
2283
|
+
);
|
|
2284
|
+
}
|
|
2285
|
+
|
|
1700
2286
|
if (hasInsStartDate.value) {
|
|
1701
2287
|
watch(
|
|
1702
2288
|
() => productConditionsForm.calcDate,
|
|
@@ -1730,6 +2316,8 @@ export default defineComponent({
|
|
|
1730
2316
|
async val => {
|
|
1731
2317
|
if (val?.length && val.every(option => option.id != 0) && calculatorForm.type?.nameRu != null) {
|
|
1732
2318
|
await dataStore.getTripInsuredAmount();
|
|
2319
|
+
} else {
|
|
2320
|
+
calculatorForm.amount = new Value();
|
|
1733
2321
|
}
|
|
1734
2322
|
},
|
|
1735
2323
|
{ deep: true },
|
|
@@ -1763,8 +2351,41 @@ export default defineComponent({
|
|
|
1763
2351
|
);
|
|
1764
2352
|
}
|
|
1765
2353
|
|
|
2354
|
+
if (whichProduct.value === 'pensionannuitynew') {
|
|
2355
|
+
watch(
|
|
2356
|
+
() => pensionForm.value.guaranteedPeriod,
|
|
2357
|
+
async () => {
|
|
2358
|
+
if (formStore.applicationData.processCode === 24) {
|
|
2359
|
+
await dataStore.reCalculateRefund(
|
|
2360
|
+
Number(pensionForm.value.parentContractAmount),
|
|
2361
|
+
Number(pensionForm.value.parentContractMainAmount),
|
|
2362
|
+
pensionForm.value.guaranteedPeriod,
|
|
2363
|
+
pensionForm.value.transferContractIsOppv,
|
|
2364
|
+
pensionForm.value.compulsoryProfMonthCount ?? 0,
|
|
2365
|
+
);
|
|
2366
|
+
}
|
|
2367
|
+
},
|
|
2368
|
+
);
|
|
2369
|
+
watch(
|
|
2370
|
+
() => contractDate.value,
|
|
2371
|
+
(val, oldVal) => {
|
|
2372
|
+
if (val !== null && val !== undefined && val.length === 10 && oldVal != undefined && !isSlavePensionForm.value) {
|
|
2373
|
+
const formattedContractDate = formatDate(val);
|
|
2374
|
+
if (formattedContractDate) {
|
|
2375
|
+
const transferMax = formattedContractDate;
|
|
2376
|
+
transferMax.setFullYear(transferMax.getFullYear() - 2);
|
|
2377
|
+
transferMax.setDate(transferMax.getDate() + 1);
|
|
2378
|
+
transferMaxDate.value = reformatDate(String(transferMax));
|
|
2379
|
+
formattedContractDate.setDate(formattedContractDate.getDate() + 20);
|
|
2380
|
+
dateOfBegin.value = reformatDate(String(formattedContractDate));
|
|
2381
|
+
}
|
|
2382
|
+
}
|
|
2383
|
+
},
|
|
2384
|
+
);
|
|
2385
|
+
}
|
|
2386
|
+
|
|
1766
2387
|
const copyRedirect = async () => {
|
|
1767
|
-
const url = await dataStore.api.getEnpfRedirectUrl(String(
|
|
2388
|
+
const url = await dataStore.api.pensionannuityNew.getEnpfRedirectUrl(String(pensionForm.value.processInstanceId));
|
|
1768
2389
|
dataStore.copyToClipboard(url.redirectUrl);
|
|
1769
2390
|
};
|
|
1770
2391
|
|
|
@@ -1772,6 +2393,7 @@ export default defineComponent({
|
|
|
1772
2393
|
// State
|
|
1773
2394
|
formStore,
|
|
1774
2395
|
vForm,
|
|
2396
|
+
isLoading,
|
|
1775
2397
|
whichProduct,
|
|
1776
2398
|
productConditionsForm,
|
|
1777
2399
|
additionalTerms,
|
|
@@ -1793,20 +2415,35 @@ export default defineComponent({
|
|
|
1793
2415
|
subTermValue,
|
|
1794
2416
|
panelCodeList,
|
|
1795
2417
|
pensionForm,
|
|
2418
|
+
insuredForm,
|
|
1796
2419
|
dateOfBegin,
|
|
1797
2420
|
contractDate,
|
|
1798
2421
|
transferContractDate,
|
|
1799
2422
|
transferContractFirstPaymentDate,
|
|
1800
2423
|
enabled,
|
|
1801
2424
|
maxDate,
|
|
2425
|
+
amountPaid,
|
|
2426
|
+
amountRefunded,
|
|
2427
|
+
transferMaxDate,
|
|
1802
2428
|
guaranteedPeriodList,
|
|
1803
2429
|
isEnpfSum,
|
|
2430
|
+
transferContracts,
|
|
2431
|
+
contractsValue,
|
|
2432
|
+
contractIndex,
|
|
2433
|
+
contragentData,
|
|
2434
|
+
customPension,
|
|
1804
2435
|
|
|
1805
2436
|
// Computed
|
|
1806
2437
|
isTask,
|
|
1807
2438
|
isDisabled,
|
|
2439
|
+
disabilityGroup,
|
|
2440
|
+
totalInsPremium,
|
|
1808
2441
|
isTermsDisabled,
|
|
1809
2442
|
isUnderwriterForm,
|
|
2443
|
+
hasCurrencySymbols,
|
|
2444
|
+
currencyListFiltered,
|
|
2445
|
+
currencySymbolsLabel,
|
|
2446
|
+
isDisabledPaymentPeriod,
|
|
1810
2447
|
insurancePremiumPerMonthRule,
|
|
1811
2448
|
insurancePremiumPerMonthDisabled,
|
|
1812
2449
|
requestedSumInsuredRule,
|
|
@@ -1814,9 +2451,13 @@ export default defineComponent({
|
|
|
1814
2451
|
isUnderwriterRole,
|
|
1815
2452
|
hasProcessIndexRate,
|
|
1816
2453
|
hasPaymentPeriod,
|
|
2454
|
+
hasRequestedSumInsured,
|
|
2455
|
+
hasInsurancePremiumPerMonth,
|
|
1817
2456
|
hasRequestedSumInsuredInDollar,
|
|
1818
2457
|
hasInsurancePremiumPerMonthInDollar,
|
|
1819
2458
|
hasCurrency,
|
|
2459
|
+
hasPaidOrRefund,
|
|
2460
|
+
hasContragentData,
|
|
1820
2461
|
hasAdbMultiply,
|
|
1821
2462
|
readonlyLifeAdditive,
|
|
1822
2463
|
readonlyDisabilityMultiply,
|
|
@@ -1826,6 +2467,7 @@ export default defineComponent({
|
|
|
1826
2467
|
hasCalculated,
|
|
1827
2468
|
hasAnnuityPayments,
|
|
1828
2469
|
hasAgencyPart,
|
|
2470
|
+
hasDisabilityAdditive,
|
|
1829
2471
|
currencySymbolsAddTerm,
|
|
1830
2472
|
amountAnnuityPayments,
|
|
1831
2473
|
requestedSumInsuredLabel,
|
|
@@ -1835,27 +2477,33 @@ export default defineComponent({
|
|
|
1835
2477
|
hasBirthDate,
|
|
1836
2478
|
hasGender,
|
|
1837
2479
|
coverPeriodLabel,
|
|
2480
|
+
lifeMultiplyLabel,
|
|
2481
|
+
lifeAdditiveLabel,
|
|
2482
|
+
disabilityMultiplyLabel,
|
|
2483
|
+
adbMultiplyLabel,
|
|
2484
|
+
adbAdditiveLabel,
|
|
1838
2485
|
insurancePremiumPerMonthLabel,
|
|
1839
2486
|
isDisabledCoverPeriod,
|
|
1840
2487
|
hasDefault,
|
|
1841
2488
|
isShownAdditionalTerms,
|
|
1842
2489
|
hasCalcSum,
|
|
2490
|
+
isDisabledInsStartDate,
|
|
1843
2491
|
isDisabledAgentCommission,
|
|
1844
2492
|
hasFixInsSum,
|
|
1845
2493
|
isDisabledFixInsSum,
|
|
1846
2494
|
defaultText,
|
|
1847
2495
|
hasDeathInsFromNS,
|
|
1848
|
-
pensionAmount,
|
|
1849
|
-
pensionCalculationParams,
|
|
1850
2496
|
hasDeathInsAnyReason,
|
|
1851
2497
|
fromIndexPage,
|
|
1852
2498
|
hasCoverPeriod,
|
|
1853
2499
|
hasInsStartDate,
|
|
1854
2500
|
hasInsEndDate,
|
|
2501
|
+
isSlavePensionForm,
|
|
1855
2502
|
|
|
1856
2503
|
// Rules
|
|
1857
|
-
coverPeriodRule,
|
|
1858
2504
|
fixInsSumRule,
|
|
2505
|
+
agencyPartRule,
|
|
2506
|
+
coverPeriodRule,
|
|
1859
2507
|
|
|
1860
2508
|
// Functions
|
|
1861
2509
|
submitForm,
|
|
@@ -1868,10 +2516,13 @@ export default defineComponent({
|
|
|
1868
2516
|
underwriterCalculate,
|
|
1869
2517
|
onInputInsurancePremiumPerMonth,
|
|
1870
2518
|
onInputInsurancePremiumPerMonthInDollar,
|
|
2519
|
+
validateContractDate,
|
|
1871
2520
|
onInputSum,
|
|
2521
|
+
onInputPension,
|
|
1872
2522
|
onInputSumDollar,
|
|
1873
2523
|
toStatement,
|
|
1874
2524
|
onClearSum,
|
|
2525
|
+
onClearPension,
|
|
1875
2526
|
onClearSumDollar,
|
|
1876
2527
|
onClearPremium,
|
|
1877
2528
|
onClearPremiumDollar,
|
|
@@ -1883,6 +2534,9 @@ export default defineComponent({
|
|
|
1883
2534
|
pickSubTermValue,
|
|
1884
2535
|
onInputFixInsSum,
|
|
1885
2536
|
copyRedirect,
|
|
2537
|
+
getContragent,
|
|
2538
|
+
addTransferContract,
|
|
2539
|
+
removeTransferContract,
|
|
1886
2540
|
};
|
|
1887
2541
|
},
|
|
1888
2542
|
});
|