hl-core 0.0.10-beta.3 → 0.0.10-beta.31
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 +300 -190
- package/api/interceptors.ts +3 -5
- package/components/Complex/TextBlock.vue +2 -0
- package/components/Dialog/Dialog.vue +7 -1
- package/components/Dialog/FamilyDialog.vue +2 -0
- package/components/Form/DigitalDocument.vue +52 -0
- package/components/Form/DynamicForm.vue +1 -0
- package/components/Form/FormData.vue +1 -0
- package/components/Form/ManagerAttachment.vue +17 -8
- package/components/Form/ProductConditionsBlock.vue +12 -6
- package/components/Input/Datepicker.vue +5 -0
- package/components/Input/DynamicInput.vue +2 -0
- package/components/Input/FormInput.vue +7 -0
- package/components/Input/OtpInput.vue +25 -0
- package/components/Input/PanelInput.vue +1 -0
- package/components/Input/RoundedInput.vue +4 -0
- package/components/Input/RoundedSelect.vue +4 -0
- package/components/Input/SwitchInput.vue +2 -0
- package/components/Input/TextInput.vue +2 -0
- package/components/Layout/Drawer.vue +2 -0
- package/components/Pages/Anketa.vue +166 -167
- package/components/Pages/Auth.vue +2 -0
- package/components/Pages/ContragentForm.vue +2 -1
- package/components/Pages/Documents.vue +429 -59
- package/components/Pages/MemberForm.vue +327 -159
- package/components/Pages/ProductConditions.vue +681 -150
- package/components/Panel/PanelHandler.vue +261 -114
- package/components/Transitions/Animation.vue +2 -0
- package/components/Utilities/Chip.vue +3 -1
- package/components/Utilities/JsonViewer.vue +1 -2
- package/composables/classes.ts +133 -42
- package/composables/constants.ts +41 -0
- package/composables/fields.ts +6 -4
- package/composables/index.ts +246 -7
- 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 +44 -14
- package/nuxt.config.ts +10 -13
- package/package.json +13 -12
- package/plugins/head.ts +2 -1
- package/store/data.store.ts +670 -480
- package/store/member.store.ts +18 -6
- package/store/rules.ts +21 -2
- package/tsconfig.json +3 -0
- package/types/enum.ts +20 -2
- package/types/env.d.ts +2 -2
- package/types/form.ts +71 -74
- package/types/index.ts +916 -873
|
@@ -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 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,7 +56,7 @@
|
|
|
49
56
|
</div>
|
|
50
57
|
</base-form-section>
|
|
51
58
|
<base-form-section
|
|
52
|
-
v-if="isUnderwriterRole && whichProduct !== 'lifebusiness' && whichProduct !== 'gns' && whichProduct !== 'pensionannuitynew'"
|
|
59
|
+
v-if="isUnderwriterRole && whichProduct !== 'lifebusiness' && whichProduct !== 'gns' && whichProduct !== 'pensionannuitynew' && whichProduct !== 'balam'"
|
|
53
60
|
:title="$dataStore.t('recalculationInfo')"
|
|
54
61
|
>
|
|
55
62
|
<base-form-input
|
|
@@ -145,12 +152,23 @@
|
|
|
145
152
|
@append="openPanel($dataStore.t('form.gender'), $dataStore.gender, 'gender')"
|
|
146
153
|
/>
|
|
147
154
|
</div>
|
|
155
|
+
<base-panel-input
|
|
156
|
+
v-if="hasCurrency"
|
|
157
|
+
v-model="productConditionsForm.currency"
|
|
158
|
+
:value="productConditionsForm.currency.nameRu"
|
|
159
|
+
:readonly="isDisabled"
|
|
160
|
+
:clearable="!isDisabled"
|
|
161
|
+
:label="$dataStore.t('agent.currency')"
|
|
162
|
+
:rules="$rules.objectRequired"
|
|
163
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
164
|
+
@append="openPanel($dataStore.t('agent.currency'), currencyListFiltered, 'currency')"
|
|
165
|
+
/>
|
|
148
166
|
<base-form-input
|
|
149
167
|
v-if="hasInsStartDate"
|
|
150
168
|
v-model="productConditionsForm.calcDate"
|
|
151
169
|
:maska="$maska.date"
|
|
152
|
-
:readonly="
|
|
153
|
-
:clearable="!
|
|
170
|
+
:readonly="isDisabledInsStartDate"
|
|
171
|
+
:clearable="!isDisabledInsStartDate"
|
|
154
172
|
:label="$dataStore.t('labels.insuranceStartDate')"
|
|
155
173
|
:rules="$rules.required"
|
|
156
174
|
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
@@ -178,8 +196,8 @@
|
|
|
178
196
|
v-if="hasPaymentPeriod"
|
|
179
197
|
v-model="productConditionsForm.paymentPeriod"
|
|
180
198
|
:value="productConditionsForm.paymentPeriod?.nameRu"
|
|
181
|
-
:readonly="
|
|
182
|
-
:clearable="!
|
|
199
|
+
:readonly="isDisabledPaymentPeriod"
|
|
200
|
+
:clearable="!isDisabledPaymentPeriod"
|
|
183
201
|
:rules="$rules.objectRequired"
|
|
184
202
|
:label="$dataStore.t('productConditionsForm.processPaymentPeriod')"
|
|
185
203
|
append-inner-icon="mdi mdi-chevron-right"
|
|
@@ -249,10 +267,10 @@
|
|
|
249
267
|
@onClear="onClearPremiumDollar"
|
|
250
268
|
/>
|
|
251
269
|
<base-form-input
|
|
252
|
-
v-if="
|
|
270
|
+
v-if="hasCurrencySymbols && $dataStore.currencies.usd"
|
|
253
271
|
v-model="$dataStore.currencies.usd"
|
|
254
272
|
:readonly="true"
|
|
255
|
-
:label="
|
|
273
|
+
:label="currencySymbolsLabel"
|
|
256
274
|
:suffix="$constants.currencySymbols.kzt"
|
|
257
275
|
/>
|
|
258
276
|
<base-form-input
|
|
@@ -289,102 +307,192 @@
|
|
|
289
307
|
:label="$dataStore.t('productConditionsForm.agencyPart')"
|
|
290
308
|
:readonly="isDisabledAgentCommission"
|
|
291
309
|
:clearable="!isDisabledAgentCommission"
|
|
292
|
-
:rules="$rules.required.concat($rules.numbers, $rules.agentCommission)"
|
|
310
|
+
:rules="formStore.lfb.add ? $rules.required : $rules.required.concat($rules.numbers, $rules.agentCommission)"
|
|
293
311
|
/>
|
|
294
312
|
</base-form-section>
|
|
295
313
|
<section v-if="whichProduct === 'pensionannuitynew'">
|
|
296
|
-
<base-
|
|
297
|
-
|
|
314
|
+
<base-animation>
|
|
315
|
+
<div
|
|
316
|
+
v-if="(formStore.applicationData.processCode === 19 || formStore.applicationData.processCode === 25) && !isDisabled"
|
|
317
|
+
:class="[$styles.blueBgLight]"
|
|
318
|
+
class="h-[52px] rounded-lg flex items-center justify-end px-2 gap-2 mt-4"
|
|
319
|
+
>
|
|
320
|
+
<base-btn class="max-w-[300px]" :text="$dataStore.t('buttons.copyToClient')" size="sm" @click="copyRedirect" />
|
|
321
|
+
</div>
|
|
322
|
+
</base-animation>
|
|
323
|
+
<base-form-section v-if="formStore.applicationData.statusCode === 'ActuaryForm' && isTask">
|
|
324
|
+
<base-content-block :class="[$styles.textSimple]">
|
|
325
|
+
<h5 class="text-center font-medium mb-4">{{ $dataStore.t('labels.contract') }}</h5>
|
|
326
|
+
<div :class="[$styles.whiteBg, $styles.rounded]" class="p-2 h-12 flex items-center relative">
|
|
327
|
+
<span class="ml-2">Договор {{ formStore.applicationData.processCode === 19 || formStore.applicationData.processCode === 25 ? 'страхования' : 'возврата' }}</span>
|
|
328
|
+
<i
|
|
329
|
+
class="transition-all cursor-pointer mdi mdi-mdi-tray-arrow-down pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
|
|
330
|
+
:class="[$styles.greenTextHover]"
|
|
331
|
+
@click="
|
|
332
|
+
$dataStore.generatePDFDocument(
|
|
333
|
+
formStore.applicationData.processCode === 19 ? 'PA_Contract' : formStore.applicationData.processCode === 25 ? 'PAJ_Contract' : 'PA_RefundAgreement',
|
|
334
|
+
'38',
|
|
335
|
+
)
|
|
336
|
+
"
|
|
337
|
+
></i>
|
|
338
|
+
</div>
|
|
339
|
+
</base-content-block>
|
|
340
|
+
</base-form-section>
|
|
341
|
+
<div v-if="formStore.applicationData.processCode === 25" class="flex items-center mt-[14px] h-[48px]">
|
|
342
|
+
<div :class="[$styles.blueBgLight]" class="flex flex-wrap items-center gap-2 p-1 rounded-t-[8px] h-full">
|
|
343
|
+
<div
|
|
344
|
+
class="h-full px-4 py-1 rounded-[8px] cursor-pointer flex items-center"
|
|
345
|
+
:class="[$styles.textSimple, !isSlavePensionForm ? `${$styles.blueBg} ${$styles.whiteText}` : '']"
|
|
346
|
+
@click="$router.replace({ query: { ...$route.query, which: undefined, upd: 'true' } })"
|
|
347
|
+
>
|
|
348
|
+
{{ !!formStore.applicationData.clientApp?.longName ? formStore.applicationData.clientApp?.longName : 'Страхователь' }}
|
|
349
|
+
</div>
|
|
350
|
+
<div
|
|
351
|
+
class="h-full px-4 py-1 rounded-[8px] cursor-pointer flex items-center"
|
|
352
|
+
:class="[$styles.textSimple, isSlavePensionForm ? `${$styles.blueBg} ${$styles.whiteText}` : '']"
|
|
353
|
+
@click="$router.replace({ query: { ...$route.query, which: 'slave', upd: 'true' } })"
|
|
354
|
+
>
|
|
355
|
+
{{ !!formStore.applicationData.slave.clientApp?.longName ? formStore.applicationData.slave.clientApp?.longName : 'Страхователь 2' }}
|
|
356
|
+
</div>
|
|
357
|
+
</div>
|
|
358
|
+
</div>
|
|
359
|
+
<base-form-section v-if="hasContragentData && contragentData">
|
|
360
|
+
<base-panel-input v-model="contragentData.gender" :readonly="true" :clearable="false" :label="$dataStore.t('form.gender')" />
|
|
361
|
+
<base-form-input v-model="contragentData.birthDate" :readonly="true" :clearable="false" :label="$dataStore.t('form.birthDate')" />
|
|
362
|
+
<base-panel-input
|
|
363
|
+
v-if="disabilityGroup"
|
|
364
|
+
v-model="disabilityGroup"
|
|
365
|
+
:value="disabilityGroup?.nameRu"
|
|
366
|
+
:readonly="true"
|
|
367
|
+
:clearable="false"
|
|
368
|
+
:label="$dataStore.t('pension.disabilityGroup')"
|
|
369
|
+
/>
|
|
370
|
+
</base-form-section>
|
|
371
|
+
<base-form-section
|
|
372
|
+
v-if="formStore.applicationData.processCode !== 24"
|
|
373
|
+
:title="$dataStore.t('pension.compulsoryAmount&Prof')"
|
|
374
|
+
:class="[formStore.applicationData.processCode === 25 ? 'mt-0 rounded-tl-none' : '']"
|
|
375
|
+
>
|
|
298
376
|
<base-form-input
|
|
299
|
-
v-model="
|
|
300
|
-
:maska="$maska.numbers"
|
|
377
|
+
v-model="pensionForm.compulsoryContractAmount"
|
|
301
378
|
:readonly="isDisabled || isEnpfSum"
|
|
302
379
|
:clearable="!isDisabled && !isEnpfSum"
|
|
303
380
|
:label="$dataStore.t('pension.compulsoryContractAmount')"
|
|
381
|
+
:rules="$dataStore.rules.sums"
|
|
382
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
383
|
+
@input="onInputPension($event, 'compulsoryContractAmount')"
|
|
384
|
+
@onClear="onClearPension('compulsoryContractAmount')"
|
|
304
385
|
/>
|
|
305
386
|
<base-form-input
|
|
306
|
-
v-model="
|
|
307
|
-
:maska="$maska.numbers"
|
|
387
|
+
v-model="pensionForm.compulsoryProfContractAmount"
|
|
308
388
|
:readonly="isDisabled || isEnpfSum"
|
|
309
389
|
:clearable="!isDisabled && !isEnpfSum"
|
|
310
390
|
:label="$dataStore.t('pension.compulsoryProfContractAmount')"
|
|
391
|
+
:rules="$dataStore.rules.sums"
|
|
392
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
393
|
+
@input="onInputPension($event, 'compulsoryProfContractAmount')"
|
|
394
|
+
@onClear="onClearPension('compulsoryProfContractAmount')"
|
|
311
395
|
/>
|
|
312
396
|
<base-animation>
|
|
313
397
|
<base-form-input
|
|
314
|
-
v-if="
|
|
398
|
+
v-if="pensionForm.compulsoryProfContractAmount && pensionForm.compulsoryProfContractAmount != 0"
|
|
315
399
|
v-model="pensionForm.compulsoryProfMonthCount"
|
|
316
400
|
:maska="$maska.numbers"
|
|
317
|
-
:readonly="isDisabled
|
|
318
|
-
:clearable="!isDisabled
|
|
401
|
+
:readonly="isDisabled"
|
|
402
|
+
:clearable="!isDisabled"
|
|
319
403
|
:label="$dataStore.t('pension.compulsoryProfMonthCount')"
|
|
320
404
|
/>
|
|
321
405
|
</base-animation>
|
|
322
406
|
<base-form-input
|
|
323
|
-
v-model="
|
|
324
|
-
:maska="$maska.numbers"
|
|
407
|
+
v-model="pensionForm.voluntaryContractAmount"
|
|
325
408
|
:readonly="isDisabled"
|
|
326
409
|
:clearable="!isDisabled"
|
|
327
410
|
:label="$dataStore.t('pension.voluntaryContractAmount')"
|
|
411
|
+
:rules="$dataStore.rules.sums"
|
|
412
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
413
|
+
@input="onInputPension($event, 'voluntaryContractAmount')"
|
|
414
|
+
@onClear="onClearPension('voluntaryContractAmount')"
|
|
328
415
|
/>
|
|
329
416
|
<base-form-input
|
|
330
|
-
v-model="
|
|
331
|
-
:maska="$maska.numbers"
|
|
417
|
+
v-model="pensionForm.ownFundsRaisAmount"
|
|
332
418
|
:readonly="isDisabled"
|
|
333
419
|
:clearable="!isDisabled"
|
|
334
420
|
:label="$dataStore.t('pension.ownFundsRaisAmount')"
|
|
421
|
+
:rules="$dataStore.rules.sums"
|
|
422
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
423
|
+
@input="onInputPension($event, 'ownFundsRaisAmount')"
|
|
424
|
+
@onClear="onClearPension('ownFundsRaisAmount')"
|
|
335
425
|
/>
|
|
336
426
|
</base-form-section>
|
|
337
|
-
<base-form-section :title="$dataStore.t('pension.companyName')">
|
|
338
|
-
<base-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
427
|
+
<base-form-section v-if="formStore.applicationData.processCode !== 24" :title="$dataStore.t('pension.companyName')">
|
|
428
|
+
<base-btn v-if="!isDisabled" :text="$dataStore.t('buttons.add')" :disabled="isDisabled" size="sm" :btn="$styles.blueBtn" @click="addTransferContract" />
|
|
429
|
+
<section v-for="(contract, index) in transferContracts" class="py-2">
|
|
430
|
+
<base-panel-input
|
|
431
|
+
v-model="contract.transferContractCompany"
|
|
432
|
+
:value="contract.transferContractCompany?.nameRu"
|
|
433
|
+
:label="$dataStore.t('pension.transferContractCompany')"
|
|
434
|
+
:readonly="isDisabled"
|
|
435
|
+
:clearable="!isDisabled"
|
|
436
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
437
|
+
@append="
|
|
438
|
+
openPanel($dataStore.t('pension.transferContractCompany'), $dataStore.transferContractCompanies, 'transferContractCompany', $dataStore.getInsuranceCompanies)
|
|
439
|
+
"
|
|
440
|
+
@click="contractIndex = index"
|
|
441
|
+
/>
|
|
442
|
+
<div class="flex flex-col">
|
|
443
|
+
<base-form-input
|
|
444
|
+
v-model="contract.transferContractDate"
|
|
445
|
+
:maska="$maska.date"
|
|
446
|
+
:label="$dataStore.t('pension.contractDate')"
|
|
447
|
+
:readonly="isDisabled"
|
|
448
|
+
:clearable="!isDisabled"
|
|
449
|
+
:max-date="formatDate(transferMaxDate) ?? undefined"
|
|
450
|
+
:rules="$dataStore.rules.required.concat($dataStore.rules.birthDate)"
|
|
451
|
+
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
452
|
+
/>
|
|
453
|
+
<span v-if="transferMaxDate && !isDisabled" class="px-3 font-light text-sm bg-white py-0 mt-[-5px]" style="color: #a0b3d8 !important"
|
|
454
|
+
>до {{ transferMaxDate }} включительно</span
|
|
455
|
+
>
|
|
456
|
+
</div>
|
|
457
|
+
<base-form-input v-model="contract.transferContractNumber" :label="$dataStore.t('pension.globalId')" :readonly="isDisabled" :clearable="!isDisabled" />
|
|
458
|
+
<base-form-input
|
|
459
|
+
v-model="contract.transferContractRegNumber"
|
|
460
|
+
:label="$dataStore.t('pension.transferRegNumber')"
|
|
461
|
+
:rules="$rules.required"
|
|
462
|
+
:readonly="isDisabled"
|
|
463
|
+
:clearable="!isDisabled"
|
|
464
|
+
/>
|
|
465
|
+
<base-form-input
|
|
466
|
+
v-model="contract.transferContractFirstPaymentDate"
|
|
467
|
+
:maska="$maska.date"
|
|
468
|
+
:label="$dataStore.t('pension.transferContractFirstPaymentDate')"
|
|
469
|
+
:rules="$dataStore.rules.required.concat($dataStore.rules.birthDate)"
|
|
470
|
+
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
471
|
+
:readonly="isDisabled"
|
|
472
|
+
:clearable="!isDisabled"
|
|
473
|
+
/>
|
|
474
|
+
<base-form-input
|
|
475
|
+
v-model="contract.transferContractAmount"
|
|
476
|
+
:label="$dataStore.t('pension.transferContractAmount')"
|
|
477
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
478
|
+
:readonly="isDisabled"
|
|
479
|
+
:clearable="!isDisabled"
|
|
480
|
+
@input="onInputPension($event, 'transferContractAmount', index)"
|
|
481
|
+
@onClear="onClearPension('transferContractAmount', index)"
|
|
482
|
+
/>
|
|
483
|
+
<base-form-toggle v-model="contract.transferContractIsOppv" :disabled="isDisabled" :has-border="false" :title="$dataStore.t('pension.isOPPVTransfer')" />
|
|
484
|
+
<base-btn v-if="!isDisabled" :text="$dataStore.t('buttons.delete')" :disabled="isDisabled" size="sm" :btn="$styles.whiteBtn" @click="removeTransferContract(index)" />
|
|
485
|
+
</section>
|
|
379
486
|
</base-form-section>
|
|
380
487
|
<base-form-section :title="$dataStore.t('pension.paymentTerms')">
|
|
381
488
|
<base-form-input
|
|
382
489
|
v-model="contractDate"
|
|
383
490
|
:maska="$maska.date"
|
|
384
491
|
:rules="!isDisabled ? $rules.required.concat($rules.date) : []"
|
|
385
|
-
:readonly="isDisabled"
|
|
492
|
+
:readonly="isDisabled || formStore.applicationData.processCode === 24 || isSlavePensionForm"
|
|
386
493
|
:clearable="!isDisabled"
|
|
387
494
|
:min-date="new Date()"
|
|
495
|
+
:max-date="formatDate(maxDate ?? '') ?? undefined"
|
|
388
496
|
:label="$dataStore.t('pension.contractDate')"
|
|
389
497
|
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
390
498
|
/>
|
|
@@ -403,8 +511,24 @@
|
|
|
403
511
|
<base-form-input v-model="pensionForm.frequencyPayments" disabled :label="$dataStore.t('pension.frequencyPayments')" />
|
|
404
512
|
<base-form-input v-model="pensionForm.periodPayments" disabled :label="$dataStore.t('pension.paymentPeriod')" />
|
|
405
513
|
<base-form-input v-model="pensionForm.insuranceProgramType" disabled :label="$dataStore.t('pension.insuranceProgramType')" />
|
|
406
|
-
<base-form-input
|
|
407
|
-
|
|
514
|
+
<base-form-input
|
|
515
|
+
v-if="formStore.applicationData.processCode === 25 && formStore.pensionApp?.slave?.amount"
|
|
516
|
+
:value="totalInsPremium"
|
|
517
|
+
:active="true"
|
|
518
|
+
:label="$dataStore.t('productConditionsForm.totalInsurancePremiumAmount')"
|
|
519
|
+
:disabled="$dataStore.isLoading"
|
|
520
|
+
readonly
|
|
521
|
+
/>
|
|
522
|
+
<base-form-input
|
|
523
|
+
v-model="pensionForm.amount"
|
|
524
|
+
:value="$dataStore.getNumberWithSpaces(pensionForm.amount)"
|
|
525
|
+
@input="onInputPension($event, 'pensionAmount')"
|
|
526
|
+
@onClear="onClearPension('pensionAmount')"
|
|
527
|
+
@change="customPension = true"
|
|
528
|
+
:readonly="isDisabled || formStore.applicationData.processCode !== 25"
|
|
529
|
+
:label="$dataStore.t('pension.pensionAmount')"
|
|
530
|
+
/>
|
|
531
|
+
<base-form-input :value="pensionPayment" :active="true" readonly :label="$dataStore.t('pension.pensionPayment')" />
|
|
408
532
|
</base-form-section>
|
|
409
533
|
</section>
|
|
410
534
|
<base-form-section v-if="hasAnnuityPayments" :title="$dataStore.t('calculationAnnuityPayments')">
|
|
@@ -619,17 +743,46 @@
|
|
|
619
743
|
</div>
|
|
620
744
|
</base-form-section>
|
|
621
745
|
</v-form>
|
|
622
|
-
<base-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
746
|
+
<base-animation>
|
|
747
|
+
<base-btn
|
|
748
|
+
v-if="!$dataStore.isCalculator && isCalculator && hasCalculated"
|
|
749
|
+
:btn="$styles.greenLightBtn"
|
|
750
|
+
:text="$dataStore.t('buttons.toStatement')"
|
|
751
|
+
class="min-h-[60px]"
|
|
752
|
+
@click="toStatement"
|
|
753
|
+
/>
|
|
754
|
+
</base-animation>
|
|
755
|
+
<base-animation>
|
|
756
|
+
<base-btn
|
|
757
|
+
v-if="!isDisabled && $dataStore.isPension && isTask"
|
|
758
|
+
:text="$dataStore.t('buttons.calculate')"
|
|
759
|
+
:loading="$dataStore.isLoading"
|
|
760
|
+
class="min-h-[60px]"
|
|
761
|
+
type="submit"
|
|
762
|
+
@click="submitForm"
|
|
763
|
+
/>
|
|
764
|
+
</base-animation>
|
|
765
|
+
<base-animation>
|
|
766
|
+
<base-btn
|
|
767
|
+
v-if="$dataStore.isCalculator ? true : !isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter()) && !$dataStore.isPension"
|
|
768
|
+
:loading="isCalculating"
|
|
769
|
+
class="min-h-[60px]"
|
|
770
|
+
:text="$dataStore.t('buttons.calculate')"
|
|
771
|
+
@click="submitForm"
|
|
772
|
+
/>
|
|
773
|
+
</base-animation>
|
|
630
774
|
<div v-if="$dataStore.isTask() && $dataStore.isUnderwriter() && !isRecalculationDisabled" class="flex gap-3">
|
|
631
|
-
<base-
|
|
632
|
-
|
|
775
|
+
<base-animation>
|
|
776
|
+
<base-btn
|
|
777
|
+
v-if="hasCalcSum"
|
|
778
|
+
class="min-h-[60px]"
|
|
779
|
+
:text="$dataStore.t('buttons.calcSum')"
|
|
780
|
+
type="submit"
|
|
781
|
+
@click.prevent="underwriterCalculate('sum')"
|
|
782
|
+
:loading="isCalculating"
|
|
783
|
+
/>
|
|
784
|
+
</base-animation>
|
|
785
|
+
<base-btn class="min-h-[60px]" :text="$dataStore.t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
|
|
633
786
|
</div>
|
|
634
787
|
<Teleport v-if="isPanelOpen" to="#right-panel-actions">
|
|
635
788
|
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
@@ -695,7 +848,17 @@
|
|
|
695
848
|
</template>
|
|
696
849
|
|
|
697
850
|
<script lang="ts">
|
|
698
|
-
import { Member, Value, CountryValue, CalculatorForm } from '../../composables/classes';
|
|
851
|
+
import { Member, Value, CountryValue, CalculatorForm, TransferContract } from '../../composables/classes';
|
|
852
|
+
import type { Projects, AddCover, AddCoverAnswer } from '../../types';
|
|
853
|
+
|
|
854
|
+
type PensionCalculation = {
|
|
855
|
+
compulsoryContractAmount: number | string | null;
|
|
856
|
+
voluntaryContractAmount: number | string | null;
|
|
857
|
+
ownFundsRaisAmount: number | string | null;
|
|
858
|
+
compulsoryProfContractAmount: number | string | null;
|
|
859
|
+
transferContractAmount: number | string | null;
|
|
860
|
+
transferContractCompany: number | string | null;
|
|
861
|
+
};
|
|
699
862
|
|
|
700
863
|
export default defineComponent({
|
|
701
864
|
props: {
|
|
@@ -736,20 +899,43 @@ export default defineComponent({
|
|
|
736
899
|
|
|
737
900
|
const additionalTerms = ref<AddCover[]>([]);
|
|
738
901
|
|
|
739
|
-
const maxDate = ref();
|
|
902
|
+
const maxDate = ref<string | null>();
|
|
903
|
+
const transferMaxDate = ref();
|
|
740
904
|
const dateOfBegin = ref();
|
|
741
|
-
const contractDate = ref();
|
|
742
|
-
const transferContractDate = ref();
|
|
743
|
-
const transferContractFirstPaymentDate = ref();
|
|
744
|
-
const guaranteedPeriodList = Array.from(Array(35), (
|
|
745
|
-
const
|
|
746
|
-
const
|
|
905
|
+
const contractDate = ref<string | null>();
|
|
906
|
+
const transferContractDate = ref<string | null>();
|
|
907
|
+
const transferContractFirstPaymentDate = ref<string | null>();
|
|
908
|
+
const guaranteedPeriodList = Array.from(Array(35), (_, i) => i + 1);
|
|
909
|
+
const isSlavePensionForm = computed(() => route.query.which === 'slave');
|
|
910
|
+
const pensionForm = computedWithControl(
|
|
911
|
+
() => formStore.pensionApp,
|
|
912
|
+
() => (route.query.which === 'slave' ? formStore.pensionApp?.slave : formStore.pensionApp ?? undefined),
|
|
913
|
+
);
|
|
914
|
+
|
|
915
|
+
const insuredForm = isSlavePensionForm.value
|
|
916
|
+
? formStore.applicationData?.slave?.insuredApp && formStore.applicationData?.slave?.insuredApp[0]
|
|
917
|
+
: (formStore.applicationData?.insuredApp && Array.isArray(formStore.applicationData?.insuredApp) && formStore.applicationData?.insuredApp[0]) ?? undefined;
|
|
918
|
+
const disabilityGroup = computed(() => {
|
|
919
|
+
if (!!insuredForm.disabilityGroupId) {
|
|
920
|
+
const disabilityGroup = dataStore.disabilityGroups.find(i => i.id === insuredForm.disabilityGroupId);
|
|
921
|
+
return disabilityGroup;
|
|
922
|
+
}
|
|
923
|
+
});
|
|
924
|
+
const isEnpfSum = pensionForm.value?.isEnpfSum ?? false;
|
|
747
925
|
|
|
926
|
+
const transferContracts = ref<TransferContract[]>([]);
|
|
927
|
+
const contractsValue = ref<Value[]>([]);
|
|
928
|
+
const contractIndex = ref<number>(0);
|
|
748
929
|
const isMultiplePanelOpen = ref<boolean>(false);
|
|
749
930
|
const multiplePanelValue = ref<CountryValue>(new CountryValue());
|
|
750
931
|
const multiplePanelList = ref<CountryValue[]>([]);
|
|
751
932
|
const calculatorForm = productConditionsForm.calculatorForm;
|
|
752
933
|
const minInsSum = computed(() => formStore.lfb.clients && formStore.lfb.clients.reduce((min, item) => Math.min(min, item.insSum), Infinity));
|
|
934
|
+
const contragentData = ref<any>();
|
|
935
|
+
const customPension = ref<boolean>(false);
|
|
936
|
+
const transferSum = ref<number>(0);
|
|
937
|
+
const firstAmount = ref<boolean>(true);
|
|
938
|
+
|
|
753
939
|
const isShownAdditionalTerms = computed(() => {
|
|
754
940
|
if (whichProduct.value === 'gons') {
|
|
755
941
|
return false;
|
|
@@ -768,6 +954,9 @@ export default defineComponent({
|
|
|
768
954
|
if (whichProduct.value === 'gons') {
|
|
769
955
|
return true;
|
|
770
956
|
}
|
|
957
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
958
|
+
return true;
|
|
959
|
+
}
|
|
771
960
|
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && dataStore.isUnderwriter()) {
|
|
772
961
|
return false;
|
|
773
962
|
}
|
|
@@ -777,7 +966,9 @@ export default defineComponent({
|
|
|
777
966
|
const isTask = computed(() => (route.params.taskId === '0' && props.isCalculator === true) || dataStore.isTask() || fromIndexPage.value);
|
|
778
967
|
const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm || formStore.canBeClaimed === true);
|
|
779
968
|
const isUnderwriterRole = computed(() => dataStore.isUnderwriter() || dataStore.isAdmin() || dataStore.isSupport());
|
|
780
|
-
const insurancePremiumPerMonthRule = computed(() =>
|
|
969
|
+
const insurancePremiumPerMonthRule = computed(() =>
|
|
970
|
+
!!productConditionsForm.insurancePremiumPerMonth ? (whichProduct.value === 'gons' ? dataStore.rules.required : dataStore.rules.required.concat(dataStore.rules.sums)) : [],
|
|
971
|
+
);
|
|
781
972
|
const insurancePremiumPerMonthDisabled = computed(() => {
|
|
782
973
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
783
974
|
return true;
|
|
@@ -787,7 +978,9 @@ export default defineComponent({
|
|
|
787
978
|
}
|
|
788
979
|
return isDisabled.value;
|
|
789
980
|
});
|
|
790
|
-
const requestedSumInsuredRule = computed(() =>
|
|
981
|
+
const requestedSumInsuredRule = computed(() =>
|
|
982
|
+
!!productConditionsForm.requestedSumInsured ? (whichProduct.value === 'gons' ? dataStore.rules.required : dataStore.rules.required.concat(dataStore.rules.sums)) : [],
|
|
983
|
+
);
|
|
791
984
|
const fixInsSumRule = computed(() =>
|
|
792
985
|
!!productConditionsForm.fixInsSum
|
|
793
986
|
? dataStore.rules.required.concat(dataStore.rules.sums, dataStore.rules.fixInsSumLimit(getNumber(productConditionsForm.fixInsSum as string), minInsSum.value))
|
|
@@ -807,7 +1000,8 @@ export default defineComponent({
|
|
|
807
1000
|
whichProduct.value === 'liferenta' ||
|
|
808
1001
|
whichProduct.value === 'lifebusiness' ||
|
|
809
1002
|
whichProduct.value === 'amuletlife' ||
|
|
810
|
-
whichProduct.value === 'gns'
|
|
1003
|
+
whichProduct.value === 'gns' ||
|
|
1004
|
+
whichProduct.value === 'balam'
|
|
811
1005
|
) {
|
|
812
1006
|
return false;
|
|
813
1007
|
}
|
|
@@ -817,6 +1011,9 @@ export default defineComponent({
|
|
|
817
1011
|
if (whichProduct.value === 'halykkazyna') {
|
|
818
1012
|
return false;
|
|
819
1013
|
}
|
|
1014
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1015
|
+
return false;
|
|
1016
|
+
}
|
|
820
1017
|
return true;
|
|
821
1018
|
});
|
|
822
1019
|
const hasCoverPeriod = computed(() => {
|
|
@@ -829,18 +1026,27 @@ export default defineComponent({
|
|
|
829
1026
|
if (whichProduct.value === 'halykkazyna') {
|
|
830
1027
|
return true;
|
|
831
1028
|
}
|
|
1029
|
+
if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
|
|
1030
|
+
return true;
|
|
1031
|
+
}
|
|
832
1032
|
return false;
|
|
833
1033
|
});
|
|
834
1034
|
const hasInsurancePremiumPerMonthInDollar = computed(() => {
|
|
835
1035
|
if (whichProduct.value === 'halykkazyna') {
|
|
836
1036
|
return true;
|
|
837
1037
|
}
|
|
1038
|
+
if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
|
|
1039
|
+
return true;
|
|
1040
|
+
}
|
|
838
1041
|
return false;
|
|
839
1042
|
});
|
|
840
|
-
const
|
|
1043
|
+
const hasCurrencySymbols = computed(() => {
|
|
841
1044
|
if (whichProduct.value === 'halykkazyna') {
|
|
842
1045
|
return true;
|
|
843
1046
|
}
|
|
1047
|
+
if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
|
|
1048
|
+
return true;
|
|
1049
|
+
}
|
|
844
1050
|
return false;
|
|
845
1051
|
});
|
|
846
1052
|
const hasAdbMultiply = computed(() => {
|
|
@@ -926,6 +1132,9 @@ export default defineComponent({
|
|
|
926
1132
|
if (whichProduct.value === 'halykkazyna') {
|
|
927
1133
|
return dataStore.t('productConditionsForm.requestedSumInsuredInTenge');
|
|
928
1134
|
}
|
|
1135
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1136
|
+
return dataStore.t('productConditionsForm.amountRefunded');
|
|
1137
|
+
}
|
|
929
1138
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
930
1139
|
return dataStore.t('productConditionsForm.totalRequestedSumInsured');
|
|
931
1140
|
}
|
|
@@ -938,11 +1147,20 @@ export default defineComponent({
|
|
|
938
1147
|
return dataStore.t('productConditionsForm.coverPeriod');
|
|
939
1148
|
});
|
|
940
1149
|
const insurancePremiumPerMonthLabel = computed(() => {
|
|
1150
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1151
|
+
return dataStore.t('productConditionsForm.amountPaid');
|
|
1152
|
+
}
|
|
941
1153
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
942
1154
|
return dataStore.t('productConditionsForm.totalInsurancePremiumAmountWithCommission');
|
|
943
1155
|
}
|
|
944
1156
|
return dataStore.t('productConditionsForm.insurancePremiumAmount');
|
|
945
1157
|
});
|
|
1158
|
+
const currencySymbolsLabel = computed(() => {
|
|
1159
|
+
if (whichProduct.value === 'gons') {
|
|
1160
|
+
return dataStore.t('productConditionsForm.exchangeRateSettlementDate');
|
|
1161
|
+
}
|
|
1162
|
+
return dataStore.t('productConditionsForm.dollarExchangeRateNBRK');
|
|
1163
|
+
});
|
|
946
1164
|
const isDisabledFixInsSum = computed(() => {
|
|
947
1165
|
if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
|
|
948
1166
|
return false;
|
|
@@ -990,11 +1208,20 @@ export default defineComponent({
|
|
|
990
1208
|
return true;
|
|
991
1209
|
});
|
|
992
1210
|
const isDisabledAgentCommission = computed(() => {
|
|
1211
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1212
|
+
return true;
|
|
1213
|
+
}
|
|
993
1214
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns' || dataStore.isUnderwriter()) {
|
|
994
1215
|
return false;
|
|
995
1216
|
}
|
|
996
1217
|
return isDisabled.value;
|
|
997
1218
|
});
|
|
1219
|
+
const isDisabledInsStartDate = computed(() => {
|
|
1220
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1221
|
+
return true;
|
|
1222
|
+
}
|
|
1223
|
+
return isDisabled.value;
|
|
1224
|
+
});
|
|
998
1225
|
const hasCalcSum = computed(() => {
|
|
999
1226
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1000
1227
|
return false;
|
|
@@ -1002,7 +1229,7 @@ export default defineComponent({
|
|
|
1002
1229
|
return true;
|
|
1003
1230
|
});
|
|
1004
1231
|
const hasFixInsSum = computed(() => {
|
|
1005
|
-
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1232
|
+
if (!formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1006
1233
|
return true;
|
|
1007
1234
|
}
|
|
1008
1235
|
return false;
|
|
@@ -1037,25 +1264,54 @@ export default defineComponent({
|
|
|
1037
1264
|
}
|
|
1038
1265
|
return false;
|
|
1039
1266
|
});
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1267
|
+
const hasCurrency = computed(() => {
|
|
1268
|
+
if (whichProduct.value === 'gons') {
|
|
1269
|
+
return true;
|
|
1270
|
+
}
|
|
1271
|
+
return false;
|
|
1272
|
+
});
|
|
1273
|
+
const hasContragentData = computed(() => {
|
|
1274
|
+
if (whichProduct.value === 'pensionannuitynew') {
|
|
1275
|
+
return true;
|
|
1276
|
+
}
|
|
1277
|
+
return false;
|
|
1278
|
+
});
|
|
1279
|
+
const isDisabledPaymentPeriod = computed(() => {
|
|
1280
|
+
if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
|
|
1281
|
+
return true;
|
|
1282
|
+
}
|
|
1283
|
+
return isDisabled.value;
|
|
1284
|
+
});
|
|
1285
|
+
const currencyListFiltered = computed(() => {
|
|
1286
|
+
if (useEnv().isProduction) {
|
|
1287
|
+
return constants.currencyList.filter(i => i.code !== 'USD');
|
|
1288
|
+
}
|
|
1289
|
+
return constants.currencyList;
|
|
1048
1290
|
});
|
|
1049
1291
|
|
|
1050
|
-
const
|
|
1051
|
-
|
|
1052
|
-
? (Number(pensionCalculationParams.value.compulsoryContractAmount) ?? 0) +
|
|
1053
|
-
(Number(pensionCalculationParams.value.voluntaryContractAmount) ?? 0) +
|
|
1054
|
-
(Number(pensionCalculationParams.value.ownFundsRaisAmount) ?? 0) +
|
|
1055
|
-
(Number(pensionCalculationParams.value.compulsoryProfContractAmount) ?? 0) +
|
|
1056
|
-
(Number(pensionCalculationParams.value.transferContractAmount) ?? 0)
|
|
1057
|
-
: 0,
|
|
1292
|
+
const totalInsPremium = computed(() =>
|
|
1293
|
+
dataStore.getNumberWithSpaces(formatSpacedNumber(formStore.pensionApp?.amount) + formatSpacedNumber(formStore.pensionApp.slave?.amount)),
|
|
1058
1294
|
);
|
|
1295
|
+
const pensionPayment = computed(() => dataStore.getNumberWithSpaces(pensionForm.value.payment));
|
|
1296
|
+
|
|
1297
|
+
const getContragent = async () => {
|
|
1298
|
+
const data = await dataStore.api.getContragentById(
|
|
1299
|
+
Number(route.query.which !== 'slave' ? formStore.applicationData.clientApp.insisId : formStore.applicationData.slave.clientApp.insisId),
|
|
1300
|
+
);
|
|
1301
|
+
if (data && data.items.length != 0) {
|
|
1302
|
+
contragentData.value = data.items[0];
|
|
1303
|
+
contragentData.value.gender = contragentData.value.gender === 1 ? dataStore.t('pension.male') : dataStore.t('pension.female');
|
|
1304
|
+
contragentData.value.birthDate = reformatDate(contragentData.value.birthDate);
|
|
1305
|
+
}
|
|
1306
|
+
};
|
|
1307
|
+
|
|
1308
|
+
const sumContractsAmount = (transferContracts: TransferContract[]) => {
|
|
1309
|
+
if (!transferContracts || !transferContracts.length) return 0;
|
|
1310
|
+
return transferContracts.reduce((accumulator, currentValue) => {
|
|
1311
|
+
const transferAmount = structuredClone(toRaw(currentValue));
|
|
1312
|
+
return accumulator + Number(String(transferAmount.transferContractAmount).replace(/\s/g, ''));
|
|
1313
|
+
}, 0);
|
|
1314
|
+
};
|
|
1059
1315
|
|
|
1060
1316
|
const formatTermValue = (term: number) => {
|
|
1061
1317
|
if (term !== null) {
|
|
@@ -1068,7 +1324,7 @@ export default defineComponent({
|
|
|
1068
1324
|
const toStatement = async () => {
|
|
1069
1325
|
const statementItem = dataStore.menuItems.find(i => i.id === 'statement');
|
|
1070
1326
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1071
|
-
await router.push({ name: 'taskId-NewApp', params: route.params, query: { tab: 'statement' } });
|
|
1327
|
+
await router.push({ name: 'taskId-NewApp', params: route.params, query: { tab: 'statement', add: 'false' } });
|
|
1072
1328
|
return;
|
|
1073
1329
|
}
|
|
1074
1330
|
if (whichProduct.value === 'gons') {
|
|
@@ -1099,8 +1355,12 @@ export default defineComponent({
|
|
|
1099
1355
|
// @ts-ignore
|
|
1100
1356
|
calculatorForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
1101
1357
|
} else if (whichProduct.value === 'pensionannuitynew') {
|
|
1102
|
-
|
|
1103
|
-
|
|
1358
|
+
if (currentPanel.value === 'transferContractCompany') {
|
|
1359
|
+
transferContracts.value[contractIndex.value].transferContractCompany = item;
|
|
1360
|
+
} else {
|
|
1361
|
+
// @ts-ignore
|
|
1362
|
+
pensionForm.value[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
1363
|
+
}
|
|
1104
1364
|
} else {
|
|
1105
1365
|
// @ts-ignore
|
|
1106
1366
|
productConditionsForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
@@ -1330,7 +1590,7 @@ export default defineComponent({
|
|
|
1330
1590
|
const calculatedPremiumDollar = getNumber(event.target.value as string);
|
|
1331
1591
|
if (calculatedPremiumDollar) {
|
|
1332
1592
|
productConditionsForm.insurancePremiumPerMonth = dataStore.getNumberWithSpaces(productConditionsForm.insurancePremiumPerMonth);
|
|
1333
|
-
if (whichProduct.value === 'halykkazyna') {
|
|
1593
|
+
if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
|
|
1334
1594
|
if (typeof dataStore.currencies.usd === 'number') {
|
|
1335
1595
|
productConditionsForm.insurancePremiumPerMonthInDollar = dataStore.getNumberWithSpaces(calculatedPremiumDollar / dataStore.currencies.usd);
|
|
1336
1596
|
} else {
|
|
@@ -1358,7 +1618,7 @@ export default defineComponent({
|
|
|
1358
1618
|
const calculatedSumDollar = getNumber(event.target.value as string);
|
|
1359
1619
|
if (calculatedSumDollar) {
|
|
1360
1620
|
productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(productConditionsForm.requestedSumInsured);
|
|
1361
|
-
if (whichProduct.value === 'halykkazyna') {
|
|
1621
|
+
if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
|
|
1362
1622
|
if (typeof dataStore.currencies.usd === 'number') {
|
|
1363
1623
|
productConditionsForm.requestedSumInsuredInDollar = dataStore.getNumberWithSpaces(calculatedSumDollar / dataStore.currencies.usd);
|
|
1364
1624
|
} else {
|
|
@@ -1369,6 +1629,42 @@ export default defineComponent({
|
|
|
1369
1629
|
}
|
|
1370
1630
|
};
|
|
1371
1631
|
|
|
1632
|
+
const onInputPension = (event: Event, key: keyof PensionCalculation | 'pensionAmount', index?: number) => {
|
|
1633
|
+
if (event.target && 'value' in event.target && event.target.value) {
|
|
1634
|
+
const calcCheck = getNumber(event.target.value as string);
|
|
1635
|
+
if (calcCheck) {
|
|
1636
|
+
if (index !== undefined) {
|
|
1637
|
+
transferContracts.value[index].transferContractAmount = dataStore.getNumberWithSpaces(event.target.value) as string;
|
|
1638
|
+
transferSum.value = transferContracts.value.reduce((accumulator, { transferContractAmount }) => (accumulator += formatSpacedNumber(transferContractAmount)), 0);
|
|
1639
|
+
} else if (key === 'pensionAmount') {
|
|
1640
|
+
pensionForm.value.amount = dataStore.getNumberWithSpaces(event.target.value) ?? '0';
|
|
1641
|
+
} else {
|
|
1642
|
+
pensionForm.value[key] = dataStore.getNumberWithSpaces(event.target.value);
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
} else {
|
|
1646
|
+
if (index !== undefined) {
|
|
1647
|
+
transferContracts.value[index].transferContractAmount = 0;
|
|
1648
|
+
transferSum.value = transferContracts.value.reduce((accumulator, { transferContractAmount }) => (accumulator += formatSpacedNumber(transferContractAmount)), 0);
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
if (key !== 'pensionAmount' && !customPension.value) {
|
|
1652
|
+
if (firstAmount.value) {
|
|
1653
|
+
firstAmount.value = false;
|
|
1654
|
+
return;
|
|
1655
|
+
}
|
|
1656
|
+
pensionForm.value.amount =
|
|
1657
|
+
dataStore.getNumberWithSpaces(
|
|
1658
|
+
formatSpacedNumber(pensionForm.value.compulsoryContractAmount) +
|
|
1659
|
+
formatSpacedNumber(pensionForm.value.compulsoryProfContractAmount) +
|
|
1660
|
+
formatSpacedNumber(pensionForm.value.ownFundsRaisAmount) +
|
|
1661
|
+
formatSpacedNumber(pensionForm.value.transferContractAmount) +
|
|
1662
|
+
formatSpacedNumber(pensionForm.value.voluntaryContractAmount) +
|
|
1663
|
+
sumContractsAmount(transferContracts.value),
|
|
1664
|
+
) ?? '';
|
|
1665
|
+
}
|
|
1666
|
+
};
|
|
1667
|
+
|
|
1372
1668
|
const onInputFixInsSum = (event: Event) => {
|
|
1373
1669
|
if (event.target && 'value' in event.target && event.target.value) {
|
|
1374
1670
|
const calculatedFixInsSum = getNumber(event.target.value as string);
|
|
@@ -1393,6 +1689,16 @@ export default defineComponent({
|
|
|
1393
1689
|
productConditionsForm.requestedSumInsuredInDollar = null;
|
|
1394
1690
|
};
|
|
1395
1691
|
|
|
1692
|
+
const onClearPension = (key: keyof PensionCalculation | 'pensionAmount', index?: number) => {
|
|
1693
|
+
if (index) {
|
|
1694
|
+
transferContracts.value[index].transferContractAmount = 0;
|
|
1695
|
+
} else if (key === 'pensionAmount') {
|
|
1696
|
+
pensionForm.value.amount = '0';
|
|
1697
|
+
} else {
|
|
1698
|
+
pensionForm.value[key] = null;
|
|
1699
|
+
}
|
|
1700
|
+
};
|
|
1701
|
+
|
|
1396
1702
|
const onClearSumDollar = () => {
|
|
1397
1703
|
productConditionsForm.requestedSumInsured = null;
|
|
1398
1704
|
};
|
|
@@ -1424,7 +1730,7 @@ export default defineComponent({
|
|
|
1424
1730
|
};
|
|
1425
1731
|
|
|
1426
1732
|
const filterTermConditions = (term: AddCover) => {
|
|
1427
|
-
if (term.coverTypeCode === 10) {
|
|
1733
|
+
if (term.coverTypeCode === 10 && !props.isCalculator) {
|
|
1428
1734
|
return !!formStore.insuredForm.find((member: Member) => member.iin === formStore.policyholderForm.iin) === false;
|
|
1429
1735
|
}
|
|
1430
1736
|
return true;
|
|
@@ -1437,6 +1743,39 @@ export default defineComponent({
|
|
|
1437
1743
|
return term.coverTypeName;
|
|
1438
1744
|
};
|
|
1439
1745
|
|
|
1746
|
+
const addTransferContract = () => {
|
|
1747
|
+
transferContracts.value.push(new TransferContract());
|
|
1748
|
+
};
|
|
1749
|
+
|
|
1750
|
+
const removeTransferContract = (index: number) => {
|
|
1751
|
+
transferContracts.value.splice(index, 1);
|
|
1752
|
+
transferSum.value = transferContracts.value.reduce((accumulator, { transferContractAmount }) => (accumulator += formatSpacedNumber(transferContractAmount)), 0);
|
|
1753
|
+
};
|
|
1754
|
+
|
|
1755
|
+
const prepareTransferContracts = (transferContracts: Array<TransferContract>) => {
|
|
1756
|
+
const formatedContracts: Array<TransferContract> = [];
|
|
1757
|
+
if (transferContracts && transferContracts.length) {
|
|
1758
|
+
transferContracts.forEach(i => {
|
|
1759
|
+
formatedContracts.push({
|
|
1760
|
+
...i,
|
|
1761
|
+
transferContractDate: constants.regex.isoDate.test(i.transferContractDate) ? i.transferContractDate : formatDate(i.transferContractDate)?.toISOString() ?? '',
|
|
1762
|
+
transferContractFirstPaymentDate: constants.regex.isoDate.test(i.transferContractFirstPaymentDate)
|
|
1763
|
+
? i.transferContractFirstPaymentDate
|
|
1764
|
+
: formatDate(i.transferContractFirstPaymentDate)?.toISOString() ?? '',
|
|
1765
|
+
// @ts-ignore
|
|
1766
|
+
transferContractCompany:
|
|
1767
|
+
typeof i.transferContractCompany !== 'string' && 'nameRu' in i.transferContractCompany ? String(i.transferContractCompany.nameRu) : i.transferContractCompany,
|
|
1768
|
+
transferContractCompanyId:
|
|
1769
|
+
// @ts-ignore
|
|
1770
|
+
typeof i.transferContractCompany !== 'string' && 'ids' in i.transferContractCompany ? i.transferContractCompany.ids : i.transferContractCompanyId,
|
|
1771
|
+
id: i.id ?? null,
|
|
1772
|
+
transferContractAmount: String(i.transferContractAmount).replace(/\s/g, ''),
|
|
1773
|
+
});
|
|
1774
|
+
});
|
|
1775
|
+
}
|
|
1776
|
+
return formatedContracts;
|
|
1777
|
+
};
|
|
1778
|
+
|
|
1440
1779
|
const submitForm = async () => {
|
|
1441
1780
|
vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
1442
1781
|
if (v.valid) {
|
|
@@ -1444,9 +1783,12 @@ export default defineComponent({
|
|
|
1444
1783
|
if (calculatorForm.type.code === 'Single' && calculatorForm.startDate && calculatorForm.endDate) {
|
|
1445
1784
|
const formattedStartDate = formatDate(calculatorForm.startDate);
|
|
1446
1785
|
const formattedEndDate = formatDate(calculatorForm.endDate);
|
|
1447
|
-
if (formattedStartDate && formattedEndDate && formattedStartDate.getTime()
|
|
1786
|
+
if (formattedStartDate && formattedEndDate && formattedStartDate.getTime() >= formattedEndDate.getTime()) {
|
|
1448
1787
|
return dataStore.showToaster('error', dataStore.t('toaster.startMoreEnd'));
|
|
1449
1788
|
}
|
|
1789
|
+
if (calculatorForm.days !== productConditionsForm.getSingleTripDays()) {
|
|
1790
|
+
return dataStore.showToaster('error', dataStore.t('toaster.daysPickAgain'));
|
|
1791
|
+
}
|
|
1450
1792
|
}
|
|
1451
1793
|
if (dataStore.isTask()) {
|
|
1452
1794
|
await dataStore.calculatePrice(route.params.taskId as string);
|
|
@@ -1454,41 +1796,114 @@ export default defineComponent({
|
|
|
1454
1796
|
await dataStore.calculatePrice();
|
|
1455
1797
|
}
|
|
1456
1798
|
} else if (whichProduct.value === 'pensionannuitynew') {
|
|
1457
|
-
if (
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
) {
|
|
1464
|
-
dataStore.showToaster('error', 'Минимальное число дней уплаты ОППВ должно быть больше 60');
|
|
1465
|
-
return;
|
|
1799
|
+
if (contractDate.value && maxDate.value && formatDate(contractDate.value) && formatDate(maxDate.value)) {
|
|
1800
|
+
const invalidDate = (formatDate(contractDate.value) ?? new Date()) > (formatDate(maxDate.value) ?? new Date());
|
|
1801
|
+
if (invalidDate) {
|
|
1802
|
+
dataStore.showToaster('error', 'Дата заключения договора некорректна');
|
|
1803
|
+
return;
|
|
1804
|
+
}
|
|
1466
1805
|
}
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
})
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1806
|
+
if (transferContracts.value && transferContracts.value.length) {
|
|
1807
|
+
transferContracts.value.forEach(i => {
|
|
1808
|
+
if (formatDate(i.transferContractDate) != null && formatDate(transferMaxDate.value)) {
|
|
1809
|
+
const invalidDate = (formatDate(i.transferContractDate) ?? new Date()) > (formatDate(transferMaxDate.value) ?? new Date());
|
|
1810
|
+
if (invalidDate) {
|
|
1811
|
+
dataStore.showToaster('error', 'Дата заключения договора КСЖ некорректна');
|
|
1812
|
+
return;
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
});
|
|
1816
|
+
}
|
|
1817
|
+
if (!pensionForm.value.compulsoryProfContractAmount) pensionForm.value.compulsoryProfMonthCount = null;
|
|
1818
|
+
const pensionData = {
|
|
1819
|
+
...pensionForm.value,
|
|
1820
|
+
...{
|
|
1821
|
+
compulsoryContractAmount: formatSpacedNumber(pensionForm.value.compulsoryContractAmount),
|
|
1822
|
+
voluntaryContractAmount: formatSpacedNumber(pensionForm.value.voluntaryContractAmount),
|
|
1823
|
+
ownFundsRaisAmount: formatSpacedNumber(pensionForm.value.ownFundsRaisAmount),
|
|
1824
|
+
compulsoryProfContractAmount: formatSpacedNumber(pensionForm.value.compulsoryProfContractAmount),
|
|
1825
|
+
transferContractAmount: formatSpacedNumber(pensionForm.value.transferContractAmount),
|
|
1826
|
+
transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
|
|
1827
|
+
},
|
|
1828
|
+
amount: formatSpacedNumber(pensionForm.value.amount),
|
|
1829
|
+
contractDate: formatDate(contractDate.value ?? ''),
|
|
1480
1830
|
};
|
|
1481
|
-
|
|
1831
|
+
const data = isSlavePensionForm.value
|
|
1832
|
+
? {
|
|
1833
|
+
...formStore.pensionApp,
|
|
1834
|
+
transferContracts: prepareTransferContracts(formStore.pensionApp.transferContracts),
|
|
1835
|
+
slave: pensionData,
|
|
1836
|
+
amount: formatSpacedNumber(formStore.pensionApp?.amount),
|
|
1837
|
+
compulsoryContractAmount: formatSpacedNumber(formStore.pensionApp?.compulsoryContractAmount),
|
|
1838
|
+
voluntaryContractAmount: formatSpacedNumber(formStore.pensionApp?.voluntaryContractAmount),
|
|
1839
|
+
ownFundsRaisAmount: formatSpacedNumber(formStore.pensionApp?.ownFundsRaisAmount),
|
|
1840
|
+
compulsoryProfContractAmount: formatSpacedNumber(formStore.pensionApp?.compulsoryProfContractAmount),
|
|
1841
|
+
transferContractAmount: formatSpacedNumber(formStore.pensionApp?.transferContractAmount),
|
|
1842
|
+
transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
|
|
1843
|
+
}
|
|
1844
|
+
: {
|
|
1845
|
+
...pensionData,
|
|
1846
|
+
transferContracts: prepareTransferContracts(transferContracts.value),
|
|
1847
|
+
slave: !!formStore.pensionApp?.slave
|
|
1848
|
+
? {
|
|
1849
|
+
...formStore.pensionApp?.slave,
|
|
1850
|
+
contractDate: pensionData.contractDate,
|
|
1851
|
+
amount: formatSpacedNumber(formStore.pensionApp?.slave?.amount),
|
|
1852
|
+
compulsoryContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.compulsoryContractAmount),
|
|
1853
|
+
voluntaryContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.voluntaryContractAmount),
|
|
1854
|
+
ownFundsRaisAmount: formatSpacedNumber(formStore.pensionApp?.slave?.ownFundsRaisAmount),
|
|
1855
|
+
compulsoryProfContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.compulsoryProfContractAmount),
|
|
1856
|
+
transferContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.transferContractAmount),
|
|
1857
|
+
transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
|
|
1858
|
+
}
|
|
1859
|
+
: null,
|
|
1860
|
+
};
|
|
1861
|
+
if (!!data.slave) {
|
|
1862
|
+
data.slave.transferContracts = prepareTransferContracts(isSlavePensionForm.value ? transferContracts.value : data.slave.transferContracts);
|
|
1863
|
+
const difference = Math.abs(
|
|
1864
|
+
formatSpacedNumber(formStore.pensionApp?.amount) + formatSpacedNumber(formStore.pensionApp?.slave?.amount) - formatSpacedNumber(pensionForm.value.amount),
|
|
1865
|
+
);
|
|
1866
|
+
if (customPension.value) {
|
|
1867
|
+
isSlavePensionForm.value ? (data.slave.amount = formatSpacedNumber(pensionForm.value.amount)) : (data.amount = formatSpacedNumber(pensionForm.value.amount));
|
|
1868
|
+
const customSum = sumPensionData(data) + sumPensionData(data.slave);
|
|
1869
|
+
if (formatSpacedNumber(totalInsPremium.value) !== customSum) {
|
|
1870
|
+
return dataStore.showToaster('error', 'Cтраховая премия не соответсвует общей страховой премии');
|
|
1871
|
+
}
|
|
1872
|
+
if (!isSlavePensionForm.value) {
|
|
1873
|
+
data.slave.amount = difference;
|
|
1874
|
+
} else {
|
|
1875
|
+
data.amount = difference;
|
|
1876
|
+
}
|
|
1877
|
+
} else {
|
|
1878
|
+
const amount = isSlavePensionForm.value ? data.slave.amount : data.amount;
|
|
1879
|
+
if (formatSpacedNumber(pensionForm.value.amount) != amount) {
|
|
1880
|
+
data.slave.amount = sumPensionData(data.slave);
|
|
1881
|
+
data.amount = sumPensionData(data);
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
const isParentValid = validatePensionForm(data, 'Заполните условия первого страхователя');
|
|
1885
|
+
const isSlaveValid = validatePensionForm(data.slave, 'Заполните условия второго страхователя');
|
|
1886
|
+
if (!isParentValid || !isSlaveValid) {
|
|
1887
|
+
return;
|
|
1888
|
+
}
|
|
1889
|
+
await dataStore.setApplication(data, true);
|
|
1890
|
+
customPension.value = false;
|
|
1891
|
+
} else {
|
|
1892
|
+
await dataStore.setApplication(data, true);
|
|
1893
|
+
}
|
|
1894
|
+
await dataStore.getApplicationData(String(route.params.taskId), false, false, false, true);
|
|
1895
|
+
pensionForm.value.payment = formStore.applicationData.pensionApp?.payment ?? 0;
|
|
1896
|
+
dateOfBegin.value = reformatDate(formStore.applicationData.pensionApp.dateOfBegin);
|
|
1482
1897
|
} else {
|
|
1483
1898
|
if (whichSum.value === 'requestedSumInsured') {
|
|
1484
1899
|
productConditionsForm.insurancePremiumPerMonth = null;
|
|
1485
|
-
if (whichProduct.value === 'halykkazyna') {
|
|
1900
|
+
if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
|
|
1486
1901
|
productConditionsForm.insurancePremiumPerMonthInDollar = null;
|
|
1487
1902
|
}
|
|
1488
1903
|
}
|
|
1489
1904
|
if (whichSum.value === 'insurancePremiumPerMonth') {
|
|
1490
1905
|
productConditionsForm.requestedSumInsured = null;
|
|
1491
|
-
if (whichProduct.value === 'halykkazyna') {
|
|
1906
|
+
if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
|
|
1492
1907
|
productConditionsForm.requestedSumInsuredInDollar = null;
|
|
1493
1908
|
}
|
|
1494
1909
|
}
|
|
@@ -1573,7 +1988,6 @@ export default defineComponent({
|
|
|
1573
1988
|
}
|
|
1574
1989
|
}
|
|
1575
1990
|
}
|
|
1576
|
-
|
|
1577
1991
|
isCalculating.value = false;
|
|
1578
1992
|
} else {
|
|
1579
1993
|
const errors = document.querySelector('.v-input--error');
|
|
@@ -1597,11 +2011,34 @@ export default defineComponent({
|
|
|
1597
2011
|
});
|
|
1598
2012
|
};
|
|
1599
2013
|
|
|
2014
|
+
const validatePensionForm = (data: any, text: string) => {
|
|
2015
|
+
if (!data.amount || !data.guaranteedPeriod) {
|
|
2016
|
+
dataStore.showToaster('error', text);
|
|
2017
|
+
return false;
|
|
2018
|
+
}
|
|
2019
|
+
return true;
|
|
2020
|
+
};
|
|
2021
|
+
|
|
2022
|
+
const sumPensionData = (data: any) => {
|
|
2023
|
+
return (
|
|
2024
|
+
formatSpacedNumber(data.ownFundsRaisAmount) +
|
|
2025
|
+
formatSpacedNumber(data.voluntaryContractAmount) +
|
|
2026
|
+
formatSpacedNumber(data.compulsoryContractAmount) +
|
|
2027
|
+
formatSpacedNumber(data.compulsoryProfContractAmount) +
|
|
2028
|
+
sumContractsAmount(data.transferContracts)
|
|
2029
|
+
);
|
|
2030
|
+
};
|
|
2031
|
+
|
|
1600
2032
|
onMounted(async () => {
|
|
2033
|
+
if (hasContragentData.value) await getContragent();
|
|
1601
2034
|
if (props.isCalculator === true) {
|
|
1602
2035
|
if (dataStore.isCalculator) {
|
|
1603
2036
|
clearFields();
|
|
1604
2037
|
}
|
|
2038
|
+
if (whichProduct.value === 'gons') {
|
|
2039
|
+
formStore.isDisabled.productConditionsForm = false;
|
|
2040
|
+
dataStore.setFormsDisabled(false);
|
|
2041
|
+
}
|
|
1605
2042
|
if (whichProduct.value !== 'lifetrip' && whichProduct.value !== 'pensionannuitynew') {
|
|
1606
2043
|
if (
|
|
1607
2044
|
(dataStore.isCalculator || route.params.taskId === '0' || fromIndexPage.value) &&
|
|
@@ -1645,12 +2082,14 @@ export default defineComponent({
|
|
|
1645
2082
|
dataStore.processCode = constants.products[whichProduct.value as keyof typeof constants.products];
|
|
1646
2083
|
await dataStore.getProcessPaymentPeriod();
|
|
1647
2084
|
}
|
|
2085
|
+
if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
|
|
2086
|
+
await dataStore.getCurrencies();
|
|
2087
|
+
}
|
|
1648
2088
|
if (whichProduct.value === 'halykkazyna') {
|
|
1649
2089
|
const kazynaPaymentPeriod = dataStore.processPaymentPeriod.find(i => i.code === 'single');
|
|
1650
2090
|
if (kazynaPaymentPeriod) productConditionsForm.paymentPeriod = kazynaPaymentPeriod;
|
|
1651
|
-
await dataStore.getCurrencies();
|
|
1652
2091
|
}
|
|
1653
|
-
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
2092
|
+
if (!formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1654
2093
|
productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(
|
|
1655
2094
|
formStore.lfb.clients.reduce((sum: number, i: any) => {
|
|
1656
2095
|
return sum + Number(i.insSum);
|
|
@@ -1658,14 +2097,34 @@ export default defineComponent({
|
|
|
1658
2097
|
);
|
|
1659
2098
|
}
|
|
1660
2099
|
if (whichProduct.value === 'pensionannuitynew') {
|
|
1661
|
-
contractDate.value = reformatDate(
|
|
1662
|
-
dateOfBegin.value = reformatDate(
|
|
1663
|
-
transferContractDate.value = reformatDate(
|
|
1664
|
-
transferContractFirstPaymentDate.value = reformatDate(
|
|
2100
|
+
contractDate.value = reformatDate(pensionForm.value.contractDate ?? '');
|
|
2101
|
+
dateOfBegin.value = reformatDate(pensionForm.value.dateOfBegin);
|
|
2102
|
+
transferContractDate.value = reformatDate(pensionForm.value.transferContractDate);
|
|
2103
|
+
transferContractFirstPaymentDate.value = reformatDate(pensionForm.value.transferContractFirstPaymentDate ?? '');
|
|
1665
2104
|
maxDate.value = await dataStore.getVariableData(formStore.applicationData.processCode ?? 19);
|
|
2105
|
+
if (!transferContracts.value.length && pensionForm.value.transferContracts && pensionForm.value.transferContracts.length) {
|
|
2106
|
+
pensionForm.value.transferContracts.forEach((contract: TransferContract) => {
|
|
2107
|
+
transferContracts.value.push({
|
|
2108
|
+
...contract,
|
|
2109
|
+
transferContractDate: constants.regex.isoDate.test(contract.transferContractDate) ? reformatDate(contract.transferContractDate)! : contract.transferContractDate,
|
|
2110
|
+
transferContractFirstPaymentDate: constants.regex.isoDate.test(contract.transferContractFirstPaymentDate)
|
|
2111
|
+
? reformatDate(contract.transferContractFirstPaymentDate)!
|
|
2112
|
+
: contract.transferContractFirstPaymentDate,
|
|
2113
|
+
transferContractCompany:
|
|
2114
|
+
typeof contract.transferContractCompany === 'string' ? ({ nameRu: contract.transferContractCompany } as any) : contract.transferContractCompany,
|
|
2115
|
+
transferContractAmount: dataStore.getNumberWithSpaces(contract.transferContractAmount) ?? '',
|
|
2116
|
+
});
|
|
2117
|
+
});
|
|
2118
|
+
}
|
|
1666
2119
|
}
|
|
1667
2120
|
});
|
|
1668
2121
|
|
|
2122
|
+
watch(
|
|
2123
|
+
() => pensionForm.value?.amount,
|
|
2124
|
+
val => {
|
|
2125
|
+
if (val) pensionForm.value.amount = dataStore.getNumberWithSpaces(val);
|
|
2126
|
+
},
|
|
2127
|
+
);
|
|
1669
2128
|
watch(
|
|
1670
2129
|
() => productConditionsForm.amountOfInsurancePremium,
|
|
1671
2130
|
val => {
|
|
@@ -1696,6 +2155,23 @@ export default defineComponent({
|
|
|
1696
2155
|
{ immediate: true },
|
|
1697
2156
|
);
|
|
1698
2157
|
|
|
2158
|
+
if (hasCurrency.value) {
|
|
2159
|
+
watch(
|
|
2160
|
+
() => productConditionsForm.currency,
|
|
2161
|
+
async val => {
|
|
2162
|
+
if (val.code === 'USD') {
|
|
2163
|
+
if (!dataStore.processPaymentPeriod.length) {
|
|
2164
|
+
await dataStore.getProcessPaymentPeriod();
|
|
2165
|
+
}
|
|
2166
|
+
const paymentPeriod = dataStore.processPaymentPeriod.find(item => item.nameRu === 'единовременно');
|
|
2167
|
+
if (paymentPeriod) {
|
|
2168
|
+
productConditionsForm.paymentPeriod = paymentPeriod;
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
},
|
|
2172
|
+
);
|
|
2173
|
+
}
|
|
2174
|
+
|
|
1699
2175
|
if (hasInsStartDate.value) {
|
|
1700
2176
|
watch(
|
|
1701
2177
|
() => productConditionsForm.calcDate,
|
|
@@ -1729,6 +2205,8 @@ export default defineComponent({
|
|
|
1729
2205
|
async val => {
|
|
1730
2206
|
if (val?.length && val.every(option => option.id != 0) && calculatorForm.type?.nameRu != null) {
|
|
1731
2207
|
await dataStore.getTripInsuredAmount();
|
|
2208
|
+
} else {
|
|
2209
|
+
calculatorForm.amount = new Value();
|
|
1732
2210
|
}
|
|
1733
2211
|
},
|
|
1734
2212
|
{ deep: true },
|
|
@@ -1762,8 +2240,41 @@ export default defineComponent({
|
|
|
1762
2240
|
);
|
|
1763
2241
|
}
|
|
1764
2242
|
|
|
2243
|
+
if (whichProduct.value === 'pensionannuitynew') {
|
|
2244
|
+
watch(
|
|
2245
|
+
() => pensionForm.value.guaranteedPeriod,
|
|
2246
|
+
async () => {
|
|
2247
|
+
if (formStore.applicationData.processCode === 24) {
|
|
2248
|
+
await dataStore.reCalculateRefund(
|
|
2249
|
+
Number(pensionForm.value.parentContractAmount),
|
|
2250
|
+
Number(pensionForm.value.parentContractMainAmount),
|
|
2251
|
+
pensionForm.value.guaranteedPeriod,
|
|
2252
|
+
pensionForm.value.transferContractIsOppv,
|
|
2253
|
+
pensionForm.value.compulsoryProfMonthCount ?? 0,
|
|
2254
|
+
);
|
|
2255
|
+
}
|
|
2256
|
+
},
|
|
2257
|
+
);
|
|
2258
|
+
watch(
|
|
2259
|
+
() => contractDate.value,
|
|
2260
|
+
(val, oldVal) => {
|
|
2261
|
+
if (val !== null && val !== undefined && val.length === 10 && oldVal != undefined && !isSlavePensionForm.value) {
|
|
2262
|
+
const formattedContractDate = formatDate(val);
|
|
2263
|
+
if (formattedContractDate) {
|
|
2264
|
+
const transferMax = formattedContractDate;
|
|
2265
|
+
transferMax.setFullYear(transferMax.getFullYear() - 2);
|
|
2266
|
+
transferMax.setDate(transferMax.getDate() + 1);
|
|
2267
|
+
transferMaxDate.value = reformatDate(String(transferMax));
|
|
2268
|
+
formattedContractDate.setDate(formattedContractDate.getDate() + 20);
|
|
2269
|
+
dateOfBegin.value = reformatDate(String(formattedContractDate));
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
},
|
|
2273
|
+
);
|
|
2274
|
+
}
|
|
2275
|
+
|
|
1765
2276
|
const copyRedirect = async () => {
|
|
1766
|
-
const url = await dataStore.api.getEnpfRedirectUrl(String(
|
|
2277
|
+
const url = await dataStore.api.pensionannuityNew.getEnpfRedirectUrl(String(pensionForm.value.processInstanceId));
|
|
1767
2278
|
dataStore.copyToClipboard(url.redirectUrl);
|
|
1768
2279
|
};
|
|
1769
2280
|
|
|
@@ -1792,20 +2303,34 @@ export default defineComponent({
|
|
|
1792
2303
|
subTermValue,
|
|
1793
2304
|
panelCodeList,
|
|
1794
2305
|
pensionForm,
|
|
2306
|
+
insuredForm,
|
|
1795
2307
|
dateOfBegin,
|
|
1796
2308
|
contractDate,
|
|
1797
2309
|
transferContractDate,
|
|
1798
2310
|
transferContractFirstPaymentDate,
|
|
1799
2311
|
enabled,
|
|
1800
2312
|
maxDate,
|
|
2313
|
+
transferMaxDate,
|
|
1801
2314
|
guaranteedPeriodList,
|
|
1802
2315
|
isEnpfSum,
|
|
2316
|
+
transferContracts,
|
|
2317
|
+
contractsValue,
|
|
2318
|
+
contractIndex,
|
|
2319
|
+
contragentData,
|
|
2320
|
+
customPension,
|
|
1803
2321
|
|
|
1804
2322
|
// Computed
|
|
1805
2323
|
isTask,
|
|
1806
2324
|
isDisabled,
|
|
2325
|
+
pensionPayment,
|
|
2326
|
+
disabilityGroup,
|
|
2327
|
+
totalInsPremium,
|
|
1807
2328
|
isTermsDisabled,
|
|
1808
2329
|
isUnderwriterForm,
|
|
2330
|
+
hasCurrencySymbols,
|
|
2331
|
+
currencyListFiltered,
|
|
2332
|
+
currencySymbolsLabel,
|
|
2333
|
+
isDisabledPaymentPeriod,
|
|
1809
2334
|
insurancePremiumPerMonthRule,
|
|
1810
2335
|
insurancePremiumPerMonthDisabled,
|
|
1811
2336
|
requestedSumInsuredRule,
|
|
@@ -1816,6 +2341,7 @@ export default defineComponent({
|
|
|
1816
2341
|
hasRequestedSumInsuredInDollar,
|
|
1817
2342
|
hasInsurancePremiumPerMonthInDollar,
|
|
1818
2343
|
hasCurrency,
|
|
2344
|
+
hasContragentData,
|
|
1819
2345
|
hasAdbMultiply,
|
|
1820
2346
|
readonlyLifeAdditive,
|
|
1821
2347
|
readonlyDisabilityMultiply,
|
|
@@ -1839,18 +2365,18 @@ export default defineComponent({
|
|
|
1839
2365
|
hasDefault,
|
|
1840
2366
|
isShownAdditionalTerms,
|
|
1841
2367
|
hasCalcSum,
|
|
2368
|
+
isDisabledInsStartDate,
|
|
1842
2369
|
isDisabledAgentCommission,
|
|
1843
2370
|
hasFixInsSum,
|
|
1844
2371
|
isDisabledFixInsSum,
|
|
1845
2372
|
defaultText,
|
|
1846
2373
|
hasDeathInsFromNS,
|
|
1847
|
-
pensionAmount,
|
|
1848
|
-
pensionCalculationParams,
|
|
1849
2374
|
hasDeathInsAnyReason,
|
|
1850
2375
|
fromIndexPage,
|
|
1851
2376
|
hasCoverPeriod,
|
|
1852
2377
|
hasInsStartDate,
|
|
1853
2378
|
hasInsEndDate,
|
|
2379
|
+
isSlavePensionForm,
|
|
1854
2380
|
|
|
1855
2381
|
// Rules
|
|
1856
2382
|
coverPeriodRule,
|
|
@@ -1868,9 +2394,11 @@ export default defineComponent({
|
|
|
1868
2394
|
onInputInsurancePremiumPerMonth,
|
|
1869
2395
|
onInputInsurancePremiumPerMonthInDollar,
|
|
1870
2396
|
onInputSum,
|
|
2397
|
+
onInputPension,
|
|
1871
2398
|
onInputSumDollar,
|
|
1872
2399
|
toStatement,
|
|
1873
2400
|
onClearSum,
|
|
2401
|
+
onClearPension,
|
|
1874
2402
|
onClearSumDollar,
|
|
1875
2403
|
onClearPremium,
|
|
1876
2404
|
onClearPremiumDollar,
|
|
@@ -1882,6 +2410,9 @@ export default defineComponent({
|
|
|
1882
2410
|
pickSubTermValue,
|
|
1883
2411
|
onInputFixInsSum,
|
|
1884
2412
|
copyRedirect,
|
|
2413
|
+
getContragent,
|
|
2414
|
+
addTransferContract,
|
|
2415
|
+
removeTransferContract,
|
|
1885
2416
|
};
|
|
1886
2417
|
},
|
|
1887
2418
|
});
|