hl-core 0.0.10-beta.30 → 0.0.10-beta.32
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 +41 -4
- package/components/Form/ManagerAttachment.vue +1 -2
- package/components/Input/Datepicker.vue +5 -0
- package/components/Input/FormInput.vue +5 -0
- package/components/Input/RoundedInput.vue +2 -0
- package/components/Pages/Documents.vue +191 -56
- package/components/Pages/MemberForm.vue +104 -116
- package/components/Pages/ProductConditions.vue +513 -124
- package/components/Panel/PanelHandler.vue +64 -49
- package/composables/classes.ts +20 -9
- package/composables/constants.ts +10 -2
- package/composables/index.ts +9 -2
- package/locales/ru.json +14 -9
- package/package.json +1 -1
- package/store/data.store.ts +327 -122
- package/store/member.store.ts +15 -4
- package/store/rules.ts +2 -2
- package/types/enum.ts +2 -0
- package/types/index.ts +2 -0
|
@@ -55,15 +55,12 @@
|
|
|
55
55
|
<base-form-input v-model="insured.gender.nameRu" class="mb-4" :label="$dataStore.t('form.gender')" :readonly="true" />
|
|
56
56
|
</div>
|
|
57
57
|
</base-form-section>
|
|
58
|
-
<base-form-section
|
|
59
|
-
v-if="isUnderwriterRole && whichProduct !== 'lifebusiness' && whichProduct !== 'gns' && whichProduct !== 'pensionannuitynew' && whichProduct !== 'balam'"
|
|
60
|
-
:title="$dataStore.t('recalculationInfo')"
|
|
61
|
-
>
|
|
58
|
+
<base-form-section v-if="isUnderwriterRole && whichProduct !== 'pensionannuitynew' && whichProduct !== 'balam'" :title="$dataStore.t('recalculationInfo')">
|
|
62
59
|
<base-form-input
|
|
63
60
|
v-model="productConditionsForm.lifeMultiply"
|
|
64
61
|
:maska="$maska.numbers"
|
|
65
62
|
:clearable="isRecalculationDisabled === false"
|
|
66
|
-
:label="
|
|
63
|
+
:label="lifeMultiplyLabel"
|
|
67
64
|
:readonly="isRecalculationDisabled"
|
|
68
65
|
:rules="whichProduct === 'gons' ? $dataStore.rules.recalculationMultiplyBetween : $dataStore.rules.recalculationMultiply"
|
|
69
66
|
/>
|
|
@@ -71,7 +68,7 @@
|
|
|
71
68
|
v-model="productConditionsForm.lifeAdditive"
|
|
72
69
|
:maska="$maska.numbers"
|
|
73
70
|
:clearable="isRecalculationDisabled === false"
|
|
74
|
-
:label="
|
|
71
|
+
:label="lifeAdditiveLabel"
|
|
75
72
|
:readonly="readonlyLifeAdditive"
|
|
76
73
|
:rules="$dataStore.rules.recalculationAdditive"
|
|
77
74
|
/>
|
|
@@ -80,7 +77,7 @@
|
|
|
80
77
|
v-model="productConditionsForm.adbMultiply"
|
|
81
78
|
:maska="$maska.numbers"
|
|
82
79
|
:clearable="isRecalculationDisabled === false"
|
|
83
|
-
:label="
|
|
80
|
+
:label="adbMultiplyLabel"
|
|
84
81
|
:readonly="isRecalculationDisabled"
|
|
85
82
|
:rules="$dataStore.rules.recalculationMultiply"
|
|
86
83
|
/>
|
|
@@ -89,7 +86,7 @@
|
|
|
89
86
|
v-model="productConditionsForm.adbAdditive"
|
|
90
87
|
:maska="$maska.numbers"
|
|
91
88
|
:clearable="isRecalculationDisabled === false"
|
|
92
|
-
:label="
|
|
89
|
+
:label="adbAdditiveLabel"
|
|
93
90
|
:readonly="isRecalculationDisabled"
|
|
94
91
|
:rules="$dataStore.rules.recalculationAdditive"
|
|
95
92
|
/>
|
|
@@ -97,11 +94,12 @@
|
|
|
97
94
|
v-model="productConditionsForm.disabilityMultiply"
|
|
98
95
|
:maska="$maska.numbers"
|
|
99
96
|
:clearable="isRecalculationDisabled === false"
|
|
100
|
-
:label="
|
|
97
|
+
:label="disabilityMultiplyLabel"
|
|
101
98
|
:readonly="readonlyDisabilityMultiply"
|
|
102
99
|
:rules="whichProduct === 'gons' ? [] : $dataStore.rules.recalculationMultiply"
|
|
103
100
|
/>
|
|
104
101
|
<base-form-input
|
|
102
|
+
v-if="hasDisabilityAdditive"
|
|
105
103
|
v-model="productConditionsForm.disabilityAdditive"
|
|
106
104
|
:maska="$maska.numbers"
|
|
107
105
|
:clearable="isRecalculationDisabled === false"
|
|
@@ -170,7 +168,7 @@
|
|
|
170
168
|
:readonly="isDisabledInsStartDate"
|
|
171
169
|
:clearable="!isDisabledInsStartDate"
|
|
172
170
|
:label="$dataStore.t('labels.insuranceStartDate')"
|
|
173
|
-
:rules="
|
|
171
|
+
:rules="$rules.required"
|
|
174
172
|
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
175
173
|
/>
|
|
176
174
|
<base-form-input
|
|
@@ -312,55 +310,120 @@
|
|
|
312
310
|
</base-form-section>
|
|
313
311
|
<section v-if="whichProduct === 'pensionannuitynew'">
|
|
314
312
|
<base-animation>
|
|
315
|
-
<
|
|
316
|
-
v-if="formStore.applicationData.processCode === 19 && !isDisabled"
|
|
317
|
-
:
|
|
318
|
-
class="
|
|
319
|
-
|
|
320
|
-
|
|
313
|
+
<div
|
|
314
|
+
v-if="(formStore.applicationData.processCode === 19 || formStore.applicationData.processCode === 25) && !isDisabled"
|
|
315
|
+
:class="[$styles.blueBgLight]"
|
|
316
|
+
class="h-[52px] rounded-lg flex items-center justify-end px-2 gap-2 mt-4"
|
|
317
|
+
>
|
|
318
|
+
<base-btn class="max-w-[300px]" :text="$dataStore.t('buttons.copyToClient')" size="sm" @click="copyRedirect" />
|
|
319
|
+
</div>
|
|
321
320
|
</base-animation>
|
|
322
|
-
<base-form-section
|
|
321
|
+
<base-form-section v-if="formStore.applicationData.statusCode === 'ActuaryForm' && isTask">
|
|
322
|
+
<base-content-block :class="[$styles.textSimple]">
|
|
323
|
+
<h5 class="text-center font-medium mb-4">{{ $dataStore.t('labels.contract') }}</h5>
|
|
324
|
+
<div :class="[$styles.whiteBg, $styles.rounded]" class="p-2 h-12 flex items-center relative">
|
|
325
|
+
<span class="ml-2">Договор {{ formStore.applicationData.processCode === 19 || formStore.applicationData.processCode === 25 ? 'страхования' : 'возврата' }}</span>
|
|
326
|
+
<i
|
|
327
|
+
class="transition-all cursor-pointer mdi mdi-tray-arrow-down pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
|
|
328
|
+
:class="[$styles.greenTextHover]"
|
|
329
|
+
@click="
|
|
330
|
+
$dataStore.generatePDFDocument(
|
|
331
|
+
formStore.applicationData.processCode === 19 ? 'PA_Contract' : formStore.applicationData.processCode === 25 ? 'PAJ_Contract' : 'PA_RefundAgreement',
|
|
332
|
+
'38',
|
|
333
|
+
)
|
|
334
|
+
"
|
|
335
|
+
></i>
|
|
336
|
+
</div>
|
|
337
|
+
</base-content-block>
|
|
338
|
+
</base-form-section>
|
|
339
|
+
<div v-if="formStore.applicationData.processCode === 25" class="flex items-center mt-[14px] h-[48px]">
|
|
340
|
+
<div :class="[$styles.blueBgLight]" class="flex flex-wrap items-center gap-2 p-1 rounded-t-[8px] h-full">
|
|
341
|
+
<div
|
|
342
|
+
class="h-full px-4 py-1 rounded-[8px] cursor-pointer flex items-center"
|
|
343
|
+
:class="[$styles.textSimple, !isSlavePensionForm ? `${$styles.blueBg} ${$styles.whiteText}` : '']"
|
|
344
|
+
@click="$router.replace({ query: { ...$route.query, which: undefined, upd: 'true' } })"
|
|
345
|
+
>
|
|
346
|
+
{{ !!formStore.applicationData.clientApp?.longName ? formStore.applicationData.clientApp?.longName : 'Страхователь' }}
|
|
347
|
+
</div>
|
|
348
|
+
<div
|
|
349
|
+
class="h-full px-4 py-1 rounded-[8px] cursor-pointer flex items-center"
|
|
350
|
+
:class="[$styles.textSimple, isSlavePensionForm ? `${$styles.blueBg} ${$styles.whiteText}` : '']"
|
|
351
|
+
@click="$router.replace({ query: { ...$route.query, which: 'slave', upd: 'true' } })"
|
|
352
|
+
>
|
|
353
|
+
{{ !!formStore.applicationData.slave.clientApp?.longName ? formStore.applicationData.slave.clientApp?.longName : 'Страхователь 2' }}
|
|
354
|
+
</div>
|
|
355
|
+
</div>
|
|
356
|
+
</div>
|
|
357
|
+
<base-form-section v-if="hasContragentData && contragentData">
|
|
358
|
+
<base-panel-input v-model="contragentData.gender" :readonly="true" :clearable="false" :label="$dataStore.t('form.gender')" />
|
|
359
|
+
<base-form-input v-model="contragentData.birthDate" :readonly="true" :clearable="false" :label="$dataStore.t('form.birthDate')" />
|
|
360
|
+
<base-panel-input
|
|
361
|
+
v-if="disabilityGroup"
|
|
362
|
+
v-model="disabilityGroup"
|
|
363
|
+
:value="disabilityGroup?.nameRu"
|
|
364
|
+
:readonly="true"
|
|
365
|
+
:clearable="false"
|
|
366
|
+
:label="$dataStore.t('pension.disabilityGroup')"
|
|
367
|
+
/>
|
|
368
|
+
</base-form-section>
|
|
369
|
+
<base-form-section
|
|
370
|
+
v-if="formStore.applicationData.processCode !== 24"
|
|
371
|
+
:title="$dataStore.t('pension.compulsoryAmount&Prof')"
|
|
372
|
+
:class="[formStore.applicationData.processCode === 25 ? 'mt-0 rounded-tl-none' : '']"
|
|
373
|
+
>
|
|
323
374
|
<base-form-input
|
|
324
|
-
v-model="
|
|
325
|
-
:maska="$maska.numbers"
|
|
375
|
+
v-model="pensionForm.compulsoryContractAmount"
|
|
326
376
|
:readonly="isDisabled || isEnpfSum"
|
|
327
377
|
:clearable="!isDisabled && !isEnpfSum"
|
|
328
378
|
:label="$dataStore.t('pension.compulsoryContractAmount')"
|
|
379
|
+
:rules="$dataStore.rules.sums"
|
|
380
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
381
|
+
@input="onInputPension($event, 'compulsoryContractAmount')"
|
|
382
|
+
@onClear="onClearPension('compulsoryContractAmount')"
|
|
329
383
|
/>
|
|
330
384
|
<base-form-input
|
|
331
|
-
v-model="
|
|
332
|
-
:maska="$maska.numbers"
|
|
385
|
+
v-model="pensionForm.compulsoryProfContractAmount"
|
|
333
386
|
:readonly="isDisabled || isEnpfSum"
|
|
334
387
|
:clearable="!isDisabled && !isEnpfSum"
|
|
335
388
|
:label="$dataStore.t('pension.compulsoryProfContractAmount')"
|
|
389
|
+
:rules="$dataStore.rules.sums"
|
|
390
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
391
|
+
@input="onInputPension($event, 'compulsoryProfContractAmount')"
|
|
392
|
+
@onClear="onClearPension('compulsoryProfContractAmount')"
|
|
336
393
|
/>
|
|
337
394
|
<base-animation>
|
|
338
395
|
<base-form-input
|
|
339
|
-
v-if="
|
|
396
|
+
v-if="pensionForm.compulsoryProfContractAmount && pensionForm.compulsoryProfContractAmount != 0"
|
|
340
397
|
v-model="pensionForm.compulsoryProfMonthCount"
|
|
341
398
|
:maska="$maska.numbers"
|
|
342
|
-
:readonly="isDisabled
|
|
343
|
-
:clearable="!isDisabled
|
|
399
|
+
:readonly="isDisabled"
|
|
400
|
+
:clearable="!isDisabled"
|
|
344
401
|
:label="$dataStore.t('pension.compulsoryProfMonthCount')"
|
|
345
402
|
/>
|
|
346
403
|
</base-animation>
|
|
347
404
|
<base-form-input
|
|
348
|
-
v-model="
|
|
349
|
-
:maska="$maska.numbers"
|
|
405
|
+
v-model="pensionForm.voluntaryContractAmount"
|
|
350
406
|
:readonly="isDisabled"
|
|
351
407
|
:clearable="!isDisabled"
|
|
352
408
|
:label="$dataStore.t('pension.voluntaryContractAmount')"
|
|
409
|
+
:rules="$dataStore.rules.sums"
|
|
410
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
411
|
+
@input="onInputPension($event, 'voluntaryContractAmount')"
|
|
412
|
+
@onClear="onClearPension('voluntaryContractAmount')"
|
|
353
413
|
/>
|
|
354
414
|
<base-form-input
|
|
355
|
-
v-model="
|
|
356
|
-
:maska="$maska.numbers"
|
|
415
|
+
v-model="pensionForm.ownFundsRaisAmount"
|
|
357
416
|
:readonly="isDisabled"
|
|
358
417
|
:clearable="!isDisabled"
|
|
359
418
|
:label="$dataStore.t('pension.ownFundsRaisAmount')"
|
|
419
|
+
:rules="$dataStore.rules.sums"
|
|
420
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
421
|
+
@input="onInputPension($event, 'ownFundsRaisAmount')"
|
|
422
|
+
@onClear="onClearPension('ownFundsRaisAmount')"
|
|
360
423
|
/>
|
|
361
424
|
</base-form-section>
|
|
362
|
-
<base-form-section v-if="formStore.applicationData.processCode !==
|
|
363
|
-
<base-btn :text="$dataStore.t('buttons.add')" size="sm" :btn="$styles.blueBtn" @click="addTransferContract" />
|
|
425
|
+
<base-form-section v-if="formStore.applicationData.processCode !== 24" :title="$dataStore.t('pension.companyName')">
|
|
426
|
+
<base-btn v-if="!isDisabled" :text="$dataStore.t('buttons.add')" :disabled="isDisabled" size="sm" :btn="$styles.blueBtn" @click="addTransferContract" />
|
|
364
427
|
<section v-for="(contract, index) in transferContracts" class="py-2">
|
|
365
428
|
<base-panel-input
|
|
366
429
|
v-model="contract.transferContractCompany"
|
|
@@ -374,27 +437,49 @@
|
|
|
374
437
|
"
|
|
375
438
|
@click="contractIndex = index"
|
|
376
439
|
/>
|
|
440
|
+
<div class="flex flex-col">
|
|
441
|
+
<base-form-input
|
|
442
|
+
v-model="contract.transferContractDate"
|
|
443
|
+
:maska="$maska.date"
|
|
444
|
+
:label="$dataStore.t('pension.contractDate')"
|
|
445
|
+
:readonly="isDisabled"
|
|
446
|
+
:clearable="!isDisabled"
|
|
447
|
+
:max-date="formatDate(transferMaxDate) ?? undefined"
|
|
448
|
+
:rules="$dataStore.rules.required.concat($dataStore.rules.birthDate)"
|
|
449
|
+
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
450
|
+
/>
|
|
451
|
+
<span v-if="transferMaxDate && !isDisabled" class="px-3 font-light text-sm bg-white py-0 mt-[-5px]" style="color: #a0b3d8 !important"
|
|
452
|
+
>до {{ transferMaxDate }} включительно</span
|
|
453
|
+
>
|
|
454
|
+
</div>
|
|
455
|
+
<base-form-input v-model="contract.transferContractNumber" :label="$dataStore.t('pension.globalId')" :readonly="isDisabled" :clearable="!isDisabled" />
|
|
377
456
|
<base-form-input
|
|
378
|
-
v-model="contract.
|
|
379
|
-
:
|
|
380
|
-
:
|
|
457
|
+
v-model="contract.transferContractRegNumber"
|
|
458
|
+
:label="$dataStore.t('pension.transferRegNumber')"
|
|
459
|
+
:rules="$rules.required"
|
|
381
460
|
:readonly="isDisabled"
|
|
382
461
|
:clearable="!isDisabled"
|
|
383
|
-
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
384
462
|
/>
|
|
385
|
-
<base-form-input v-model="contract.transferContractNumber" :label="$dataStore.t('pension.globalId')" :readonly="isDisabled" :clearable="!isDisabled" />
|
|
386
|
-
<base-form-input v-model="contract.transferContractRegNumber" :label="$dataStore.t('pension.transferRegNumber')" :readonly="isDisabled" :clearable="!isDisabled" />
|
|
387
463
|
<base-form-input
|
|
388
464
|
v-model="contract.transferContractFirstPaymentDate"
|
|
389
465
|
:maska="$maska.date"
|
|
390
466
|
:label="$dataStore.t('pension.transferContractFirstPaymentDate')"
|
|
467
|
+
:rules="$dataStore.rules.required.concat($dataStore.rules.birthDate)"
|
|
391
468
|
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
392
469
|
:readonly="isDisabled"
|
|
393
470
|
:clearable="!isDisabled"
|
|
394
471
|
/>
|
|
395
|
-
<base-form-input
|
|
472
|
+
<base-form-input
|
|
473
|
+
v-model="contract.transferContractAmount"
|
|
474
|
+
:label="$dataStore.t('pension.transferContractAmount')"
|
|
475
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
476
|
+
:readonly="isDisabled"
|
|
477
|
+
:clearable="!isDisabled"
|
|
478
|
+
@input="onInputPension($event, 'transferContractAmount', index)"
|
|
479
|
+
@onClear="onClearPension('transferContractAmount', index)"
|
|
480
|
+
/>
|
|
396
481
|
<base-form-toggle v-model="contract.transferContractIsOppv" :disabled="isDisabled" :has-border="false" :title="$dataStore.t('pension.isOPPVTransfer')" />
|
|
397
|
-
<base-btn :text="$dataStore.t('buttons.delete')" size="sm" :btn="$styles.whiteBtn" @click="removeTransferContract(index)" />
|
|
482
|
+
<base-btn v-if="!isDisabled" :text="$dataStore.t('buttons.delete')" :disabled="isDisabled" size="sm" :btn="$styles.whiteBtn" @click="removeTransferContract(index)" />
|
|
398
483
|
</section>
|
|
399
484
|
</base-form-section>
|
|
400
485
|
<base-form-section :title="$dataStore.t('pension.paymentTerms')">
|
|
@@ -402,9 +487,10 @@
|
|
|
402
487
|
v-model="contractDate"
|
|
403
488
|
:maska="$maska.date"
|
|
404
489
|
:rules="!isDisabled ? $rules.required.concat($rules.date) : []"
|
|
405
|
-
:readonly="isDisabled"
|
|
490
|
+
:readonly="isDisabled || formStore.applicationData.processCode === 24 || isSlavePensionForm"
|
|
406
491
|
:clearable="!isDisabled"
|
|
407
492
|
:min-date="new Date()"
|
|
493
|
+
:max-date="formatDate(maxDate ?? '') ?? undefined"
|
|
408
494
|
:label="$dataStore.t('pension.contractDate')"
|
|
409
495
|
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
410
496
|
/>
|
|
@@ -423,8 +509,24 @@
|
|
|
423
509
|
<base-form-input v-model="pensionForm.frequencyPayments" disabled :label="$dataStore.t('pension.frequencyPayments')" />
|
|
424
510
|
<base-form-input v-model="pensionForm.periodPayments" disabled :label="$dataStore.t('pension.paymentPeriod')" />
|
|
425
511
|
<base-form-input v-model="pensionForm.insuranceProgramType" disabled :label="$dataStore.t('pension.insuranceProgramType')" />
|
|
426
|
-
<base-form-input
|
|
427
|
-
|
|
512
|
+
<base-form-input
|
|
513
|
+
v-if="formStore.applicationData.processCode === 25 && formStore.pensionApp?.slave?.amount"
|
|
514
|
+
:value="totalInsPremium"
|
|
515
|
+
:active="true"
|
|
516
|
+
:label="$dataStore.t('productConditionsForm.totalInsurancePremiumAmount')"
|
|
517
|
+
:disabled="$dataStore.isLoading"
|
|
518
|
+
readonly
|
|
519
|
+
/>
|
|
520
|
+
<base-form-input
|
|
521
|
+
v-model="pensionForm.amount"
|
|
522
|
+
:value="$dataStore.getNumberWithSpaces(pensionForm.amount)"
|
|
523
|
+
@input="onInputPension($event, 'pensionAmount')"
|
|
524
|
+
@onClear="onClearPension('pensionAmount')"
|
|
525
|
+
@change="customPension = true"
|
|
526
|
+
:readonly="isDisabled || formStore.applicationData.processCode !== 25"
|
|
527
|
+
:label="$dataStore.t('pension.pensionAmount')"
|
|
528
|
+
/>
|
|
529
|
+
<base-form-input :value="pensionPayment" :active="true" readonly :label="$dataStore.t('pension.pensionPayment')" />
|
|
428
530
|
</base-form-section>
|
|
429
531
|
</section>
|
|
430
532
|
<base-form-section v-if="hasAnnuityPayments" :title="$dataStore.t('calculationAnnuityPayments')">
|
|
@@ -651,7 +753,7 @@
|
|
|
651
753
|
<base-animation>
|
|
652
754
|
<base-btn
|
|
653
755
|
v-if="!isDisabled && $dataStore.isPension && isTask"
|
|
654
|
-
:text="$dataStore.t('buttons.
|
|
756
|
+
:text="$dataStore.t('buttons.calculate')"
|
|
655
757
|
:loading="$dataStore.isLoading"
|
|
656
758
|
class="min-h-[60px]"
|
|
657
759
|
type="submit"
|
|
@@ -747,6 +849,15 @@
|
|
|
747
849
|
import { Member, Value, CountryValue, CalculatorForm, TransferContract } from '../../composables/classes';
|
|
748
850
|
import type { Projects, AddCover, AddCoverAnswer } from '../../types';
|
|
749
851
|
|
|
852
|
+
type PensionCalculation = {
|
|
853
|
+
compulsoryContractAmount: number | string | null;
|
|
854
|
+
voluntaryContractAmount: number | string | null;
|
|
855
|
+
ownFundsRaisAmount: number | string | null;
|
|
856
|
+
compulsoryProfContractAmount: number | string | null;
|
|
857
|
+
transferContractAmount: number | string | null;
|
|
858
|
+
transferContractCompany: number | string | null;
|
|
859
|
+
};
|
|
860
|
+
|
|
750
861
|
export default defineComponent({
|
|
751
862
|
props: {
|
|
752
863
|
isCalculator: {
|
|
@@ -786,14 +897,29 @@ export default defineComponent({
|
|
|
786
897
|
|
|
787
898
|
const additionalTerms = ref<AddCover[]>([]);
|
|
788
899
|
|
|
789
|
-
const maxDate = ref();
|
|
900
|
+
const maxDate = ref<string | null>();
|
|
901
|
+
const transferMaxDate = ref();
|
|
790
902
|
const dateOfBegin = ref();
|
|
791
|
-
const contractDate = ref();
|
|
792
|
-
const transferContractDate = ref();
|
|
793
|
-
const transferContractFirstPaymentDate = ref();
|
|
794
|
-
const guaranteedPeriodList = Array.from(Array(35), (
|
|
795
|
-
const
|
|
796
|
-
const
|
|
903
|
+
const contractDate = ref<string | null>();
|
|
904
|
+
const transferContractDate = ref<string | null>();
|
|
905
|
+
const transferContractFirstPaymentDate = ref<string | null>();
|
|
906
|
+
const guaranteedPeriodList = Array.from(Array(35), (_, i) => i + 1);
|
|
907
|
+
const isSlavePensionForm = computed(() => route.query.which === 'slave');
|
|
908
|
+
const pensionForm = computedWithControl(
|
|
909
|
+
() => formStore.pensionApp,
|
|
910
|
+
() => (route.query.which === 'slave' ? formStore.pensionApp?.slave : formStore.pensionApp ?? undefined),
|
|
911
|
+
);
|
|
912
|
+
|
|
913
|
+
const insuredForm = isSlavePensionForm.value
|
|
914
|
+
? formStore.applicationData?.slave?.insuredApp && formStore.applicationData?.slave?.insuredApp[0]
|
|
915
|
+
: (formStore.applicationData?.insuredApp && Array.isArray(formStore.applicationData?.insuredApp) && formStore.applicationData?.insuredApp[0]) ?? undefined;
|
|
916
|
+
const disabilityGroup = computed(() => {
|
|
917
|
+
if (!!insuredForm.disabilityGroupId) {
|
|
918
|
+
const disabilityGroup = dataStore.disabilityGroups.find(i => i.id === insuredForm.disabilityGroupId);
|
|
919
|
+
return disabilityGroup;
|
|
920
|
+
}
|
|
921
|
+
});
|
|
922
|
+
const isEnpfSum = pensionForm.value?.isEnpfSum ?? false;
|
|
797
923
|
|
|
798
924
|
const transferContracts = ref<TransferContract[]>([]);
|
|
799
925
|
const contractsValue = ref<Value[]>([]);
|
|
@@ -803,6 +929,11 @@ export default defineComponent({
|
|
|
803
929
|
const multiplePanelList = ref<CountryValue[]>([]);
|
|
804
930
|
const calculatorForm = productConditionsForm.calculatorForm;
|
|
805
931
|
const minInsSum = computed(() => formStore.lfb.clients && formStore.lfb.clients.reduce((min, item) => Math.min(min, item.insSum), Infinity));
|
|
932
|
+
const contragentData = ref<any>();
|
|
933
|
+
const customPension = ref<boolean>(false);
|
|
934
|
+
const transferSum = ref<number>(0);
|
|
935
|
+
const firstAmount = ref<boolean>(true);
|
|
936
|
+
|
|
806
937
|
const isShownAdditionalTerms = computed(() => {
|
|
807
938
|
if (whichProduct.value === 'gons') {
|
|
808
939
|
return false;
|
|
@@ -834,7 +965,11 @@ export default defineComponent({
|
|
|
834
965
|
const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm || formStore.canBeClaimed === true);
|
|
835
966
|
const isUnderwriterRole = computed(() => dataStore.isUnderwriter() || dataStore.isAdmin() || dataStore.isSupport());
|
|
836
967
|
const insurancePremiumPerMonthRule = computed(() =>
|
|
837
|
-
!!productConditionsForm.insurancePremiumPerMonth
|
|
968
|
+
!!productConditionsForm.insurancePremiumPerMonth
|
|
969
|
+
? whichProduct.value === 'gons' || whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns'
|
|
970
|
+
? dataStore.rules.required
|
|
971
|
+
: dataStore.rules.required.concat(dataStore.rules.sums)
|
|
972
|
+
: [],
|
|
838
973
|
);
|
|
839
974
|
const insurancePremiumPerMonthDisabled = computed(() => {
|
|
840
975
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
@@ -861,18 +996,8 @@ export default defineComponent({
|
|
|
861
996
|
return !!productConditionsForm.requestedSumInsured && !!productConditionsForm.insurancePremiumPerMonth;
|
|
862
997
|
});
|
|
863
998
|
const hasProcessIndexRate = computed(() => {
|
|
864
|
-
if (
|
|
865
|
-
|
|
866
|
-
whichProduct.value === 'halykkazyna' ||
|
|
867
|
-
whichProduct.value === 'liferenta' ||
|
|
868
|
-
whichProduct.value === 'lifebusiness' ||
|
|
869
|
-
whichProduct.value === 'amuletlife' ||
|
|
870
|
-
whichProduct.value === 'gns' ||
|
|
871
|
-
whichProduct.value === 'balam'
|
|
872
|
-
) {
|
|
873
|
-
return false;
|
|
874
|
-
}
|
|
875
|
-
return true;
|
|
999
|
+
if (whichProduct.value === 'baiterek' || whichProduct.value === 'bolashak') return true;
|
|
1000
|
+
return false;
|
|
876
1001
|
});
|
|
877
1002
|
const hasPaymentPeriod = computed(() => {
|
|
878
1003
|
if (whichProduct.value === 'halykkazyna') {
|
|
@@ -950,6 +1075,15 @@ export default defineComponent({
|
|
|
950
1075
|
if (whichProduct.value === 'gons') {
|
|
951
1076
|
return false;
|
|
952
1077
|
}
|
|
1078
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1079
|
+
return false;
|
|
1080
|
+
}
|
|
1081
|
+
return true;
|
|
1082
|
+
});
|
|
1083
|
+
const hasDisabilityAdditive = computed(() => {
|
|
1084
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1085
|
+
return false;
|
|
1086
|
+
}
|
|
953
1087
|
return true;
|
|
954
1088
|
});
|
|
955
1089
|
const hasAnnuityPayments = computed(() => {
|
|
@@ -1028,6 +1162,36 @@ export default defineComponent({
|
|
|
1028
1162
|
}
|
|
1029
1163
|
return dataStore.t('productConditionsForm.dollarExchangeRateNBRK');
|
|
1030
1164
|
});
|
|
1165
|
+
const lifeMultiplyLabel = computed(() => {
|
|
1166
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1167
|
+
return dataStore.t('percent') + `Life (смерть по любой причине) multiply`;
|
|
1168
|
+
}
|
|
1169
|
+
return dataStore.t('percent') + `Life Multiply`;
|
|
1170
|
+
});
|
|
1171
|
+
const lifeAdditiveLabel = computed(() => {
|
|
1172
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1173
|
+
return dataStore.t('percent') + `Life (смерть по любой причине) надбавка`;
|
|
1174
|
+
}
|
|
1175
|
+
return dataStore.t('percent') + `Life Additive`;
|
|
1176
|
+
});
|
|
1177
|
+
const disabilityMultiplyLabel = computed(() => {
|
|
1178
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1179
|
+
return dataStore.t('percent') + `Disability (инвалидность, временная утрата тр-ти, стойкая утрата тр-ти)`;
|
|
1180
|
+
}
|
|
1181
|
+
return dataStore.t('percent') + `Disability Multiply`;
|
|
1182
|
+
});
|
|
1183
|
+
const adbMultiplyLabel = computed(() => {
|
|
1184
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1185
|
+
return dataStore.t('percent') + `Accidental life multiply`;
|
|
1186
|
+
}
|
|
1187
|
+
return dataStore.t('percent') + `Adb Multiply`;
|
|
1188
|
+
});
|
|
1189
|
+
const adbAdditiveLabel = computed(() => {
|
|
1190
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1191
|
+
return dataStore.t('percent') + `Accidental life additional надбавка`;
|
|
1192
|
+
}
|
|
1193
|
+
return dataStore.t('percent') + `Adb Additive`;
|
|
1194
|
+
});
|
|
1031
1195
|
const isDisabledFixInsSum = computed(() => {
|
|
1032
1196
|
if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
|
|
1033
1197
|
return false;
|
|
@@ -1137,6 +1301,12 @@ export default defineComponent({
|
|
|
1137
1301
|
}
|
|
1138
1302
|
return false;
|
|
1139
1303
|
});
|
|
1304
|
+
const hasContragentData = computed(() => {
|
|
1305
|
+
if (whichProduct.value === 'pensionannuitynew') {
|
|
1306
|
+
return true;
|
|
1307
|
+
}
|
|
1308
|
+
return false;
|
|
1309
|
+
});
|
|
1140
1310
|
const isDisabledPaymentPeriod = computed(() => {
|
|
1141
1311
|
if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
|
|
1142
1312
|
return true;
|
|
@@ -1150,28 +1320,29 @@ export default defineComponent({
|
|
|
1150
1320
|
return constants.currencyList;
|
|
1151
1321
|
});
|
|
1152
1322
|
|
|
1153
|
-
const
|
|
1154
|
-
|
|
1155
|
-
voluntaryContractAmount: pensionForm && pensionForm.voluntaryContractAmount && pensionForm.voluntaryContractAmount != 0 ? pensionForm.voluntaryContractAmount : null,
|
|
1156
|
-
ownFundsRaisAmount: pensionForm && pensionForm.ownFundsRaisAmount && pensionForm.ownFundsRaisAmount != 0 ? pensionForm.ownFundsRaisAmount : null,
|
|
1157
|
-
compulsoryProfContractAmount:
|
|
1158
|
-
pensionForm && pensionForm.compulsoryProfContractAmount && pensionForm.compulsoryProfContractAmount != 0 ? pensionForm.compulsoryProfContractAmount : null,
|
|
1159
|
-
transferContractAmount: pensionForm && pensionForm.transferContractAmount && pensionForm.transferContractAmount != 0 ? pensionForm.transferContractAmount : null,
|
|
1160
|
-
transferContractCompany: pensionForm && pensionForm.transferContractCompany ? pensionForm.transferContractCompany : null,
|
|
1161
|
-
});
|
|
1162
|
-
|
|
1163
|
-
const contractsAmount = computed(() => transferContracts.value?.reduce((accumulator, currentValue) => accumulator + currentValue.transferContractAmount, 0));
|
|
1164
|
-
|
|
1165
|
-
const pensionAmount = computed(() =>
|
|
1166
|
-
pensionCalculationParams.value
|
|
1167
|
-
? (Number(pensionCalculationParams.value.compulsoryContractAmount) ?? 0) +
|
|
1168
|
-
(Number(pensionCalculationParams.value.voluntaryContractAmount) ?? 0) +
|
|
1169
|
-
(Number(pensionCalculationParams.value.ownFundsRaisAmount) ?? 0) +
|
|
1170
|
-
(Number(pensionCalculationParams.value.compulsoryProfContractAmount) ?? 0) +
|
|
1171
|
-
(Number(pensionCalculationParams.value.transferContractAmount) ?? 0) +
|
|
1172
|
-
Number(contractsAmount.value)
|
|
1173
|
-
: 0,
|
|
1323
|
+
const totalInsPremium = computed(() =>
|
|
1324
|
+
dataStore.getNumberWithSpaces(formatSpacedNumber(formStore.pensionApp?.amount) + formatSpacedNumber(formStore.pensionApp.slave?.amount)),
|
|
1174
1325
|
);
|
|
1326
|
+
const pensionPayment = computed(() => dataStore.getNumberWithSpaces(pensionForm.value.payment));
|
|
1327
|
+
|
|
1328
|
+
const getContragent = async () => {
|
|
1329
|
+
const data = await dataStore.api.getContragentById(
|
|
1330
|
+
Number(route.query.which !== 'slave' ? formStore.applicationData.clientApp.insisId : formStore.applicationData.slave.clientApp.insisId),
|
|
1331
|
+
);
|
|
1332
|
+
if (data && data.items.length != 0) {
|
|
1333
|
+
contragentData.value = data.items[0];
|
|
1334
|
+
contragentData.value.gender = contragentData.value.gender === 1 ? dataStore.t('pension.male') : dataStore.t('pension.female');
|
|
1335
|
+
contragentData.value.birthDate = reformatDate(contragentData.value.birthDate);
|
|
1336
|
+
}
|
|
1337
|
+
};
|
|
1338
|
+
|
|
1339
|
+
const sumContractsAmount = (transferContracts: TransferContract[]) => {
|
|
1340
|
+
if (!transferContracts || !transferContracts.length) return 0;
|
|
1341
|
+
return transferContracts.reduce((accumulator, currentValue) => {
|
|
1342
|
+
const transferAmount = structuredClone(toRaw(currentValue));
|
|
1343
|
+
return accumulator + Number(String(transferAmount.transferContractAmount).replace(/\s/g, ''));
|
|
1344
|
+
}, 0);
|
|
1345
|
+
};
|
|
1175
1346
|
|
|
1176
1347
|
const formatTermValue = (term: number) => {
|
|
1177
1348
|
if (term !== null) {
|
|
@@ -1219,7 +1390,7 @@ export default defineComponent({
|
|
|
1219
1390
|
transferContracts.value[contractIndex.value].transferContractCompany = item;
|
|
1220
1391
|
} else {
|
|
1221
1392
|
// @ts-ignore
|
|
1222
|
-
pensionForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
1393
|
+
pensionForm.value[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
1223
1394
|
}
|
|
1224
1395
|
} else {
|
|
1225
1396
|
// @ts-ignore
|
|
@@ -1489,6 +1660,42 @@ export default defineComponent({
|
|
|
1489
1660
|
}
|
|
1490
1661
|
};
|
|
1491
1662
|
|
|
1663
|
+
const onInputPension = (event: Event, key: keyof PensionCalculation | 'pensionAmount', index?: number) => {
|
|
1664
|
+
if (event.target && 'value' in event.target && event.target.value) {
|
|
1665
|
+
const calcCheck = getNumber(event.target.value as string);
|
|
1666
|
+
if (calcCheck) {
|
|
1667
|
+
if (index !== undefined) {
|
|
1668
|
+
transferContracts.value[index].transferContractAmount = dataStore.getNumberWithSpaces(event.target.value) as string;
|
|
1669
|
+
transferSum.value = transferContracts.value.reduce((accumulator, { transferContractAmount }) => (accumulator += formatSpacedNumber(transferContractAmount)), 0);
|
|
1670
|
+
} else if (key === 'pensionAmount') {
|
|
1671
|
+
pensionForm.value.amount = dataStore.getNumberWithSpaces(event.target.value) ?? '0';
|
|
1672
|
+
} else {
|
|
1673
|
+
pensionForm.value[key] = dataStore.getNumberWithSpaces(event.target.value);
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
} else {
|
|
1677
|
+
if (index !== undefined) {
|
|
1678
|
+
transferContracts.value[index].transferContractAmount = 0;
|
|
1679
|
+
transferSum.value = transferContracts.value.reduce((accumulator, { transferContractAmount }) => (accumulator += formatSpacedNumber(transferContractAmount)), 0);
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
if (key !== 'pensionAmount' && !customPension.value) {
|
|
1683
|
+
if (firstAmount.value) {
|
|
1684
|
+
firstAmount.value = false;
|
|
1685
|
+
return;
|
|
1686
|
+
}
|
|
1687
|
+
pensionForm.value.amount =
|
|
1688
|
+
dataStore.getNumberWithSpaces(
|
|
1689
|
+
formatSpacedNumber(pensionForm.value.compulsoryContractAmount) +
|
|
1690
|
+
formatSpacedNumber(pensionForm.value.compulsoryProfContractAmount) +
|
|
1691
|
+
formatSpacedNumber(pensionForm.value.ownFundsRaisAmount) +
|
|
1692
|
+
formatSpacedNumber(pensionForm.value.transferContractAmount) +
|
|
1693
|
+
formatSpacedNumber(pensionForm.value.voluntaryContractAmount) +
|
|
1694
|
+
sumContractsAmount(transferContracts.value),
|
|
1695
|
+
) ?? '';
|
|
1696
|
+
}
|
|
1697
|
+
};
|
|
1698
|
+
|
|
1492
1699
|
const onInputFixInsSum = (event: Event) => {
|
|
1493
1700
|
if (event.target && 'value' in event.target && event.target.value) {
|
|
1494
1701
|
const calculatedFixInsSum = getNumber(event.target.value as string);
|
|
@@ -1513,6 +1720,16 @@ export default defineComponent({
|
|
|
1513
1720
|
productConditionsForm.requestedSumInsuredInDollar = null;
|
|
1514
1721
|
};
|
|
1515
1722
|
|
|
1723
|
+
const onClearPension = (key: keyof PensionCalculation | 'pensionAmount', index?: number) => {
|
|
1724
|
+
if (index) {
|
|
1725
|
+
transferContracts.value[index].transferContractAmount = 0;
|
|
1726
|
+
} else if (key === 'pensionAmount') {
|
|
1727
|
+
pensionForm.value.amount = '0';
|
|
1728
|
+
} else {
|
|
1729
|
+
pensionForm.value[key] = null;
|
|
1730
|
+
}
|
|
1731
|
+
};
|
|
1732
|
+
|
|
1516
1733
|
const onClearSumDollar = () => {
|
|
1517
1734
|
productConditionsForm.requestedSumInsured = null;
|
|
1518
1735
|
};
|
|
@@ -1563,6 +1780,31 @@ export default defineComponent({
|
|
|
1563
1780
|
|
|
1564
1781
|
const removeTransferContract = (index: number) => {
|
|
1565
1782
|
transferContracts.value.splice(index, 1);
|
|
1783
|
+
transferSum.value = transferContracts.value.reduce((accumulator, { transferContractAmount }) => (accumulator += formatSpacedNumber(transferContractAmount)), 0);
|
|
1784
|
+
};
|
|
1785
|
+
|
|
1786
|
+
const prepareTransferContracts = (transferContracts: Array<TransferContract>) => {
|
|
1787
|
+
const formatedContracts: Array<TransferContract> = [];
|
|
1788
|
+
if (transferContracts && transferContracts.length) {
|
|
1789
|
+
transferContracts.forEach(i => {
|
|
1790
|
+
formatedContracts.push({
|
|
1791
|
+
...i,
|
|
1792
|
+
transferContractDate: constants.regex.isoDate.test(i.transferContractDate) ? i.transferContractDate : formatDate(i.transferContractDate)?.toISOString() ?? '',
|
|
1793
|
+
transferContractFirstPaymentDate: constants.regex.isoDate.test(i.transferContractFirstPaymentDate)
|
|
1794
|
+
? i.transferContractFirstPaymentDate
|
|
1795
|
+
: formatDate(i.transferContractFirstPaymentDate)?.toISOString() ?? '',
|
|
1796
|
+
// @ts-ignore
|
|
1797
|
+
transferContractCompany:
|
|
1798
|
+
typeof i.transferContractCompany !== 'string' && 'nameRu' in i.transferContractCompany ? String(i.transferContractCompany.nameRu) : i.transferContractCompany,
|
|
1799
|
+
transferContractCompanyId:
|
|
1800
|
+
// @ts-ignore
|
|
1801
|
+
typeof i.transferContractCompany !== 'string' && 'ids' in i.transferContractCompany ? i.transferContractCompany.ids : i.transferContractCompanyId,
|
|
1802
|
+
id: i.id ?? null,
|
|
1803
|
+
transferContractAmount: String(i.transferContractAmount).replace(/\s/g, ''),
|
|
1804
|
+
});
|
|
1805
|
+
});
|
|
1806
|
+
}
|
|
1807
|
+
return formatedContracts;
|
|
1566
1808
|
};
|
|
1567
1809
|
|
|
1568
1810
|
const submitForm = async () => {
|
|
@@ -1585,36 +1827,104 @@ export default defineComponent({
|
|
|
1585
1827
|
await dataStore.calculatePrice();
|
|
1586
1828
|
}
|
|
1587
1829
|
} else if (whichProduct.value === 'pensionannuitynew') {
|
|
1588
|
-
|
|
1830
|
+
if (contractDate.value && maxDate.value && formatDate(contractDate.value) && formatDate(maxDate.value)) {
|
|
1831
|
+
const invalidDate = (formatDate(contractDate.value) ?? new Date()) > (formatDate(maxDate.value) ?? new Date());
|
|
1832
|
+
if (invalidDate) {
|
|
1833
|
+
dataStore.showToaster('error', 'Дата заключения договора некорректна');
|
|
1834
|
+
return;
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1589
1837
|
if (transferContracts.value && transferContracts.value.length) {
|
|
1590
|
-
transferContracts.value.forEach(
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
// @ts-ignore
|
|
1599
|
-
transferContractCompany: formatedNameRu,
|
|
1600
|
-
id: transferContracts.value[index].id ?? null,
|
|
1601
|
-
});
|
|
1838
|
+
transferContracts.value.forEach(i => {
|
|
1839
|
+
if (formatDate(i.transferContractDate) != null && formatDate(transferMaxDate.value)) {
|
|
1840
|
+
const invalidDate = (formatDate(i.transferContractDate) ?? new Date()) > (formatDate(transferMaxDate.value) ?? new Date());
|
|
1841
|
+
if (invalidDate) {
|
|
1842
|
+
dataStore.showToaster('error', 'Дата заключения договора КСЖ некорректна');
|
|
1843
|
+
return;
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1602
1846
|
});
|
|
1603
1847
|
}
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
...
|
|
1607
|
-
|
|
1608
|
-
compulsoryContractAmount:
|
|
1609
|
-
voluntaryContractAmount:
|
|
1610
|
-
ownFundsRaisAmount:
|
|
1611
|
-
compulsoryProfContractAmount:
|
|
1612
|
-
transferContractAmount:
|
|
1613
|
-
transferContractCompany: pensionForm?.transferContractCompany?.nameRu ?? '',
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1848
|
+
if (!pensionForm.value.compulsoryProfContractAmount) pensionForm.value.compulsoryProfMonthCount = null;
|
|
1849
|
+
const pensionData = {
|
|
1850
|
+
...pensionForm.value,
|
|
1851
|
+
...{
|
|
1852
|
+
compulsoryContractAmount: formatSpacedNumber(pensionForm.value.compulsoryContractAmount),
|
|
1853
|
+
voluntaryContractAmount: formatSpacedNumber(pensionForm.value.voluntaryContractAmount),
|
|
1854
|
+
ownFundsRaisAmount: formatSpacedNumber(pensionForm.value.ownFundsRaisAmount),
|
|
1855
|
+
compulsoryProfContractAmount: formatSpacedNumber(pensionForm.value.compulsoryProfContractAmount),
|
|
1856
|
+
transferContractAmount: formatSpacedNumber(pensionForm.value.transferContractAmount),
|
|
1857
|
+
transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
|
|
1858
|
+
},
|
|
1859
|
+
amount: formatSpacedNumber(pensionForm.value.amount),
|
|
1860
|
+
contractDate: formatDate(contractDate.value ?? ''),
|
|
1616
1861
|
};
|
|
1617
|
-
|
|
1862
|
+
const data = isSlavePensionForm.value
|
|
1863
|
+
? {
|
|
1864
|
+
...formStore.pensionApp,
|
|
1865
|
+
transferContracts: prepareTransferContracts(formStore.pensionApp.transferContracts),
|
|
1866
|
+
slave: pensionData,
|
|
1867
|
+
amount: formatSpacedNumber(formStore.pensionApp?.amount),
|
|
1868
|
+
compulsoryContractAmount: formatSpacedNumber(formStore.pensionApp?.compulsoryContractAmount),
|
|
1869
|
+
voluntaryContractAmount: formatSpacedNumber(formStore.pensionApp?.voluntaryContractAmount),
|
|
1870
|
+
ownFundsRaisAmount: formatSpacedNumber(formStore.pensionApp?.ownFundsRaisAmount),
|
|
1871
|
+
compulsoryProfContractAmount: formatSpacedNumber(formStore.pensionApp?.compulsoryProfContractAmount),
|
|
1872
|
+
transferContractAmount: formatSpacedNumber(formStore.pensionApp?.transferContractAmount),
|
|
1873
|
+
transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
|
|
1874
|
+
}
|
|
1875
|
+
: {
|
|
1876
|
+
...pensionData,
|
|
1877
|
+
transferContracts: prepareTransferContracts(transferContracts.value),
|
|
1878
|
+
slave: !!formStore.pensionApp?.slave
|
|
1879
|
+
? {
|
|
1880
|
+
...formStore.pensionApp?.slave,
|
|
1881
|
+
contractDate: pensionData.contractDate,
|
|
1882
|
+
amount: formatSpacedNumber(formStore.pensionApp?.slave?.amount),
|
|
1883
|
+
compulsoryContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.compulsoryContractAmount),
|
|
1884
|
+
voluntaryContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.voluntaryContractAmount),
|
|
1885
|
+
ownFundsRaisAmount: formatSpacedNumber(formStore.pensionApp?.slave?.ownFundsRaisAmount),
|
|
1886
|
+
compulsoryProfContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.compulsoryProfContractAmount),
|
|
1887
|
+
transferContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.transferContractAmount),
|
|
1888
|
+
transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
|
|
1889
|
+
}
|
|
1890
|
+
: null,
|
|
1891
|
+
};
|
|
1892
|
+
if (!!data.slave) {
|
|
1893
|
+
data.slave.transferContracts = prepareTransferContracts(isSlavePensionForm.value ? transferContracts.value : data.slave.transferContracts);
|
|
1894
|
+
const difference = Math.abs(
|
|
1895
|
+
formatSpacedNumber(formStore.pensionApp?.amount) + formatSpacedNumber(formStore.pensionApp?.slave?.amount) - formatSpacedNumber(pensionForm.value.amount),
|
|
1896
|
+
);
|
|
1897
|
+
if (customPension.value) {
|
|
1898
|
+
isSlavePensionForm.value ? (data.slave.amount = formatSpacedNumber(pensionForm.value.amount)) : (data.amount = formatSpacedNumber(pensionForm.value.amount));
|
|
1899
|
+
const customSum = sumPensionData(data) + sumPensionData(data.slave);
|
|
1900
|
+
if (formatSpacedNumber(totalInsPremium.value) !== customSum) {
|
|
1901
|
+
return dataStore.showToaster('error', 'Cтраховая премия не соответсвует общей страховой премии');
|
|
1902
|
+
}
|
|
1903
|
+
if (!isSlavePensionForm.value) {
|
|
1904
|
+
data.slave.amount = difference;
|
|
1905
|
+
} else {
|
|
1906
|
+
data.amount = difference;
|
|
1907
|
+
}
|
|
1908
|
+
} else {
|
|
1909
|
+
const amount = isSlavePensionForm.value ? data.slave.amount : data.amount;
|
|
1910
|
+
if (formatSpacedNumber(pensionForm.value.amount) != amount) {
|
|
1911
|
+
data.slave.amount = sumPensionData(data.slave);
|
|
1912
|
+
data.amount = sumPensionData(data);
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
const isParentValid = validatePensionForm(data, 'Заполните условия первого страхователя');
|
|
1916
|
+
const isSlaveValid = validatePensionForm(data.slave, 'Заполните условия второго страхователя');
|
|
1917
|
+
if (!isParentValid || !isSlaveValid) {
|
|
1918
|
+
return;
|
|
1919
|
+
}
|
|
1920
|
+
await dataStore.setApplication(data, true);
|
|
1921
|
+
customPension.value = false;
|
|
1922
|
+
} else {
|
|
1923
|
+
await dataStore.setApplication(data, true);
|
|
1924
|
+
}
|
|
1925
|
+
await dataStore.getApplicationData(String(route.params.taskId), false, false, false, true);
|
|
1926
|
+
pensionForm.value.payment = formStore.applicationData.pensionApp?.payment ?? 0;
|
|
1927
|
+
dateOfBegin.value = reformatDate(formStore.applicationData.pensionApp.dateOfBegin);
|
|
1618
1928
|
} else {
|
|
1619
1929
|
if (whichSum.value === 'requestedSumInsured') {
|
|
1620
1930
|
productConditionsForm.insurancePremiumPerMonth = null;
|
|
@@ -1709,7 +2019,6 @@ export default defineComponent({
|
|
|
1709
2019
|
}
|
|
1710
2020
|
}
|
|
1711
2021
|
}
|
|
1712
|
-
|
|
1713
2022
|
isCalculating.value = false;
|
|
1714
2023
|
} else {
|
|
1715
2024
|
const errors = document.querySelector('.v-input--error');
|
|
@@ -1733,7 +2042,26 @@ export default defineComponent({
|
|
|
1733
2042
|
});
|
|
1734
2043
|
};
|
|
1735
2044
|
|
|
2045
|
+
const validatePensionForm = (data: any, text: string) => {
|
|
2046
|
+
if (!data.amount || !data.guaranteedPeriod) {
|
|
2047
|
+
dataStore.showToaster('error', text);
|
|
2048
|
+
return false;
|
|
2049
|
+
}
|
|
2050
|
+
return true;
|
|
2051
|
+
};
|
|
2052
|
+
|
|
2053
|
+
const sumPensionData = (data: any) => {
|
|
2054
|
+
return (
|
|
2055
|
+
formatSpacedNumber(data.ownFundsRaisAmount) +
|
|
2056
|
+
formatSpacedNumber(data.voluntaryContractAmount) +
|
|
2057
|
+
formatSpacedNumber(data.compulsoryContractAmount) +
|
|
2058
|
+
formatSpacedNumber(data.compulsoryProfContractAmount) +
|
|
2059
|
+
sumContractsAmount(data.transferContracts)
|
|
2060
|
+
);
|
|
2061
|
+
};
|
|
2062
|
+
|
|
1736
2063
|
onMounted(async () => {
|
|
2064
|
+
if (hasContragentData.value) await getContragent();
|
|
1737
2065
|
if (props.isCalculator === true) {
|
|
1738
2066
|
if (dataStore.isCalculator) {
|
|
1739
2067
|
clearFields();
|
|
@@ -1800,22 +2128,34 @@ export default defineComponent({
|
|
|
1800
2128
|
);
|
|
1801
2129
|
}
|
|
1802
2130
|
if (whichProduct.value === 'pensionannuitynew') {
|
|
1803
|
-
contractDate.value = reformatDate(
|
|
1804
|
-
dateOfBegin.value = reformatDate(
|
|
1805
|
-
transferContractDate.value = reformatDate(
|
|
1806
|
-
transferContractFirstPaymentDate.value = reformatDate(
|
|
2131
|
+
contractDate.value = reformatDate(pensionForm.value.contractDate ?? '');
|
|
2132
|
+
dateOfBegin.value = reformatDate(pensionForm.value.dateOfBegin);
|
|
2133
|
+
transferContractDate.value = reformatDate(pensionForm.value.transferContractDate);
|
|
2134
|
+
transferContractFirstPaymentDate.value = reformatDate(pensionForm.value.transferContractFirstPaymentDate ?? '');
|
|
1807
2135
|
maxDate.value = await dataStore.getVariableData(formStore.applicationData.processCode ?? 19);
|
|
1808
|
-
if (transferContracts.value && transferContracts.value.length) {
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
2136
|
+
if (!transferContracts.value.length && pensionForm.value.transferContracts && pensionForm.value.transferContracts.length) {
|
|
2137
|
+
pensionForm.value.transferContracts.forEach((contract: TransferContract) => {
|
|
2138
|
+
transferContracts.value.push({
|
|
2139
|
+
...contract,
|
|
2140
|
+
transferContractDate: constants.regex.isoDate.test(contract.transferContractDate) ? reformatDate(contract.transferContractDate)! : contract.transferContractDate,
|
|
2141
|
+
transferContractFirstPaymentDate: constants.regex.isoDate.test(contract.transferContractFirstPaymentDate)
|
|
2142
|
+
? reformatDate(contract.transferContractFirstPaymentDate)!
|
|
2143
|
+
: contract.transferContractFirstPaymentDate,
|
|
2144
|
+
transferContractCompany:
|
|
2145
|
+
typeof contract.transferContractCompany === 'string' ? ({ nameRu: contract.transferContractCompany } as any) : contract.transferContractCompany,
|
|
2146
|
+
transferContractAmount: dataStore.getNumberWithSpaces(contract.transferContractAmount) ?? '',
|
|
2147
|
+
});
|
|
1814
2148
|
});
|
|
1815
2149
|
}
|
|
1816
2150
|
}
|
|
1817
2151
|
});
|
|
1818
2152
|
|
|
2153
|
+
watch(
|
|
2154
|
+
() => pensionForm.value?.amount,
|
|
2155
|
+
val => {
|
|
2156
|
+
if (val) pensionForm.value.amount = dataStore.getNumberWithSpaces(val);
|
|
2157
|
+
},
|
|
2158
|
+
);
|
|
1819
2159
|
watch(
|
|
1820
2160
|
() => productConditionsForm.amountOfInsurancePremium,
|
|
1821
2161
|
val => {
|
|
@@ -1931,8 +2271,41 @@ export default defineComponent({
|
|
|
1931
2271
|
);
|
|
1932
2272
|
}
|
|
1933
2273
|
|
|
2274
|
+
if (whichProduct.value === 'pensionannuitynew') {
|
|
2275
|
+
watch(
|
|
2276
|
+
() => pensionForm.value.guaranteedPeriod,
|
|
2277
|
+
async () => {
|
|
2278
|
+
if (formStore.applicationData.processCode === 24) {
|
|
2279
|
+
await dataStore.reCalculateRefund(
|
|
2280
|
+
Number(pensionForm.value.parentContractAmount),
|
|
2281
|
+
Number(pensionForm.value.parentContractMainAmount),
|
|
2282
|
+
pensionForm.value.guaranteedPeriod,
|
|
2283
|
+
pensionForm.value.transferContractIsOppv,
|
|
2284
|
+
pensionForm.value.compulsoryProfMonthCount ?? 0,
|
|
2285
|
+
);
|
|
2286
|
+
}
|
|
2287
|
+
},
|
|
2288
|
+
);
|
|
2289
|
+
watch(
|
|
2290
|
+
() => contractDate.value,
|
|
2291
|
+
(val, oldVal) => {
|
|
2292
|
+
if (val !== null && val !== undefined && val.length === 10 && oldVal != undefined && !isSlavePensionForm.value) {
|
|
2293
|
+
const formattedContractDate = formatDate(val);
|
|
2294
|
+
if (formattedContractDate) {
|
|
2295
|
+
const transferMax = formattedContractDate;
|
|
2296
|
+
transferMax.setFullYear(transferMax.getFullYear() - 2);
|
|
2297
|
+
transferMax.setDate(transferMax.getDate() + 1);
|
|
2298
|
+
transferMaxDate.value = reformatDate(String(transferMax));
|
|
2299
|
+
formattedContractDate.setDate(formattedContractDate.getDate() + 20);
|
|
2300
|
+
dateOfBegin.value = reformatDate(String(formattedContractDate));
|
|
2301
|
+
}
|
|
2302
|
+
}
|
|
2303
|
+
},
|
|
2304
|
+
);
|
|
2305
|
+
}
|
|
2306
|
+
|
|
1934
2307
|
const copyRedirect = async () => {
|
|
1935
|
-
const url = await dataStore.api.pensionannuityNew.getEnpfRedirectUrl(String(
|
|
2308
|
+
const url = await dataStore.api.pensionannuityNew.getEnpfRedirectUrl(String(pensionForm.value.processInstanceId));
|
|
1936
2309
|
dataStore.copyToClipboard(url.redirectUrl);
|
|
1937
2310
|
};
|
|
1938
2311
|
|
|
@@ -1961,21 +2334,28 @@ export default defineComponent({
|
|
|
1961
2334
|
subTermValue,
|
|
1962
2335
|
panelCodeList,
|
|
1963
2336
|
pensionForm,
|
|
2337
|
+
insuredForm,
|
|
1964
2338
|
dateOfBegin,
|
|
1965
2339
|
contractDate,
|
|
1966
2340
|
transferContractDate,
|
|
1967
2341
|
transferContractFirstPaymentDate,
|
|
1968
2342
|
enabled,
|
|
1969
2343
|
maxDate,
|
|
2344
|
+
transferMaxDate,
|
|
1970
2345
|
guaranteedPeriodList,
|
|
1971
2346
|
isEnpfSum,
|
|
1972
2347
|
transferContracts,
|
|
1973
2348
|
contractsValue,
|
|
1974
2349
|
contractIndex,
|
|
2350
|
+
contragentData,
|
|
2351
|
+
customPension,
|
|
1975
2352
|
|
|
1976
2353
|
// Computed
|
|
1977
2354
|
isTask,
|
|
1978
2355
|
isDisabled,
|
|
2356
|
+
pensionPayment,
|
|
2357
|
+
disabilityGroup,
|
|
2358
|
+
totalInsPremium,
|
|
1979
2359
|
isTermsDisabled,
|
|
1980
2360
|
isUnderwriterForm,
|
|
1981
2361
|
hasCurrencySymbols,
|
|
@@ -1992,6 +2372,7 @@ export default defineComponent({
|
|
|
1992
2372
|
hasRequestedSumInsuredInDollar,
|
|
1993
2373
|
hasInsurancePremiumPerMonthInDollar,
|
|
1994
2374
|
hasCurrency,
|
|
2375
|
+
hasContragentData,
|
|
1995
2376
|
hasAdbMultiply,
|
|
1996
2377
|
readonlyLifeAdditive,
|
|
1997
2378
|
readonlyDisabilityMultiply,
|
|
@@ -2001,6 +2382,7 @@ export default defineComponent({
|
|
|
2001
2382
|
hasCalculated,
|
|
2002
2383
|
hasAnnuityPayments,
|
|
2003
2384
|
hasAgencyPart,
|
|
2385
|
+
hasDisabilityAdditive,
|
|
2004
2386
|
currencySymbolsAddTerm,
|
|
2005
2387
|
amountAnnuityPayments,
|
|
2006
2388
|
requestedSumInsuredLabel,
|
|
@@ -2010,6 +2392,11 @@ export default defineComponent({
|
|
|
2010
2392
|
hasBirthDate,
|
|
2011
2393
|
hasGender,
|
|
2012
2394
|
coverPeriodLabel,
|
|
2395
|
+
lifeMultiplyLabel,
|
|
2396
|
+
lifeAdditiveLabel,
|
|
2397
|
+
disabilityMultiplyLabel,
|
|
2398
|
+
adbMultiplyLabel,
|
|
2399
|
+
adbAdditiveLabel,
|
|
2013
2400
|
insurancePremiumPerMonthLabel,
|
|
2014
2401
|
isDisabledCoverPeriod,
|
|
2015
2402
|
hasDefault,
|
|
@@ -2021,13 +2408,12 @@ export default defineComponent({
|
|
|
2021
2408
|
isDisabledFixInsSum,
|
|
2022
2409
|
defaultText,
|
|
2023
2410
|
hasDeathInsFromNS,
|
|
2024
|
-
pensionAmount,
|
|
2025
|
-
pensionCalculationParams,
|
|
2026
2411
|
hasDeathInsAnyReason,
|
|
2027
2412
|
fromIndexPage,
|
|
2028
2413
|
hasCoverPeriod,
|
|
2029
2414
|
hasInsStartDate,
|
|
2030
2415
|
hasInsEndDate,
|
|
2416
|
+
isSlavePensionForm,
|
|
2031
2417
|
|
|
2032
2418
|
// Rules
|
|
2033
2419
|
coverPeriodRule,
|
|
@@ -2045,9 +2431,11 @@ export default defineComponent({
|
|
|
2045
2431
|
onInputInsurancePremiumPerMonth,
|
|
2046
2432
|
onInputInsurancePremiumPerMonthInDollar,
|
|
2047
2433
|
onInputSum,
|
|
2434
|
+
onInputPension,
|
|
2048
2435
|
onInputSumDollar,
|
|
2049
2436
|
toStatement,
|
|
2050
2437
|
onClearSum,
|
|
2438
|
+
onClearPension,
|
|
2051
2439
|
onClearSumDollar,
|
|
2052
2440
|
onClearPremium,
|
|
2053
2441
|
onClearPremiumDollar,
|
|
@@ -2059,6 +2447,7 @@ export default defineComponent({
|
|
|
2059
2447
|
pickSubTermValue,
|
|
2060
2448
|
onInputFixInsSum,
|
|
2061
2449
|
copyRedirect,
|
|
2450
|
+
getContragent,
|
|
2062
2451
|
addTransferContract,
|
|
2063
2452
|
removeTransferContract,
|
|
2064
2453
|
};
|