hl-core 0.0.10-beta.5 → 0.0.10-beta.51
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 +345 -137
- package/api/interceptors.ts +3 -5
- package/components/Dialog/Dialog.vue +5 -1
- package/components/Dialog/FamilyDialog.vue +15 -4
- 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 +452 -64
- package/components/Pages/MemberForm.vue +416 -180
- package/components/Pages/ProductConditions.vue +1021 -243
- package/components/Panel/PanelHandler.vue +297 -124
- package/components/Utilities/Chip.vue +1 -1
- package/components/Utilities/JsonViewer.vue +1 -2
- package/composables/classes.ts +124 -20
- package/composables/constants.ts +46 -1
- package/composables/index.ts +336 -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 +90 -19
- package/nuxt.config.ts +10 -12
- package/package.json +12 -12
- package/plugins/head.ts +7 -1
- package/store/data.store.ts +966 -575
- package/store/member.store.ts +17 -6
- package/store/rules.ts +23 -3
- package/types/enum.ts +42 -2
- package/types/index.ts +111 -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,209 @@
|
|
|
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
|
-
:readonly="isDisabled"
|
|
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(checkTransferContractDate)"
|
|
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
|
+
<!--
|
|
477
|
+
<base-form-input v-model="contract.transferContractNumber" :label="$dataStore.t('pension.globalId')" :readonly="isDisabled" :clearable="!isDisabled"
|
|
478
|
+
<base-form-input
|
|
479
|
+
v-model="contract.transferContractRegNumber"
|
|
480
|
+
:label="$dataStore.t('pension.transferRegNumber')"
|
|
481
|
+
:rules="$rules.required"
|
|
482
|
+
:readonly="isDisabled"
|
|
483
|
+
:clearable="!isDisabled"
|
|
484
|
+
/>
|
|
485
|
+
-->
|
|
486
|
+
<base-form-input
|
|
487
|
+
v-model="contract.transferContractFirstPaymentDate"
|
|
488
|
+
:maska="$maska.date"
|
|
489
|
+
:label="$dataStore.t('pension.transferContractFirstPaymentDate')"
|
|
490
|
+
:rules="$dataStore.rules.required.concat($dataStore.rules.birthDate)"
|
|
491
|
+
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
492
|
+
:readonly="isDisabled"
|
|
493
|
+
:clearable="!isDisabled"
|
|
494
|
+
/>
|
|
495
|
+
<base-form-input
|
|
496
|
+
v-model="contract.transferContractAmount"
|
|
497
|
+
:label="$dataStore.t('pension.transferContractAmount')"
|
|
498
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
499
|
+
:readonly="isDisabled"
|
|
500
|
+
:clearable="!isDisabled"
|
|
501
|
+
@input="onInputPension($event, 'transferContractAmount', index)"
|
|
502
|
+
@onClear="onClearPension('transferContractAmount', index)"
|
|
503
|
+
/>
|
|
504
|
+
<base-form-toggle v-model="contract.transferContractIsOppv" :disabled="isDisabled" :has-border="false" :title="$dataStore.t('pension.isOPPVTransfer')" />
|
|
505
|
+
<base-form-input
|
|
506
|
+
v-if="contract.transferContractIsOppv"
|
|
507
|
+
v-model="contract.transferContractMonthCount"
|
|
508
|
+
:disabled="$dataStore.isLoading"
|
|
509
|
+
:rules="$rules.required.concat($rules.notZero, $rules.numbers)"
|
|
510
|
+
:label="$dataStore.t('pension.compulsoryProfMonthCount')"
|
|
511
|
+
/>
|
|
512
|
+
<base-btn
|
|
513
|
+
v-if="!isDisabled"
|
|
514
|
+
class="mt-3"
|
|
515
|
+
:text="$dataStore.t('buttons.delete')"
|
|
516
|
+
:disabled="isDisabled"
|
|
517
|
+
size="sm"
|
|
518
|
+
:btn="$styles.redBtn"
|
|
519
|
+
@click="removeTransferContract(index)"
|
|
520
|
+
/>
|
|
521
|
+
</section>
|
|
379
522
|
</base-form-section>
|
|
380
523
|
<base-form-section :title="$dataStore.t('pension.paymentTerms')">
|
|
381
524
|
<base-form-input
|
|
382
525
|
v-model="contractDate"
|
|
383
526
|
:maska="$maska.date"
|
|
384
|
-
:rules="!isDisabled ? $rules.required.concat($rules.date) : []"
|
|
385
|
-
:readonly="isDisabled"
|
|
527
|
+
:rules="!isDisabled ? $rules.required.concat($rules.date, [validateContractDate]) : []"
|
|
528
|
+
:readonly="isDisabled || formStore.applicationData.processCode === 24 || isSlavePensionForm"
|
|
386
529
|
:clearable="!isDisabled"
|
|
387
530
|
:min-date="new Date()"
|
|
531
|
+
:max-date="formatDate(maxDate ?? '') ?? undefined"
|
|
388
532
|
:label="$dataStore.t('pension.contractDate')"
|
|
389
533
|
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
390
534
|
/>
|
|
@@ -392,7 +536,7 @@
|
|
|
392
536
|
<base-form-input v-model="dateOfBegin" :maska="$maska.date" readonly :label="$dataStore.t('pension.paymentsDate')" append-inner-icon="mdi mdi-calendar-blank-outline" />
|
|
393
537
|
<base-rounded-select
|
|
394
538
|
v-model="pensionForm.guaranteedPeriod"
|
|
395
|
-
class="pension-
|
|
539
|
+
class="pension-round-toggle"
|
|
396
540
|
:readonly="isDisabled"
|
|
397
541
|
:clearable="!isDisabled"
|
|
398
542
|
:rules="$rules.notZero"
|
|
@@ -400,11 +544,39 @@
|
|
|
400
544
|
:items="guaranteedPeriodList"
|
|
401
545
|
:hide-details="true"
|
|
402
546
|
/>
|
|
547
|
+
<base-rounded-select
|
|
548
|
+
v-if="dividendPeriods"
|
|
549
|
+
v-model="pensionForm.dividendId"
|
|
550
|
+
class="pension-round-toggle"
|
|
551
|
+
:readonly="isDisabled"
|
|
552
|
+
:rules="$rules.notZero"
|
|
553
|
+
:label="$dataStore.t('pension.dividendPeriod')"
|
|
554
|
+
item-title="nameRu"
|
|
555
|
+
item-value="id"
|
|
556
|
+
:items="dividendPeriods"
|
|
557
|
+
:hide-details="true"
|
|
558
|
+
/>
|
|
403
559
|
<base-form-input v-model="pensionForm.frequencyPayments" disabled :label="$dataStore.t('pension.frequencyPayments')" />
|
|
404
560
|
<base-form-input v-model="pensionForm.periodPayments" disabled :label="$dataStore.t('pension.paymentPeriod')" />
|
|
405
561
|
<base-form-input v-model="pensionForm.insuranceProgramType" disabled :label="$dataStore.t('pension.insuranceProgramType')" />
|
|
406
|
-
<base-form-input
|
|
407
|
-
|
|
562
|
+
<base-form-input
|
|
563
|
+
v-if="formStore.applicationData.processCode === 25 && formStore.pensionApp?.slave?.amount"
|
|
564
|
+
:value="totalInsPremium"
|
|
565
|
+
:active="true"
|
|
566
|
+
:label="$dataStore.t('productConditionsForm.totalInsurancePremiumAmount')"
|
|
567
|
+
:disabled="$dataStore.isLoading"
|
|
568
|
+
readonly
|
|
569
|
+
/>
|
|
570
|
+
<base-form-input
|
|
571
|
+
v-model="pensionForm.amount"
|
|
572
|
+
:value="$dataStore.getNumberWithSpaces(pensionForm.amount)"
|
|
573
|
+
@input="onInputPension($event, 'pensionAmount')"
|
|
574
|
+
@onClear="onClearPension('pensionAmount')"
|
|
575
|
+
@change="customPension = true"
|
|
576
|
+
:readonly="isDisabled || formStore.applicationData.processCode !== 25"
|
|
577
|
+
:label="$dataStore.t('pension.pensionAmount')"
|
|
578
|
+
/>
|
|
579
|
+
<base-form-input :value="$dataStore.getNumberWithSpaces(pensionForm.payment)" :active="true" readonly :label="$dataStore.t('pension.pensionPayment')" />
|
|
408
580
|
</base-form-section>
|
|
409
581
|
</section>
|
|
410
582
|
<base-form-section v-if="hasAnnuityPayments" :title="$dataStore.t('calculationAnnuityPayments')">
|
|
@@ -619,18 +791,81 @@
|
|
|
619
791
|
</div>
|
|
620
792
|
</base-form-section>
|
|
621
793
|
</v-form>
|
|
622
|
-
<base-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
794
|
+
<base-animation>
|
|
795
|
+
<base-btn
|
|
796
|
+
v-if="!$dataStore.isCalculator && isCalculator && hasCalculated"
|
|
797
|
+
:btn="$styles.greenLightBtn"
|
|
798
|
+
:text="$dataStore.t('buttons.toStatement')"
|
|
799
|
+
class="min-h-[60px]"
|
|
800
|
+
@click="toStatement"
|
|
801
|
+
/>
|
|
802
|
+
</base-animation>
|
|
803
|
+
<base-animation>
|
|
804
|
+
<base-btn
|
|
805
|
+
v-if="!isDisabled && $dataStore.isPension && isTask"
|
|
806
|
+
:text="$dataStore.t('buttons.calculate')"
|
|
807
|
+
:loading="$dataStore.isLoading"
|
|
808
|
+
class="min-h-[60px]"
|
|
809
|
+
type="submit"
|
|
810
|
+
@click="submitForm"
|
|
811
|
+
/>
|
|
812
|
+
</base-animation>
|
|
813
|
+
<base-animation>
|
|
814
|
+
<base-btn
|
|
815
|
+
v-if="$dataStore.isCalculator ? true : !isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter()) && !$dataStore.isPension"
|
|
816
|
+
:loading="isCalculating"
|
|
817
|
+
class="min-h-[60px]"
|
|
818
|
+
:text="$dataStore.t('buttons.calculate')"
|
|
819
|
+
@click="submitForm"
|
|
820
|
+
/>
|
|
821
|
+
</base-animation>
|
|
630
822
|
<div v-if="$dataStore.isTask() && $dataStore.isUnderwriter() && !isRecalculationDisabled" class="flex gap-3">
|
|
631
|
-
<base-
|
|
632
|
-
|
|
823
|
+
<base-animation>
|
|
824
|
+
<base-btn
|
|
825
|
+
v-if="hasCalcSum"
|
|
826
|
+
class="min-h-[60px]"
|
|
827
|
+
:text="$dataStore.t('buttons.calcSum')"
|
|
828
|
+
type="submit"
|
|
829
|
+
@click.prevent="underwriterCalculate('sum')"
|
|
830
|
+
:loading="isCalculating"
|
|
831
|
+
/>
|
|
832
|
+
</base-animation>
|
|
833
|
+
<base-btn class="min-h-[60px]" :text="$dataStore.t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
|
|
633
834
|
</div>
|
|
835
|
+
<base-fade-transition>
|
|
836
|
+
<base-form-section :title="$dataStore.t('pension.dividendsGraph')" v-if="dividendSchedules.scheduleDividend" class="grid-table">
|
|
837
|
+
<div class="flex justify-between rounded-t-[8px] border-b-[1px]" :class="[$styles.blueBg, $styles.whiteText]">
|
|
838
|
+
<span class="h-full">#</span>
|
|
839
|
+
<span class="h-full">{{ $dataStore.t('pension.dividendDate') }}</span>
|
|
840
|
+
<span class="h-full grow">{{ $dataStore.t('pension.dividendAmount') }}</span>
|
|
841
|
+
</div>
|
|
842
|
+
<v-virtual-scroll :items="dividendSchedules.scheduleDividend" height="300">
|
|
843
|
+
<template v-slot:default="{ item, index }">
|
|
844
|
+
<div class="flex justify-between border-b-[1px]" :class="[$styles.whiteBg, $styles.textSimple, $styles.rounded]">
|
|
845
|
+
<span class="h-full">{{ index + 1 }}</span>
|
|
846
|
+
<span class="h-full">{{ reformatDate(item.date) }}</span>
|
|
847
|
+
<span class="h-full grow">{{ $dataStore.getNumberWithSpaces(item.amount) }}</span>
|
|
848
|
+
</div>
|
|
849
|
+
</template>
|
|
850
|
+
</v-virtual-scroll>
|
|
851
|
+
</base-form-section>
|
|
852
|
+
<base-form-section :title="$dataStore.t('pension.dividendsGraph') + ' 2'" v-if="dividendSchedules.scheduleDividend2" class="grid-table">
|
|
853
|
+
<div class="flex justify-between rounded-t-[8px] border-b-[1px]" :class="[$styles.blueBg, $styles.whiteText]">
|
|
854
|
+
<span class="h-full">#</span>
|
|
855
|
+
<span class="h-full">{{ $dataStore.t('pension.dividendDate') }}</span>
|
|
856
|
+
<span class="h-full grow">{{ $dataStore.t('pension.dividendAmount') }}</span>
|
|
857
|
+
</div>
|
|
858
|
+
<v-virtual-scroll :items="dividendSchedules.scheduleDividend2" height="300">
|
|
859
|
+
<template v-slot:default="{ item, index }">
|
|
860
|
+
<div class="flex justify-between border-b-[1px]" :class="[$styles.whiteBg, $styles.textSimple, $styles.rounded]">
|
|
861
|
+
<span class="h-full">{{ index + 1 }}</span>
|
|
862
|
+
<span class="h-full">{{ reformatDate(item.date) }}</span>
|
|
863
|
+
<span class="h-full grow">{{ $dataStore.getNumberWithSpaces(item.amount) }}</span>
|
|
864
|
+
</div>
|
|
865
|
+
</template>
|
|
866
|
+
</v-virtual-scroll>
|
|
867
|
+
</base-form-section>
|
|
868
|
+
</base-fade-transition>
|
|
634
869
|
<Teleport v-if="isPanelOpen" to="#right-panel-actions">
|
|
635
870
|
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
636
871
|
<base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
@@ -692,12 +927,22 @@
|
|
|
692
927
|
</div>
|
|
693
928
|
</Teleport>
|
|
694
929
|
</section>
|
|
930
|
+
<div v-if="isLoading" class="w-full h-[80dvh] flex items-center justify-center"><base-loader :size="50" /></div>
|
|
695
931
|
</template>
|
|
696
932
|
|
|
697
933
|
<script lang="ts">
|
|
698
|
-
import { Member, Value, CountryValue, CalculatorForm } from '../../composables/classes';
|
|
934
|
+
import { Member, Value, CountryValue, CalculatorForm, TransferContract } from '../../composables/classes';
|
|
699
935
|
import type { Projects, AddCover, AddCoverAnswer } from '../../types';
|
|
700
936
|
|
|
937
|
+
type PensionCalculation = {
|
|
938
|
+
compulsoryContractAmount: number | string | null;
|
|
939
|
+
voluntaryContractAmount: number | string | null;
|
|
940
|
+
ownFundsRaisAmount: number | string | null;
|
|
941
|
+
compulsoryProfContractAmount: number | string | null;
|
|
942
|
+
transferContractAmount: number | string | null;
|
|
943
|
+
transferContractCompany: number | string | null;
|
|
944
|
+
};
|
|
945
|
+
|
|
701
946
|
export default defineComponent({
|
|
702
947
|
props: {
|
|
703
948
|
isCalculator: {
|
|
@@ -722,6 +967,7 @@ export default defineComponent({
|
|
|
722
967
|
const isPanelLoading = ref<boolean>(false);
|
|
723
968
|
const isPanelOpen = ref<boolean>(false);
|
|
724
969
|
const isTermsPanelOpen = ref<boolean>(false);
|
|
970
|
+
const isLoading = ref<boolean>(false);
|
|
725
971
|
const panelValue = ref<Value>(new Value());
|
|
726
972
|
const termValue = ref<AddCover>();
|
|
727
973
|
const subTermValue = ref<string>('');
|
|
@@ -734,23 +980,86 @@ export default defineComponent({
|
|
|
734
980
|
const whichSum = ref<'insurancePremiumPerMonth' | 'requestedSumInsured' | ''>('');
|
|
735
981
|
const panelCodeList = ['processcovertypesum', 'fixedinssum'];
|
|
736
982
|
const enabled = 'включено';
|
|
983
|
+
const amountRefunded = ref<string | number | null>(null);
|
|
984
|
+
const amountPaid = ref<string | number | null>(null);
|
|
737
985
|
|
|
738
986
|
const additionalTerms = ref<AddCover[]>([]);
|
|
739
987
|
|
|
740
|
-
const maxDate = ref();
|
|
988
|
+
const maxDate = ref<string | null>();
|
|
741
989
|
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 isEnpfSum = (formStore.applicationData?.isEnpfSum ?? false) && useEnv().isProduction;
|
|
990
|
+
const contractDate = ref<string | null>();
|
|
991
|
+
const transferContractDate = ref<string | null>();
|
|
992
|
+
const transferContractFirstPaymentDate = ref<string | null>();
|
|
993
|
+
const guaranteedPeriodList = Array.from(Array(35), (_, i) => i + 1);
|
|
994
|
+
const dividendPeriods = ref<Value[] | null>(null);
|
|
748
995
|
|
|
996
|
+
const dividendSchedules = ref(<
|
|
997
|
+
{
|
|
998
|
+
scheduleDividend: any[] | null;
|
|
999
|
+
scheduleDividend2: any[] | null;
|
|
1000
|
+
}
|
|
1001
|
+
>{
|
|
1002
|
+
scheduleDividend: null,
|
|
1003
|
+
scheduleDividend2: null,
|
|
1004
|
+
});
|
|
1005
|
+
const transferMaxDate = computed({
|
|
1006
|
+
get() {
|
|
1007
|
+
if (contractDate.value) {
|
|
1008
|
+
var maxDate = structuredClone(formatDate(contractDate.value))!;
|
|
1009
|
+
maxDate.setFullYear(maxDate.getFullYear() - 2);
|
|
1010
|
+
maxDate.setDate(maxDate.getDate() + 1);
|
|
1011
|
+
return reformatDate(String(maxDate))!;
|
|
1012
|
+
} else {
|
|
1013
|
+
return '';
|
|
1014
|
+
}
|
|
1015
|
+
},
|
|
1016
|
+
set(newValue) {
|
|
1017
|
+
return newValue;
|
|
1018
|
+
},
|
|
1019
|
+
});
|
|
1020
|
+
const isSlavePensionForm = computed(() => route.query.which === 'slave');
|
|
1021
|
+
const pensionForm = computedWithControl(
|
|
1022
|
+
() => formStore.pensionApp,
|
|
1023
|
+
() => (route.query.which === 'slave' ? formStore.pensionApp?.slave : formStore.pensionApp ?? undefined),
|
|
1024
|
+
);
|
|
1025
|
+
|
|
1026
|
+
const insuredForm = isSlavePensionForm.value
|
|
1027
|
+
? formStore.applicationData?.slave?.insuredApp && formStore.applicationData?.slave?.insuredApp[0]
|
|
1028
|
+
: (formStore.applicationData?.insuredApp && Array.isArray(formStore.applicationData?.insuredApp) && formStore.applicationData?.insuredApp[0]) ?? undefined;
|
|
1029
|
+
const disabilityGroup = computed(() => {
|
|
1030
|
+
if (!!insuredForm.disabilityGroupId) {
|
|
1031
|
+
const disabilityGroup = dataStore.disabilityGroups.find(i => i.id === insuredForm.disabilityGroupId);
|
|
1032
|
+
return disabilityGroup;
|
|
1033
|
+
}
|
|
1034
|
+
});
|
|
1035
|
+
const isEnpfSum = pensionForm.value?.isEnpfSum ?? false;
|
|
1036
|
+
|
|
1037
|
+
const transferContracts = ref<TransferContract[]>([]);
|
|
1038
|
+
const contractsValue = ref<Value[]>([]);
|
|
1039
|
+
const contractIndex = ref<number>(0);
|
|
749
1040
|
const isMultiplePanelOpen = ref<boolean>(false);
|
|
750
1041
|
const multiplePanelValue = ref<CountryValue>(new CountryValue());
|
|
751
1042
|
const multiplePanelList = ref<CountryValue[]>([]);
|
|
752
1043
|
const calculatorForm = productConditionsForm.calculatorForm;
|
|
753
1044
|
const minInsSum = computed(() => formStore.lfb.clients && formStore.lfb.clients.reduce((min, item) => Math.min(min, item.insSum), Infinity));
|
|
1045
|
+
const contragentData = ref<any>();
|
|
1046
|
+
const customPension = ref<boolean>(false);
|
|
1047
|
+
const transferSum = ref<number>(0);
|
|
1048
|
+
const firstAmount = ref<boolean>(true);
|
|
1049
|
+
const isHalykBank = formStore.lfb.policyholder.clientData.iin.replace(/-/g, '') === '940140000385';
|
|
1050
|
+
|
|
1051
|
+
const checkTransferContractDate = (val: any) => {
|
|
1052
|
+
if (val) {
|
|
1053
|
+
if (new Date(formatDate(transferMaxDate.value)!.valueOf() - formatDate(val)!.valueOf()).getUTCFullYear() - 1970 < 0) {
|
|
1054
|
+
return dataStore.t('rules.invalidtransferContractDate');
|
|
1055
|
+
} else {
|
|
1056
|
+
return true;
|
|
1057
|
+
}
|
|
1058
|
+
} else {
|
|
1059
|
+
return true;
|
|
1060
|
+
}
|
|
1061
|
+
};
|
|
1062
|
+
|
|
754
1063
|
const isShownAdditionalTerms = computed(() => {
|
|
755
1064
|
if (whichProduct.value === 'gons') {
|
|
756
1065
|
return false;
|
|
@@ -769,6 +1078,9 @@ export default defineComponent({
|
|
|
769
1078
|
if (whichProduct.value === 'gons') {
|
|
770
1079
|
return true;
|
|
771
1080
|
}
|
|
1081
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1082
|
+
return true;
|
|
1083
|
+
}
|
|
772
1084
|
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && dataStore.isUnderwriter()) {
|
|
773
1085
|
return false;
|
|
774
1086
|
}
|
|
@@ -778,7 +1090,13 @@ export default defineComponent({
|
|
|
778
1090
|
const isTask = computed(() => (route.params.taskId === '0' && props.isCalculator === true) || dataStore.isTask() || fromIndexPage.value);
|
|
779
1091
|
const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm || formStore.canBeClaimed === true);
|
|
780
1092
|
const isUnderwriterRole = computed(() => dataStore.isUnderwriter() || dataStore.isAdmin() || dataStore.isSupport());
|
|
781
|
-
const insurancePremiumPerMonthRule = computed(() =>
|
|
1093
|
+
const insurancePremiumPerMonthRule = computed(() =>
|
|
1094
|
+
!!productConditionsForm.insurancePremiumPerMonth
|
|
1095
|
+
? whichProduct.value === 'gons' || whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns'
|
|
1096
|
+
? dataStore.rules.required
|
|
1097
|
+
: dataStore.rules.required.concat(dataStore.rules.sums)
|
|
1098
|
+
: [],
|
|
1099
|
+
);
|
|
782
1100
|
const insurancePremiumPerMonthDisabled = computed(() => {
|
|
783
1101
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
784
1102
|
return true;
|
|
@@ -788,12 +1106,21 @@ export default defineComponent({
|
|
|
788
1106
|
}
|
|
789
1107
|
return isDisabled.value;
|
|
790
1108
|
});
|
|
791
|
-
const requestedSumInsuredRule = computed(() =>
|
|
1109
|
+
const requestedSumInsuredRule = computed(() =>
|
|
1110
|
+
!!productConditionsForm.requestedSumInsured ? (whichProduct.value === 'gons' ? dataStore.rules.required : dataStore.rules.required.concat(dataStore.rules.sums)) : [],
|
|
1111
|
+
);
|
|
792
1112
|
const fixInsSumRule = computed(() =>
|
|
793
1113
|
!!productConditionsForm.fixInsSum
|
|
794
1114
|
? dataStore.rules.required.concat(dataStore.rules.sums, dataStore.rules.fixInsSumLimit(getNumber(productConditionsForm.fixInsSum as string), minInsSum.value))
|
|
795
1115
|
: [],
|
|
796
1116
|
);
|
|
1117
|
+
const agencyPartRule = computed(() => {
|
|
1118
|
+
if (formStore.lfb.add || isHalykBank) {
|
|
1119
|
+
return productConditionsForm.agentCommission === 0 ? [] : dataStore.rules.required;
|
|
1120
|
+
} else {
|
|
1121
|
+
return dataStore.rules.required.concat(dataStore.rules.numbers, dataStore.rules.agentCommission);
|
|
1122
|
+
}
|
|
1123
|
+
});
|
|
797
1124
|
const amountAnnuityPayments = computed(() => (!!productConditionsForm.amountAnnuityPayments ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
798
1125
|
const hasCalculated = computed(() => {
|
|
799
1126
|
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && productConditionsForm.requestedSumInsured === null) {
|
|
@@ -802,22 +1129,16 @@ export default defineComponent({
|
|
|
802
1129
|
return !!productConditionsForm.requestedSumInsured && !!productConditionsForm.insurancePremiumPerMonth;
|
|
803
1130
|
});
|
|
804
1131
|
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;
|
|
1132
|
+
if (whichProduct.value === 'baiterek' || whichProduct.value === 'bolashak') return true;
|
|
1133
|
+
return false;
|
|
816
1134
|
});
|
|
817
1135
|
const hasPaymentPeriod = computed(() => {
|
|
818
1136
|
if (whichProduct.value === 'halykkazyna') {
|
|
819
1137
|
return false;
|
|
820
1138
|
}
|
|
1139
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1140
|
+
return false;
|
|
1141
|
+
}
|
|
821
1142
|
return true;
|
|
822
1143
|
});
|
|
823
1144
|
const hasCoverPeriod = computed(() => {
|
|
@@ -826,22 +1147,44 @@ export default defineComponent({
|
|
|
826
1147
|
}
|
|
827
1148
|
return true;
|
|
828
1149
|
});
|
|
1150
|
+
|
|
1151
|
+
const hasRequestedSumInsured = computed(() => {
|
|
1152
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1153
|
+
return false;
|
|
1154
|
+
}
|
|
1155
|
+
return true;
|
|
1156
|
+
});
|
|
829
1157
|
const hasRequestedSumInsuredInDollar = computed(() => {
|
|
830
1158
|
if (whichProduct.value === 'halykkazyna') {
|
|
831
1159
|
return true;
|
|
832
1160
|
}
|
|
1161
|
+
if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
|
|
1162
|
+
return true;
|
|
1163
|
+
}
|
|
833
1164
|
return false;
|
|
834
1165
|
});
|
|
1166
|
+
const hasInsurancePremiumPerMonth = computed(() => {
|
|
1167
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1168
|
+
return false;
|
|
1169
|
+
}
|
|
1170
|
+
return true;
|
|
1171
|
+
});
|
|
835
1172
|
const hasInsurancePremiumPerMonthInDollar = computed(() => {
|
|
836
1173
|
if (whichProduct.value === 'halykkazyna') {
|
|
837
1174
|
return true;
|
|
838
1175
|
}
|
|
1176
|
+
if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
|
|
1177
|
+
return true;
|
|
1178
|
+
}
|
|
839
1179
|
return false;
|
|
840
1180
|
});
|
|
841
|
-
const
|
|
1181
|
+
const hasCurrencySymbols = computed(() => {
|
|
842
1182
|
if (whichProduct.value === 'halykkazyna') {
|
|
843
1183
|
return true;
|
|
844
1184
|
}
|
|
1185
|
+
if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
|
|
1186
|
+
return true;
|
|
1187
|
+
}
|
|
845
1188
|
return false;
|
|
846
1189
|
});
|
|
847
1190
|
const hasAdbMultiply = computed(() => {
|
|
@@ -878,6 +1221,15 @@ export default defineComponent({
|
|
|
878
1221
|
if (whichProduct.value === 'gons') {
|
|
879
1222
|
return false;
|
|
880
1223
|
}
|
|
1224
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1225
|
+
return false;
|
|
1226
|
+
}
|
|
1227
|
+
return true;
|
|
1228
|
+
});
|
|
1229
|
+
const hasDisabilityAdditive = computed(() => {
|
|
1230
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1231
|
+
return false;
|
|
1232
|
+
}
|
|
881
1233
|
return true;
|
|
882
1234
|
});
|
|
883
1235
|
const hasAnnuityPayments = computed(() => {
|
|
@@ -944,6 +1296,42 @@ export default defineComponent({
|
|
|
944
1296
|
}
|
|
945
1297
|
return dataStore.t('productConditionsForm.insurancePremiumAmount');
|
|
946
1298
|
});
|
|
1299
|
+
const currencySymbolsLabel = computed(() => {
|
|
1300
|
+
if (whichProduct.value === 'gons') {
|
|
1301
|
+
return dataStore.t('productConditionsForm.exchangeRateSettlementDate');
|
|
1302
|
+
}
|
|
1303
|
+
return dataStore.t('productConditionsForm.dollarExchangeRateNBRK');
|
|
1304
|
+
});
|
|
1305
|
+
const lifeMultiplyLabel = computed(() => {
|
|
1306
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1307
|
+
return dataStore.t('percent') + `Life (смерть по любой причине) multiply`;
|
|
1308
|
+
}
|
|
1309
|
+
return dataStore.t('percent') + `Life Multiply`;
|
|
1310
|
+
});
|
|
1311
|
+
const lifeAdditiveLabel = computed(() => {
|
|
1312
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1313
|
+
return dataStore.t('percent') + `Life (смерть по любой причине) надбавка`;
|
|
1314
|
+
}
|
|
1315
|
+
return dataStore.t('percent') + `Life Additive`;
|
|
1316
|
+
});
|
|
1317
|
+
const disabilityMultiplyLabel = computed(() => {
|
|
1318
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1319
|
+
return dataStore.t('percent') + `Disability (инвалидность, временная утрата тр-ти, стойкая утрата тр-ти)`;
|
|
1320
|
+
}
|
|
1321
|
+
return dataStore.t('percent') + `Disability Multiply`;
|
|
1322
|
+
});
|
|
1323
|
+
const adbMultiplyLabel = computed(() => {
|
|
1324
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1325
|
+
return dataStore.t('percent') + `Accidental life multiply`;
|
|
1326
|
+
}
|
|
1327
|
+
return dataStore.t('percent') + `Adb Multiply`;
|
|
1328
|
+
});
|
|
1329
|
+
const adbAdditiveLabel = computed(() => {
|
|
1330
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1331
|
+
return dataStore.t('percent') + `Accidental life additional надбавка`;
|
|
1332
|
+
}
|
|
1333
|
+
return dataStore.t('percent') + `Adb Additive`;
|
|
1334
|
+
});
|
|
947
1335
|
const isDisabledFixInsSum = computed(() => {
|
|
948
1336
|
if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
|
|
949
1337
|
return false;
|
|
@@ -991,11 +1379,23 @@ export default defineComponent({
|
|
|
991
1379
|
return true;
|
|
992
1380
|
});
|
|
993
1381
|
const isDisabledAgentCommission = computed(() => {
|
|
1382
|
+
if (isHalykBank) {
|
|
1383
|
+
return true;
|
|
1384
|
+
}
|
|
1385
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1386
|
+
return true;
|
|
1387
|
+
}
|
|
994
1388
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns' || dataStore.isUnderwriter()) {
|
|
995
1389
|
return false;
|
|
996
1390
|
}
|
|
997
1391
|
return isDisabled.value;
|
|
998
1392
|
});
|
|
1393
|
+
const isDisabledInsStartDate = computed(() => {
|
|
1394
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1395
|
+
return true;
|
|
1396
|
+
}
|
|
1397
|
+
return isDisabled.value;
|
|
1398
|
+
});
|
|
999
1399
|
const hasCalcSum = computed(() => {
|
|
1000
1400
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1001
1401
|
return false;
|
|
@@ -1003,7 +1403,13 @@ export default defineComponent({
|
|
|
1003
1403
|
return true;
|
|
1004
1404
|
});
|
|
1005
1405
|
const hasFixInsSum = computed(() => {
|
|
1006
|
-
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1406
|
+
if (!formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1407
|
+
return true;
|
|
1408
|
+
}
|
|
1409
|
+
return false;
|
|
1410
|
+
});
|
|
1411
|
+
const hasPaidOrRefund = computed(() => {
|
|
1412
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1007
1413
|
return true;
|
|
1008
1414
|
}
|
|
1009
1415
|
return false;
|
|
@@ -1038,26 +1444,51 @@ export default defineComponent({
|
|
|
1038
1444
|
}
|
|
1039
1445
|
return false;
|
|
1040
1446
|
});
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1447
|
+
const hasCurrency = computed(() => {
|
|
1448
|
+
if (whichProduct.value === 'gons') {
|
|
1449
|
+
return true;
|
|
1450
|
+
}
|
|
1451
|
+
return false;
|
|
1452
|
+
});
|
|
1453
|
+
const hasContragentData = computed(() => {
|
|
1454
|
+
if (whichProduct.value === 'pensionannuitynew') {
|
|
1455
|
+
return true;
|
|
1456
|
+
}
|
|
1457
|
+
return false;
|
|
1458
|
+
});
|
|
1459
|
+
const isDisabledPaymentPeriod = computed(() => {
|
|
1460
|
+
if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
|
|
1461
|
+
return true;
|
|
1462
|
+
}
|
|
1463
|
+
return isDisabled.value;
|
|
1464
|
+
});
|
|
1465
|
+
const currencyListFiltered = computed(() => {
|
|
1466
|
+
return constants.currencyList;
|
|
1049
1467
|
});
|
|
1050
1468
|
|
|
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,
|
|
1469
|
+
const totalInsPremium = computed(() =>
|
|
1470
|
+
dataStore.getNumberWithSpaces(formatSpacedNumber(formStore.pensionApp?.amount) + formatSpacedNumber(formStore.pensionApp.slave?.amount)),
|
|
1059
1471
|
);
|
|
1060
1472
|
|
|
1473
|
+
const getContragent = async () => {
|
|
1474
|
+
const data = await dataStore.api.getContragentById(
|
|
1475
|
+
Number(route.query.which !== 'slave' ? formStore.applicationData.clientApp.insisId : formStore.applicationData.slave.clientApp.insisId),
|
|
1476
|
+
);
|
|
1477
|
+
if (data && data.items.length != 0) {
|
|
1478
|
+
contragentData.value = data.items[0];
|
|
1479
|
+
contragentData.value.gender = contragentData.value.gender === 1 ? dataStore.t('pension.male') : dataStore.t('pension.female');
|
|
1480
|
+
contragentData.value.birthDate = reformatDate(contragentData.value.birthDate);
|
|
1481
|
+
}
|
|
1482
|
+
};
|
|
1483
|
+
|
|
1484
|
+
const sumContractsAmount = (transferContracts: TransferContract[]) => {
|
|
1485
|
+
if (!transferContracts || !transferContracts.length) return 0;
|
|
1486
|
+
return transferContracts.reduce((accumulator, currentValue) => {
|
|
1487
|
+
const transferAmount = structuredClone(toRaw(currentValue));
|
|
1488
|
+
return accumulator + Number(String(transferAmount.transferContractAmount).replace(/\s/g, ''));
|
|
1489
|
+
}, 0);
|
|
1490
|
+
};
|
|
1491
|
+
|
|
1061
1492
|
const formatTermValue = (term: number) => {
|
|
1062
1493
|
if (term !== null) {
|
|
1063
1494
|
const termNumber = Number(term);
|
|
@@ -1069,7 +1500,7 @@ export default defineComponent({
|
|
|
1069
1500
|
const toStatement = async () => {
|
|
1070
1501
|
const statementItem = dataStore.menuItems.find(i => i.id === 'statement');
|
|
1071
1502
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1072
|
-
await router.push({ name: 'taskId-NewApp', params: route.params, query: { tab: 'statement' } });
|
|
1503
|
+
await router.push({ name: 'taskId-NewApp', params: route.params, query: { tab: 'statement', add: 'false' } });
|
|
1073
1504
|
return;
|
|
1074
1505
|
}
|
|
1075
1506
|
if (whichProduct.value === 'gons') {
|
|
@@ -1088,7 +1519,7 @@ export default defineComponent({
|
|
|
1088
1519
|
}
|
|
1089
1520
|
};
|
|
1090
1521
|
|
|
1091
|
-
const pickPanelValue = (item: Value) => {
|
|
1522
|
+
const pickPanelValue = async (item: Value) => {
|
|
1092
1523
|
dataStore.rightPanel.open = false;
|
|
1093
1524
|
isPanelOpen.value = false;
|
|
1094
1525
|
isMultiplePanelOpen.value = false;
|
|
@@ -1100,14 +1531,31 @@ export default defineComponent({
|
|
|
1100
1531
|
// @ts-ignore
|
|
1101
1532
|
calculatorForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
1102
1533
|
} else if (whichProduct.value === 'pensionannuitynew') {
|
|
1103
|
-
|
|
1104
|
-
|
|
1534
|
+
if (currentPanel.value === 'transferContractCompany') {
|
|
1535
|
+
transferContracts.value[contractIndex.value].transferContractCompany = item;
|
|
1536
|
+
} else {
|
|
1537
|
+
// @ts-ignore
|
|
1538
|
+
pensionForm.value[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
1539
|
+
}
|
|
1105
1540
|
} else {
|
|
1106
1541
|
// @ts-ignore
|
|
1107
1542
|
productConditionsForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
1108
|
-
if (currentPanel.value === 'paymentPeriod' &&
|
|
1109
|
-
|
|
1110
|
-
|
|
1543
|
+
if (currentPanel.value === 'paymentPeriod' && item.code === 'single') {
|
|
1544
|
+
if (hasProcessIndexRate.value) {
|
|
1545
|
+
const defaultIndexRate = dataStore.processIndexRate.find((i: any) => i.isDefault === true);
|
|
1546
|
+
if (defaultIndexRate) productConditionsForm.processIndexRate = defaultIndexRate;
|
|
1547
|
+
}
|
|
1548
|
+
if (whichProduct.value === 'bolashak') {
|
|
1549
|
+
const termCover = additionalTerms.value?.findIndex(i => i.coverTypeCode === 10);
|
|
1550
|
+
if (termCover !== -1) {
|
|
1551
|
+
const termList = await dataStore.getAdditionalInsuranceTermsAnswers(additionalTerms.value[termCover].coverTypeId);
|
|
1552
|
+
const defaultTermValue = termList?.find(i => i.isDefault === true);
|
|
1553
|
+
if (defaultTermValue) {
|
|
1554
|
+
additionalTerms.value[termCover].coverSumId = String(defaultTermValue.id);
|
|
1555
|
+
additionalTerms.value[termCover].coverSumName = String(defaultTermValue.nameRu);
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1111
1559
|
}
|
|
1112
1560
|
}
|
|
1113
1561
|
};
|
|
@@ -1331,7 +1779,7 @@ export default defineComponent({
|
|
|
1331
1779
|
const calculatedPremiumDollar = getNumber(event.target.value as string);
|
|
1332
1780
|
if (calculatedPremiumDollar) {
|
|
1333
1781
|
productConditionsForm.insurancePremiumPerMonth = dataStore.getNumberWithSpaces(productConditionsForm.insurancePremiumPerMonth);
|
|
1334
|
-
if (whichProduct.value === 'halykkazyna') {
|
|
1782
|
+
if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
|
|
1335
1783
|
if (typeof dataStore.currencies.usd === 'number') {
|
|
1336
1784
|
productConditionsForm.insurancePremiumPerMonthInDollar = dataStore.getNumberWithSpaces(calculatedPremiumDollar / dataStore.currencies.usd);
|
|
1337
1785
|
} else {
|
|
@@ -1359,7 +1807,7 @@ export default defineComponent({
|
|
|
1359
1807
|
const calculatedSumDollar = getNumber(event.target.value as string);
|
|
1360
1808
|
if (calculatedSumDollar) {
|
|
1361
1809
|
productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(productConditionsForm.requestedSumInsured);
|
|
1362
|
-
if (whichProduct.value === 'halykkazyna') {
|
|
1810
|
+
if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
|
|
1363
1811
|
if (typeof dataStore.currencies.usd === 'number') {
|
|
1364
1812
|
productConditionsForm.requestedSumInsuredInDollar = dataStore.getNumberWithSpaces(calculatedSumDollar / dataStore.currencies.usd);
|
|
1365
1813
|
} else {
|
|
@@ -1370,6 +1818,42 @@ export default defineComponent({
|
|
|
1370
1818
|
}
|
|
1371
1819
|
};
|
|
1372
1820
|
|
|
1821
|
+
const onInputPension = (event: Event, key: keyof PensionCalculation | 'pensionAmount', index?: number) => {
|
|
1822
|
+
if (event.target && 'value' in event.target && event.target.value) {
|
|
1823
|
+
const calcCheck = getNumber(event.target.value as string);
|
|
1824
|
+
if (calcCheck) {
|
|
1825
|
+
if (index !== undefined) {
|
|
1826
|
+
transferContracts.value[index].transferContractAmount = dataStore.getNumberWithSpaces(event.target.value) as string;
|
|
1827
|
+
transferSum.value = transferContracts.value.reduce((accumulator, { transferContractAmount }) => (accumulator += formatSpacedNumber(transferContractAmount)), 0);
|
|
1828
|
+
} else if (key === 'pensionAmount') {
|
|
1829
|
+
pensionForm.value.amount = dataStore.getNumberWithSpaces(event.target.value) ?? '0';
|
|
1830
|
+
} else {
|
|
1831
|
+
pensionForm.value[key] = dataStore.getNumberWithSpaces(event.target.value);
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
} else {
|
|
1835
|
+
if (index !== undefined) {
|
|
1836
|
+
transferContracts.value[index].transferContractAmount = 0;
|
|
1837
|
+
transferSum.value = transferContracts.value.reduce((accumulator, { transferContractAmount }) => (accumulator += formatSpacedNumber(transferContractAmount)), 0);
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
if (key !== 'pensionAmount' && !customPension.value) {
|
|
1841
|
+
if (firstAmount.value) {
|
|
1842
|
+
firstAmount.value = false;
|
|
1843
|
+
return;
|
|
1844
|
+
}
|
|
1845
|
+
pensionForm.value.amount =
|
|
1846
|
+
dataStore.getNumberWithSpaces(
|
|
1847
|
+
formatSpacedNumber(pensionForm.value.compulsoryContractAmount) +
|
|
1848
|
+
formatSpacedNumber(pensionForm.value.compulsoryProfContractAmount) +
|
|
1849
|
+
formatSpacedNumber(pensionForm.value.ownFundsRaisAmount) +
|
|
1850
|
+
formatSpacedNumber(pensionForm.value.transferContractAmount) +
|
|
1851
|
+
formatSpacedNumber(pensionForm.value.voluntaryContractAmount) +
|
|
1852
|
+
sumContractsAmount(transferContracts.value),
|
|
1853
|
+
) ?? '';
|
|
1854
|
+
}
|
|
1855
|
+
};
|
|
1856
|
+
|
|
1373
1857
|
const onInputFixInsSum = (event: Event) => {
|
|
1374
1858
|
if (event.target && 'value' in event.target && event.target.value) {
|
|
1375
1859
|
const calculatedFixInsSum = getNumber(event.target.value as string);
|
|
@@ -1394,6 +1878,16 @@ export default defineComponent({
|
|
|
1394
1878
|
productConditionsForm.requestedSumInsuredInDollar = null;
|
|
1395
1879
|
};
|
|
1396
1880
|
|
|
1881
|
+
const onClearPension = (key: keyof PensionCalculation | 'pensionAmount', index?: number) => {
|
|
1882
|
+
if (index) {
|
|
1883
|
+
transferContracts.value[index].transferContractAmount = 0;
|
|
1884
|
+
} else if (key === 'pensionAmount') {
|
|
1885
|
+
pensionForm.value.amount = '0';
|
|
1886
|
+
} else {
|
|
1887
|
+
pensionForm.value[key] = null;
|
|
1888
|
+
}
|
|
1889
|
+
};
|
|
1890
|
+
|
|
1397
1891
|
const onClearSumDollar = () => {
|
|
1398
1892
|
productConditionsForm.requestedSumInsured = null;
|
|
1399
1893
|
};
|
|
@@ -1425,8 +1919,10 @@ export default defineComponent({
|
|
|
1425
1919
|
};
|
|
1426
1920
|
|
|
1427
1921
|
const filterTermConditions = (term: AddCover) => {
|
|
1428
|
-
if (term.coverTypeCode === 10) {
|
|
1429
|
-
|
|
1922
|
+
if (term.coverTypeCode === 10 && !props.isCalculator) {
|
|
1923
|
+
const isSinglePeriod = whichProduct.value === 'bolashak' ? productConditionsForm.paymentPeriod?.code === 'single' : false;
|
|
1924
|
+
const isDifferentClients = !!formStore.insuredForm.find((member: Member) => member.iin === formStore.policyholderForm.iin) === false;
|
|
1925
|
+
return isDifferentClients && !isSinglePeriod;
|
|
1430
1926
|
}
|
|
1431
1927
|
return true;
|
|
1432
1928
|
};
|
|
@@ -1438,6 +1934,48 @@ export default defineComponent({
|
|
|
1438
1934
|
return term.coverTypeName;
|
|
1439
1935
|
};
|
|
1440
1936
|
|
|
1937
|
+
const addTransferContract = () => {
|
|
1938
|
+
transferContracts.value.push(new TransferContract());
|
|
1939
|
+
transferContracts.value[transferContracts.value.length - 1].transferContractDate = transferMaxDate.value;
|
|
1940
|
+
};
|
|
1941
|
+
|
|
1942
|
+
const removeTransferContract = (index: number) => {
|
|
1943
|
+
transferContracts.value.splice(index, 1);
|
|
1944
|
+
transferSum.value = transferContracts.value.reduce((accumulator, { transferContractAmount }) => (accumulator += formatSpacedNumber(transferContractAmount)), 0);
|
|
1945
|
+
};
|
|
1946
|
+
|
|
1947
|
+
const prepareTransferContracts = (transferContracts: Array<TransferContract>) => {
|
|
1948
|
+
const formatedContracts: Array<TransferContract> = [];
|
|
1949
|
+
if (transferContracts && transferContracts.length) {
|
|
1950
|
+
transferContracts.forEach(i => {
|
|
1951
|
+
formatedContracts.push({
|
|
1952
|
+
...i,
|
|
1953
|
+
transferContractDate: constants.regex.isoDate.test(i.transferContractDate) ? i.transferContractDate : formatDate(i.transferContractDate)?.toISOString() ?? '',
|
|
1954
|
+
transferContractFirstPaymentDate: constants.regex.isoDate.test(i.transferContractFirstPaymentDate)
|
|
1955
|
+
? i.transferContractFirstPaymentDate
|
|
1956
|
+
: formatDate(i.transferContractFirstPaymentDate)?.toISOString() ?? '',
|
|
1957
|
+
// @ts-ignore
|
|
1958
|
+
transferContractCompany:
|
|
1959
|
+
typeof i.transferContractCompany !== 'string' && 'nameRu' in i.transferContractCompany ? String(i.transferContractCompany.nameRu) : i.transferContractCompany,
|
|
1960
|
+
transferContractCompanyId:
|
|
1961
|
+
// @ts-ignore
|
|
1962
|
+
typeof i.transferContractCompany !== 'string' && 'ids' in i.transferContractCompany ? i.transferContractCompany.ids : i.transferContractCompanyId,
|
|
1963
|
+
id: i.id ?? null,
|
|
1964
|
+
transferContractAmount: String(i.transferContractAmount).replace(/\s/g, ''),
|
|
1965
|
+
});
|
|
1966
|
+
});
|
|
1967
|
+
}
|
|
1968
|
+
return formatedContracts;
|
|
1969
|
+
};
|
|
1970
|
+
|
|
1971
|
+
const validateContractDate = (v: any) => {
|
|
1972
|
+
if (v && maxDate.value && formatDate(v) && formatDate(maxDate.value)) {
|
|
1973
|
+
const invalidDate = (formatDate(v) ?? new Date()) > (formatDate(maxDate.value) ?? new Date());
|
|
1974
|
+
if (invalidDate) return 'Дата заключения договора некорректна';
|
|
1975
|
+
}
|
|
1976
|
+
return true;
|
|
1977
|
+
};
|
|
1978
|
+
|
|
1441
1979
|
const submitForm = async () => {
|
|
1442
1980
|
vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
1443
1981
|
if (v.valid) {
|
|
@@ -1445,9 +1983,12 @@ export default defineComponent({
|
|
|
1445
1983
|
if (calculatorForm.type.code === 'Single' && calculatorForm.startDate && calculatorForm.endDate) {
|
|
1446
1984
|
const formattedStartDate = formatDate(calculatorForm.startDate);
|
|
1447
1985
|
const formattedEndDate = formatDate(calculatorForm.endDate);
|
|
1448
|
-
if (formattedStartDate && formattedEndDate && formattedStartDate.getTime()
|
|
1986
|
+
if (formattedStartDate && formattedEndDate && formattedStartDate.getTime() >= formattedEndDate.getTime()) {
|
|
1449
1987
|
return dataStore.showToaster('error', dataStore.t('toaster.startMoreEnd'));
|
|
1450
1988
|
}
|
|
1989
|
+
if (calculatorForm.days !== productConditionsForm.getSingleTripDays()) {
|
|
1990
|
+
return dataStore.showToaster('error', dataStore.t('toaster.daysPickAgain'));
|
|
1991
|
+
}
|
|
1451
1992
|
}
|
|
1452
1993
|
if (dataStore.isTask()) {
|
|
1453
1994
|
await dataStore.calculatePrice(route.params.taskId as string);
|
|
@@ -1455,41 +1996,114 @@ export default defineComponent({
|
|
|
1455
1996
|
await dataStore.calculatePrice();
|
|
1456
1997
|
}
|
|
1457
1998
|
} else if (whichProduct.value === 'pensionannuitynew') {
|
|
1458
|
-
if (
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1999
|
+
if (contractDate.value && maxDate.value && formatDate(contractDate.value) && formatDate(maxDate.value)) {
|
|
2000
|
+
const invalidDate = (formatDate(contractDate.value) ?? new Date()) > (formatDate(maxDate.value) ?? new Date());
|
|
2001
|
+
if (invalidDate) {
|
|
2002
|
+
dataStore.showToaster('error', 'Дата заключения договора некорректна');
|
|
2003
|
+
return;
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
if (transferContracts.value && transferContracts.value.length) {
|
|
2007
|
+
transferContracts.value.forEach(i => {
|
|
2008
|
+
if (formatDate(i.transferContractDate) != null && formatDate(transferMaxDate.value)) {
|
|
2009
|
+
const invalidDate = (formatDate(i.transferContractDate) ?? new Date()) > (formatDate(transferMaxDate.value) ?? new Date());
|
|
2010
|
+
if (invalidDate) {
|
|
2011
|
+
dataStore.showToaster('error', 'Дата заключения договора КСЖ некорректна');
|
|
2012
|
+
return;
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
2015
|
+
});
|
|
1467
2016
|
}
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
...
|
|
1471
|
-
|
|
1472
|
-
compulsoryContractAmount:
|
|
1473
|
-
voluntaryContractAmount:
|
|
1474
|
-
ownFundsRaisAmount:
|
|
1475
|
-
compulsoryProfContractAmount:
|
|
1476
|
-
transferContractAmount:
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
2017
|
+
if (!pensionForm.value.compulsoryProfContractAmount) pensionForm.value.compulsoryProfMonthCount = null;
|
|
2018
|
+
const pensionData = {
|
|
2019
|
+
...pensionForm.value,
|
|
2020
|
+
...{
|
|
2021
|
+
compulsoryContractAmount: formatSpacedNumber(pensionForm.value.compulsoryContractAmount),
|
|
2022
|
+
voluntaryContractAmount: formatSpacedNumber(pensionForm.value.voluntaryContractAmount),
|
|
2023
|
+
ownFundsRaisAmount: formatSpacedNumber(pensionForm.value.ownFundsRaisAmount),
|
|
2024
|
+
compulsoryProfContractAmount: formatSpacedNumber(pensionForm.value.compulsoryProfContractAmount),
|
|
2025
|
+
transferContractAmount: formatSpacedNumber(pensionForm.value.transferContractAmount),
|
|
2026
|
+
transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
|
|
2027
|
+
},
|
|
2028
|
+
amount: formatSpacedNumber(pensionForm.value.amount),
|
|
2029
|
+
contractDate: formatDate(contractDate.value ?? ''),
|
|
1481
2030
|
};
|
|
1482
|
-
|
|
2031
|
+
const data = isSlavePensionForm.value
|
|
2032
|
+
? {
|
|
2033
|
+
...formStore.pensionApp,
|
|
2034
|
+
transferContracts: prepareTransferContracts(formStore.pensionApp.transferContracts),
|
|
2035
|
+
slave: pensionData,
|
|
2036
|
+
amount: formatSpacedNumber(formStore.pensionApp?.amount),
|
|
2037
|
+
compulsoryContractAmount: formatSpacedNumber(formStore.pensionApp?.compulsoryContractAmount),
|
|
2038
|
+
voluntaryContractAmount: formatSpacedNumber(formStore.pensionApp?.voluntaryContractAmount),
|
|
2039
|
+
ownFundsRaisAmount: formatSpacedNumber(formStore.pensionApp?.ownFundsRaisAmount),
|
|
2040
|
+
compulsoryProfContractAmount: formatSpacedNumber(formStore.pensionApp?.compulsoryProfContractAmount),
|
|
2041
|
+
transferContractAmount: formatSpacedNumber(formStore.pensionApp?.transferContractAmount),
|
|
2042
|
+
transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
|
|
2043
|
+
}
|
|
2044
|
+
: {
|
|
2045
|
+
...pensionData,
|
|
2046
|
+
transferContracts: prepareTransferContracts(transferContracts.value),
|
|
2047
|
+
slave: !!formStore.pensionApp?.slave
|
|
2048
|
+
? {
|
|
2049
|
+
...formStore.pensionApp?.slave,
|
|
2050
|
+
contractDate: pensionData.contractDate,
|
|
2051
|
+
amount: formatSpacedNumber(formStore.pensionApp?.slave?.amount),
|
|
2052
|
+
compulsoryContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.compulsoryContractAmount),
|
|
2053
|
+
voluntaryContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.voluntaryContractAmount),
|
|
2054
|
+
ownFundsRaisAmount: formatSpacedNumber(formStore.pensionApp?.slave?.ownFundsRaisAmount),
|
|
2055
|
+
compulsoryProfContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.compulsoryProfContractAmount),
|
|
2056
|
+
transferContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.transferContractAmount),
|
|
2057
|
+
transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
|
|
2058
|
+
}
|
|
2059
|
+
: null,
|
|
2060
|
+
};
|
|
2061
|
+
if (!!data.slave) {
|
|
2062
|
+
data.slave.transferContracts = prepareTransferContracts(isSlavePensionForm.value ? transferContracts.value : data.slave.transferContracts);
|
|
2063
|
+
const difference = Math.abs(
|
|
2064
|
+
formatSpacedNumber(formStore.pensionApp?.amount) + formatSpacedNumber(formStore.pensionApp?.slave?.amount) - formatSpacedNumber(pensionForm.value.amount),
|
|
2065
|
+
);
|
|
2066
|
+
if (customPension.value) {
|
|
2067
|
+
isSlavePensionForm.value ? (data.slave.amount = formatSpacedNumber(pensionForm.value.amount)) : (data.amount = formatSpacedNumber(pensionForm.value.amount));
|
|
2068
|
+
const customSum = sumPensionData(data) + sumPensionData(data.slave);
|
|
2069
|
+
if (formatSpacedNumber(totalInsPremium.value) !== customSum) {
|
|
2070
|
+
return dataStore.showToaster('error', 'Cтраховая премия не соответсвует общей страховой премии');
|
|
2071
|
+
}
|
|
2072
|
+
if (!isSlavePensionForm.value) {
|
|
2073
|
+
data.slave.amount = difference;
|
|
2074
|
+
} else {
|
|
2075
|
+
data.amount = difference;
|
|
2076
|
+
}
|
|
2077
|
+
} else {
|
|
2078
|
+
const amount = isSlavePensionForm.value ? data.slave.amount : data.amount;
|
|
2079
|
+
if (formatSpacedNumber(pensionForm.value.amount) != amount) {
|
|
2080
|
+
data.slave.amount = sumPensionData(data.slave);
|
|
2081
|
+
data.amount = sumPensionData(data);
|
|
2082
|
+
}
|
|
2083
|
+
}
|
|
2084
|
+
const isParentValid = validatePensionForm(data, 'Заполните условия первого страхователя');
|
|
2085
|
+
const isSlaveValid = validatePensionForm(data.slave, 'Заполните условия второго страхователя');
|
|
2086
|
+
if (!isParentValid || !isSlaveValid) {
|
|
2087
|
+
return;
|
|
2088
|
+
}
|
|
2089
|
+
await dataStore.setApplication(data, true);
|
|
2090
|
+
customPension.value = false;
|
|
2091
|
+
} else {
|
|
2092
|
+
await dataStore.setApplication(data, true);
|
|
2093
|
+
}
|
|
2094
|
+
await dataStore.getApplicationData(String(route.params.taskId), false, false, false, true);
|
|
2095
|
+
dateOfBegin.value = reformatDate(formStore.applicationData.pensionApp.dateOfBegin);
|
|
2096
|
+
dividendSchedules.value = await dataStore.getDividendSchedule();
|
|
1483
2097
|
} else {
|
|
1484
2098
|
if (whichSum.value === 'requestedSumInsured') {
|
|
1485
2099
|
productConditionsForm.insurancePremiumPerMonth = null;
|
|
1486
|
-
if (whichProduct.value === 'halykkazyna') {
|
|
2100
|
+
if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
|
|
1487
2101
|
productConditionsForm.insurancePremiumPerMonthInDollar = null;
|
|
1488
2102
|
}
|
|
1489
2103
|
}
|
|
1490
2104
|
if (whichSum.value === 'insurancePremiumPerMonth') {
|
|
1491
2105
|
productConditionsForm.requestedSumInsured = null;
|
|
1492
|
-
if (whichProduct.value === 'halykkazyna') {
|
|
2106
|
+
if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
|
|
1493
2107
|
productConditionsForm.requestedSumInsuredInDollar = null;
|
|
1494
2108
|
}
|
|
1495
2109
|
}
|
|
@@ -1555,7 +2169,9 @@ export default defineComponent({
|
|
|
1555
2169
|
recalculationData.riskGroup = productConditionsForm.riskGroup?.id ? productConditionsForm.riskGroup.id : 1;
|
|
1556
2170
|
isCalculating.value = true;
|
|
1557
2171
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1558
|
-
|
|
2172
|
+
const setApplicationData = dataStore.getConditionsData();
|
|
2173
|
+
const hasSetApplication = await dataStore.setApplication(setApplicationData);
|
|
2174
|
+
if (hasSetApplication && !isHalykBank) await dataStore.calculate(route.params.taskId as string);
|
|
1559
2175
|
additionalTerms.value = formStore.additionalInsuranceTerms;
|
|
1560
2176
|
} else {
|
|
1561
2177
|
await dataStore.reCalculate(formStore.applicationData.processInstanceId, recalculationData, route.params.taskId as string, whichSum.value);
|
|
@@ -1569,12 +2185,11 @@ export default defineComponent({
|
|
|
1569
2185
|
additionalTerms.value = formStore.additionalInsuranceTermsWithout;
|
|
1570
2186
|
} else {
|
|
1571
2187
|
if (dataStore.isProcessEditable(formStore.applicationData.statusCode)) {
|
|
1572
|
-
await dataStore.calculate(route.params.taskId as string);
|
|
2188
|
+
await dataStore.calculate(route.params.taskId as string, isHalykBank);
|
|
1573
2189
|
additionalTerms.value = formStore.additionalInsuranceTerms;
|
|
1574
2190
|
}
|
|
1575
2191
|
}
|
|
1576
2192
|
}
|
|
1577
|
-
|
|
1578
2193
|
isCalculating.value = false;
|
|
1579
2194
|
} else {
|
|
1580
2195
|
const errors = document.querySelector('.v-input--error');
|
|
@@ -1598,75 +2213,135 @@ export default defineComponent({
|
|
|
1598
2213
|
});
|
|
1599
2214
|
};
|
|
1600
2215
|
|
|
2216
|
+
const validatePensionForm = (data: any, text: string) => {
|
|
2217
|
+
if (!data.amount || !data.guaranteedPeriod) {
|
|
2218
|
+
dataStore.showToaster('error', text);
|
|
2219
|
+
return false;
|
|
2220
|
+
}
|
|
2221
|
+
return true;
|
|
2222
|
+
};
|
|
2223
|
+
|
|
2224
|
+
const sumPensionData = (data: any) => {
|
|
2225
|
+
return (
|
|
2226
|
+
formatSpacedNumber(data.ownFundsRaisAmount) +
|
|
2227
|
+
formatSpacedNumber(data.voluntaryContractAmount) +
|
|
2228
|
+
formatSpacedNumber(data.compulsoryContractAmount) +
|
|
2229
|
+
formatSpacedNumber(data.compulsoryProfContractAmount) +
|
|
2230
|
+
sumContractsAmount(data.transferContracts)
|
|
2231
|
+
);
|
|
2232
|
+
};
|
|
2233
|
+
|
|
1601
2234
|
onMounted(async () => {
|
|
1602
|
-
|
|
2235
|
+
try {
|
|
2236
|
+
if (hasContragentData.value) await getContragent();
|
|
2237
|
+
if (props.isCalculator === true) {
|
|
2238
|
+
isLoading.value = true;
|
|
2239
|
+
if (dataStore.isCalculator) {
|
|
2240
|
+
clearFields();
|
|
2241
|
+
}
|
|
2242
|
+
if (whichProduct.value === 'gons') {
|
|
2243
|
+
formStore.isDisabled.productConditionsForm = false;
|
|
2244
|
+
dataStore.setFormsDisabled(false);
|
|
2245
|
+
}
|
|
2246
|
+
if (whichProduct.value !== 'lifetrip' && whichProduct.value !== 'pensionannuitynew') {
|
|
2247
|
+
if (
|
|
2248
|
+
(dataStore.isCalculator || route.params.taskId === '0' || fromIndexPage.value) &&
|
|
2249
|
+
productConditionsForm.requestedSumInsured === null &&
|
|
2250
|
+
productConditionsForm.insurancePremiumPerMonth === null
|
|
2251
|
+
) {
|
|
2252
|
+
// @ts-ignore
|
|
2253
|
+
const defaultData = await dataStore.getDefaultCalculationData(true, whichProduct.value);
|
|
2254
|
+
if (!defaultData) {
|
|
2255
|
+
dataStore.showToaster('error', 'Отсутствуют базовые данные');
|
|
2256
|
+
return;
|
|
2257
|
+
}
|
|
2258
|
+
formStore.additionalInsuranceTermsWithout = defaultData.addCovers;
|
|
2259
|
+
productConditionsForm.requestedSumInsured = defaultData.amount;
|
|
2260
|
+
productConditionsForm.insurancePremiumPerMonth = defaultData.premium;
|
|
2261
|
+
const indexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
|
|
2262
|
+
if (indexRate) productConditionsForm.processIndexRate = indexRate;
|
|
2263
|
+
const paymendPeriod = dataStore.processPaymentPeriod.find(i => i.id === defaultData.paymentPeriodId);
|
|
2264
|
+
if (paymendPeriod) productConditionsForm.paymentPeriod = paymendPeriod;
|
|
2265
|
+
if (defaultData.signDate) {
|
|
2266
|
+
productConditionsForm.signDate = reformatDate(defaultData.signDate);
|
|
2267
|
+
}
|
|
2268
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
2269
|
+
productConditionsForm.coverPeriod = defaultData.insTermInMonth ?? null;
|
|
2270
|
+
productConditionsForm.insurancePremiumPerMonth = null;
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
}
|
|
2274
|
+
}
|
|
2275
|
+
additionalTerms.value = props.isCalculator ? formStore.additionalInsuranceTermsWithout : formStore.additionalInsuranceTerms;
|
|
2276
|
+
if (!!productConditionsForm.insurancePremiumPerMonth) {
|
|
2277
|
+
whichSum.value = 'insurancePremiumPerMonth';
|
|
2278
|
+
}
|
|
2279
|
+
if (!!productConditionsForm.requestedSumInsured) {
|
|
2280
|
+
whichSum.value = 'requestedSumInsured';
|
|
2281
|
+
}
|
|
2282
|
+
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && !productConditionsForm.requestedSumInsured) {
|
|
2283
|
+
whichSum.value = 'requestedSumInsured';
|
|
2284
|
+
}
|
|
1603
2285
|
if (dataStore.isCalculator) {
|
|
1604
|
-
|
|
2286
|
+
dataStore.processCode = constants.products[whichProduct.value as keyof typeof constants.products];
|
|
2287
|
+
await dataStore.getProcessPaymentPeriod();
|
|
1605
2288
|
}
|
|
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
|
-
|
|
2289
|
+
if (
|
|
2290
|
+
formStore.productConditionsForm.requestedSumInsured === null &&
|
|
2291
|
+
formStore.productConditionsForm.insurancePremiumPerMonth === null &&
|
|
2292
|
+
(whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons')
|
|
2293
|
+
) {
|
|
2294
|
+
await dataStore.getCurrencies();
|
|
2295
|
+
}
|
|
2296
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
2297
|
+
const kazynaPaymentPeriod = dataStore.processPaymentPeriod.find(i => i.code === 'single');
|
|
2298
|
+
if (kazynaPaymentPeriod) productConditionsForm.paymentPeriod = kazynaPaymentPeriod;
|
|
2299
|
+
}
|
|
2300
|
+
if (!formStore.lfb.add && !isHalykBank && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
2301
|
+
productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(
|
|
2302
|
+
formStore.lfb.clients.reduce((sum: number, i: any) => {
|
|
2303
|
+
return sum + Number(i.insSum);
|
|
2304
|
+
}, 0),
|
|
2305
|
+
);
|
|
2306
|
+
}
|
|
2307
|
+
if (whichProduct.value === 'pensionannuitynew') {
|
|
2308
|
+
contractDate.value = reformatDate(pensionForm.value.contractDate ?? '');
|
|
2309
|
+
dateOfBegin.value = reformatDate(pensionForm.value.dateOfBegin);
|
|
2310
|
+
transferContractDate.value = reformatDate(pensionForm.value.transferContractDate);
|
|
2311
|
+
transferContractFirstPaymentDate.value = reformatDate(pensionForm.value.transferContractFirstPaymentDate ?? '');
|
|
2312
|
+
maxDate.value = await dataStore.getVariableData(formStore.applicationData.processCode ?? 19);
|
|
2313
|
+
dividendPeriods.value = await dataStore.getProcessDividendPeriods();
|
|
2314
|
+
if (pensionForm.value.dividendId) {
|
|
2315
|
+
dividendSchedules.value = await dataStore.getDividendSchedule();
|
|
2316
|
+
}
|
|
2317
|
+
if (!transferContracts.value.length && pensionForm.value.transferContracts && pensionForm.value.transferContracts.length) {
|
|
2318
|
+
pensionForm.value.transferContracts.forEach((contract: TransferContract) => {
|
|
2319
|
+
transferContracts.value.push({
|
|
2320
|
+
...contract,
|
|
2321
|
+
transferContractDate: constants.regex.isoDate.test(contract.transferContractDate) ? reformatDate(contract.transferContractDate)! : contract.transferContractDate,
|
|
2322
|
+
transferContractFirstPaymentDate: constants.regex.isoDate.test(contract.transferContractFirstPaymentDate)
|
|
2323
|
+
? reformatDate(contract.transferContractFirstPaymentDate)!
|
|
2324
|
+
: contract.transferContractFirstPaymentDate,
|
|
2325
|
+
transferContractCompany:
|
|
2326
|
+
typeof contract.transferContractCompany === 'string' ? ({ nameRu: contract.transferContractCompany } as any) : contract.transferContractCompany,
|
|
2327
|
+
transferContractAmount: dataStore.getNumberWithSpaces(contract.transferContractAmount) ?? '',
|
|
2328
|
+
});
|
|
2329
|
+
});
|
|
1632
2330
|
}
|
|
1633
2331
|
}
|
|
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);
|
|
2332
|
+
} catch (err) {
|
|
2333
|
+
console.log(err);
|
|
2334
|
+
} finally {
|
|
2335
|
+
isLoading.value = false;
|
|
1667
2336
|
}
|
|
1668
2337
|
});
|
|
1669
2338
|
|
|
2339
|
+
watch(
|
|
2340
|
+
() => pensionForm.value?.amount,
|
|
2341
|
+
val => {
|
|
2342
|
+
if (val) pensionForm.value.amount = dataStore.getNumberWithSpaces(val);
|
|
2343
|
+
},
|
|
2344
|
+
);
|
|
1670
2345
|
watch(
|
|
1671
2346
|
() => productConditionsForm.amountOfInsurancePremium,
|
|
1672
2347
|
val => {
|
|
@@ -1697,6 +2372,23 @@ export default defineComponent({
|
|
|
1697
2372
|
{ immediate: true },
|
|
1698
2373
|
);
|
|
1699
2374
|
|
|
2375
|
+
if (hasCurrency.value) {
|
|
2376
|
+
watch(
|
|
2377
|
+
() => productConditionsForm.currency,
|
|
2378
|
+
async val => {
|
|
2379
|
+
if (val.code === 'USD') {
|
|
2380
|
+
if (!dataStore.processPaymentPeriod.length) {
|
|
2381
|
+
await dataStore.getProcessPaymentPeriod();
|
|
2382
|
+
}
|
|
2383
|
+
const paymentPeriod = dataStore.processPaymentPeriod.find(item => item.nameRu === 'единовременно');
|
|
2384
|
+
if (paymentPeriod) {
|
|
2385
|
+
productConditionsForm.paymentPeriod = paymentPeriod;
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
},
|
|
2389
|
+
);
|
|
2390
|
+
}
|
|
2391
|
+
|
|
1700
2392
|
if (hasInsStartDate.value) {
|
|
1701
2393
|
watch(
|
|
1702
2394
|
() => productConditionsForm.calcDate,
|
|
@@ -1730,6 +2422,8 @@ export default defineComponent({
|
|
|
1730
2422
|
async val => {
|
|
1731
2423
|
if (val?.length && val.every(option => option.id != 0) && calculatorForm.type?.nameRu != null) {
|
|
1732
2424
|
await dataStore.getTripInsuredAmount();
|
|
2425
|
+
} else {
|
|
2426
|
+
calculatorForm.amount = new Value();
|
|
1733
2427
|
}
|
|
1734
2428
|
},
|
|
1735
2429
|
{ deep: true },
|
|
@@ -1763,8 +2457,38 @@ export default defineComponent({
|
|
|
1763
2457
|
);
|
|
1764
2458
|
}
|
|
1765
2459
|
|
|
2460
|
+
if (whichProduct.value === 'pensionannuitynew') {
|
|
2461
|
+
watch(
|
|
2462
|
+
() => pensionForm.value.guaranteedPeriod,
|
|
2463
|
+
async () => {
|
|
2464
|
+
if (formStore.applicationData.processCode === 24) {
|
|
2465
|
+
await dataStore.reCalculateRefund(
|
|
2466
|
+
Number(pensionForm.value.parentContractAmount),
|
|
2467
|
+
Number(pensionForm.value.parentContractMainAmount),
|
|
2468
|
+
pensionForm.value.guaranteedPeriod,
|
|
2469
|
+
pensionForm.value.transferContractIsOppv,
|
|
2470
|
+
pensionForm.value.compulsoryProfMonthCount ?? 0,
|
|
2471
|
+
);
|
|
2472
|
+
}
|
|
2473
|
+
},
|
|
2474
|
+
);
|
|
2475
|
+
watch(
|
|
2476
|
+
() => contractDate.value,
|
|
2477
|
+
(val, oldVal) => {
|
|
2478
|
+
if (val !== null && val !== undefined && val.length === 10 && oldVal != undefined && !isSlavePensionForm.value) {
|
|
2479
|
+
const formattedContractDate = formatDate(val);
|
|
2480
|
+
if (formattedContractDate) {
|
|
2481
|
+
formattedContractDate.setDate(formattedContractDate.getDate() + 20);
|
|
2482
|
+
dateOfBegin.value = reformatDate(String(formattedContractDate));
|
|
2483
|
+
}
|
|
2484
|
+
}
|
|
2485
|
+
},
|
|
2486
|
+
{ immediate: true },
|
|
2487
|
+
);
|
|
2488
|
+
}
|
|
2489
|
+
|
|
1766
2490
|
const copyRedirect = async () => {
|
|
1767
|
-
const url = await dataStore.api.getEnpfRedirectUrl(String(
|
|
2491
|
+
const url = await dataStore.api.pensionannuityNew.getEnpfRedirectUrl(String(pensionForm.value.processInstanceId));
|
|
1768
2492
|
dataStore.copyToClipboard(url.redirectUrl);
|
|
1769
2493
|
};
|
|
1770
2494
|
|
|
@@ -1772,6 +2496,7 @@ export default defineComponent({
|
|
|
1772
2496
|
// State
|
|
1773
2497
|
formStore,
|
|
1774
2498
|
vForm,
|
|
2499
|
+
isLoading,
|
|
1775
2500
|
whichProduct,
|
|
1776
2501
|
productConditionsForm,
|
|
1777
2502
|
additionalTerms,
|
|
@@ -1793,20 +2518,35 @@ export default defineComponent({
|
|
|
1793
2518
|
subTermValue,
|
|
1794
2519
|
panelCodeList,
|
|
1795
2520
|
pensionForm,
|
|
2521
|
+
insuredForm,
|
|
1796
2522
|
dateOfBegin,
|
|
1797
2523
|
contractDate,
|
|
1798
2524
|
transferContractDate,
|
|
1799
2525
|
transferContractFirstPaymentDate,
|
|
1800
2526
|
enabled,
|
|
1801
2527
|
maxDate,
|
|
2528
|
+
amountPaid,
|
|
2529
|
+
amountRefunded,
|
|
2530
|
+
transferMaxDate,
|
|
1802
2531
|
guaranteedPeriodList,
|
|
1803
2532
|
isEnpfSum,
|
|
2533
|
+
transferContracts,
|
|
2534
|
+
contractsValue,
|
|
2535
|
+
contractIndex,
|
|
2536
|
+
contragentData,
|
|
2537
|
+
customPension,
|
|
1804
2538
|
|
|
1805
2539
|
// Computed
|
|
1806
2540
|
isTask,
|
|
1807
2541
|
isDisabled,
|
|
2542
|
+
disabilityGroup,
|
|
2543
|
+
totalInsPremium,
|
|
1808
2544
|
isTermsDisabled,
|
|
1809
2545
|
isUnderwriterForm,
|
|
2546
|
+
hasCurrencySymbols,
|
|
2547
|
+
currencyListFiltered,
|
|
2548
|
+
currencySymbolsLabel,
|
|
2549
|
+
isDisabledPaymentPeriod,
|
|
1810
2550
|
insurancePremiumPerMonthRule,
|
|
1811
2551
|
insurancePremiumPerMonthDisabled,
|
|
1812
2552
|
requestedSumInsuredRule,
|
|
@@ -1814,9 +2554,13 @@ export default defineComponent({
|
|
|
1814
2554
|
isUnderwriterRole,
|
|
1815
2555
|
hasProcessIndexRate,
|
|
1816
2556
|
hasPaymentPeriod,
|
|
2557
|
+
hasRequestedSumInsured,
|
|
2558
|
+
hasInsurancePremiumPerMonth,
|
|
1817
2559
|
hasRequestedSumInsuredInDollar,
|
|
1818
2560
|
hasInsurancePremiumPerMonthInDollar,
|
|
1819
2561
|
hasCurrency,
|
|
2562
|
+
hasPaidOrRefund,
|
|
2563
|
+
hasContragentData,
|
|
1820
2564
|
hasAdbMultiply,
|
|
1821
2565
|
readonlyLifeAdditive,
|
|
1822
2566
|
readonlyDisabilityMultiply,
|
|
@@ -1826,6 +2570,7 @@ export default defineComponent({
|
|
|
1826
2570
|
hasCalculated,
|
|
1827
2571
|
hasAnnuityPayments,
|
|
1828
2572
|
hasAgencyPart,
|
|
2573
|
+
hasDisabilityAdditive,
|
|
1829
2574
|
currencySymbolsAddTerm,
|
|
1830
2575
|
amountAnnuityPayments,
|
|
1831
2576
|
requestedSumInsuredLabel,
|
|
@@ -1835,27 +2580,35 @@ export default defineComponent({
|
|
|
1835
2580
|
hasBirthDate,
|
|
1836
2581
|
hasGender,
|
|
1837
2582
|
coverPeriodLabel,
|
|
2583
|
+
lifeMultiplyLabel,
|
|
2584
|
+
lifeAdditiveLabel,
|
|
2585
|
+
disabilityMultiplyLabel,
|
|
2586
|
+
adbMultiplyLabel,
|
|
2587
|
+
adbAdditiveLabel,
|
|
1838
2588
|
insurancePremiumPerMonthLabel,
|
|
1839
2589
|
isDisabledCoverPeriod,
|
|
1840
2590
|
hasDefault,
|
|
1841
2591
|
isShownAdditionalTerms,
|
|
1842
2592
|
hasCalcSum,
|
|
2593
|
+
isDisabledInsStartDate,
|
|
1843
2594
|
isDisabledAgentCommission,
|
|
1844
2595
|
hasFixInsSum,
|
|
1845
2596
|
isDisabledFixInsSum,
|
|
1846
2597
|
defaultText,
|
|
1847
2598
|
hasDeathInsFromNS,
|
|
1848
|
-
pensionAmount,
|
|
1849
|
-
pensionCalculationParams,
|
|
1850
2599
|
hasDeathInsAnyReason,
|
|
1851
2600
|
fromIndexPage,
|
|
1852
2601
|
hasCoverPeriod,
|
|
1853
2602
|
hasInsStartDate,
|
|
1854
2603
|
hasInsEndDate,
|
|
2604
|
+
isSlavePensionForm,
|
|
2605
|
+
dividendPeriods,
|
|
2606
|
+
dividendSchedules,
|
|
1855
2607
|
|
|
1856
2608
|
// Rules
|
|
1857
|
-
coverPeriodRule,
|
|
1858
2609
|
fixInsSumRule,
|
|
2610
|
+
agencyPartRule,
|
|
2611
|
+
coverPeriodRule,
|
|
1859
2612
|
|
|
1860
2613
|
// Functions
|
|
1861
2614
|
submitForm,
|
|
@@ -1868,10 +2621,13 @@ export default defineComponent({
|
|
|
1868
2621
|
underwriterCalculate,
|
|
1869
2622
|
onInputInsurancePremiumPerMonth,
|
|
1870
2623
|
onInputInsurancePremiumPerMonthInDollar,
|
|
2624
|
+
validateContractDate,
|
|
1871
2625
|
onInputSum,
|
|
2626
|
+
onInputPension,
|
|
1872
2627
|
onInputSumDollar,
|
|
1873
2628
|
toStatement,
|
|
1874
2629
|
onClearSum,
|
|
2630
|
+
onClearPension,
|
|
1875
2631
|
onClearSumDollar,
|
|
1876
2632
|
onClearPremium,
|
|
1877
2633
|
onClearPremiumDollar,
|
|
@@ -1883,13 +2639,35 @@ export default defineComponent({
|
|
|
1883
2639
|
pickSubTermValue,
|
|
1884
2640
|
onInputFixInsSum,
|
|
1885
2641
|
copyRedirect,
|
|
2642
|
+
getContragent,
|
|
2643
|
+
addTransferContract,
|
|
2644
|
+
removeTransferContract,
|
|
2645
|
+
checkTransferContractDate,
|
|
1886
2646
|
};
|
|
1887
2647
|
},
|
|
1888
2648
|
});
|
|
1889
2649
|
</script>
|
|
1890
2650
|
|
|
1891
2651
|
<style>
|
|
1892
|
-
.pension-
|
|
2652
|
+
.pension-round-toggle .v-field {
|
|
1893
2653
|
border: none !important;
|
|
1894
2654
|
}
|
|
2655
|
+
.grid-table > div > span {
|
|
2656
|
+
padding-left: 24px;
|
|
2657
|
+
border-right: 1px solid #fff;
|
|
2658
|
+
display: flex;
|
|
2659
|
+
align-items: center;
|
|
2660
|
+
padding-top: 12px;
|
|
2661
|
+
padding-bottom: 12px;
|
|
2662
|
+
min-width: 15%;
|
|
2663
|
+
}
|
|
2664
|
+
.v-virtual-scroll__item > div > span {
|
|
2665
|
+
padding-left: 24px;
|
|
2666
|
+
border-right: 1px solid #fff;
|
|
2667
|
+
display: flex;
|
|
2668
|
+
align-items: center;
|
|
2669
|
+
padding-top: 12px;
|
|
2670
|
+
padding-bottom: 12px;
|
|
2671
|
+
min-width: 15%;
|
|
2672
|
+
}
|
|
1895
2673
|
</style>
|