hl-core 0.0.10-beta.30 → 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 +41 -0
- 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 +188 -56
- package/components/Pages/MemberForm.vue +104 -116
- package/components/Pages/ProductConditions.vue +454 -102
- package/components/Panel/PanelHandler.vue +63 -44
- package/composables/classes.ts +20 -4
- package/composables/constants.ts +8 -0
- package/composables/index.ts +4 -1
- package/locales/ru.json +12 -6
- package/package.json +1 -1
- package/store/data.store.ts +296 -97
- package/store/member.store.ts +15 -4
- package/store/rules.ts +2 -2
- package/types/enum.ts +1 -0
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
:readonly="isDisabledInsStartDate"
|
|
171
171
|
:clearable="!isDisabledInsStartDate"
|
|
172
172
|
:label="$dataStore.t('labels.insuranceStartDate')"
|
|
173
|
-
:rules="
|
|
173
|
+
:rules="$rules.required"
|
|
174
174
|
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
175
175
|
/>
|
|
176
176
|
<base-form-input
|
|
@@ -312,55 +312,120 @@
|
|
|
312
312
|
</base-form-section>
|
|
313
313
|
<section v-if="whichProduct === 'pensionannuitynew'">
|
|
314
314
|
<base-animation>
|
|
315
|
-
<
|
|
316
|
-
v-if="formStore.applicationData.processCode === 19 && !isDisabled"
|
|
317
|
-
:
|
|
318
|
-
class="
|
|
319
|
-
|
|
320
|
-
|
|
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>
|
|
321
322
|
</base-animation>
|
|
322
|
-
<base-form-section
|
|
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
|
+
>
|
|
323
376
|
<base-form-input
|
|
324
|
-
v-model="
|
|
325
|
-
:maska="$maska.numbers"
|
|
377
|
+
v-model="pensionForm.compulsoryContractAmount"
|
|
326
378
|
:readonly="isDisabled || isEnpfSum"
|
|
327
379
|
:clearable="!isDisabled && !isEnpfSum"
|
|
328
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')"
|
|
329
385
|
/>
|
|
330
386
|
<base-form-input
|
|
331
|
-
v-model="
|
|
332
|
-
:maska="$maska.numbers"
|
|
387
|
+
v-model="pensionForm.compulsoryProfContractAmount"
|
|
333
388
|
:readonly="isDisabled || isEnpfSum"
|
|
334
389
|
:clearable="!isDisabled && !isEnpfSum"
|
|
335
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')"
|
|
336
395
|
/>
|
|
337
396
|
<base-animation>
|
|
338
397
|
<base-form-input
|
|
339
|
-
v-if="
|
|
398
|
+
v-if="pensionForm.compulsoryProfContractAmount && pensionForm.compulsoryProfContractAmount != 0"
|
|
340
399
|
v-model="pensionForm.compulsoryProfMonthCount"
|
|
341
400
|
:maska="$maska.numbers"
|
|
342
|
-
:readonly="isDisabled
|
|
343
|
-
:clearable="!isDisabled
|
|
401
|
+
:readonly="isDisabled"
|
|
402
|
+
:clearable="!isDisabled"
|
|
344
403
|
:label="$dataStore.t('pension.compulsoryProfMonthCount')"
|
|
345
404
|
/>
|
|
346
405
|
</base-animation>
|
|
347
406
|
<base-form-input
|
|
348
|
-
v-model="
|
|
349
|
-
:maska="$maska.numbers"
|
|
407
|
+
v-model="pensionForm.voluntaryContractAmount"
|
|
350
408
|
:readonly="isDisabled"
|
|
351
409
|
:clearable="!isDisabled"
|
|
352
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')"
|
|
353
415
|
/>
|
|
354
416
|
<base-form-input
|
|
355
|
-
v-model="
|
|
356
|
-
:maska="$maska.numbers"
|
|
417
|
+
v-model="pensionForm.ownFundsRaisAmount"
|
|
357
418
|
:readonly="isDisabled"
|
|
358
419
|
:clearable="!isDisabled"
|
|
359
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')"
|
|
360
425
|
/>
|
|
361
426
|
</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" />
|
|
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" />
|
|
364
429
|
<section v-for="(contract, index) in transferContracts" class="py-2">
|
|
365
430
|
<base-panel-input
|
|
366
431
|
v-model="contract.transferContractCompany"
|
|
@@ -374,27 +439,49 @@
|
|
|
374
439
|
"
|
|
375
440
|
@click="contractIndex = index"
|
|
376
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" />
|
|
377
458
|
<base-form-input
|
|
378
|
-
v-model="contract.
|
|
379
|
-
:
|
|
380
|
-
:
|
|
459
|
+
v-model="contract.transferContractRegNumber"
|
|
460
|
+
:label="$dataStore.t('pension.transferRegNumber')"
|
|
461
|
+
:rules="$rules.required"
|
|
381
462
|
:readonly="isDisabled"
|
|
382
463
|
:clearable="!isDisabled"
|
|
383
|
-
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
384
464
|
/>
|
|
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
465
|
<base-form-input
|
|
388
466
|
v-model="contract.transferContractFirstPaymentDate"
|
|
389
467
|
:maska="$maska.date"
|
|
390
468
|
:label="$dataStore.t('pension.transferContractFirstPaymentDate')"
|
|
469
|
+
:rules="$dataStore.rules.required.concat($dataStore.rules.birthDate)"
|
|
391
470
|
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
392
471
|
:readonly="isDisabled"
|
|
393
472
|
:clearable="!isDisabled"
|
|
394
473
|
/>
|
|
395
|
-
<base-form-input
|
|
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
|
+
/>
|
|
396
483
|
<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)" />
|
|
484
|
+
<base-btn v-if="!isDisabled" :text="$dataStore.t('buttons.delete')" :disabled="isDisabled" size="sm" :btn="$styles.whiteBtn" @click="removeTransferContract(index)" />
|
|
398
485
|
</section>
|
|
399
486
|
</base-form-section>
|
|
400
487
|
<base-form-section :title="$dataStore.t('pension.paymentTerms')">
|
|
@@ -402,9 +489,10 @@
|
|
|
402
489
|
v-model="contractDate"
|
|
403
490
|
:maska="$maska.date"
|
|
404
491
|
:rules="!isDisabled ? $rules.required.concat($rules.date) : []"
|
|
405
|
-
:readonly="isDisabled"
|
|
492
|
+
:readonly="isDisabled || formStore.applicationData.processCode === 24 || isSlavePensionForm"
|
|
406
493
|
:clearable="!isDisabled"
|
|
407
494
|
:min-date="new Date()"
|
|
495
|
+
:max-date="formatDate(maxDate ?? '') ?? undefined"
|
|
408
496
|
:label="$dataStore.t('pension.contractDate')"
|
|
409
497
|
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
410
498
|
/>
|
|
@@ -423,8 +511,24 @@
|
|
|
423
511
|
<base-form-input v-model="pensionForm.frequencyPayments" disabled :label="$dataStore.t('pension.frequencyPayments')" />
|
|
424
512
|
<base-form-input v-model="pensionForm.periodPayments" disabled :label="$dataStore.t('pension.paymentPeriod')" />
|
|
425
513
|
<base-form-input v-model="pensionForm.insuranceProgramType" disabled :label="$dataStore.t('pension.insuranceProgramType')" />
|
|
426
|
-
<base-form-input
|
|
427
|
-
|
|
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')" />
|
|
428
532
|
</base-form-section>
|
|
429
533
|
</section>
|
|
430
534
|
<base-form-section v-if="hasAnnuityPayments" :title="$dataStore.t('calculationAnnuityPayments')">
|
|
@@ -651,7 +755,7 @@
|
|
|
651
755
|
<base-animation>
|
|
652
756
|
<base-btn
|
|
653
757
|
v-if="!isDisabled && $dataStore.isPension && isTask"
|
|
654
|
-
:text="$dataStore.t('buttons.
|
|
758
|
+
:text="$dataStore.t('buttons.calculate')"
|
|
655
759
|
:loading="$dataStore.isLoading"
|
|
656
760
|
class="min-h-[60px]"
|
|
657
761
|
type="submit"
|
|
@@ -747,6 +851,15 @@
|
|
|
747
851
|
import { Member, Value, CountryValue, CalculatorForm, TransferContract } from '../../composables/classes';
|
|
748
852
|
import type { Projects, AddCover, AddCoverAnswer } from '../../types';
|
|
749
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
|
+
};
|
|
862
|
+
|
|
750
863
|
export default defineComponent({
|
|
751
864
|
props: {
|
|
752
865
|
isCalculator: {
|
|
@@ -786,14 +899,29 @@ export default defineComponent({
|
|
|
786
899
|
|
|
787
900
|
const additionalTerms = ref<AddCover[]>([]);
|
|
788
901
|
|
|
789
|
-
const maxDate = ref();
|
|
902
|
+
const maxDate = ref<string | null>();
|
|
903
|
+
const transferMaxDate = ref();
|
|
790
904
|
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
|
|
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;
|
|
797
925
|
|
|
798
926
|
const transferContracts = ref<TransferContract[]>([]);
|
|
799
927
|
const contractsValue = ref<Value[]>([]);
|
|
@@ -803,6 +931,11 @@ export default defineComponent({
|
|
|
803
931
|
const multiplePanelList = ref<CountryValue[]>([]);
|
|
804
932
|
const calculatorForm = productConditionsForm.calculatorForm;
|
|
805
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
|
+
|
|
806
939
|
const isShownAdditionalTerms = computed(() => {
|
|
807
940
|
if (whichProduct.value === 'gons') {
|
|
808
941
|
return false;
|
|
@@ -1137,6 +1270,12 @@ export default defineComponent({
|
|
|
1137
1270
|
}
|
|
1138
1271
|
return false;
|
|
1139
1272
|
});
|
|
1273
|
+
const hasContragentData = computed(() => {
|
|
1274
|
+
if (whichProduct.value === 'pensionannuitynew') {
|
|
1275
|
+
return true;
|
|
1276
|
+
}
|
|
1277
|
+
return false;
|
|
1278
|
+
});
|
|
1140
1279
|
const isDisabledPaymentPeriod = computed(() => {
|
|
1141
1280
|
if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
|
|
1142
1281
|
return true;
|
|
@@ -1150,28 +1289,29 @@ export default defineComponent({
|
|
|
1150
1289
|
return constants.currencyList;
|
|
1151
1290
|
});
|
|
1152
1291
|
|
|
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,
|
|
1292
|
+
const totalInsPremium = computed(() =>
|
|
1293
|
+
dataStore.getNumberWithSpaces(formatSpacedNumber(formStore.pensionApp?.amount) + formatSpacedNumber(formStore.pensionApp.slave?.amount)),
|
|
1174
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
|
+
};
|
|
1175
1315
|
|
|
1176
1316
|
const formatTermValue = (term: number) => {
|
|
1177
1317
|
if (term !== null) {
|
|
@@ -1219,7 +1359,7 @@ export default defineComponent({
|
|
|
1219
1359
|
transferContracts.value[contractIndex.value].transferContractCompany = item;
|
|
1220
1360
|
} else {
|
|
1221
1361
|
// @ts-ignore
|
|
1222
|
-
pensionForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
1362
|
+
pensionForm.value[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
1223
1363
|
}
|
|
1224
1364
|
} else {
|
|
1225
1365
|
// @ts-ignore
|
|
@@ -1489,6 +1629,42 @@ export default defineComponent({
|
|
|
1489
1629
|
}
|
|
1490
1630
|
};
|
|
1491
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
|
+
|
|
1492
1668
|
const onInputFixInsSum = (event: Event) => {
|
|
1493
1669
|
if (event.target && 'value' in event.target && event.target.value) {
|
|
1494
1670
|
const calculatedFixInsSum = getNumber(event.target.value as string);
|
|
@@ -1513,6 +1689,16 @@ export default defineComponent({
|
|
|
1513
1689
|
productConditionsForm.requestedSumInsuredInDollar = null;
|
|
1514
1690
|
};
|
|
1515
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
|
+
|
|
1516
1702
|
const onClearSumDollar = () => {
|
|
1517
1703
|
productConditionsForm.requestedSumInsured = null;
|
|
1518
1704
|
};
|
|
@@ -1563,6 +1749,31 @@ export default defineComponent({
|
|
|
1563
1749
|
|
|
1564
1750
|
const removeTransferContract = (index: number) => {
|
|
1565
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;
|
|
1566
1777
|
};
|
|
1567
1778
|
|
|
1568
1779
|
const submitForm = async () => {
|
|
@@ -1585,36 +1796,104 @@ export default defineComponent({
|
|
|
1585
1796
|
await dataStore.calculatePrice();
|
|
1586
1797
|
}
|
|
1587
1798
|
} else if (whichProduct.value === 'pensionannuitynew') {
|
|
1588
|
-
|
|
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
|
+
}
|
|
1805
|
+
}
|
|
1589
1806
|
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
|
-
});
|
|
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
|
+
}
|
|
1602
1815
|
});
|
|
1603
1816
|
}
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
...
|
|
1607
|
-
|
|
1608
|
-
compulsoryContractAmount:
|
|
1609
|
-
voluntaryContractAmount:
|
|
1610
|
-
ownFundsRaisAmount:
|
|
1611
|
-
compulsoryProfContractAmount:
|
|
1612
|
-
transferContractAmount:
|
|
1613
|
-
transferContractCompany: pensionForm?.transferContractCompany?.nameRu ?? '',
|
|
1614
|
-
}
|
|
1615
|
-
|
|
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 ?? ''),
|
|
1616
1830
|
};
|
|
1617
|
-
|
|
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);
|
|
1618
1897
|
} else {
|
|
1619
1898
|
if (whichSum.value === 'requestedSumInsured') {
|
|
1620
1899
|
productConditionsForm.insurancePremiumPerMonth = null;
|
|
@@ -1709,7 +1988,6 @@ export default defineComponent({
|
|
|
1709
1988
|
}
|
|
1710
1989
|
}
|
|
1711
1990
|
}
|
|
1712
|
-
|
|
1713
1991
|
isCalculating.value = false;
|
|
1714
1992
|
} else {
|
|
1715
1993
|
const errors = document.querySelector('.v-input--error');
|
|
@@ -1733,7 +2011,26 @@ export default defineComponent({
|
|
|
1733
2011
|
});
|
|
1734
2012
|
};
|
|
1735
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
|
+
|
|
1736
2032
|
onMounted(async () => {
|
|
2033
|
+
if (hasContragentData.value) await getContragent();
|
|
1737
2034
|
if (props.isCalculator === true) {
|
|
1738
2035
|
if (dataStore.isCalculator) {
|
|
1739
2036
|
clearFields();
|
|
@@ -1800,22 +2097,34 @@ export default defineComponent({
|
|
|
1800
2097
|
);
|
|
1801
2098
|
}
|
|
1802
2099
|
if (whichProduct.value === 'pensionannuitynew') {
|
|
1803
|
-
contractDate.value = reformatDate(
|
|
1804
|
-
dateOfBegin.value = reformatDate(
|
|
1805
|
-
transferContractDate.value = reformatDate(
|
|
1806
|
-
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 ?? '');
|
|
1807
2104
|
maxDate.value = await dataStore.getVariableData(formStore.applicationData.processCode ?? 19);
|
|
1808
|
-
if (transferContracts.value && transferContracts.value.length) {
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
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
|
+
});
|
|
1814
2117
|
});
|
|
1815
2118
|
}
|
|
1816
2119
|
}
|
|
1817
2120
|
});
|
|
1818
2121
|
|
|
2122
|
+
watch(
|
|
2123
|
+
() => pensionForm.value?.amount,
|
|
2124
|
+
val => {
|
|
2125
|
+
if (val) pensionForm.value.amount = dataStore.getNumberWithSpaces(val);
|
|
2126
|
+
},
|
|
2127
|
+
);
|
|
1819
2128
|
watch(
|
|
1820
2129
|
() => productConditionsForm.amountOfInsurancePremium,
|
|
1821
2130
|
val => {
|
|
@@ -1931,8 +2240,41 @@ export default defineComponent({
|
|
|
1931
2240
|
);
|
|
1932
2241
|
}
|
|
1933
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
|
+
|
|
1934
2276
|
const copyRedirect = async () => {
|
|
1935
|
-
const url = await dataStore.api.pensionannuityNew.getEnpfRedirectUrl(String(
|
|
2277
|
+
const url = await dataStore.api.pensionannuityNew.getEnpfRedirectUrl(String(pensionForm.value.processInstanceId));
|
|
1936
2278
|
dataStore.copyToClipboard(url.redirectUrl);
|
|
1937
2279
|
};
|
|
1938
2280
|
|
|
@@ -1961,21 +2303,28 @@ export default defineComponent({
|
|
|
1961
2303
|
subTermValue,
|
|
1962
2304
|
panelCodeList,
|
|
1963
2305
|
pensionForm,
|
|
2306
|
+
insuredForm,
|
|
1964
2307
|
dateOfBegin,
|
|
1965
2308
|
contractDate,
|
|
1966
2309
|
transferContractDate,
|
|
1967
2310
|
transferContractFirstPaymentDate,
|
|
1968
2311
|
enabled,
|
|
1969
2312
|
maxDate,
|
|
2313
|
+
transferMaxDate,
|
|
1970
2314
|
guaranteedPeriodList,
|
|
1971
2315
|
isEnpfSum,
|
|
1972
2316
|
transferContracts,
|
|
1973
2317
|
contractsValue,
|
|
1974
2318
|
contractIndex,
|
|
2319
|
+
contragentData,
|
|
2320
|
+
customPension,
|
|
1975
2321
|
|
|
1976
2322
|
// Computed
|
|
1977
2323
|
isTask,
|
|
1978
2324
|
isDisabled,
|
|
2325
|
+
pensionPayment,
|
|
2326
|
+
disabilityGroup,
|
|
2327
|
+
totalInsPremium,
|
|
1979
2328
|
isTermsDisabled,
|
|
1980
2329
|
isUnderwriterForm,
|
|
1981
2330
|
hasCurrencySymbols,
|
|
@@ -1992,6 +2341,7 @@ export default defineComponent({
|
|
|
1992
2341
|
hasRequestedSumInsuredInDollar,
|
|
1993
2342
|
hasInsurancePremiumPerMonthInDollar,
|
|
1994
2343
|
hasCurrency,
|
|
2344
|
+
hasContragentData,
|
|
1995
2345
|
hasAdbMultiply,
|
|
1996
2346
|
readonlyLifeAdditive,
|
|
1997
2347
|
readonlyDisabilityMultiply,
|
|
@@ -2021,13 +2371,12 @@ export default defineComponent({
|
|
|
2021
2371
|
isDisabledFixInsSum,
|
|
2022
2372
|
defaultText,
|
|
2023
2373
|
hasDeathInsFromNS,
|
|
2024
|
-
pensionAmount,
|
|
2025
|
-
pensionCalculationParams,
|
|
2026
2374
|
hasDeathInsAnyReason,
|
|
2027
2375
|
fromIndexPage,
|
|
2028
2376
|
hasCoverPeriod,
|
|
2029
2377
|
hasInsStartDate,
|
|
2030
2378
|
hasInsEndDate,
|
|
2379
|
+
isSlavePensionForm,
|
|
2031
2380
|
|
|
2032
2381
|
// Rules
|
|
2033
2382
|
coverPeriodRule,
|
|
@@ -2045,9 +2394,11 @@ export default defineComponent({
|
|
|
2045
2394
|
onInputInsurancePremiumPerMonth,
|
|
2046
2395
|
onInputInsurancePremiumPerMonthInDollar,
|
|
2047
2396
|
onInputSum,
|
|
2397
|
+
onInputPension,
|
|
2048
2398
|
onInputSumDollar,
|
|
2049
2399
|
toStatement,
|
|
2050
2400
|
onClearSum,
|
|
2401
|
+
onClearPension,
|
|
2051
2402
|
onClearSumDollar,
|
|
2052
2403
|
onClearPremium,
|
|
2053
2404
|
onClearPremiumDollar,
|
|
@@ -2059,6 +2410,7 @@ export default defineComponent({
|
|
|
2059
2410
|
pickSubTermValue,
|
|
2060
2411
|
onInputFixInsSum,
|
|
2061
2412
|
copyRedirect,
|
|
2413
|
+
getContragent,
|
|
2062
2414
|
addTransferContract,
|
|
2063
2415
|
removeTransferContract,
|
|
2064
2416
|
};
|