hl-core 0.0.9-beta.41 → 0.0.9-beta.42-test
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 +3 -3
- package/components/Input/Datepicker.vue +38 -0
- package/components/Input/FileInput.vue +9 -1
- package/components/Input/TextInput.vue +2 -1
- package/components/Layout/SettingsPanel.vue +1 -1
- package/components/Pages/ProductConditions.vue +107 -118
- package/components/Panel/PanelHandler.vue +6 -43
- package/composables/classes.ts +159 -157
- package/locales/ru.json +8 -2
- package/package.json +1 -1
- package/store/data.store.ts +86 -21
- package/store/rules.ts +1 -0
- package/types/enum.ts +0 -3
- package/types/index.ts +29 -4
package/api/base.api.ts
CHANGED
|
@@ -750,7 +750,7 @@ export class ApiClass {
|
|
|
750
750
|
});
|
|
751
751
|
}
|
|
752
752
|
|
|
753
|
-
async
|
|
753
|
+
async saveClientActivityTypes(clientId: string | number, data: any) {
|
|
754
754
|
return await this.axiosCall({
|
|
755
755
|
method: Methods.POST,
|
|
756
756
|
url: `/${this.productUrl}/api/Application/saveClientAcivityTypes/?clientId=${clientId}`,
|
|
@@ -767,7 +767,7 @@ export class ApiClass {
|
|
|
767
767
|
}
|
|
768
768
|
|
|
769
769
|
async saveBeneficialOwner(processInstanceId: string | number, benificiaryId: string | null, data: any) {
|
|
770
|
-
return await this.axiosCall({
|
|
770
|
+
return await this.axiosCall<string>({
|
|
771
771
|
method: Methods.POST,
|
|
772
772
|
url: `/${this.productUrl}/api/Application/saveBeneficialOwner/?processInstanceId=${processInstanceId}&benificiaryId=${benificiaryId}`,
|
|
773
773
|
data: data,
|
|
@@ -783,7 +783,7 @@ export class ApiClass {
|
|
|
783
783
|
}
|
|
784
784
|
|
|
785
785
|
async saveInsured(processInstanceId: string | number, insuredId: string | null, data: any) {
|
|
786
|
-
return await this.axiosCall({
|
|
786
|
+
return await this.axiosCall<string>({
|
|
787
787
|
method: Methods.POST,
|
|
788
788
|
url: `/${this.productUrl}/api/Application/saveInsured/?processInstanceId=${processInstanceId}&insuredId=${insuredId}`,
|
|
789
789
|
data: data,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<vue-date-picker
|
|
3
|
+
class="base-datepicker"
|
|
3
4
|
:model-value="modelValue"
|
|
4
5
|
:clearable="false"
|
|
5
6
|
:disabled="disabled"
|
|
@@ -10,12 +11,16 @@
|
|
|
10
11
|
:teleport="true"
|
|
11
12
|
:close-on-scroll="true"
|
|
12
13
|
:enable-time-picker="false"
|
|
14
|
+
:six-weeks="true"
|
|
13
15
|
cancel-text="Отменить"
|
|
14
16
|
select-text="Выбрать"
|
|
15
17
|
>
|
|
16
18
|
<template #trigger>
|
|
17
19
|
<v-icon icon="mdi mdi-calendar-blank-outline cursor-pointer" />
|
|
18
20
|
</template>
|
|
21
|
+
<template #action-preview="{ value }">
|
|
22
|
+
{{ reformatDate(value) }}
|
|
23
|
+
</template>
|
|
19
24
|
</vue-date-picker>
|
|
20
25
|
</template>
|
|
21
26
|
|
|
@@ -36,3 +41,36 @@ export default defineComponent({
|
|
|
36
41
|
},
|
|
37
42
|
});
|
|
38
43
|
</script>
|
|
44
|
+
|
|
45
|
+
<style>
|
|
46
|
+
:root {
|
|
47
|
+
--dp-menu-min-width: 300px;
|
|
48
|
+
--dp-border-radius: 10px;
|
|
49
|
+
--dp-cell-border-radius: 9999px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.dp__calendar_item .dp__active_date {
|
|
53
|
+
@apply bg-[#A0B3D8];
|
|
54
|
+
}
|
|
55
|
+
.dp__calendar_item .dp__today {
|
|
56
|
+
@apply border-[#A0B3D8];
|
|
57
|
+
}
|
|
58
|
+
.dp__calendar_item .dp__today:not(.dp__active_date) {
|
|
59
|
+
@apply border-[#009C73];
|
|
60
|
+
}
|
|
61
|
+
.dp__overlay_cell_active {
|
|
62
|
+
@apply !bg-[#A0B3D8];
|
|
63
|
+
}
|
|
64
|
+
.dp__action_button {
|
|
65
|
+
@apply h-auto px-3 py-1 text-[14px] rounded-lg;
|
|
66
|
+
}
|
|
67
|
+
.dp__action_cancel {
|
|
68
|
+
@apply hover:border-[#A0B3D8];
|
|
69
|
+
}
|
|
70
|
+
.dp__action_select {
|
|
71
|
+
@apply bg-[#009C73] hover:bg-[#00a277] text-white px-4;
|
|
72
|
+
}
|
|
73
|
+
.dp__selection_preview[title*='/'] {
|
|
74
|
+
@apply rounded-lg border-[1px] px-3 py-1 text-[14px] text-[#009C73];
|
|
75
|
+
}
|
|
76
|
+
</style>
|
|
@@ -14,7 +14,11 @@
|
|
|
14
14
|
:label="label"
|
|
15
15
|
@click:append-inner="$emit('append-inner', $event)"
|
|
16
16
|
@click:clear="$emit('on-clear')"
|
|
17
|
-
|
|
17
|
+
>
|
|
18
|
+
<template v-slot:loader>
|
|
19
|
+
<v-progress-linear v-if="loading" color="#A0B3D8" height="3" indeterminate />
|
|
20
|
+
</template>
|
|
21
|
+
</v-file-input>
|
|
18
22
|
</template>
|
|
19
23
|
|
|
20
24
|
<script lang="ts">
|
|
@@ -34,6 +38,10 @@ export default defineComponent({
|
|
|
34
38
|
return useDataStore().t('labels.chooseDoc');
|
|
35
39
|
},
|
|
36
40
|
},
|
|
41
|
+
loading: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false,
|
|
44
|
+
},
|
|
37
45
|
},
|
|
38
46
|
emits: ['input', 'append-inner', 'on-clear'],
|
|
39
47
|
});
|
|
@@ -80,7 +80,7 @@ const hasHistory = computed(() => {
|
|
|
80
80
|
return !dataStore.isLKA;
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
-
const hasFAQ = computed(() =>
|
|
83
|
+
const hasFAQ = computed(() => router.hasRoute('FAQ'));
|
|
84
84
|
|
|
85
85
|
const openHistory = async () => {
|
|
86
86
|
dataStore.sendToParent(constants.postActions.toStatementHistory, dataStore.isBridge || dataStore.isDSO || dataStore.isUU ? '' : dataStore.product);
|
|
@@ -243,16 +243,13 @@
|
|
|
243
243
|
:label="$dataStore.t('productConditionsForm.statePremium7')"
|
|
244
244
|
:suffix="$constants.currencySymbols.kzt"
|
|
245
245
|
/>
|
|
246
|
-
<base-
|
|
246
|
+
<base-form-input
|
|
247
247
|
v-if="hasAgencyPart"
|
|
248
|
-
v-model="productConditionsForm.
|
|
249
|
-
:value="productConditionsForm.processTariff?.nameRu"
|
|
250
|
-
:readonly="isDisabled"
|
|
251
|
-
:clearable="!isDisabled"
|
|
252
|
-
:rules="$rules.objectRequired"
|
|
248
|
+
v-model="productConditionsForm.agentCommission"
|
|
253
249
|
:label="$dataStore.t('productConditionsForm.agencyPart')"
|
|
254
|
-
|
|
255
|
-
|
|
250
|
+
:readonly="isDisabledAgentCommission"
|
|
251
|
+
:clearable="!isDisabledAgentCommission"
|
|
252
|
+
:rules="$rules.required.concat($rules.numbers, $rules.agentCommission)"
|
|
256
253
|
/>
|
|
257
254
|
<base-panel-input
|
|
258
255
|
v-if="hasProcessGfot"
|
|
@@ -459,7 +456,13 @@
|
|
|
459
456
|
:clearable="false"
|
|
460
457
|
:label="coverTypeName(term)"
|
|
461
458
|
append-inner-icon="mdi mdi-chevron-right"
|
|
462
|
-
:suffix="
|
|
459
|
+
:suffix="
|
|
460
|
+
whichProduct === 'lifebusiness' && term.coverTypeCode === 6
|
|
461
|
+
? String(term.coverPeriodName ?? '')
|
|
462
|
+
: !!term.amount
|
|
463
|
+
? `${formatTermValue(term.amount)} ${currencySymbolsAddTerm}`
|
|
464
|
+
: ''
|
|
465
|
+
"
|
|
463
466
|
@append="openTermPanel(coverTypeName(term), $dataStore.getAdditionalInsuranceTermsAnswers, term.coverTypeId, index)"
|
|
464
467
|
/>
|
|
465
468
|
</div>
|
|
@@ -473,7 +476,7 @@
|
|
|
473
476
|
@click="submitForm"
|
|
474
477
|
/>
|
|
475
478
|
<div v-if="$dataStore.isTask() && $dataStore.isUnderwriter() && !isRecalculationDisabled" class="flex gap-3">
|
|
476
|
-
<base-btn :text="$dataStore.t('buttons.calcSum')" type="submit" @click.prevent="underwriterCalculate('sum')" :loading="isCalculating" />
|
|
479
|
+
<base-btn :text="$dataStore.t('buttons.calcSum')" v-if="hasCalcSum" type="submit" @click.prevent="underwriterCalculate('sum')" :loading="isCalculating" />
|
|
477
480
|
<base-btn :text="$dataStore.t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
|
|
478
481
|
</div>
|
|
479
482
|
<Teleport v-if="isPanelOpen" to="#right-panel-actions">
|
|
@@ -519,45 +522,23 @@
|
|
|
519
522
|
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
520
523
|
<base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
521
524
|
<div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
522
|
-
<
|
|
523
|
-
v-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
525
|
+
<div v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))">
|
|
526
|
+
<v-expansion-panels v-if="panelCodeList.includes(String(item.code)) && whichProduct === 'lifebusiness'" variant="accordion">
|
|
527
|
+
<v-expansion-panel class="hover:bg-[#f5f8fd]" elevation="0" bg-color="#F3F6FC">
|
|
528
|
+
<v-expansion-panel-title @click="pickTermValue(item)">
|
|
529
|
+
{{ item.nameRu }}
|
|
530
|
+
</v-expansion-panel-title>
|
|
531
|
+
<v-expansion-panel-text class="border-t-[1px] border-t-white cursor-pointer" :class="[$styles.textSimple]" v-for="(i, idx) of subPanelList">
|
|
532
|
+
<base-panel-select-item class="!p-0" :key="idx" :text="(i.nameRu as string)" :selected="i.code === subTermValue" @click="pickSubTermValue(item, i)" />
|
|
533
|
+
</v-expansion-panel-text>
|
|
534
|
+
</v-expansion-panel>
|
|
535
|
+
</v-expansion-panels>
|
|
536
|
+
<base-panel-select-item v-else :key="index" :text="(item.nameRu as string)" :selected="item.nameRu === termValue?.coverSumName" @click="pickTermValue(item)" />
|
|
537
|
+
</div>
|
|
529
538
|
</div>
|
|
530
539
|
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
|
|
531
540
|
</div>
|
|
532
541
|
</Teleport>
|
|
533
|
-
<Teleport v-if="isFixInsAmountPanelOpen" to="#right-panel-actions">
|
|
534
|
-
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
535
|
-
<base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
536
|
-
<div class="w-full flex flex-col gap-2 p-2">
|
|
537
|
-
<base-panel-select-item
|
|
538
|
-
v-for="(item, index) of $constants.fixInsAmount.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
|
|
539
|
-
:key="index"
|
|
540
|
-
:text="(item.nameRu as string)"
|
|
541
|
-
:selected="item.code === fixInsValue"
|
|
542
|
-
@click="pickfixInsValue(item)"
|
|
543
|
-
/>
|
|
544
|
-
</div>
|
|
545
|
-
</div>
|
|
546
|
-
</Teleport>
|
|
547
|
-
<Teleport v-if="isCoverPeriodPanelOpen" to="#right-panel-actions">
|
|
548
|
-
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
549
|
-
<base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
550
|
-
<div class="w-full flex flex-col gap-2 p-2">
|
|
551
|
-
<base-panel-select-item
|
|
552
|
-
v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
|
|
553
|
-
:key="index"
|
|
554
|
-
:text="(item.nameRu as string)"
|
|
555
|
-
:selected="item.code === coverPeriodValue"
|
|
556
|
-
@click="pickCoverPeriodValue(item)"
|
|
557
|
-
/>
|
|
558
|
-
</div>
|
|
559
|
-
</div>
|
|
560
|
-
</Teleport>
|
|
561
542
|
</section>
|
|
562
543
|
</template>
|
|
563
544
|
|
|
@@ -588,18 +569,17 @@ export default defineComponent({
|
|
|
588
569
|
const isPanelLoading = ref<boolean>(false);
|
|
589
570
|
const isPanelOpen = ref<boolean>(false);
|
|
590
571
|
const isTermsPanelOpen = ref<boolean>(false);
|
|
591
|
-
const isFixInsAmountPanelOpen = ref<boolean>(false);
|
|
592
|
-
const isCoverPeriodPanelOpen = ref<boolean>(false);
|
|
593
|
-
const fixInsValue = ref<string | number>();
|
|
594
|
-
const coverPeriodValue = ref<string>('');
|
|
595
572
|
const panelValue = ref<Value>(new Value());
|
|
596
573
|
const termValue = ref<AddCover>();
|
|
574
|
+
const subTermValue = ref<string>('');
|
|
597
575
|
const panelList = ref<Value[]>([]);
|
|
576
|
+
const subPanelList = ref<Value[]>([]);
|
|
598
577
|
const productConditionsForm = formStore.productConditionsForm;
|
|
599
578
|
const currentPanel = ref<keyof typeof productConditionsForm>();
|
|
600
579
|
const currentIndex = ref<number>();
|
|
601
580
|
const searchQuery = ref<string>('');
|
|
602
581
|
const whichSum = ref<'insurancePremiumPerMonth' | 'requestedSumInsured' | ''>('');
|
|
582
|
+
const panelCodeList = ['processcovertypesum', 'fixedinssum'];
|
|
603
583
|
|
|
604
584
|
const additionalTerms = ref<AddCover[]>([]);
|
|
605
585
|
|
|
@@ -628,6 +608,9 @@ export default defineComponent({
|
|
|
628
608
|
if (whichProduct.value === 'gons') {
|
|
629
609
|
return true;
|
|
630
610
|
}
|
|
611
|
+
if (whichProduct.value === 'lifebusiness' && dataStore.isUnderwriter()) {
|
|
612
|
+
return false;
|
|
613
|
+
}
|
|
631
614
|
return isDisabled.value;
|
|
632
615
|
});
|
|
633
616
|
const isTask = computed(() => (route.params.taskId === '0' && props.isCalculator === true) || dataStore.isTask());
|
|
@@ -635,12 +618,12 @@ export default defineComponent({
|
|
|
635
618
|
const isUnderwriterRole = computed(() => dataStore.isUnderwriter() || dataStore.isAdmin() || dataStore.isSupport());
|
|
636
619
|
const insurancePremiumPerMonthRule = computed(() => (!!productConditionsForm.insurancePremiumPerMonth ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
637
620
|
const insurancePremiumPerMonthDisabled = computed(() => {
|
|
638
|
-
if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
|
|
639
|
-
return false;
|
|
640
|
-
}
|
|
641
621
|
if (whichProduct.value === 'lifebusiness') {
|
|
642
622
|
return true;
|
|
643
623
|
}
|
|
624
|
+
if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
|
|
625
|
+
return false;
|
|
626
|
+
}
|
|
644
627
|
return isDisabled.value;
|
|
645
628
|
});
|
|
646
629
|
const requestedSumInsuredRule = computed(() => (!!productConditionsForm.requestedSumInsured ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
@@ -797,12 +780,12 @@ export default defineComponent({
|
|
|
797
780
|
if (whichProduct.value === 'halykkazyna') {
|
|
798
781
|
return true;
|
|
799
782
|
}
|
|
800
|
-
if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
|
|
801
|
-
return false;
|
|
802
|
-
}
|
|
803
783
|
if (whichProduct.value === 'lifebusiness' && productConditionsForm.processGfot.id !== null) {
|
|
804
784
|
return true;
|
|
805
785
|
}
|
|
786
|
+
if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
|
|
787
|
+
return false;
|
|
788
|
+
}
|
|
806
789
|
return isDisabled.value;
|
|
807
790
|
});
|
|
808
791
|
const isDisabledSumDollar = computed(() => {
|
|
@@ -837,8 +820,23 @@ export default defineComponent({
|
|
|
837
820
|
if (whichProduct.value === 'lifebusiness' && !!productConditionsForm.requestedSumInsured) {
|
|
838
821
|
return true;
|
|
839
822
|
}
|
|
823
|
+
if (dataStore.isUnderwriter()) {
|
|
824
|
+
return false;
|
|
825
|
+
}
|
|
840
826
|
return isDisabled.value;
|
|
841
827
|
});
|
|
828
|
+
const isDisabledAgentCommission = computed(() => {
|
|
829
|
+
if (whichProduct.value === 'lifebusiness' || dataStore.isUnderwriter()) {
|
|
830
|
+
return false;
|
|
831
|
+
}
|
|
832
|
+
return isDisabled.value;
|
|
833
|
+
});
|
|
834
|
+
const hasCalcSum = computed(() => {
|
|
835
|
+
if (whichProduct.value === 'lifebusiness') {
|
|
836
|
+
return false;
|
|
837
|
+
}
|
|
838
|
+
return true;
|
|
839
|
+
});
|
|
842
840
|
const formatTermValue = (term: number) => {
|
|
843
841
|
if (term !== null) {
|
|
844
842
|
const termNumber = Number(term);
|
|
@@ -907,36 +905,47 @@ export default defineComponent({
|
|
|
907
905
|
}
|
|
908
906
|
};
|
|
909
907
|
const pickTermValue = async (item: Value) => {
|
|
910
|
-
|
|
911
|
-
|
|
908
|
+
if (!panelCodeList.includes(item.code as string)) {
|
|
909
|
+
dataStore.rightPanel.open = false;
|
|
910
|
+
isTermsPanelOpen.value = false;
|
|
911
|
+
}
|
|
912
912
|
if (typeof currentIndex.value !== 'number') return;
|
|
913
|
+
|
|
914
|
+
if (whichProduct.value === 'lifebusiness' && item.code === 'processcovertypesum') {
|
|
915
|
+
if (item.id !== additionalTerms.value[currentIndex.value].coverSumId) {
|
|
916
|
+
additionalTerms.value[currentIndex.value].coverPeriodCode = null;
|
|
917
|
+
additionalTerms.value[currentIndex.value].coverPeriodId = null;
|
|
918
|
+
additionalTerms.value[currentIndex.value].coverPeriodName = null;
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
|
|
913
922
|
additionalTerms.value[currentIndex.value].coverSumId = item.id as string;
|
|
914
923
|
additionalTerms.value[currentIndex.value].coverSumName = item.nameRu as string;
|
|
924
|
+
|
|
915
925
|
if (whichProduct.value === 'lifebusiness') {
|
|
916
|
-
if (item.code === 'fixedinssum') {
|
|
917
|
-
|
|
926
|
+
if (termValue.value && item.code === 'fixedinssum') {
|
|
927
|
+
subPanelList.value = constants.fixInsAmount;
|
|
928
|
+
subTermValue.value = String(termValue.value.amount);
|
|
918
929
|
} else {
|
|
919
930
|
additionalTerms.value[currentIndex.value].amount = 0;
|
|
920
931
|
}
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
isMultiplePanelOpen.value = false;
|
|
933
|
-
dataStore.rightPanel.title = dataStore.t('clients.coveragePeriod');
|
|
932
|
+
|
|
933
|
+
if (termValue.value && termValue.value.coverTypeCode === 6 && item.code === 'processcovertypesum') {
|
|
934
|
+
const response = await dataStore.getFromApi('DicCoverTypePeriod', 'getArmDicts', 'DicCoverTypePeriod');
|
|
935
|
+
subPanelList.value = response;
|
|
936
|
+
subTermValue.value = termValue.value.coverPeriodCode as string;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
if (termValue.value && termValue.value.coverTypeCode === 6 && item.code !== 'processcovertypesum') {
|
|
940
|
+
additionalTerms.value[currentIndex.value].coverPeriodCode = null;
|
|
941
|
+
additionalTerms.value[currentIndex.value].coverPeriodId = null;
|
|
942
|
+
additionalTerms.value[currentIndex.value].coverPeriodName = null;
|
|
934
943
|
}
|
|
935
944
|
}
|
|
936
945
|
};
|
|
937
946
|
|
|
938
947
|
const openPanel = async (title: string, list: Value[], key: string, asyncFunction?: Function, filterKey?: string) => {
|
|
939
|
-
if (!isDisabled.value || (key === 'riskGroup' && !isRecalculationDisabled.value)) {
|
|
948
|
+
if (!isDisabled.value || (key === 'riskGroup' && !isRecalculationDisabled.value) || (key === 'processGfot' && !isDisabledProcessGfot.value)) {
|
|
940
949
|
if (key === 'amount') {
|
|
941
950
|
if (calculatorForm.type.nameRu === null || !calculatorForm.countries || (calculatorForm.countries && calculatorForm.countries.length === 0)) {
|
|
942
951
|
return dataStore.showToaster('error', dataStore.t('toaster.noAmountBeforeTypeAndCountries'), 2000);
|
|
@@ -951,8 +960,6 @@ export default defineComponent({
|
|
|
951
960
|
currentPanel.value = key as keyof typeof productConditionsForm;
|
|
952
961
|
isPanelOpen.value = true;
|
|
953
962
|
isTermsPanelOpen.value = false;
|
|
954
|
-
isFixInsAmountPanelOpen.value = false;
|
|
955
|
-
isCoverPeriodPanelOpen.value = false;
|
|
956
963
|
dataStore.panelAction = null;
|
|
957
964
|
dataStore.rightPanel.open = true;
|
|
958
965
|
dataStore.rightPanel.title = title;
|
|
@@ -979,8 +986,6 @@ export default defineComponent({
|
|
|
979
986
|
const openMultiplePanel = async (title: string, list: CountryValue[], key: string, asyncFunction?: Function, filterKey?: string) => {
|
|
980
987
|
if (!isDisabled.value || !isRecalculationDisabled.value) {
|
|
981
988
|
isPanelOpen.value = false;
|
|
982
|
-
isFixInsAmountPanelOpen.value = false;
|
|
983
|
-
isCoverPeriodPanelOpen.value = false;
|
|
984
989
|
isMultiplePanelOpen.value = true;
|
|
985
990
|
isPanelLoading.value = true;
|
|
986
991
|
let newList = list;
|
|
@@ -1024,13 +1029,11 @@ export default defineComponent({
|
|
|
1024
1029
|
};
|
|
1025
1030
|
|
|
1026
1031
|
const openTermPanel = async (title: string, asyncFunction: Function, questionId: string, index: number) => {
|
|
1027
|
-
if (!isDisabled.value) {
|
|
1032
|
+
if (!isDisabled.value || (whichProduct.value === 'lifebusiness' && dataStore.isUnderwriter())) {
|
|
1028
1033
|
searchQuery.value = '';
|
|
1029
1034
|
currentIndex.value = index;
|
|
1030
1035
|
isPanelOpen.value = false;
|
|
1031
1036
|
isMultiplePanelOpen.value = false;
|
|
1032
|
-
isFixInsAmountPanelOpen.value = false;
|
|
1033
|
-
isCoverPeriodPanelOpen.value = false;
|
|
1034
1037
|
isTermsPanelOpen.value = true;
|
|
1035
1038
|
dataStore.panelAction = null;
|
|
1036
1039
|
dataStore.rightPanel.open = true;
|
|
@@ -1050,39 +1053,21 @@ export default defineComponent({
|
|
|
1050
1053
|
}
|
|
1051
1054
|
};
|
|
1052
1055
|
|
|
1053
|
-
const
|
|
1054
|
-
if (!isDisabled.value) {
|
|
1055
|
-
searchQuery.value = '';
|
|
1056
|
-
isPanelOpen.value = false;
|
|
1057
|
-
isTermsPanelOpen.value = false;
|
|
1058
|
-
isMultiplePanelOpen.value = false;
|
|
1059
|
-
isCoverPeriodPanelOpen.value = false;
|
|
1060
|
-
isFixInsAmountPanelOpen.value = true;
|
|
1061
|
-
dataStore.panelAction = null;
|
|
1062
|
-
dataStore.rightPanel.open = true;
|
|
1063
|
-
dataStore.rightPanel.title = title;
|
|
1064
|
-
panelList.value = constants.fixInsAmount;
|
|
1065
|
-
fixInsValue.value = String(amount);
|
|
1066
|
-
} else {
|
|
1067
|
-
dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
|
|
1068
|
-
}
|
|
1069
|
-
};
|
|
1070
|
-
|
|
1071
|
-
const pickfixInsValue = (item: Value) => {
|
|
1056
|
+
const pickSubTermValue = (item: Value, subItem: Value) => {
|
|
1072
1057
|
dataStore.rightPanel.open = false;
|
|
1073
|
-
|
|
1058
|
+
isTermsPanelOpen.value = false;
|
|
1059
|
+
subTermValue.value = item.code as string;
|
|
1074
1060
|
if (typeof currentIndex.value !== 'number') return;
|
|
1075
|
-
additionalTerms.value[currentIndex.value].amount = Number(item.code);
|
|
1076
|
-
};
|
|
1077
1061
|
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
if (
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1062
|
+
if (item.code === 'fixedinssum') {
|
|
1063
|
+
additionalTerms.value[currentIndex.value].amount = Number(subItem.code);
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
if (item.code === 'processcovertypesum') {
|
|
1067
|
+
additionalTerms.value[currentIndex.value].coverPeriodCode = subItem.code as string;
|
|
1068
|
+
additionalTerms.value[currentIndex.value].coverPeriodId = subItem.id as string;
|
|
1069
|
+
additionalTerms.value[currentIndex.value].coverPeriodName = subItem.nameRu as string;
|
|
1070
|
+
}
|
|
1086
1071
|
};
|
|
1087
1072
|
|
|
1088
1073
|
const underwriterCalculate = async (type: 'sum' | 'premium') => {
|
|
@@ -1296,7 +1281,12 @@ export default defineComponent({
|
|
|
1296
1281
|
recalculationData.premium = Number((productConditionsForm.insurancePremiumPerMonth as string)?.replace(/\s/g, ''));
|
|
1297
1282
|
recalculationData.riskGroup = productConditionsForm.riskGroup?.id ? productConditionsForm.riskGroup.id : 1;
|
|
1298
1283
|
isCalculating.value = true;
|
|
1299
|
-
|
|
1284
|
+
if (whichProduct.value === 'lifebusiness') {
|
|
1285
|
+
await dataStore.calculate(route.params.taskId as string);
|
|
1286
|
+
additionalTerms.value = formStore.additionalInsuranceTerms;
|
|
1287
|
+
} else {
|
|
1288
|
+
await dataStore.reCalculate(formStore.applicationData.processInstanceId, recalculationData, route.params.taskId as string, whichSum.value);
|
|
1289
|
+
}
|
|
1300
1290
|
}
|
|
1301
1291
|
isCalculating.value = true;
|
|
1302
1292
|
if (props.isCalculator) {
|
|
@@ -1492,10 +1482,9 @@ export default defineComponent({
|
|
|
1492
1482
|
whichSum,
|
|
1493
1483
|
Value,
|
|
1494
1484
|
calculatorForm,
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
coverPeriodValue,
|
|
1485
|
+
subPanelList,
|
|
1486
|
+
subTermValue,
|
|
1487
|
+
panelCodeList,
|
|
1499
1488
|
|
|
1500
1489
|
// Computed
|
|
1501
1490
|
isTask,
|
|
@@ -1536,6 +1525,8 @@ export default defineComponent({
|
|
|
1536
1525
|
hasDefault,
|
|
1537
1526
|
isDisabledProcessGfot,
|
|
1538
1527
|
isShownAdditionalTerms,
|
|
1528
|
+
hasCalcSum,
|
|
1529
|
+
isDisabledAgentCommission,
|
|
1539
1530
|
|
|
1540
1531
|
// Rules
|
|
1541
1532
|
coverPeriodRule,
|
|
@@ -1562,10 +1553,8 @@ export default defineComponent({
|
|
|
1562
1553
|
formatTermValue,
|
|
1563
1554
|
filterTermConditions,
|
|
1564
1555
|
selectOption,
|
|
1565
|
-
pickfixInsValue,
|
|
1566
|
-
openFixInsPanel,
|
|
1567
|
-
pickCoverPeriodValue,
|
|
1568
1556
|
coverTypeName,
|
|
1557
|
+
pickSubTermValue,
|
|
1569
1558
|
};
|
|
1570
1559
|
},
|
|
1571
1560
|
});
|
|
@@ -148,27 +148,12 @@
|
|
|
148
148
|
<base-btn :text="buttonText" :loading="loading" @click="submitForm" />
|
|
149
149
|
</div>
|
|
150
150
|
</section>
|
|
151
|
-
<section v-if="templateAction">
|
|
152
|
-
<div :class="[$styles.flexColNav]">
|
|
153
|
-
<base-content-block>
|
|
154
|
-
<base-panel-item class="cursor-pointer bg-white mb-4 border-b-0 rounded" @click.prevent="downloadTemplate(constants.documentTypes.insuredsList, 'vnd.ms-excel')">
|
|
155
|
-
{{ $dataStore.t('downloadTemplate') }}
|
|
156
|
-
<i class="mdi mdi-download text-2xl text-[#A0B3D8]"></i
|
|
157
|
-
></base-panel-item>
|
|
158
|
-
</base-content-block>
|
|
159
|
-
<base-content-block>
|
|
160
|
-
<v-form ref="vForm" class="mb-3">
|
|
161
|
-
<base-form-input v-model.trim="email" :label="$dataStore.t('form.email')" :rules="$rules.required" />
|
|
162
|
-
</v-form>
|
|
163
|
-
<base-btn :text="$dataStore.t('form.sendToEmail')" :loading="loading" @click="sendTemplateToEmail" />
|
|
164
|
-
</base-content-block>
|
|
165
|
-
</div>
|
|
166
|
-
</section>
|
|
167
151
|
</template>
|
|
168
152
|
|
|
169
153
|
<script lang="ts">
|
|
170
154
|
import { DocumentItem, Value } from '../../composables/classes';
|
|
171
155
|
import { HubConnectionBuilder } from '@microsoft/signalr';
|
|
156
|
+
import { uuid } from 'vue-uuid';
|
|
172
157
|
|
|
173
158
|
export default defineComponent({
|
|
174
159
|
emits: ['task'],
|
|
@@ -182,7 +167,6 @@ export default defineComponent({
|
|
|
182
167
|
const isScansDocuments = ref<boolean>(false);
|
|
183
168
|
const isQr = ref<boolean>(false);
|
|
184
169
|
const isElectronicContract = ref<boolean>(true);
|
|
185
|
-
const email = ref<string>('');
|
|
186
170
|
const qrUrl = ref<string>('');
|
|
187
171
|
const connection = ref<any>(null);
|
|
188
172
|
const isQrLoading = ref<boolean>(false);
|
|
@@ -367,25 +351,17 @@ export default defineComponent({
|
|
|
367
351
|
case constants.actions.register:
|
|
368
352
|
return dataStore.t('buttons.register');
|
|
369
353
|
case constants.actions.affiliate:
|
|
370
|
-
case constants.actions.template:
|
|
371
354
|
return dataStore.t('buttons.send');
|
|
372
355
|
default:
|
|
373
356
|
return dataStore.t('buttons.send');
|
|
374
357
|
}
|
|
375
358
|
});
|
|
376
359
|
|
|
377
|
-
const panelTitle = computed(() => {
|
|
378
|
-
if (dataStore.isLifeBusiness && dataStore.panelAction === constants.actions.template) {
|
|
379
|
-
return dataStore.t('template');
|
|
380
|
-
}
|
|
381
|
-
return buttonText.value;
|
|
382
|
-
});
|
|
383
|
-
|
|
384
360
|
watch(
|
|
385
361
|
() => dataStore.panelAction,
|
|
386
362
|
val => {
|
|
387
363
|
if (!!val) {
|
|
388
|
-
dataStore.panel.title =
|
|
364
|
+
dataStore.panel.title = buttonText.value;
|
|
389
365
|
dataStore.panel.open = true;
|
|
390
366
|
}
|
|
391
367
|
},
|
|
@@ -403,7 +379,6 @@ export default defineComponent({
|
|
|
403
379
|
() => dataStore.panelAction === constants.actions.reject || dataStore.panelAction === constants.actions.return || dataStore.panelAction === constants.actions.rejectclient,
|
|
404
380
|
);
|
|
405
381
|
const acceptAction = computed(() => dataStore.panelAction === constants.actions.accept);
|
|
406
|
-
const templateAction = computed(() => dataStore.panelAction === constants.actions.template);
|
|
407
382
|
const signingActions = computed(() => dataStore.panelAction === constants.actions.sign);
|
|
408
383
|
const payingActions = computed(() => dataStore.panelAction === constants.actions.pay);
|
|
409
384
|
const affiliateActions = computed(() => dataStore.panelAction === constants.actions.affiliate);
|
|
@@ -456,21 +431,12 @@ export default defineComponent({
|
|
|
456
431
|
await dataStore.downloadTemplate(documentType, fileType);
|
|
457
432
|
};
|
|
458
433
|
|
|
459
|
-
const sendTemplateToEmail = async () => {
|
|
460
|
-
await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
461
|
-
if (v.valid) {
|
|
462
|
-
dataStore.panel.open = false;
|
|
463
|
-
dataStore.panelAction = null;
|
|
464
|
-
await dataStore.sendTemplateToEmail(email.value);
|
|
465
|
-
}
|
|
466
|
-
});
|
|
467
|
-
};
|
|
468
|
-
|
|
469
434
|
const handleSignAction = async (type: 'paper' | 'electronic' | 'scans' | 'qr') => {
|
|
470
435
|
loading.value = true;
|
|
471
436
|
if (type === 'electronic') {
|
|
472
437
|
await dataStore.signDocument();
|
|
473
438
|
isElectronicContract.value = true;
|
|
439
|
+
dataStore.panelAction = constants.actions.sign;
|
|
474
440
|
}
|
|
475
441
|
if (type === 'paper') {
|
|
476
442
|
isPaperContract.value = true;
|
|
@@ -491,8 +457,8 @@ export default defineComponent({
|
|
|
491
457
|
|
|
492
458
|
// TODO Рефактор QR c npm
|
|
493
459
|
const generateQR = async (groupId: string) => {
|
|
494
|
-
const
|
|
495
|
-
const qrValue = `${getValuePerEnv('qrGenUrl')}/${
|
|
460
|
+
const uuidV4 = uuid.v4();
|
|
461
|
+
const qrValue = `${getValuePerEnv('qrGenUrl')}/${uuidV4}/${groupId}`;
|
|
496
462
|
qrUrl.value = `https://api.qrserver.com/v1/create-qr-code/?size=135x135&data=${qrValue}`;
|
|
497
463
|
|
|
498
464
|
if (dataStore.isLifeBusiness) {
|
|
@@ -503,7 +469,7 @@ export default defineComponent({
|
|
|
503
469
|
urlCopy.value = `https://mgovsign.page.link/?link=${qrValue}?mgovSign&apn=kz.mobile.mgov&isi=1476128386&ibi=kz.egov.mobile`;
|
|
504
470
|
}
|
|
505
471
|
|
|
506
|
-
await startConnection(
|
|
472
|
+
await startConnection(uuidV4);
|
|
507
473
|
};
|
|
508
474
|
|
|
509
475
|
const startConnection = async (uuid: string) => {
|
|
@@ -560,7 +526,6 @@ export default defineComponent({
|
|
|
560
526
|
selectedClient,
|
|
561
527
|
isPaperContract,
|
|
562
528
|
isScansDocuments,
|
|
563
|
-
email,
|
|
564
529
|
isQr,
|
|
565
530
|
qrUrl,
|
|
566
531
|
scansFiles,
|
|
@@ -575,7 +540,6 @@ export default defineComponent({
|
|
|
575
540
|
openEpayPanel,
|
|
576
541
|
onFileChange,
|
|
577
542
|
downloadTemplate,
|
|
578
|
-
sendTemplateToEmail,
|
|
579
543
|
onFileChangeScans,
|
|
580
544
|
sendFiles,
|
|
581
545
|
onClearFile,
|
|
@@ -596,7 +560,6 @@ export default defineComponent({
|
|
|
596
560
|
hasConditionsInfo,
|
|
597
561
|
price,
|
|
598
562
|
insuredAmount,
|
|
599
|
-
templateAction,
|
|
600
563
|
isElectronicContract,
|
|
601
564
|
handleSignAction,
|
|
602
565
|
generateDocument,
|