hl-core 0.0.8-beta.2 → 0.0.8-beta.20
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/api/index.ts +42 -14
- package/api/interceptors.ts +1 -1
- package/components/Dialog/Dialog.vue +6 -3
- package/components/Form/FormBlock.vue +63 -28
- package/components/Form/FormSection.vue +4 -1
- package/components/Form/ManagerAttachment.vue +196 -0
- package/components/Form/ProductConditionsBlock.vue +64 -12
- package/components/Input/FormInput.vue +12 -3
- package/components/Input/PanelInput.vue +5 -0
- package/components/Layout/Drawer.vue +1 -0
- package/components/Layout/Header.vue +40 -4
- package/components/Layout/SettingsPanel.vue +35 -8
- package/components/Menu/MenuHover.vue +30 -0
- package/components/Menu/MenuNav.vue +27 -10
- package/components/Pages/Anketa.vue +8 -4
- package/components/Pages/Auth.vue +147 -30
- package/components/Pages/InvoiceInfo.vue +30 -0
- package/components/Pages/MemberForm.vue +274 -79
- package/components/Pages/ProductConditions.vue +291 -7
- package/components/Panel/PanelHandler.vue +74 -1
- package/components/Utilities/JsonViewer.vue +27 -0
- package/composables/classes.ts +126 -23
- package/composables/constants.ts +11 -1
- package/composables/styles.ts +9 -3
- package/configs/i18n.ts +19 -0
- package/layouts/default.vue +2 -2
- package/locales/en.json +558 -0
- package/locales/kz.json +558 -0
- package/locales/ru.json +558 -0
- package/nuxt.config.ts +8 -0
- package/package.json +7 -2
- package/pages/500.vue +1 -1
- package/pages/Token.vue +51 -0
- package/plugins/helperFunctionsPlugins.ts +2 -0
- package/plugins/storePlugin.ts +0 -1
- package/plugins/vuetifyPlugin.ts +5 -0
- package/store/data.store.js +472 -530
- package/store/member.store.ts +120 -15
- package/store/rules.js +27 -3
- package/types/index.ts +34 -0
- package/store/messages.ts +0 -434
|
@@ -19,20 +19,10 @@
|
|
|
19
19
|
:readonly="isDisabled || isIinPhoneDisabled"
|
|
20
20
|
:clearable="!isDisabled"
|
|
21
21
|
:append-inner-icon="otpCondition ? 'mdi mdi-phone-message' : ''"
|
|
22
|
-
@append="
|
|
23
|
-
@keyup.enter.prevent="otpCondition ?
|
|
22
|
+
@append="openCustomPanel('otp')"
|
|
23
|
+
@keyup.enter.prevent="otpCondition ? openCustomPanel('otp') : null"
|
|
24
24
|
:rules="phoneRule"
|
|
25
25
|
></base-form-input>
|
|
26
|
-
<base-fade-transition>
|
|
27
|
-
<base-form-input
|
|
28
|
-
v-if="otpCondition && member.otpTokenId"
|
|
29
|
-
v-model="member.otpCode"
|
|
30
|
-
:label="$t('form.otpCode')"
|
|
31
|
-
:maska="$maska.otp"
|
|
32
|
-
:append-inner-icon="hasOtp ? 'mdi mdi-check' : ''"
|
|
33
|
-
@keyup.enter.prevent="hasOtp ? checkOtp() : null"
|
|
34
|
-
></base-form-input>
|
|
35
|
-
</base-fade-transition>
|
|
36
26
|
<base-form-input
|
|
37
27
|
v-model="member.lastName"
|
|
38
28
|
:readonly="isDisabled || isFromGBD"
|
|
@@ -59,7 +49,7 @@
|
|
|
59
49
|
:readonly="isDisabled || isFromGBD"
|
|
60
50
|
:clearable="!isDisabled"
|
|
61
51
|
:label="$t('form.birthDate')"
|
|
62
|
-
:rules="
|
|
52
|
+
:rules="birthDateRule"
|
|
63
53
|
:maska="$maska.date"
|
|
64
54
|
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
65
55
|
></base-form-input>
|
|
@@ -221,6 +211,13 @@
|
|
|
221
211
|
<base-form-input v-model="member.jobPlace" :label="$t('form.jobPlace')" :readonly="isDisabled" :clearable="!isDisabled" :rules="$rules.required"></base-form-input>
|
|
222
212
|
</base-form-section>
|
|
223
213
|
<base-form-section :title="$t('form.placeRegistration')" v-if="$dataStore.hasPlaceSection(whichForm)">
|
|
214
|
+
<base-form-toggle
|
|
215
|
+
v-if="whichForm === formStore.beneficiaryFormKey"
|
|
216
|
+
v-model="sameAddress"
|
|
217
|
+
:disabled="isDisabled"
|
|
218
|
+
:has-border="false"
|
|
219
|
+
:title="$t('form.sameAddress')"
|
|
220
|
+
></base-form-toggle>
|
|
224
221
|
<base-panel-input
|
|
225
222
|
v-model="member.registrationCountry"
|
|
226
223
|
:value="member.registrationCountry.nameRu"
|
|
@@ -480,6 +477,23 @@
|
|
|
480
477
|
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="getFile('download')"></base-btn>
|
|
481
478
|
</div>
|
|
482
479
|
</Teleport>
|
|
480
|
+
<Teleport v-if="isOtpPanelOpen && !member.hasAgreement" to="#panel-actions">
|
|
481
|
+
<div :class="[$libStyles.flexColNav]">
|
|
482
|
+
<base-fade-transition>
|
|
483
|
+
<base-rounded-input
|
|
484
|
+
v-if="otpCondition && member.otpTokenId"
|
|
485
|
+
v-model="member.otpCode"
|
|
486
|
+
:label="$t('form.otpCode')"
|
|
487
|
+
:maska="$maska.otp"
|
|
488
|
+
:append-inner-icon="hasOtp ? 'mdi-cellphone-message text-[17px]' : ''"
|
|
489
|
+
hide-details
|
|
490
|
+
@keyup.enter.prevent="hasOtp ? checkOtp() : null"
|
|
491
|
+
></base-rounded-input>
|
|
492
|
+
</base-fade-transition>
|
|
493
|
+
<base-btn v-if="!member.otpTokenId" :disabled="otpSending" :loading="otpSending" :text="$t('buttons.sendOtp')" @click="sendOtp(false)"></base-btn>
|
|
494
|
+
<base-btn v-if="member.otpTokenId" :disabled="otpSending" :loading="otpSending" :text="$t('buttons.check')" @click="checkOtp()"></base-btn>
|
|
495
|
+
</div>
|
|
496
|
+
</Teleport>
|
|
483
497
|
<base-dialog v-model="familyDialog" :title="$t('dialog.familyMember')" actions="familyDialog">
|
|
484
498
|
<template #actions>
|
|
485
499
|
<base-family-dialog :selected="selectedFamilyMember" @selectFamilyMember="selectFamilyMember" @reset="closeFamilyDialog(true)"></base-family-dialog>
|
|
@@ -511,10 +525,13 @@ export default {
|
|
|
511
525
|
const isButtonLoading = ref<boolean>(false);
|
|
512
526
|
const isSubmittingForm = ref<boolean>(false);
|
|
513
527
|
const documentLoading = ref<boolean>(false);
|
|
528
|
+
const otpSending = ref<boolean>(false);
|
|
514
529
|
const isSearchOpen = ref<boolean>(false);
|
|
515
530
|
const isDocumentOpen = ref<boolean>(false);
|
|
531
|
+
const isOtpPanelOpen = ref<boolean>(false);
|
|
516
532
|
const isPanelLoading = ref<boolean>(false);
|
|
517
533
|
const familyDialog = ref<boolean>(false);
|
|
534
|
+
const sameAddress = ref<boolean>(false);
|
|
518
535
|
const panelValue = ref<Value>(new Value());
|
|
519
536
|
const panelList = ref<Value[]>([]);
|
|
520
537
|
const currentPanel = ref<keyof typeof member.value>();
|
|
@@ -546,14 +563,39 @@ export default {
|
|
|
546
563
|
return generalCondition && perMemberCondtion();
|
|
547
564
|
});
|
|
548
565
|
|
|
549
|
-
const hasGBDFL = computed(() =>
|
|
566
|
+
const hasGBDFL = computed(() => {
|
|
567
|
+
const perMemberCondition = () => {
|
|
568
|
+
switch (whichForm.value) {
|
|
569
|
+
case formStore.beneficiaryFormKey: {
|
|
570
|
+
if (dataStore.isKazyna || dataStore.isLiferenta) {
|
|
571
|
+
return !!member.value.iin;
|
|
572
|
+
}
|
|
573
|
+
if (dataStore.isBolashak || dataStore.isGons) {
|
|
574
|
+
return false;
|
|
575
|
+
}
|
|
576
|
+
return true;
|
|
577
|
+
}
|
|
578
|
+
case formStore.insuredFormKey:
|
|
579
|
+
case formStore.beneficiaryFormKey:
|
|
580
|
+
case formStore.beneficialOwnerFormKey:
|
|
581
|
+
case formStore.policyholdersRepresentativeFormKey:
|
|
582
|
+
return true;
|
|
583
|
+
default:
|
|
584
|
+
return true;
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
return dataStore.controls.hasGBDFL && perMemberCondition();
|
|
588
|
+
});
|
|
550
589
|
const hasInsis = computed(() => dataStore.controls.hasInsis);
|
|
551
590
|
const hasGKB = computed(() => {
|
|
552
|
-
const byProductCondition = dataStore.isGons || dataStore.isBolashak;
|
|
553
591
|
const perMemberCondition = () => {
|
|
554
592
|
switch (whichForm.value) {
|
|
555
|
-
case formStore.beneficiaryFormKey:
|
|
593
|
+
case formStore.beneficiaryFormKey: {
|
|
594
|
+
if (dataStore.isKazyna || dataStore.isLiferenta) {
|
|
595
|
+
return !member.value.iin;
|
|
596
|
+
}
|
|
556
597
|
return member.value.id === 0;
|
|
598
|
+
}
|
|
557
599
|
case formStore.policyholderFormKey:
|
|
558
600
|
case formStore.insuredFormKey:
|
|
559
601
|
case formStore.beneficialOwnerFormKey:
|
|
@@ -563,56 +605,67 @@ export default {
|
|
|
563
605
|
return false;
|
|
564
606
|
}
|
|
565
607
|
};
|
|
566
|
-
return dataStore.controls.hasGKB && !!dataStore.isTask() &&
|
|
608
|
+
return dataStore.controls.hasGKB && !!dataStore.isTask() && perMemberCondition();
|
|
567
609
|
});
|
|
568
610
|
|
|
611
|
+
const birthDateRule = computed(() => {
|
|
612
|
+
const baseDateRule = dataStore.rules.required.concat(dataStore.rules.birthDate);
|
|
613
|
+
const byMemverAndProductRule = () => {
|
|
614
|
+
if (whichForm.value === formStore.policyholderFormKey) {
|
|
615
|
+
if (dataStore.isGons || dataStore.isBolashak || dataStore.isBaiterek) {
|
|
616
|
+
return dataStore.rules.age18ByDate;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
if (whichForm.value === formStore.insuredFormKey) {
|
|
620
|
+
if (dataStore.isBolashak || dataStore.isBaiterek) {
|
|
621
|
+
return dataStore.rules.age18ByDate;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
return [];
|
|
625
|
+
};
|
|
626
|
+
return baseDateRule.concat(byMemverAndProductRule());
|
|
627
|
+
});
|
|
569
628
|
const ageRule = computed(() => {
|
|
570
|
-
const baseAgeRule = dataStore.rules.
|
|
629
|
+
const baseAgeRule = dataStore.rules.numbers;
|
|
571
630
|
const byMemberAndProductRule = () => {
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
return dataStore.rules.policyholderAgeLimit;
|
|
576
|
-
}
|
|
631
|
+
if (whichForm.value === formStore.policyholderFormKey) {
|
|
632
|
+
if (dataStore.isGons || dataStore.isBolashak || dataStore.isBaiterek) {
|
|
633
|
+
return dataStore.rules.age18;
|
|
577
634
|
}
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
635
|
+
}
|
|
636
|
+
if (whichForm.value === formStore.beneficiaryFormKey) {
|
|
637
|
+
if (dataStore.isBolashak) {
|
|
638
|
+
return dataStore.rules.beneficiaryAgeLimit;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
if (whichForm.value === formStore.insuredFormKey) {
|
|
642
|
+
if (dataStore.isBaiterek || dataStore.isBolashak) {
|
|
643
|
+
return dataStore.rules.age18;
|
|
582
644
|
}
|
|
583
|
-
default:
|
|
584
|
-
return [];
|
|
585
645
|
}
|
|
646
|
+
return [];
|
|
586
647
|
};
|
|
587
648
|
return baseAgeRule.concat(byMemberAndProductRule());
|
|
588
649
|
});
|
|
589
650
|
|
|
590
651
|
const phoneRule = computed(() => {
|
|
591
652
|
const basePhoneRule = dataStore.rules.required.concat(dataStore.rules.phoneFormat);
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
if (dataStore.isGons || dataStore.isBolashak) {
|
|
596
|
-
return [];
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
default:
|
|
600
|
-
return basePhoneRule;
|
|
653
|
+
if (whichForm.value === formStore.beneficiaryFormKey) {
|
|
654
|
+
if (dataStore.isGons || dataStore.isBolashak) {
|
|
655
|
+
return [];
|
|
601
656
|
}
|
|
602
|
-
}
|
|
603
|
-
return
|
|
657
|
+
}
|
|
658
|
+
return basePhoneRule;
|
|
604
659
|
});
|
|
605
660
|
|
|
606
661
|
const residencyRule = computed(() => {
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
}
|
|
662
|
+
const baseResidencyRule = dataStore.rules.objectRequired;
|
|
663
|
+
if (whichForm.value === formStore.policyholderFormKey) {
|
|
664
|
+
if (dataStore.isBolashak || dataStore.isBaiterek) {
|
|
665
|
+
return baseResidencyRule.concat(dataStore.rules.noResident);
|
|
612
666
|
}
|
|
613
|
-
default:
|
|
614
|
-
return dataStore.rules.objectRequired;
|
|
615
667
|
}
|
|
668
|
+
return baseResidencyRule;
|
|
616
669
|
});
|
|
617
670
|
|
|
618
671
|
const getOtpConditionByMember = () => {
|
|
@@ -640,6 +693,7 @@ export default {
|
|
|
640
693
|
dataStore.panel.open = true;
|
|
641
694
|
isSearchOpen.value = true;
|
|
642
695
|
isDocumentOpen.value = false;
|
|
696
|
+
isOtpPanelOpen.value = false;
|
|
643
697
|
isPanelOpen.value = false;
|
|
644
698
|
} else {
|
|
645
699
|
dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
|
|
@@ -650,13 +704,21 @@ export default {
|
|
|
650
704
|
vForm.value.scrollTo({ top: direction === 'up' ? 0 : screen.height * 10, behavior: 'smooth' });
|
|
651
705
|
};
|
|
652
706
|
|
|
653
|
-
const openCustomPanel = (type: 'document' = 'document') => {
|
|
707
|
+
const openCustomPanel = (type: 'document' | 'otp' = 'document') => {
|
|
654
708
|
dataStore.panelAction = null;
|
|
655
709
|
if (type === 'document' && memberDocument.value) {
|
|
656
710
|
dataStore.panel.title = memberDocument.value.fileTypeName!;
|
|
657
711
|
isDocumentOpen.value = true;
|
|
658
712
|
isSearchOpen.value = false;
|
|
659
713
|
isPanelOpen.value = false;
|
|
714
|
+
isOtpPanelOpen.value = false;
|
|
715
|
+
}
|
|
716
|
+
if (type === 'otp') {
|
|
717
|
+
dataStore.panel.title = dataStore.t('form.otpCode');
|
|
718
|
+
isOtpPanelOpen.value = true;
|
|
719
|
+
isDocumentOpen.value = false;
|
|
720
|
+
isSearchOpen.value = false;
|
|
721
|
+
isPanelOpen.value = false;
|
|
660
722
|
}
|
|
661
723
|
dataStore.panel.open = true;
|
|
662
724
|
};
|
|
@@ -665,6 +727,7 @@ export default {
|
|
|
665
727
|
if (!isDisabled.value) {
|
|
666
728
|
isSearchOpen.value = false;
|
|
667
729
|
isDocumentOpen.value = false;
|
|
730
|
+
isOtpPanelOpen.value = false;
|
|
668
731
|
// Feature
|
|
669
732
|
// const notAllowedToChange = ['gender', 'documentType', 'documentIssuers'];
|
|
670
733
|
// if (member.value.gotFromInsis === false && notAllowedToChange.includes(key)) {
|
|
@@ -683,7 +746,7 @@ export default {
|
|
|
683
746
|
isPanelLoading.value = true;
|
|
684
747
|
newList = await asyncFunction(filterKey, member.value);
|
|
685
748
|
}
|
|
686
|
-
panelList.value = newList;
|
|
749
|
+
panelList.value = filterList(newList, key);
|
|
687
750
|
panelValue.value = member.value[currentPanel.value];
|
|
688
751
|
isPanelLoading.value = false;
|
|
689
752
|
} else {
|
|
@@ -691,6 +754,22 @@ export default {
|
|
|
691
754
|
}
|
|
692
755
|
};
|
|
693
756
|
|
|
757
|
+
const filterList = (list: Value[], key: string) => {
|
|
758
|
+
if (dataStore.isBolashak) {
|
|
759
|
+
if (key === 'relationDegree') {
|
|
760
|
+
if (whichForm.value === formStore.beneficiaryFormKey) {
|
|
761
|
+
const beneficiaryRelations = [12, 13, 14, 15, 20, 21, 22, 23];
|
|
762
|
+
return list.filter(i => beneficiaryRelations.includes(Number(i.ids)));
|
|
763
|
+
}
|
|
764
|
+
if (whichForm.value === formStore.insuredFormKey) {
|
|
765
|
+
const insuredRelations = [6, 7, 10, 11, 12, 13, 14, 15, 20, 21, 22, 23];
|
|
766
|
+
return list.filter(i => insuredRelations.includes(Number(i.ids)));
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
return list;
|
|
771
|
+
};
|
|
772
|
+
|
|
694
773
|
const pickPanelValue = (item: Value) => {
|
|
695
774
|
if (formStore.isDisabled[whichForm.value as keyof typeof formStore.isDisabled] === false) {
|
|
696
775
|
dataStore.panel.open = false;
|
|
@@ -702,6 +781,55 @@ export default {
|
|
|
702
781
|
}
|
|
703
782
|
};
|
|
704
783
|
|
|
784
|
+
const setAddress = () => {
|
|
785
|
+
const beneficiary = formStore.beneficiaryForm[Number(whichIndex.value)];
|
|
786
|
+
const policyholder = formStore.policyholderForm;
|
|
787
|
+
if (sameAddress.value === true) {
|
|
788
|
+
beneficiary.registrationCity = policyholder.registrationCity;
|
|
789
|
+
beneficiary.registrationCountry = policyholder.registrationCountry;
|
|
790
|
+
beneficiary.birthPlace = policyholder.birthPlace;
|
|
791
|
+
beneficiary.registrationMicroDistrict = policyholder.registrationMicroDistrict;
|
|
792
|
+
beneficiary.registrationNumberApartment = policyholder.registrationNumberApartment;
|
|
793
|
+
beneficiary.registrationNumberApartment = policyholder.registrationNumberApartment;
|
|
794
|
+
beneficiary.registrationNumberHouse = policyholder.registrationNumberHouse;
|
|
795
|
+
beneficiary.registrationProvince = policyholder.registrationProvince;
|
|
796
|
+
beneficiary.registrationQuarter = policyholder.registrationQuarter;
|
|
797
|
+
beneficiary.registrationRegion = policyholder.registrationRegion;
|
|
798
|
+
beneficiary.registrationRegionType = policyholder.registrationRegionType;
|
|
799
|
+
beneficiary.registrationStreet = policyholder.registrationStreet;
|
|
800
|
+
} else {
|
|
801
|
+
if (beneficiary.id === 0) {
|
|
802
|
+
beneficiary.registrationCity = new Value();
|
|
803
|
+
beneficiary.registrationCountry = new Value();
|
|
804
|
+
beneficiary.registrationMicroDistrict = '';
|
|
805
|
+
beneficiary.registrationNumberApartment = '';
|
|
806
|
+
beneficiary.registrationNumberApartment = '';
|
|
807
|
+
beneficiary.registrationNumberHouse = '';
|
|
808
|
+
beneficiary.registrationProvince = new Value();
|
|
809
|
+
beneficiary.registrationQuarter = '';
|
|
810
|
+
beneficiary.registrationRegion = new Value();
|
|
811
|
+
beneficiary.registrationRegionType = new Value();
|
|
812
|
+
beneficiary.registrationStreet = '';
|
|
813
|
+
} else {
|
|
814
|
+
const country = dataStore.countries.find(i => (i.nameRu as string).match(new RegExp(beneficiary.response?.addresses[0].countryName, 'i')));
|
|
815
|
+
const city = dataStore.cities.find(i => i.nameRu === beneficiary.response?.addresses[0].cityName.replace('г.', ''));
|
|
816
|
+
const province = dataStore.states.find(i => i.ids === beneficiary.response?.addresses[0].stateCode);
|
|
817
|
+
const localityType = dataStore.localityTypes.find(i => i.nameRu === beneficiary.response?.addresses[0].cityTypeName);
|
|
818
|
+
const region = dataStore.regions.find(i => i.ids == beneficiary.response?.addresses[0].regionCode);
|
|
819
|
+
beneficiary.registrationCountry = country ?? new Value();
|
|
820
|
+
beneficiary.registrationCity = city ?? new Value();
|
|
821
|
+
beneficiary.registrationMicroDistrict = beneficiary.response?.addresses[0].microRaion ?? '';
|
|
822
|
+
beneficiary.registrationNumberApartment = beneficiary.response?.addresses[0].apartmentNumber ?? '';
|
|
823
|
+
beneficiary.registrationNumberHouse = beneficiary.response?.addresses[0].blockNumber ?? '';
|
|
824
|
+
beneficiary.registrationProvince = province ?? new Value();
|
|
825
|
+
beneficiary.registrationQuarter = beneficiary.response?.addresses[0].kvartal ?? '';
|
|
826
|
+
beneficiary.registrationRegion = region ?? new Value();
|
|
827
|
+
beneficiary.registrationRegionType = localityType ?? new Value();
|
|
828
|
+
beneficiary.registrationStreet = beneficiary.response?.addresses[0].streetName ?? '';
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
};
|
|
832
|
+
|
|
705
833
|
const uploadFile = async (processInstanceId: string | number) => {
|
|
706
834
|
const selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.nameRu === member.value.documentType.nameRu);
|
|
707
835
|
const formData = new FormData();
|
|
@@ -786,41 +914,45 @@ export default {
|
|
|
786
914
|
};
|
|
787
915
|
|
|
788
916
|
const getContragentFromGBDFL = async () => {
|
|
789
|
-
if (member.value.hasAgreement
|
|
917
|
+
if (member.value.hasAgreement !== true) {
|
|
790
918
|
dataStore.showToaster('error', dataStore.t('toaster.needAgreement'), 3000);
|
|
791
919
|
dataStore.panel.open = false;
|
|
792
920
|
isSearchOpen.value = false;
|
|
793
921
|
return;
|
|
794
922
|
}
|
|
795
923
|
if (!member.value.iin || member.value.iin.length !== useMask().iin.length || !member.value.phoneNumber || member.value.phoneNumber.length !== useMask().phone.length) {
|
|
796
|
-
dataStore.showToaster('error', dataStore.t('toaster.errorFormField'
|
|
924
|
+
dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: 'Номер телефона, ИИН' }), 5000);
|
|
797
925
|
dataStore.panel.open = false;
|
|
798
926
|
isSearchOpen.value = false;
|
|
799
927
|
return;
|
|
800
928
|
}
|
|
801
929
|
isButtonLoading.value = true;
|
|
802
|
-
await dataStore.getContragentFromGBDFL(member.value
|
|
803
|
-
|
|
930
|
+
const response = await dataStore.getContragentFromGBDFL(member.value);
|
|
931
|
+
if (typeof response === 'boolean') {
|
|
932
|
+
if (response === true) {
|
|
933
|
+
member.value.gotFromInsis = true;
|
|
934
|
+
}
|
|
935
|
+
dataStore.panel.open = false;
|
|
936
|
+
isSearchOpen.value = false;
|
|
937
|
+
}
|
|
804
938
|
isButtonLoading.value = false;
|
|
805
|
-
dataStore.panel.open = false;
|
|
806
|
-
isSearchOpen.value = false;
|
|
807
939
|
};
|
|
808
940
|
|
|
809
941
|
const getContragent = async () => {
|
|
810
|
-
if (member.value.hasAgreement
|
|
942
|
+
if (member.value.hasAgreement !== true) {
|
|
811
943
|
dataStore.showToaster('error', dataStore.t('toaster.needAgreement'), 3000);
|
|
812
944
|
dataStore.panel.open = false;
|
|
813
945
|
isSearchOpen.value = false;
|
|
814
946
|
return;
|
|
815
947
|
}
|
|
816
948
|
if (!member.value.iin || member.value.iin.length !== useMask().iin.length) {
|
|
817
|
-
dataStore.showToaster('error', dataStore.t('toaster.errorFormField'
|
|
949
|
+
dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: 'ИИН' }), 5000);
|
|
818
950
|
dataStore.panel.open = false;
|
|
819
951
|
isSearchOpen.value = false;
|
|
820
952
|
return;
|
|
821
953
|
}
|
|
822
954
|
isButtonLoading.value = true;
|
|
823
|
-
await dataStore.getContragent(member.value,
|
|
955
|
+
await dataStore.getContragent(member.value, false);
|
|
824
956
|
isButtonLoading.value = false;
|
|
825
957
|
dataStore.panel.open = false;
|
|
826
958
|
isSearchOpen.value = false;
|
|
@@ -854,12 +986,14 @@ export default {
|
|
|
854
986
|
return false;
|
|
855
987
|
}
|
|
856
988
|
const isInsured = formStore.isPolicyholderInsured;
|
|
989
|
+
const remoteIsInsured = ref<boolean | null>(null);
|
|
857
990
|
if (whichForm.value == formStore.policyholderFormKey) {
|
|
858
991
|
if (route.params.taskId === '0') {
|
|
859
992
|
try {
|
|
860
993
|
const taskId = await dataStore.startApplication(member.value);
|
|
861
994
|
if (taskId) {
|
|
862
995
|
await dataStore.getApplicationData(taskId, false, false, false, false);
|
|
996
|
+
remoteIsInsured.value = formStore.applicationData.clientApp.isInsured;
|
|
863
997
|
await router.replace({
|
|
864
998
|
name: route.name!,
|
|
865
999
|
params: { taskId: taskId as string },
|
|
@@ -882,22 +1016,27 @@ export default {
|
|
|
882
1016
|
}
|
|
883
1017
|
}
|
|
884
1018
|
const memberFromApplicaiton = memberStore.getMemberFromApplication(whichForm.value as MemberKeys, whichIndex.value ? Number(whichIndex.value) : undefined);
|
|
1019
|
+
if (typeof member.value.id !== 'number' || (typeof member.value.id === 'number' && member.value.id > 0 === false)) {
|
|
1020
|
+
return false;
|
|
1021
|
+
}
|
|
885
1022
|
const isSaved = await dataStore.saveMember(member.value, memberStore.getMemberCode(whichForm.value as MemberKeys), memberFromApplicaiton);
|
|
886
1023
|
if (!isSaved) return false;
|
|
887
|
-
if (whichForm.value === formStore.policyholderFormKey
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
1024
|
+
if (whichForm.value === formStore.policyholderFormKey) {
|
|
1025
|
+
if (isInsured === true || remoteIsInsured.value === true) {
|
|
1026
|
+
formStore.insuredForm[0] = formStore.policyholderForm;
|
|
1027
|
+
const isInsuredSaved = await dataStore.saveMember(
|
|
1028
|
+
member.value,
|
|
1029
|
+
memberStore.getMemberCode(formStore.insuredFormKey as MemberKeys),
|
|
1030
|
+
memberStore.getMemberFromApplication(formStore.insuredFormKey as MemberKeys, formStore.insuredFormIndex),
|
|
1031
|
+
);
|
|
1032
|
+
if (!isInsuredSaved) return false;
|
|
1033
|
+
}
|
|
895
1034
|
}
|
|
896
1035
|
await router.replace({
|
|
897
1036
|
name: route.name!,
|
|
898
1037
|
query: { ...route.query, id: member.value.id },
|
|
899
1038
|
});
|
|
900
|
-
await dataStore.getApplicationData(route.params.taskId, false, false,
|
|
1039
|
+
await dataStore.getApplicationData(route.params.taskId, false, false, true, false);
|
|
901
1040
|
if (dataStore.controls.hasCalculator) {
|
|
902
1041
|
if (formStore.additionalInsuranceTermsWithout && formStore.additionalInsuranceTermsWithout.length !== 0) {
|
|
903
1042
|
formStore.additionalInsuranceTerms.forEach((term: any) => {
|
|
@@ -921,7 +1060,7 @@ export default {
|
|
|
921
1060
|
return true;
|
|
922
1061
|
}
|
|
923
1062
|
}
|
|
924
|
-
if (member.value.hasAgreement
|
|
1063
|
+
if (member.value.hasAgreement !== true) {
|
|
925
1064
|
dataStore.showToaster('error', dataStore.t('toaster.needAgreement'));
|
|
926
1065
|
return false;
|
|
927
1066
|
}
|
|
@@ -963,11 +1102,11 @@ export default {
|
|
|
963
1102
|
if (errors) {
|
|
964
1103
|
const errorText = errors.querySelector('.v-label.v-field-label');
|
|
965
1104
|
if (errorText) {
|
|
966
|
-
dataStore.showToaster('error', dataStore.t('toaster.errorFormField'
|
|
1105
|
+
dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorText.innerHTML?.replace(/[-<>!//.]/g, '') }));
|
|
967
1106
|
} else {
|
|
968
1107
|
const errorFieldText = errors.querySelector('.v-input__control');
|
|
969
1108
|
if (errorFieldText) {
|
|
970
|
-
dataStore.showToaster('error', dataStore.t('toaster.errorFormField'
|
|
1109
|
+
dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorFieldText.innerHTML?.replace(/[-<>!//.]/g, '') }));
|
|
971
1110
|
}
|
|
972
1111
|
}
|
|
973
1112
|
errors.scrollIntoView({
|
|
@@ -982,19 +1121,62 @@ export default {
|
|
|
982
1121
|
|
|
983
1122
|
const checkOtp = async () => {
|
|
984
1123
|
if (!member.value.otpCode || member.value.iin?.length !== useMask().iin.length || member.value.phoneNumber?.length !== useMask().phone.length) {
|
|
985
|
-
dataStore.showToaster('error', dataStore.t('toaster.errorFormField'
|
|
1124
|
+
dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: dataStore.t('form.otpCode') }), 3000);
|
|
986
1125
|
return;
|
|
987
1126
|
}
|
|
1127
|
+
otpSending.value = true;
|
|
988
1128
|
const checked = await memberStore.checkOtp(member.value);
|
|
989
1129
|
if (typeof checked !== 'undefined') {
|
|
990
1130
|
member.value.hasAgreement = checked;
|
|
991
1131
|
}
|
|
1132
|
+
otpSending.value = false;
|
|
1133
|
+
if (checked === true) {
|
|
1134
|
+
dataStore.panel.open = false;
|
|
1135
|
+
}
|
|
992
1136
|
};
|
|
993
1137
|
|
|
994
1138
|
const sendOtp = async (onInit = false) => {
|
|
1139
|
+
otpSending.value = true;
|
|
995
1140
|
const response = await memberStore.sendOtp(member.value, formStore.applicationData.processInstanceId, onInit);
|
|
996
1141
|
if (response) {
|
|
997
1142
|
if (member.value.hasAgreement === null) member.value.hasAgreement = response.otpStatus;
|
|
1143
|
+
if (response.otpStatus === true) {
|
|
1144
|
+
dataStore.panel.open = false;
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
otpSending.value = false;
|
|
1148
|
+
};
|
|
1149
|
+
|
|
1150
|
+
const setDefaultValues = async () => {
|
|
1151
|
+
const setDefaults = dataStore.controls.setDefaults;
|
|
1152
|
+
if (setDefaults.sectorCode) {
|
|
1153
|
+
await setSectorCode();
|
|
1154
|
+
}
|
|
1155
|
+
if (setDefaults.percentage) {
|
|
1156
|
+
setPercentage();
|
|
1157
|
+
}
|
|
1158
|
+
};
|
|
1159
|
+
|
|
1160
|
+
const setSectorCode = async () => {
|
|
1161
|
+
if (member.value.id === 0 && route.query.id === '0') {
|
|
1162
|
+
const sectorList = await dataStore.getSectorCodeList();
|
|
1163
|
+
const defaultValue = sectorList.find(item => item.ids === '500003.9') as Value;
|
|
1164
|
+
member.value.economySectorCode = defaultValue ? defaultValue : new Value();
|
|
1165
|
+
}
|
|
1166
|
+
};
|
|
1167
|
+
|
|
1168
|
+
const setPercentage = () => {
|
|
1169
|
+
if (whichForm.value === formStore.beneficiaryFormKey && member.value.id === 0 && route.query.id === '0' && member.value.percentageOfPayoutAmount === null) {
|
|
1170
|
+
if (dataStore.members.beneficiaryApp.isMultiple) {
|
|
1171
|
+
const availablePercentage =
|
|
1172
|
+
100 -
|
|
1173
|
+
formStore.beneficiaryForm.reduce((sum, member) => {
|
|
1174
|
+
return sum + Number(member.percentageOfPayoutAmount);
|
|
1175
|
+
}, 0);
|
|
1176
|
+
if (availablePercentage >= 0 && availablePercentage <= 100) member.value.percentageOfPayoutAmount = availablePercentage;
|
|
1177
|
+
} else {
|
|
1178
|
+
member.value.percentageOfPayoutAmount = 100;
|
|
1179
|
+
}
|
|
998
1180
|
}
|
|
999
1181
|
};
|
|
1000
1182
|
|
|
@@ -1020,6 +1202,7 @@ export default {
|
|
|
1020
1202
|
const filteredDocuments: DocumentItem[] = dataStore.getFilesByIIN(member.value.iin!.replace(/-/g, '')) as DocumentItem[];
|
|
1021
1203
|
if (filteredDocuments && filteredDocuments.length) memberDocument.value = filteredDocuments[0];
|
|
1022
1204
|
}
|
|
1205
|
+
await setDefaultValues();
|
|
1023
1206
|
};
|
|
1024
1207
|
|
|
1025
1208
|
onMounted(async () => {
|
|
@@ -1032,6 +1215,13 @@ export default {
|
|
|
1032
1215
|
}
|
|
1033
1216
|
});
|
|
1034
1217
|
|
|
1218
|
+
watch(
|
|
1219
|
+
() => sameAddress.value,
|
|
1220
|
+
() => {
|
|
1221
|
+
if (whichForm.value === formStore.beneficiaryFormKey) setAddress();
|
|
1222
|
+
},
|
|
1223
|
+
);
|
|
1224
|
+
|
|
1035
1225
|
watch(
|
|
1036
1226
|
() => member.value.percentageOfPayoutAmount,
|
|
1037
1227
|
val => {
|
|
@@ -1058,14 +1248,14 @@ export default {
|
|
|
1058
1248
|
},
|
|
1059
1249
|
);
|
|
1060
1250
|
|
|
1061
|
-
watch(
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
);
|
|
1251
|
+
// watch(
|
|
1252
|
+
// () => member.value.otpCode,
|
|
1253
|
+
// async () => {
|
|
1254
|
+
// if (member.value.otpCode && member.value.otpCode.length === useMask().otp.length) {
|
|
1255
|
+
// await checkOtp();
|
|
1256
|
+
// }
|
|
1257
|
+
// },
|
|
1258
|
+
// );
|
|
1069
1259
|
|
|
1070
1260
|
watch(
|
|
1071
1261
|
() => dataStore.panel.open,
|
|
@@ -1074,6 +1264,7 @@ export default {
|
|
|
1074
1264
|
isPanelOpen.value = false;
|
|
1075
1265
|
isDocumentOpen.value = false;
|
|
1076
1266
|
isSearchOpen.value = false;
|
|
1267
|
+
isOtpPanelOpen.value = false;
|
|
1077
1268
|
dataStore.panelAction = null;
|
|
1078
1269
|
}
|
|
1079
1270
|
},
|
|
@@ -1095,10 +1286,12 @@ export default {
|
|
|
1095
1286
|
isPanelOpen,
|
|
1096
1287
|
isSearchOpen,
|
|
1097
1288
|
isDocumentOpen,
|
|
1289
|
+
isOtpPanelOpen,
|
|
1098
1290
|
isPanelLoading,
|
|
1099
1291
|
isButtonLoading,
|
|
1100
1292
|
isSubmittingForm,
|
|
1101
1293
|
documentLoading,
|
|
1294
|
+
otpSending,
|
|
1102
1295
|
panelValue,
|
|
1103
1296
|
panelList,
|
|
1104
1297
|
searchQuery,
|
|
@@ -1106,6 +1299,7 @@ export default {
|
|
|
1106
1299
|
memberDocument,
|
|
1107
1300
|
familyDialog,
|
|
1108
1301
|
selectedFamilyMember,
|
|
1302
|
+
sameAddress,
|
|
1109
1303
|
|
|
1110
1304
|
// Computed
|
|
1111
1305
|
whichForm,
|
|
@@ -1125,6 +1319,7 @@ export default {
|
|
|
1125
1319
|
ageRule,
|
|
1126
1320
|
phoneRule,
|
|
1127
1321
|
residencyRule,
|
|
1322
|
+
birthDateRule,
|
|
1128
1323
|
|
|
1129
1324
|
// Functions
|
|
1130
1325
|
searchMember,
|