hl-core 0.0.9-beta.25 → 0.0.9-beta.27
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/base.api.ts +77 -1
- package/api/interceptors.ts +3 -3
- package/components/Form/FormData.vue +48 -0
- package/components/Pages/ProductConditions.vue +90 -5
- package/components/Panel/PanelHandler.vue +35 -8
- package/composables/classes.ts +230 -113
- package/locales/ru.json +62 -35
- package/package.json +1 -1
- package/store/data.store.ts +339 -17
- package/store/form.store.ts +3 -1
- package/types/index.ts +43 -2
package/api/base.api.ts
CHANGED
|
@@ -377,7 +377,7 @@ export class ApiClass {
|
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
379
|
|
|
380
|
-
async startApplication(data:
|
|
380
|
+
async startApplication(data: any) {
|
|
381
381
|
return await this.axiosCall<{
|
|
382
382
|
processInstanceId: string;
|
|
383
383
|
}>({
|
|
@@ -689,6 +689,19 @@ export class ApiClass {
|
|
|
689
689
|
data: data,
|
|
690
690
|
});
|
|
691
691
|
}
|
|
692
|
+
async downloadTemplate() {
|
|
693
|
+
return this.axiosCall({
|
|
694
|
+
method: Methods.GET,
|
|
695
|
+
url: `/${this.productUrl}/api/Application/DownloadTemplate`,
|
|
696
|
+
});
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
async sendTemplateToEmail(email: string) {
|
|
700
|
+
return this.axiosCall({
|
|
701
|
+
method: Methods.GET,
|
|
702
|
+
url: `/${this.productUrl}/api/Application/SendTemplateToEmail?emailTo=${email}`,
|
|
703
|
+
});
|
|
704
|
+
}
|
|
692
705
|
|
|
693
706
|
async getCalculator(data: SetApplicationRequest) {
|
|
694
707
|
return await this.axiosCall<number>({
|
|
@@ -697,4 +710,67 @@ export class ApiClass {
|
|
|
697
710
|
data: data,
|
|
698
711
|
});
|
|
699
712
|
}
|
|
713
|
+
|
|
714
|
+
async saveClient(processInstanceId: string | number, clientId: string | null, data: any) {
|
|
715
|
+
return await this.axiosCall({
|
|
716
|
+
method: Methods.POST,
|
|
717
|
+
url: `/${this.productUrl}/api/Application/saveClient/?processInstanceId=${processInstanceId}&clientId=${clientId}`,
|
|
718
|
+
data: data,
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
async saveAccidentIncidents(processInstanceId: string | number, data: any) {
|
|
723
|
+
return await this.axiosCall({
|
|
724
|
+
method: Methods.POST,
|
|
725
|
+
url: `/${this.productUrl}/api/Application/saveAccidentIncidentsList/?processInstance=${processInstanceId}`,
|
|
726
|
+
data: data,
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
async saveClientAcivityTypes(clientId: string | number, data: any) {
|
|
731
|
+
return await this.axiosCall({
|
|
732
|
+
method: Methods.POST,
|
|
733
|
+
url: `/${this.productUrl}/api/Application/saveClientAcivityTypes/?clientId=${clientId}`,
|
|
734
|
+
data: data,
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
async saveBeneficialOwnerList(processInstanceId: string | number, data: any) {
|
|
739
|
+
return await this.axiosCall({
|
|
740
|
+
method: Methods.POST,
|
|
741
|
+
url: `/${this.productUrl}/api/Application/saveBeneficialOwnerList/?processInstanceId=${processInstanceId}`,
|
|
742
|
+
data: data,
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
async saveBeneficialOwner(processInstanceId: string | number, benificiaryId: string | null, data: any) {
|
|
747
|
+
return await this.axiosCall({
|
|
748
|
+
method: Methods.POST,
|
|
749
|
+
url: `/${this.productUrl}/api/Application/saveBeneficialOwner/?processInstanceId=${processInstanceId}&benificiaryId=${benificiaryId}`,
|
|
750
|
+
data: data,
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
async saveInsuredList(processInstanceId: string | number, data: any) {
|
|
755
|
+
return await this.axiosCall({
|
|
756
|
+
method: Methods.POST,
|
|
757
|
+
url: `/${this.productUrl}/api/Application/saveInsuredList/?processInstanceId=${processInstanceId}`,
|
|
758
|
+
data: data,
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
async saveInsured(processInstanceId: string | number, insuredId: string | null, data: any) {
|
|
763
|
+
return await this.axiosCall({
|
|
764
|
+
method: Methods.POST,
|
|
765
|
+
url: `/${this.productUrl}/api/Application/saveInsured/?processInstanceId=${processInstanceId}&insuredId=${insuredId}`,
|
|
766
|
+
data: data,
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
async getProcessGfot(processCode: string | number) {
|
|
771
|
+
return await this.axiosCall<Value[]>({
|
|
772
|
+
method: Methods.GET,
|
|
773
|
+
url: `/Arm/api/Dictionary/ProcessGfot/${processCode}`,
|
|
774
|
+
});
|
|
775
|
+
}
|
|
700
776
|
}
|
package/api/interceptors.ts
CHANGED
|
@@ -24,10 +24,10 @@ export default function (axios: AxiosInstance) {
|
|
|
24
24
|
if (request.baseURL === 'https://products.halyklife.kz/api/v1/test/insis') {
|
|
25
25
|
request.baseURL = 'http://vega:84';
|
|
26
26
|
}
|
|
27
|
-
if (request.baseURL === 'https://products.halyklife.kz/
|
|
27
|
+
if (request.baseURL === 'https://products.halyklife.kz/test/efo/api') {
|
|
28
28
|
request.baseURL = 'http://efo-dev.halyklife.nb/api';
|
|
29
29
|
}
|
|
30
|
-
if (request.baseURL === 'https://products.halyklife.kz/
|
|
30
|
+
if (request.baseURL === 'https://products.halyklife.kz/test/aml/api') {
|
|
31
31
|
request.baseURL = 'http://aml-dev.halyklife.nb/api';
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -44,7 +44,7 @@ export default function (axios: AxiosInstance) {
|
|
|
44
44
|
request.baseURL = request.baseURL.replace('api/v1/insis', 'efo/api');
|
|
45
45
|
}
|
|
46
46
|
if (request.baseURL.includes('api/v1/test/insis')) {
|
|
47
|
-
request.baseURL = request.baseURL.replace('api/v1/test/insis', '
|
|
47
|
+
request.baseURL = request.baseURL.replace('api/v1/test/insis', 'test/efo/api');
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bg-primary-light-blue rounded-lg mb-2">
|
|
3
|
+
<div class="bg-white rounded-lg pa-3 pa-sm-6">
|
|
4
|
+
<div class="items-center justify-between">
|
|
5
|
+
<p class="text-[#009C73] text-base">{{ props.control.title }}</p>
|
|
6
|
+
</div>
|
|
7
|
+
<v-row class="mt-1">
|
|
8
|
+
<v-col v-for="(label, index) in visibleLabels" :key="index" :cols="label.hideInMobile !== false ? label.size : 11 / visibleLabels.length">
|
|
9
|
+
<p class="text-sm font-medium">
|
|
10
|
+
{{ label.value }}
|
|
11
|
+
</p>
|
|
12
|
+
</v-col>
|
|
13
|
+
<v-col cols="1"></v-col>
|
|
14
|
+
</v-row>
|
|
15
|
+
<v-row v-if="props.control.entries && props.control.entries.length">
|
|
16
|
+
<v-col v-for="(label, index) in visibleLabels" :key="index" :cols="label.size ?? 11 / visibleLabels.length" class="flex items-center">
|
|
17
|
+
<p class="text-base">{{ props.control.entries[index].value }}</p>
|
|
18
|
+
</v-col>
|
|
19
|
+
<v-col cols="1" class="flex items-end justify-end">
|
|
20
|
+
<button v-if="!props.control.disabled" @click="$emit('onMore', { whichForm: control.key })">
|
|
21
|
+
<i class="mdi mdi-dots-vertical text-xl"></i>
|
|
22
|
+
</button>
|
|
23
|
+
</v-col>
|
|
24
|
+
</v-row>
|
|
25
|
+
<v-row v-else>
|
|
26
|
+
<v-col cols="11" class="flex items-center">
|
|
27
|
+
<span class="text-primary-blue text-base">{{ $dataStore.t('clients.necessaryFillForm') }} </span>
|
|
28
|
+
</v-col>
|
|
29
|
+
<v-col cols="1" class="flex items-end justify-end">
|
|
30
|
+
<button v-if="!props.control.disabled" @click="$emit('onMore', { whichForm: control.key })">
|
|
31
|
+
<i class="mdi mdi-dots-vertical text-xl"></i>
|
|
32
|
+
</button>
|
|
33
|
+
</v-col>
|
|
34
|
+
</v-row>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
<script setup lang="ts">
|
|
39
|
+
const display = useDisplayInfo();
|
|
40
|
+
const props = defineProps({
|
|
41
|
+
control: {
|
|
42
|
+
type: Object as PropType<FormBlock>,
|
|
43
|
+
required: true,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
const isDesktop = computed(() => display.lgAndUp.value);
|
|
47
|
+
const visibleLabels = computed(() => (isDesktop.value ? props.control.labels : props.control.labels.filter(l => l.hideInMobile === false)));
|
|
48
|
+
</script>
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
<base-form-input v-model="formStore.policyholderForm.age" :label="$dataStore.t('form.age')" :readonly="true" />
|
|
45
45
|
<base-form-input v-model="formStore.policyholderForm.gender.nameRu" class="mb-4" :label="$dataStore.t('form.gender')" :readonly="true" />
|
|
46
46
|
</base-form-section>
|
|
47
|
-
<base-form-section v-if="isUnderwriterRole && $dataStore.members.insuredApp.has === true" :title="$dataStore.t('insuredForm')">
|
|
47
|
+
<base-form-section v-if="isUnderwriterRole && $dataStore.members.insuredApp.has === true && !$dataStore.isLifeBusiness" :title="$dataStore.t('insuredForm')">
|
|
48
48
|
<div v-for="(insured, index) of formStore.insuredForm" :key="index">
|
|
49
49
|
<base-form-input v-model="insured.longName" :label="$dataStore.t('labels.insurerLongName')" :readonly="true" />
|
|
50
50
|
<base-form-input v-model="insured.job" :label="$dataStore.t('form.job')" :readonly="true" />
|
|
@@ -266,6 +266,16 @@
|
|
|
266
266
|
append-inner-icon="mdi mdi-chevron-right"
|
|
267
267
|
@append="openPanel($dataStore.t('productConditionsForm.agencyPart'), $dataStore.processTariff, 'processTariff', $dataStore.getProcessTariff)"
|
|
268
268
|
/>
|
|
269
|
+
<base-panel-input
|
|
270
|
+
v-if="hasProcessGfot"
|
|
271
|
+
v-model="productConditionsForm.processGfot"
|
|
272
|
+
:value="productConditionsForm.processGfot?.nameRu"
|
|
273
|
+
:readonly="isDisabledProcessGfot"
|
|
274
|
+
:clearable="!isDisabledProcessGfot"
|
|
275
|
+
:label="$dataStore.t('productConditionsForm.processGfot')"
|
|
276
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
277
|
+
@append="openPanel($dataStore.t('productConditionsForm.processGfot'), $dataStore.processTariff, 'processGfot', $dataStore.getProcessGfot)"
|
|
278
|
+
/>
|
|
269
279
|
</base-form-section>
|
|
270
280
|
<base-form-section v-if="hasAnnuityPayments" :title="$dataStore.t('calculationAnnuityPayments')">
|
|
271
281
|
<base-form-toggle
|
|
@@ -546,6 +556,20 @@
|
|
|
546
556
|
</div>
|
|
547
557
|
</div>
|
|
548
558
|
</Teleport>
|
|
559
|
+
<Teleport v-if="isCoverPeriodPanelOpen" to="#panel-actions">
|
|
560
|
+
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
561
|
+
<base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
562
|
+
<div class="w-full flex flex-col gap-2 p-2">
|
|
563
|
+
<base-panel-select-item
|
|
564
|
+
v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
|
|
565
|
+
:key="index"
|
|
566
|
+
:text="(item.nameRu as string)"
|
|
567
|
+
:selected="item.code === coverPeriodValue"
|
|
568
|
+
@click="pickCoverPeriodValue(item)"
|
|
569
|
+
/>
|
|
570
|
+
</div>
|
|
571
|
+
</div>
|
|
572
|
+
</Teleport>
|
|
549
573
|
</section>
|
|
550
574
|
</template>
|
|
551
575
|
|
|
@@ -577,7 +601,9 @@ export default defineComponent({
|
|
|
577
601
|
const isPanelOpen = ref<boolean>(false);
|
|
578
602
|
const isTermsPanelOpen = ref<boolean>(false);
|
|
579
603
|
const isFixInsAmountPanelOpen = ref<boolean>(false);
|
|
604
|
+
const isCoverPeriodPanelOpen = ref<boolean>(false);
|
|
580
605
|
const fixInsValue = ref<string | number>();
|
|
606
|
+
const coverPeriodValue = ref<string>('');
|
|
581
607
|
const panelValue = ref<Value>(new Value());
|
|
582
608
|
const termValue = ref<AddCover>();
|
|
583
609
|
const panelList = ref<Value[]>([]);
|
|
@@ -616,11 +642,19 @@ export default defineComponent({
|
|
|
616
642
|
if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
|
|
617
643
|
return false;
|
|
618
644
|
}
|
|
645
|
+
if (dataStore.isLifeBusiness) {
|
|
646
|
+
return true;
|
|
647
|
+
}
|
|
619
648
|
return isDisabled.value;
|
|
620
649
|
});
|
|
621
650
|
const requestedSumInsuredRule = computed(() => (!!productConditionsForm.requestedSumInsured ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
622
|
-
const hasCalculated = computed(() => !!productConditionsForm.requestedSumInsured && !!productConditionsForm.insurancePremiumPerMonth);
|
|
623
651
|
const amountAnnuityPayments = computed(() => (!!productConditionsForm.amountAnnuityPayments ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
652
|
+
const hasCalculated = computed(() => {
|
|
653
|
+
if (whichProduct.value === 'lifebusiness' && productConditionsForm.requestedSumInsured === null) {
|
|
654
|
+
return !!productConditionsForm.insurancePremiumPerMonth;
|
|
655
|
+
}
|
|
656
|
+
return !!productConditionsForm.requestedSumInsured && !!productConditionsForm.insurancePremiumPerMonth;
|
|
657
|
+
});
|
|
624
658
|
const hasProcessIndexRate = computed(() => {
|
|
625
659
|
if (whichProduct.value === 'gons' || whichProduct.value === 'halykkazyna' || whichProduct.value === 'liferenta' || whichProduct.value === 'lifebusiness') {
|
|
626
660
|
return false;
|
|
@@ -711,6 +745,12 @@ export default defineComponent({
|
|
|
711
745
|
}
|
|
712
746
|
return false;
|
|
713
747
|
});
|
|
748
|
+
const hasProcessGfot = computed(() => {
|
|
749
|
+
if (whichProduct.value === 'lifebusiness') {
|
|
750
|
+
return true;
|
|
751
|
+
}
|
|
752
|
+
return false;
|
|
753
|
+
});
|
|
714
754
|
const coverPeriodRule = computed(() => {
|
|
715
755
|
const baseCondition = dataStore.rules.required.concat(dataStore.rules.numbers);
|
|
716
756
|
if (whichProduct.value === 'gons') {
|
|
@@ -758,6 +798,9 @@ export default defineComponent({
|
|
|
758
798
|
if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
|
|
759
799
|
return false;
|
|
760
800
|
}
|
|
801
|
+
if (whichProduct.value === 'lifebusiness' && productConditionsForm.processGfot.id !== null) {
|
|
802
|
+
return true;
|
|
803
|
+
}
|
|
761
804
|
return isDisabled.value;
|
|
762
805
|
});
|
|
763
806
|
const isDisabledSumDollar = computed(() => {
|
|
@@ -788,6 +831,12 @@ export default defineComponent({
|
|
|
788
831
|
}
|
|
789
832
|
return true;
|
|
790
833
|
});
|
|
834
|
+
const isDisabledProcessGfot = computed(() => {
|
|
835
|
+
if (whichProduct.value === 'lifebusiness' && !!productConditionsForm.requestedSumInsured) {
|
|
836
|
+
return true;
|
|
837
|
+
}
|
|
838
|
+
return isDisabled.value;
|
|
839
|
+
});
|
|
791
840
|
const formatTermValue = (term: number) => {
|
|
792
841
|
if (term !== null) {
|
|
793
842
|
const termNumber = Number(term);
|
|
@@ -855,7 +904,7 @@ export default defineComponent({
|
|
|
855
904
|
}
|
|
856
905
|
}
|
|
857
906
|
};
|
|
858
|
-
const pickTermValue = (item: Value) => {
|
|
907
|
+
const pickTermValue = async (item: Value) => {
|
|
859
908
|
dataStore.panel.open = false;
|
|
860
909
|
isTermsPanelOpen.value = false;
|
|
861
910
|
if (typeof currentIndex.value !== 'number') return;
|
|
@@ -863,10 +912,24 @@ export default defineComponent({
|
|
|
863
912
|
additionalTerms.value[currentIndex.value].coverSumName = item.nameRu as string;
|
|
864
913
|
if (whichProduct.value === 'lifebusiness') {
|
|
865
914
|
if (item.code === 'fixedinssum') {
|
|
866
|
-
openFixInsPanel(dataStore.t('
|
|
915
|
+
openFixInsPanel(dataStore.t('clients.selectInsSum'), additionalTerms.value[currentIndex.value].amount);
|
|
867
916
|
} else {
|
|
868
917
|
additionalTerms.value[currentIndex.value].amount = 0;
|
|
869
918
|
}
|
|
919
|
+
if (termValue.value && termValue.value.coverTypeCode === 6) {
|
|
920
|
+
const res = await dataStore.getFromApi('DicCoverTypePeriod', 'getArmDicts', 'DicCoverTypePeriod');
|
|
921
|
+
panelList.value = filterList(res, '');
|
|
922
|
+
const coverPeriodName = panelList.value.find(i => i.id === String(termValue.value!.coverPeriodId));
|
|
923
|
+
if (coverPeriodName) coverPeriodValue.value = coverPeriodName.code as string;
|
|
924
|
+
isPanelOpen.value = false;
|
|
925
|
+
isTermsPanelOpen.value = false;
|
|
926
|
+
isFixInsAmountPanelOpen.value = false;
|
|
927
|
+
isCoverPeriodPanelOpen.value = true;
|
|
928
|
+
dataStore.panelAction = null;
|
|
929
|
+
dataStore.panel.open = true;
|
|
930
|
+
isMultiplePanelOpen.value = false;
|
|
931
|
+
dataStore.panel.title = dataStore.t('clients.coveragePeriod');
|
|
932
|
+
}
|
|
870
933
|
}
|
|
871
934
|
};
|
|
872
935
|
|
|
@@ -887,6 +950,7 @@ export default defineComponent({
|
|
|
887
950
|
isPanelOpen.value = true;
|
|
888
951
|
isTermsPanelOpen.value = false;
|
|
889
952
|
isFixInsAmountPanelOpen.value = false;
|
|
953
|
+
isCoverPeriodPanelOpen.value = false;
|
|
890
954
|
dataStore.panelAction = null;
|
|
891
955
|
dataStore.panel.open = true;
|
|
892
956
|
dataStore.panel.title = title;
|
|
@@ -914,6 +978,7 @@ export default defineComponent({
|
|
|
914
978
|
if (!isDisabled.value || !isRecalculationDisabled.value) {
|
|
915
979
|
isPanelOpen.value = false;
|
|
916
980
|
isFixInsAmountPanelOpen.value = false;
|
|
981
|
+
isCoverPeriodPanelOpen.value = false;
|
|
917
982
|
isMultiplePanelOpen.value = true;
|
|
918
983
|
isPanelLoading.value = true;
|
|
919
984
|
let newList = list;
|
|
@@ -963,6 +1028,7 @@ export default defineComponent({
|
|
|
963
1028
|
isPanelOpen.value = false;
|
|
964
1029
|
isMultiplePanelOpen.value = false;
|
|
965
1030
|
isFixInsAmountPanelOpen.value = false;
|
|
1031
|
+
isCoverPeriodPanelOpen.value = false;
|
|
966
1032
|
isTermsPanelOpen.value = true;
|
|
967
1033
|
dataStore.panelAction = null;
|
|
968
1034
|
dataStore.panel.open = true;
|
|
@@ -988,12 +1054,13 @@ export default defineComponent({
|
|
|
988
1054
|
isPanelOpen.value = false;
|
|
989
1055
|
isTermsPanelOpen.value = false;
|
|
990
1056
|
isMultiplePanelOpen.value = false;
|
|
1057
|
+
isCoverPeriodPanelOpen.value = false;
|
|
991
1058
|
isFixInsAmountPanelOpen.value = true;
|
|
992
1059
|
dataStore.panelAction = null;
|
|
993
1060
|
dataStore.panel.open = true;
|
|
994
1061
|
dataStore.panel.title = title;
|
|
995
1062
|
panelList.value = constants.fixInsAmount;
|
|
996
|
-
fixInsValue.value = amount;
|
|
1063
|
+
fixInsValue.value = String(amount);
|
|
997
1064
|
} else {
|
|
998
1065
|
dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
|
|
999
1066
|
}
|
|
@@ -1006,6 +1073,16 @@ export default defineComponent({
|
|
|
1006
1073
|
additionalTerms.value[currentIndex.value].amount = Number(item.code);
|
|
1007
1074
|
};
|
|
1008
1075
|
|
|
1076
|
+
const pickCoverPeriodValue = (item: Value) => {
|
|
1077
|
+
coverPeriodValue.value = item.code as string;
|
|
1078
|
+
dataStore.panel.open = false;
|
|
1079
|
+
isCoverPeriodPanelOpen.value = false;
|
|
1080
|
+
if (typeof currentIndex.value !== 'number') return;
|
|
1081
|
+
additionalTerms.value[currentIndex.value].coverPeriodCode = item.code as string;
|
|
1082
|
+
additionalTerms.value[currentIndex.value].coverPeriodId = item.id as string;
|
|
1083
|
+
additionalTerms.value[currentIndex.value].coverPeriodName = item.nameRu as string;
|
|
1084
|
+
};
|
|
1085
|
+
|
|
1009
1086
|
const underwriterCalculate = async (type: 'sum' | 'premium') => {
|
|
1010
1087
|
if (!type) return;
|
|
1011
1088
|
if (type === 'sum') {
|
|
@@ -1287,6 +1364,9 @@ export default defineComponent({
|
|
|
1287
1364
|
if (!!productConditionsForm.requestedSumInsured) {
|
|
1288
1365
|
whichSum.value = 'requestedSumInsured';
|
|
1289
1366
|
}
|
|
1367
|
+
if (dataStore.isLifeBusiness && !productConditionsForm.requestedSumInsured) {
|
|
1368
|
+
whichSum.value = 'requestedSumInsured';
|
|
1369
|
+
}
|
|
1290
1370
|
if (dataStore.isCalculator) {
|
|
1291
1371
|
dataStore.processCode = constants.products[whichProduct.value as keyof typeof constants.products];
|
|
1292
1372
|
await dataStore.getProcessPaymentPeriod();
|
|
@@ -1401,7 +1481,9 @@ export default defineComponent({
|
|
|
1401
1481
|
Value,
|
|
1402
1482
|
calculatorForm,
|
|
1403
1483
|
isFixInsAmountPanelOpen,
|
|
1484
|
+
isCoverPeriodPanelOpen,
|
|
1404
1485
|
fixInsValue,
|
|
1486
|
+
coverPeriodValue,
|
|
1405
1487
|
|
|
1406
1488
|
// Computed
|
|
1407
1489
|
isTask,
|
|
@@ -1427,6 +1509,7 @@ export default defineComponent({
|
|
|
1427
1509
|
hasCalculated,
|
|
1428
1510
|
hasAnnuityPayments,
|
|
1429
1511
|
hasAgencyPart,
|
|
1512
|
+
hasProcessGfot,
|
|
1430
1513
|
currencySymbolsAddTerm,
|
|
1431
1514
|
amountAnnuityPayments,
|
|
1432
1515
|
requestedSumInsuredLabel,
|
|
@@ -1439,6 +1522,7 @@ export default defineComponent({
|
|
|
1439
1522
|
insurancePremiumPerMonthLabel,
|
|
1440
1523
|
isDisabledCoverPeriod,
|
|
1441
1524
|
hasDefault,
|
|
1525
|
+
isDisabledProcessGfot,
|
|
1442
1526
|
|
|
1443
1527
|
// Rules
|
|
1444
1528
|
coverPeriodRule,
|
|
@@ -1467,6 +1551,7 @@ export default defineComponent({
|
|
|
1467
1551
|
selectOption,
|
|
1468
1552
|
pickfixInsValue,
|
|
1469
1553
|
openFixInsPanel,
|
|
1554
|
+
pickCoverPeriodValue,
|
|
1470
1555
|
};
|
|
1471
1556
|
},
|
|
1472
1557
|
});
|
|
@@ -125,15 +125,17 @@
|
|
|
125
125
|
<section v-if="templateAction">
|
|
126
126
|
<div :class="[$styles.flexColNav]">
|
|
127
127
|
<base-content-block>
|
|
128
|
-
<base-panel-item class="cursor-pointer bg-white mb-4 border-b-0 rounded">
|
|
129
|
-
{{ $dataStore.t('
|
|
128
|
+
<base-panel-item class="cursor-pointer bg-white mb-4 border-b-0 rounded" @click.prevent="downloadTemplate">
|
|
129
|
+
{{ $dataStore.t('downloadTemplate') }}
|
|
130
130
|
<i class="mdi mdi-download text-2xl text-[#A0B3D8]"></i
|
|
131
131
|
></base-panel-item>
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
</base-content-block>
|
|
133
|
+
<base-content-block>
|
|
134
|
+
<v-form ref="vForm" class="mb-3">
|
|
135
|
+
<base-form-input v-model.trim="email" :label="$dataStore.t('form.email')" :rules="$rules.required" />
|
|
134
136
|
</v-form>
|
|
137
|
+
<base-btn :text="$dataStore.t('form.sendToEmail')" :loading="loading" @click="sendTemplateToEmail" />
|
|
135
138
|
</base-content-block>
|
|
136
|
-
<base-btn :text="buttonText" :loading="loading" @click="submitForm" />
|
|
137
139
|
</div>
|
|
138
140
|
</section>
|
|
139
141
|
</template>
|
|
@@ -151,6 +153,7 @@ export default defineComponent({
|
|
|
151
153
|
const loading = ref<boolean>(false);
|
|
152
154
|
const isPaperContract = ref<boolean>(false);
|
|
153
155
|
const isElectronicContract = ref<boolean>(true);
|
|
156
|
+
const email = ref<string>('');
|
|
154
157
|
|
|
155
158
|
const vForm = ref<any>();
|
|
156
159
|
const isSendNumberOpen = ref<boolean>(false);
|
|
@@ -315,7 +318,12 @@ export default defineComponent({
|
|
|
315
318
|
|
|
316
319
|
const paymentPeriod = computed(() => formStore.productConditionsForm.paymentPeriod.nameRu);
|
|
317
320
|
const insurancePremiumPerMonth = computed(() => dataStore.getNumberWithSpaces(formStore.productConditionsForm.insurancePremiumPerMonth));
|
|
318
|
-
const requestedSumInsured = computed(() =>
|
|
321
|
+
const requestedSumInsured = computed(() => {
|
|
322
|
+
if (dataStore.isLifeBusiness && formStore.productConditionsForm.requestedSumInsured === null) {
|
|
323
|
+
dataStore.getNumberWithSpaces(formStore.applicationData.policyAppDto!.mainInsSum);
|
|
324
|
+
}
|
|
325
|
+
return dataStore.getNumberWithSpaces(formStore.productConditionsForm.requestedSumInsured);
|
|
326
|
+
});
|
|
319
327
|
const price = computed(() => dataStore.getNumberWithSpaces(formStore.productConditionsForm.calculatorForm.price));
|
|
320
328
|
const insuredAmount = computed(() => formStore.productConditionsForm.calculatorForm.amount!.nameRu! + dataStore.currency);
|
|
321
329
|
const hasConditionsInfo = computed(() => {
|
|
@@ -327,6 +335,22 @@ export default defineComponent({
|
|
|
327
335
|
}
|
|
328
336
|
return true;
|
|
329
337
|
});
|
|
338
|
+
const downloadTemplate = async () => {
|
|
339
|
+
dataStore.panel.open = false;
|
|
340
|
+
dataStore.panelAction = null;
|
|
341
|
+
await dataStore.downloadTemplate();
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
const sendTemplateToEmail = async () => {
|
|
345
|
+
await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
346
|
+
if (v.valid) {
|
|
347
|
+
dataStore.panel.open = false;
|
|
348
|
+
dataStore.panelAction = null;
|
|
349
|
+
await dataStore.sendTemplateToEmail(email.value);
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
};
|
|
353
|
+
|
|
330
354
|
const handleSignAction = async (type: 'paper' | 'electronic') => {
|
|
331
355
|
if (type === 'electronic') {
|
|
332
356
|
await dataStore.signDocument();
|
|
@@ -336,11 +360,13 @@ export default defineComponent({
|
|
|
336
360
|
isPaperContract.value = true;
|
|
337
361
|
}
|
|
338
362
|
};
|
|
363
|
+
|
|
339
364
|
const generateDocument = async () => {
|
|
340
365
|
dataStore.panel.open = false;
|
|
341
366
|
dataStore.panelAction = null;
|
|
342
367
|
await dataStore.generateDocument();
|
|
343
368
|
};
|
|
369
|
+
|
|
344
370
|
return {
|
|
345
371
|
// State
|
|
346
372
|
formStore,
|
|
@@ -351,7 +377,7 @@ export default defineComponent({
|
|
|
351
377
|
phoneNumber,
|
|
352
378
|
selectedClient,
|
|
353
379
|
isPaperContract,
|
|
354
|
-
|
|
380
|
+
email,
|
|
355
381
|
// Functions
|
|
356
382
|
closePanel,
|
|
357
383
|
submitForm,
|
|
@@ -359,7 +385,8 @@ export default defineComponent({
|
|
|
359
385
|
openSmsPanel,
|
|
360
386
|
openEpayPanel,
|
|
361
387
|
onFileChange,
|
|
362
|
-
|
|
388
|
+
downloadTemplate,
|
|
389
|
+
sendTemplateToEmail,
|
|
363
390
|
// Computed
|
|
364
391
|
buttonText,
|
|
365
392
|
sendingActions,
|