hl-core 0.0.8-beta.26 → 0.0.8-beta.28
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/components/Dialog/Dialog.vue +2 -35
- package/components/Form/FormBlock.vue +4 -2
- package/components/Form/ManagerAttachment.vue +1 -0
- package/components/Input/FormInput.vue +9 -5
- package/components/Menu/MenuNavItem.vue +5 -2
- package/components/Pages/Anketa.vue +1 -1
- package/components/Pages/Auth.vue +3 -1
- package/components/Pages/MemberForm.vue +99 -94
- package/components/Pages/ProductConditions.vue +2 -1
- package/components/Utilities/Chip.vue +27 -0
- package/composables/classes.ts +8 -3
- package/composables/index.ts +53 -1
- package/locales/en.json +13 -9
- package/locales/kz.json +13 -9
- package/locales/ru.json +14 -10
- package/package.json +4 -2
- package/plugins/helperFunctionsPlugins.ts +1 -0
- package/store/data.store.js +107 -89
- package/store/member.store.ts +31 -11
- package/types/index.ts +5 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-dialog
|
|
2
|
+
<v-dialog :model-value="modelValue" @update:modelValue="$emit('update:modelValue', $event)" :persistent="true">
|
|
3
3
|
<v-card class="self-center w-full sm:w-3/4 md:w-2/3 lg:w-2/4 xl:w-[600px] rounded-lg !p-2">
|
|
4
4
|
<v-card-title>
|
|
5
5
|
<slot v-if="!title" name="title"></slot>
|
|
@@ -41,39 +41,6 @@ export default defineComponent({
|
|
|
41
41
|
default: 'default',
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
|
-
emits: ['update:modelValue', '
|
|
45
|
-
setup(props, { emit }) {
|
|
46
|
-
const fieldModel = ref(props.modelValue);
|
|
47
|
-
|
|
48
|
-
const updateValue = (event: boolean) => {
|
|
49
|
-
fieldModel.value = event;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const submitted = (event: any) => {
|
|
53
|
-
emit('submitted', event);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
watch(
|
|
57
|
-
fieldModel,
|
|
58
|
-
() => {
|
|
59
|
-
emit('update:modelValue', fieldModel.value);
|
|
60
|
-
},
|
|
61
|
-
{ immediate: true },
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
watch(
|
|
65
|
-
() => props.modelValue,
|
|
66
|
-
() => {
|
|
67
|
-
fieldModel.value = props.modelValue;
|
|
68
|
-
},
|
|
69
|
-
{ immediate: true },
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
fieldModel,
|
|
74
|
-
submitted,
|
|
75
|
-
updateValue,
|
|
76
|
-
};
|
|
77
|
-
},
|
|
44
|
+
emits: ['update:modelValue', 'yes', 'no'],
|
|
78
45
|
});
|
|
79
46
|
</script>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<div class="flex justify-between mr-5">
|
|
5
5
|
<p :class="[$libStyles.textTitle, $libStyles.greenText]">{{ title }}</p>
|
|
6
6
|
<div
|
|
7
|
-
v-if="isMultiple && more && !isShort"
|
|
7
|
+
v-if="isMultiple && more && !isShort && isActionsAvailable"
|
|
8
8
|
:class="[$libStyles.blueBg, $libStyles.whiteText, $libStyles.textSimple, disabled ? $libStyles.disabled : 'cursor-pointer']"
|
|
9
9
|
class="hidden lg:flex transition-all rounded-lg h-[36px] flex items-center font-medium justify-center opacity-50 hover:opacity-90 w-[120px]"
|
|
10
10
|
@click="!disabled && memberStore.addMember(whichForm)"
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
</div>
|
|
70
70
|
</div>
|
|
71
71
|
<div
|
|
72
|
-
v-if="isMultiple && more && !isShort"
|
|
72
|
+
v-if="isMultiple && more && !isShort && isActionsAvailable"
|
|
73
73
|
:class="[$libStyles.blueBg, $libStyles.whiteText, $libStyles.textSimple, disabled ? $libStyles.disabled : 'cursor-pointer']"
|
|
74
74
|
class="block lg:hidden transition-all rounded-b-lg h-[36px] flex items-center font-medium justify-center opacity-50 hover:opacity-90"
|
|
75
75
|
@click="!disabled && memberStore.addMember(whichForm)"
|
|
@@ -119,6 +119,7 @@ export default defineComponent({
|
|
|
119
119
|
const member: Member = formStore[props.whichForm as MemberKeys];
|
|
120
120
|
|
|
121
121
|
const isShort = computed(() => props.type === 'short');
|
|
122
|
+
const isActionsAvailable = computed(() => memberStore.isStatementEditible(props.whichForm));
|
|
122
123
|
|
|
123
124
|
const getMemberInfo = (memberData: Member) => {
|
|
124
125
|
return {
|
|
@@ -140,6 +141,7 @@ export default defineComponent({
|
|
|
140
141
|
|
|
141
142
|
// Computed
|
|
142
143
|
isShort,
|
|
144
|
+
isActionsAvailable,
|
|
143
145
|
|
|
144
146
|
// Functions
|
|
145
147
|
getMemberInfo,
|
|
@@ -117,6 +117,7 @@ export default defineComponent({
|
|
|
117
117
|
() =>
|
|
118
118
|
props.disabled ||
|
|
119
119
|
route.params.taskId === '0' ||
|
|
120
|
+
!dataStore.isInitiator() ||
|
|
120
121
|
(route.params.taskId !== '0' && (!dataStore.isProcessEditable(formStore.applicationData.statusCode) || !dataStore.isTask())),
|
|
121
122
|
);
|
|
122
123
|
|
|
@@ -31,11 +31,16 @@
|
|
|
31
31
|
>
|
|
32
32
|
<template v-if="appendInnerIcon && appendInnerIcon.length" v-slot:append-inner>
|
|
33
33
|
<v-icon
|
|
34
|
-
v-if="appendInnerIcon
|
|
34
|
+
v-if="appendInnerIcon.includes('mdi-calendar-blank-outline') === false"
|
|
35
35
|
:icon="appendInnerIcon"
|
|
36
36
|
@click="appendInnerIcon.includes('mdi-magnify') ? $emit('append') : !props.readonly && $emit('append')"
|
|
37
37
|
></v-icon>
|
|
38
|
-
<base-datepicker
|
|
38
|
+
<base-datepicker
|
|
39
|
+
v-if="appendInnerIcon.includes('mdi-calendar-blank-outline') && !props.readonly"
|
|
40
|
+
:model-value="modelValue"
|
|
41
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
42
|
+
:teleport="teleport"
|
|
43
|
+
></base-datepicker>
|
|
39
44
|
</template>
|
|
40
45
|
<template v-if="loading" #loader>
|
|
41
46
|
<v-progress-linear :active="loading" :color="color" absolute height="1" indeterminate></v-progress-linear>
|
|
@@ -148,9 +153,9 @@ export default defineComponent({
|
|
|
148
153
|
border: none !important;
|
|
149
154
|
outline: none !important;
|
|
150
155
|
}
|
|
151
|
-
.form-input input {
|
|
156
|
+
/* .form-input input {
|
|
152
157
|
padding-top: 30px;
|
|
153
|
-
}
|
|
158
|
+
} */
|
|
154
159
|
.form-input .v-field {
|
|
155
160
|
box-shadow: none;
|
|
156
161
|
font-size: 14px;
|
|
@@ -159,7 +164,6 @@ export default defineComponent({
|
|
|
159
164
|
top: 20px;
|
|
160
165
|
}
|
|
161
166
|
.form-input .v-field__append-inner {
|
|
162
|
-
padding-top: 18px;
|
|
163
167
|
padding-right: 6px;
|
|
164
168
|
}
|
|
165
169
|
.form-input .v-field__append-inner i {
|
|
@@ -7,10 +7,13 @@
|
|
|
7
7
|
$libStyles.textSimple,
|
|
8
8
|
disabled ? 'cursor-not-allowed opacity-50' : '',
|
|
9
9
|
]"
|
|
10
|
-
class="h-[60px] flex items-center justify-between hover:bg-[#A0B3D8] hover:!text-white pl-4 cursor-pointer transition-all"
|
|
10
|
+
class="h-[60px] flex items-center justify-between hover:bg-[#A0B3D8] hover:!text-white pl-4 cursor-pointer transition-all group"
|
|
11
11
|
>
|
|
12
12
|
<span>{{ menuItem.title }}</span>
|
|
13
|
-
<
|
|
13
|
+
<div class="flex items-center">
|
|
14
|
+
<i v-if="menuItem.icon" class="mdi text-xl pr-4" :class="[menuItem.icon]"></i>
|
|
15
|
+
<base-chip :chip="menuItem.chip"></base-chip>
|
|
16
|
+
</div>
|
|
14
17
|
<v-tooltip v-if="menuItem.description" activator="parent" location="bottom">{{ menuItem.description }}</v-tooltip>
|
|
15
18
|
</div>
|
|
16
19
|
</template>
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
</base-form-text-section>
|
|
70
70
|
</section>
|
|
71
71
|
</v-form>
|
|
72
|
-
<base-btn class="my-[14px] self-center" :loading="isButtonLoading" :disabled="formStore.isDisabled[whichSurvey]" @click="submitForm" :text="$t('buttons.save')"></base-btn>
|
|
72
|
+
<base-btn class="my-[14px] self-center" :loading="isButtonLoading" :disabled="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()" @click="submitForm" :text="$t('buttons.save')"></base-btn>
|
|
73
73
|
</section>
|
|
74
74
|
<v-btn
|
|
75
75
|
v-if="secondQuestionList && secondQuestionList.length && firstPanel"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section class="flex h-full" :class="$libStyles.blueBgLight">
|
|
3
|
+
<!-- @vue-ignore -->
|
|
3
4
|
<aside :class="{ '!hidden': !$display().lgAndUp.value }" class="w-full lg:w-1/4 bg-white flex flex-col justify-between border-r-2 relative px-8">
|
|
4
5
|
<img draggable="false" class="w-[50%] mt-8" src="~/assets/auth-logo.svg" />
|
|
5
6
|
<div class="self-center flex flex-col items-center justify-center base-auth">
|
|
@@ -16,6 +17,7 @@
|
|
|
16
17
|
<base-btn :text="$t('buttons.more')" :disabled="true" class="mb-28"></base-btn>
|
|
17
18
|
</aside>
|
|
18
19
|
<section v-if="isLogin" class="w-full lg:w-3/4 flex flex-col justify-center">
|
|
20
|
+
<!-- @vue-ignore -->
|
|
19
21
|
<img :class="{ '!block': !$display().lgAndUp.value }" draggable="false" class="hidden w-2/4 sm:w-1/3 mb-10 self-center" src="~/assets/auth-logo.svg" />
|
|
20
22
|
<div class="flex flex-col items-center mb-8 text-center">
|
|
21
23
|
<h1 class="text-[28px] font-medium mb-1">{{ $t('labels.welcomeHL') }}</h1>
|
|
@@ -158,7 +160,7 @@ export default defineComponent({
|
|
|
158
160
|
numAttempts.value++;
|
|
159
161
|
authLoading.value = false;
|
|
160
162
|
if (!!dataStore.user.id) {
|
|
161
|
-
router.push({ name: 'index' });
|
|
163
|
+
await router.push({ name: 'index' });
|
|
162
164
|
}
|
|
163
165
|
} else {
|
|
164
166
|
// TODO Reset password
|
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section class="flex flex-col gap-4 px-[10px]">
|
|
3
3
|
<v-form v-if="member" ref="vForm" @submit="submitForm" class="max-h-[82svh] overflow-y-scroll">
|
|
4
|
-
<
|
|
4
|
+
<div v-if="memberSetting.has === true && memberSetting.isMultiple === true" class="flex items-center mt-[14px] min-h-[54px]">
|
|
5
|
+
<div :class="[$libStyles.blueBgLight]" class="flex flex-wrap items-center gap-2 p-1 rounded-t-[8px] h-full">
|
|
6
|
+
<div
|
|
7
|
+
v-for="(each, index) of formStore[whichForm as MemberKeys]"
|
|
8
|
+
:key="index"
|
|
9
|
+
class="pl-3 pr-1 py-1 rounded-[8px] cursor-pointer flex items-center"
|
|
10
|
+
:class="[Number($route.query.i) === index ? `${$libStyles.blueBg} ${$libStyles.whiteText}` : '', $libStyles.textSimple]"
|
|
11
|
+
@click.self="selectMember(index)"
|
|
12
|
+
>
|
|
13
|
+
{{ `${$dataStore.menu.selectedItem.title} ${index + 1}` }}
|
|
14
|
+
<v-btn
|
|
15
|
+
icon="mdi-close !text-[20px]"
|
|
16
|
+
size="x-small"
|
|
17
|
+
:disabled="!memberStore.canMemberDeleted((whichForm as MemberKeys), index) && !memberStore.canMemberCleared((whichForm as MemberKeys), index)"
|
|
18
|
+
variant="plain"
|
|
19
|
+
:color="Number($route.query.i) === index ? '#FFF' : '#A0B3D8'"
|
|
20
|
+
@click.prevent="
|
|
21
|
+
memberStore.canMemberDeleted(whichForm as MemberKeys, index) || memberStore.canMemberCleared(whichForm as MemberKeys, index) ? deleteMember(index) : null
|
|
22
|
+
"
|
|
23
|
+
></v-btn>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
<v-btn class="ml-2" icon="mdi-plus !text-[24px]" @click="memberStore.addMember(whichForm as MemberKeys)" size="small" color="#A0B3D8" variant="tonal"></v-btn>
|
|
27
|
+
</div>
|
|
28
|
+
<base-form-section :title="$t('form.personalData')" :class="[memberSetting.has === true && memberSetting.isMultiple === true ? 'rounded-t-0 mt-[-5px]' : 'mt-[14px]']">
|
|
5
29
|
<base-form-input
|
|
6
30
|
v-model="member.phoneNumber"
|
|
7
31
|
:label="$t('form.phoneNumber')"
|
|
8
32
|
:maska="$maska.phone"
|
|
9
|
-
:readonly="isDisabled || isIinPhoneDisabled"
|
|
33
|
+
:readonly="!!isDisabled || !!isIinPhoneDisabled"
|
|
10
34
|
:clearable="!isDisabled"
|
|
11
35
|
:append-inner-icon="otpCondition ? 'mdi mdi-phone-message' : ''"
|
|
12
36
|
@append="openCustomPanel('otp')"
|
|
@@ -17,10 +41,11 @@
|
|
|
17
41
|
v-model="member.iin"
|
|
18
42
|
:label="$t('form.iin')"
|
|
19
43
|
:maska="$maska.iin"
|
|
20
|
-
:readonly="isDisabled || isIinPhoneDisabled"
|
|
44
|
+
:readonly="!!isDisabled || !!isIinPhoneDisabled"
|
|
21
45
|
:clearable="!isDisabled"
|
|
22
46
|
:append-inner-icon="showSaveButton ? 'mdi mdi-magnify' : ''"
|
|
23
47
|
@append="searchMember"
|
|
48
|
+
@input="onIinInput"
|
|
24
49
|
:rules="$rules.required.concat($rules.iinRight)"
|
|
25
50
|
></base-form-input>
|
|
26
51
|
<base-form-input
|
|
@@ -488,6 +513,7 @@
|
|
|
488
513
|
:append-inner-icon="hasOtp ? 'mdi-cellphone-message text-[17px]' : ''"
|
|
489
514
|
hide-details
|
|
490
515
|
@keyup.enter.prevent="hasOtp ? checkOtp() : null"
|
|
516
|
+
@input="onOtpCodeInput"
|
|
491
517
|
></base-rounded-input>
|
|
492
518
|
</base-fade-transition>
|
|
493
519
|
<base-btn v-if="!member.otpTokenId" :disabled="otpSending" :loading="otpSending" :text="$t('buttons.sendOtp')" @click="sendOtp(false)"></base-btn>
|
|
@@ -505,7 +531,7 @@
|
|
|
505
531
|
|
|
506
532
|
<script lang="ts">
|
|
507
533
|
import { LocationQueryValue } from 'vue-router';
|
|
508
|
-
import { Value, DocumentItem } from '@/composables/classes';
|
|
534
|
+
import { Value, DocumentItem, Member } from '@/composables/classes';
|
|
509
535
|
import { uuid } from 'vue-uuid';
|
|
510
536
|
|
|
511
537
|
export default {
|
|
@@ -530,6 +556,7 @@ export default {
|
|
|
530
556
|
const isDocumentOpen = ref<boolean>(false);
|
|
531
557
|
const isOtpPanelOpen = ref<boolean>(false);
|
|
532
558
|
const isPanelLoading = ref<boolean>(false);
|
|
559
|
+
const isChangingMember = ref<boolean>(false);
|
|
533
560
|
const familyDialog = ref<boolean>(false);
|
|
534
561
|
const sameAddress = ref<boolean>(false);
|
|
535
562
|
const panelValue = ref<Value>(new Value());
|
|
@@ -540,6 +567,7 @@ export default {
|
|
|
540
567
|
|
|
541
568
|
const whichForm = computed(() => route.query.tab);
|
|
542
569
|
const whichIndex = computed(() => route.query.i);
|
|
570
|
+
const memberSetting = computed(() => dataStore.members[memberStore.getMemberApplicationCode(whichForm.value as MemberKeys) as keyof typeof dataStore.members]);
|
|
543
571
|
const hasOtp = computed(() => member.value.otpCode && member.value.otpCode.length === useMask().otp.length);
|
|
544
572
|
const isDisabled = computed(() => !memberStore.isStatementEditible(whichForm.value as string));
|
|
545
573
|
const isTask = computed(() => route.params.taskId === '0' || dataStore.isTask());
|
|
@@ -689,7 +717,7 @@ export default {
|
|
|
689
717
|
const searchMember = async () => {
|
|
690
718
|
if (!isDisabled.value) {
|
|
691
719
|
dataStore.panelAction = null;
|
|
692
|
-
dataStore.panel.title = 'Поиск
|
|
720
|
+
dataStore.panel.title = 'Поиск контрагента';
|
|
693
721
|
dataStore.panel.open = true;
|
|
694
722
|
isSearchOpen.value = true;
|
|
695
723
|
isDocumentOpen.value = false;
|
|
@@ -781,55 +809,6 @@ export default {
|
|
|
781
809
|
}
|
|
782
810
|
};
|
|
783
811
|
|
|
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
|
-
|
|
833
812
|
const uploadFile = async (processInstanceId: string | number) => {
|
|
834
813
|
const selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.nameRu === member.value.documentType.nameRu);
|
|
835
814
|
const formData = new FormData();
|
|
@@ -1019,6 +998,7 @@ export default {
|
|
|
1019
998
|
if (typeof member.value.id !== 'number' || (typeof member.value.id === 'number' && member.value.id > 0 === false)) {
|
|
1020
999
|
return false;
|
|
1021
1000
|
}
|
|
1001
|
+
const wasInsuredAction = ref<boolean>(false);
|
|
1022
1002
|
const isSaved = await dataStore.saveMember(member.value, memberStore.getMemberCode(whichForm.value as MemberKeys), memberFromApplicaiton);
|
|
1023
1003
|
if (!isSaved) return false;
|
|
1024
1004
|
if (whichForm.value === formStore.policyholderFormKey) {
|
|
@@ -1030,13 +1010,17 @@ export default {
|
|
|
1030
1010
|
memberStore.getMemberFromApplication(formStore.insuredFormKey as MemberKeys, formStore.insuredFormIndex),
|
|
1031
1011
|
);
|
|
1032
1012
|
if (!isInsuredSaved) return false;
|
|
1013
|
+
wasInsuredAction.value = true;
|
|
1033
1014
|
}
|
|
1034
1015
|
}
|
|
1016
|
+
if (whichForm.value === formStore.insuredFormKey) {
|
|
1017
|
+
wasInsuredAction.value = true;
|
|
1018
|
+
}
|
|
1035
1019
|
await router.replace({
|
|
1036
1020
|
name: route.name!,
|
|
1037
1021
|
query: { ...route.query, id: member.value.id },
|
|
1038
1022
|
});
|
|
1039
|
-
await dataStore.getApplicationData(route.params.taskId, false, false, true,
|
|
1023
|
+
await dataStore.getApplicationData(route.params.taskId, false, false, true, wasInsuredAction.value);
|
|
1040
1024
|
if (dataStore.controls.hasCalculator) {
|
|
1041
1025
|
if (formStore.additionalInsuranceTermsWithout && formStore.additionalInsuranceTermsWithout.length !== 0) {
|
|
1042
1026
|
formStore.additionalInsuranceTerms.forEach((term: any) => {
|
|
@@ -1180,27 +1164,40 @@ export default {
|
|
|
1180
1164
|
}
|
|
1181
1165
|
};
|
|
1182
1166
|
|
|
1183
|
-
const
|
|
1184
|
-
|
|
1185
|
-
|
|
1167
|
+
const selectMember = async (index: number) => {
|
|
1168
|
+
dataStore.panel.open = false;
|
|
1169
|
+
isButtonLoading.value = true;
|
|
1170
|
+
isChangingMember.value = true;
|
|
1171
|
+
//@ts-ignore
|
|
1172
|
+
await router.replace({ query: { ...route.query, i: index, id: getMember(route.query.tab, index).id } });
|
|
1173
|
+
isChangingMember.value = false;
|
|
1174
|
+
};
|
|
1175
|
+
|
|
1176
|
+
const deleteMember = async (index: number) => {
|
|
1177
|
+
const formLength = formStore[whichForm.value as MemberKeys].length;
|
|
1178
|
+
await memberStore.deleteMember(route.params.taskId as string, whichForm.value as MemberKeys, index);
|
|
1179
|
+
const currendIndex = Number(whichIndex.value);
|
|
1180
|
+
if (index <= currendIndex) {
|
|
1181
|
+
const newIndex = ref<number>(currendIndex - 1 > 0 ? currendIndex - 1 : 0);
|
|
1182
|
+
await selectMember(newIndex.value);
|
|
1186
1183
|
}
|
|
1184
|
+
};
|
|
1185
|
+
|
|
1186
|
+
const onInit = async () => {
|
|
1187
|
+
// if (route.params.taskId === '0' || (route.params.taskId !== '0' && dataStore.isProcessEditable(formStore.applicationData.statusCode))) {
|
|
1188
|
+
// await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
|
|
1189
|
+
// }
|
|
1187
1190
|
if (getOtpConditionByMember()) {
|
|
1188
1191
|
await sendOtp(true);
|
|
1189
1192
|
} else {
|
|
1190
1193
|
if (member.value.hasAgreement === null) member.value.hasAgreement = true;
|
|
1191
1194
|
}
|
|
1192
|
-
if (
|
|
1193
|
-
await
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
query: { ...route.query, id: member.value.id },
|
|
1199
|
-
});
|
|
1200
|
-
}
|
|
1201
|
-
if (member.value.id) {
|
|
1202
|
-
const filteredDocuments: DocumentItem[] = dataStore.getFilesByIIN(member.value.iin!.replace(/-/g, '')) as DocumentItem[];
|
|
1203
|
-
if (filteredDocuments && filteredDocuments.length) memberDocument.value = filteredDocuments[0];
|
|
1195
|
+
if (!member.value.id) {
|
|
1196
|
+
await router.replace({ query: { ...route.query, id: 0 } });
|
|
1197
|
+
} else {
|
|
1198
|
+
if (route.query.id !== String(member.value.id)) await router.replace({ query: { ...route.query, id: member.value.id } });
|
|
1199
|
+
// const filteredDocuments: DocumentItem[] = dataStore.getFilesByIIN(member.value.iin!.replace(/-/g, '')) as DocumentItem[];
|
|
1200
|
+
// if (filteredDocuments && filteredDocuments.length) memberDocument.value = filteredDocuments[0];
|
|
1204
1201
|
}
|
|
1205
1202
|
await setDefaultValues();
|
|
1206
1203
|
};
|
|
@@ -1209,30 +1206,26 @@ export default {
|
|
|
1209
1206
|
await onInit();
|
|
1210
1207
|
});
|
|
1211
1208
|
|
|
1212
|
-
onBeforeRouteUpdate(to => {
|
|
1213
|
-
if ('tab' in to.query && to.query.tab !== 'productConditions') {
|
|
1214
|
-
member.value = getMember(to.query.tab, to.query.i);
|
|
1215
|
-
}
|
|
1216
|
-
});
|
|
1217
|
-
|
|
1218
1209
|
watch(
|
|
1219
1210
|
() => sameAddress.value,
|
|
1220
1211
|
() => {
|
|
1221
|
-
if (whichForm.value === formStore.beneficiaryFormKey)
|
|
1212
|
+
if (whichForm.value === formStore.beneficiaryFormKey) setAddressBeneficiary(Number(whichIndex.value), sameAddress.value);
|
|
1222
1213
|
},
|
|
1223
1214
|
);
|
|
1224
1215
|
|
|
1225
1216
|
watch(
|
|
1226
1217
|
() => member.value.percentageOfPayoutAmount,
|
|
1227
1218
|
val => {
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
if (percentage
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1219
|
+
if (isChangingMember.value === false) {
|
|
1220
|
+
const percentage = typeof val === 'string' ? Number(val) : val;
|
|
1221
|
+
if (percentage) {
|
|
1222
|
+
if (percentage < 0) {
|
|
1223
|
+
member.value.percentageOfPayoutAmount = 0;
|
|
1224
|
+
dataStore.showToaster('error', dataStore.t('toaster.incorrectInput'), 1000);
|
|
1225
|
+
} else if (percentage > 100) {
|
|
1226
|
+
member.value.percentageOfPayoutAmount = 100;
|
|
1227
|
+
dataStore.showToaster('error', dataStore.t('toaster.incorrectInput'), 1000);
|
|
1228
|
+
}
|
|
1236
1229
|
}
|
|
1237
1230
|
}
|
|
1238
1231
|
},
|
|
@@ -1241,21 +1234,28 @@ export default {
|
|
|
1241
1234
|
watch(
|
|
1242
1235
|
() => member.value.birthDate,
|
|
1243
1236
|
val => {
|
|
1244
|
-
if (val && val.length === useMask().date.length) {
|
|
1237
|
+
if (val && val.length === useMask().date.length && isChangingMember.value === false) {
|
|
1245
1238
|
const calculatedAge = member.value.getAgeByBirthDate();
|
|
1246
1239
|
if (calculatedAge) member.value.age = calculatedAge;
|
|
1247
1240
|
}
|
|
1248
1241
|
},
|
|
1249
1242
|
);
|
|
1250
1243
|
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1244
|
+
const onIinInput = () => {
|
|
1245
|
+
if (!!member.value.iin && member.value.iin.length === useMask().iin.length && memberSetting.value.isMultiple === true) {
|
|
1246
|
+
const alreadyInStatement = formStore[whichForm.value as MemberKeys].findIndex((i: Member) => i.iin === member.value.iin);
|
|
1247
|
+
if (alreadyInStatement !== -1 && alreadyInStatement !== Number(whichIndex.value)) {
|
|
1248
|
+
dataStore.showToaster('error', dataStore.t('toaster.hasAlreadyMember'), 3000);
|
|
1249
|
+
member.value.iin = null;
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
};
|
|
1253
|
+
|
|
1254
|
+
const onOtpCodeInput = async () => {
|
|
1255
|
+
if (member.value.otpCode && member.value.otpCode.length === useMask().otp.length) {
|
|
1256
|
+
await checkOtp();
|
|
1257
|
+
}
|
|
1258
|
+
};
|
|
1259
1259
|
|
|
1260
1260
|
watch(
|
|
1261
1261
|
() => dataStore.panel.open,
|
|
@@ -1304,6 +1304,7 @@ export default {
|
|
|
1304
1304
|
// Computed
|
|
1305
1305
|
whichForm,
|
|
1306
1306
|
whichIndex,
|
|
1307
|
+
memberSetting,
|
|
1307
1308
|
otpCondition,
|
|
1308
1309
|
hasOtp,
|
|
1309
1310
|
isDisabled,
|
|
@@ -1337,6 +1338,10 @@ export default {
|
|
|
1337
1338
|
selectFamilyMember,
|
|
1338
1339
|
closeFamilyDialog,
|
|
1339
1340
|
scrollForm,
|
|
1341
|
+
onIinInput,
|
|
1342
|
+
onOtpCodeInput,
|
|
1343
|
+
deleteMember,
|
|
1344
|
+
selectMember,
|
|
1340
1345
|
};
|
|
1341
1346
|
},
|
|
1342
1347
|
};
|
|
@@ -670,6 +670,7 @@ export default defineComponent({
|
|
|
670
670
|
}
|
|
671
671
|
isCalculating.value = true;
|
|
672
672
|
if (props.isRecalculation) {
|
|
673
|
+
//@ts-ignore
|
|
673
674
|
await dataStore.calculateWithoutApplication(true, whichProduct.value);
|
|
674
675
|
additionalTerms.value = formStore.additionalInsuranceTermsWithout;
|
|
675
676
|
} else {
|
|
@@ -735,7 +736,7 @@ export default defineComponent({
|
|
|
735
736
|
whichSum.value = 'requestedSumInsured';
|
|
736
737
|
}
|
|
737
738
|
if (dataStore.isCalculator) {
|
|
738
|
-
dataStore.processCode = constants.products[whichProduct.value];
|
|
739
|
+
dataStore.processCode = constants.products[whichProduct.value as keyof typeof constants.products];
|
|
739
740
|
await dataStore.getProcessPaymentPeriod();
|
|
740
741
|
}
|
|
741
742
|
if (whichProduct.value === 'halykkazyna') {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<label v-if="chip && chip.title" class="transition-all leading-6 px-3 py-1 rounded-pill border-[1px] border-white mr-4 whitespace-nowrap" :class="[textSize, color]"
|
|
3
|
+
>{{ chip.title }}<v-tooltip v-if="chip.description" activator="parent" location="bottom" :max-width="maxWidth">{{ chip.description }}</v-tooltip></label
|
|
4
|
+
>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
export default defineComponent({
|
|
9
|
+
props: {
|
|
10
|
+
chip: {
|
|
11
|
+
type: Object as PropType<ChipComponent>,
|
|
12
|
+
},
|
|
13
|
+
color: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: 'bg-[#A0B3D8] text-white group-hover:bg-white group-hover:!text-black',
|
|
16
|
+
},
|
|
17
|
+
textSize: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: '!text-[10px]',
|
|
20
|
+
},
|
|
21
|
+
maxWidth: {
|
|
22
|
+
type: [String, Number],
|
|
23
|
+
default: 230,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
</script>
|
package/composables/classes.ts
CHANGED
|
@@ -16,6 +16,7 @@ class MenuItemConfig {
|
|
|
16
16
|
disabled?: ComputedRef;
|
|
17
17
|
color?: string;
|
|
18
18
|
show?: ComputedRef;
|
|
19
|
+
chip?: ChipComponent;
|
|
19
20
|
|
|
20
21
|
constructor(
|
|
21
22
|
id: any = null,
|
|
@@ -30,6 +31,7 @@ class MenuItemConfig {
|
|
|
30
31
|
disabled?: ComputedRef,
|
|
31
32
|
color?: string,
|
|
32
33
|
show?: ComputedRef,
|
|
34
|
+
chip?: ChipComponent,
|
|
33
35
|
) {
|
|
34
36
|
this.id = id;
|
|
35
37
|
this.title = title;
|
|
@@ -43,12 +45,13 @@ class MenuItemConfig {
|
|
|
43
45
|
this.disabled = disabled;
|
|
44
46
|
this.color = color;
|
|
45
47
|
this.show = show;
|
|
48
|
+
this.chip = chip;
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
export class MenuItem extends MenuItemConfig {
|
|
50
|
-
constructor({ id, title, link, hasLine, description, url, initial, icon, action, disabled, color, show }: MenuItemConfig = new MenuItemConfig()) {
|
|
51
|
-
super(id, title, link, hasLine, description, url, initial, icon, action, disabled, color, show);
|
|
53
|
+
constructor({ id, title, link, hasLine, description, url, initial, icon, action, disabled, color, show, chip }: MenuItemConfig = new MenuItemConfig()) {
|
|
54
|
+
super(id, title, link, hasLine, description, url, initial, icon, action, disabled, color, show, chip);
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
57
|
|
|
@@ -799,10 +802,12 @@ export class MemberSettings {
|
|
|
799
802
|
has?: boolean;
|
|
800
803
|
isMultiple?: boolean;
|
|
801
804
|
required?: boolean;
|
|
802
|
-
|
|
805
|
+
limit?: number;
|
|
806
|
+
constructor(options?: { has?: boolean; isMultiple?: boolean; required?: boolean; limit?: number }) {
|
|
803
807
|
if (options) {
|
|
804
808
|
this.has = options.has;
|
|
805
809
|
this.isMultiple = options.isMultiple;
|
|
810
|
+
this.limit = options.limit;
|
|
806
811
|
if (this.has === true) {
|
|
807
812
|
this.required = options.required;
|
|
808
813
|
} else {
|