hl-core 0.0.7-beta.13 → 0.0.7-beta.15
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 +2 -2
- package/components/Form/FormBlock.vue +22 -8
- package/components/Form/FormSection.vue +18 -0
- package/components/Form/FormToggle.vue +1 -1
- package/components/Form/MemberForm.vue +376 -0
- package/components/Form/ProductConditions.vue +43 -0
- package/components/Form/ProductConditionsBlock.vue +2 -2
- package/components/Input/FormInput.vue +65 -15
- package/components/Input/PanelInput.vue +132 -0
- package/components/Input/RoundedInput.vue +34 -8
- package/composables/classes.ts +26 -24
- package/composables/constants.ts +2 -0
- package/layouts/clear.vue +0 -29
- package/layouts/default.vue +1 -1
- package/layouts/full.vue +0 -29
- package/package.json +1 -1
- package/plugins/storePlugin.ts +1 -0
- package/store/data.store.js +39 -26
- package/store/member.store.ts +33 -12
- package/store/messages.ts +7 -0
package/api/index.ts
CHANGED
|
@@ -21,7 +21,7 @@ export class ApiClass {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
async loginUser(data: { login: string; password: string; numAttempt: number }) {
|
|
24
|
+
async loginUser(data: { login: string; password: string; numAttempt: number }): Promise<{ refreshToken: string; accessToken: string }> {
|
|
25
25
|
return this.axiosCall({
|
|
26
26
|
method: Methods.POST,
|
|
27
27
|
url: '/identity/api/Account/login',
|
|
@@ -29,7 +29,7 @@ export class ApiClass {
|
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
async getNewAccessToken({ refreshToken, accessToken }: { refreshToken: string; accessToken: string }) {
|
|
32
|
+
async getNewAccessToken({ refreshToken, accessToken }: { refreshToken: string; accessToken: string }): Promise<{ refreshToken: string; accessToken: string }> {
|
|
33
33
|
return this.axiosCall({
|
|
34
34
|
method: Methods.POST,
|
|
35
35
|
url: '/identity/api/Account/refresh',
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="pt-3
|
|
3
|
-
<div>
|
|
2
|
+
<div class="pt-3 rounded-lg border-[1px]" :class="[$libStyles.whiteBg]">
|
|
3
|
+
<div class="ml-5">
|
|
4
4
|
<p :class="[$libStyles.textTitle, $libStyles.greenText]">{{ title }}</p>
|
|
5
5
|
<p v-if="!!subtitle" :class="[$libStyles.greyText, $libStyles.textSimple]">{{ subtitle }}</p>
|
|
6
6
|
</div>
|
|
7
|
-
<div class="mt-6 grid grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 auto-rows-fr items-center">
|
|
7
|
+
<div class="ml-5 mt-6 grid grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 auto-rows-fr items-center">
|
|
8
8
|
<span :class="[$libStyles.textSimple]" class="font-medium">{{ $t('form.fullName') }}</span>
|
|
9
9
|
<span :class="[$libStyles.textSimple]" class="font-medium">{{ $t('form.iin') }}</span>
|
|
10
10
|
<span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block"> {{ $t('form.gender') }}</span>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $t('form.Country') }} </span>
|
|
13
13
|
<span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block"> {{ $t('code') }}</span>
|
|
14
14
|
</div>
|
|
15
|
-
<div v-if="isMultiple" class="flex flex-col">
|
|
15
|
+
<div v-if="isMultiple" class="ml-5 flex flex-col">
|
|
16
16
|
<div v-for="(each, index) of member" :key="index" class="grid grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 auto-rows-fr items-center relative">
|
|
17
17
|
<span :class="[getMemberInfo(each).fullName === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(each).fullName }}</span>
|
|
18
18
|
<span :class="[getMemberInfo(each).iin === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(each).iin }}</span>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<span :class="[getMemberInfo(each).birthPlace === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).birthPlace }} </span>
|
|
22
22
|
<span :class="[getMemberInfo(each).sectorCode === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).sectorCode }} </span>
|
|
23
23
|
<div
|
|
24
|
-
class="transition-all h-[70px] w-[60px] place-self-end cursor-pointer"
|
|
24
|
+
class="rounded-br-lg transition-all h-[70px] w-[60px] place-self-end cursor-pointer"
|
|
25
25
|
:class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover]"
|
|
26
26
|
@click="$emit('onMore', { whichForm, index })"
|
|
27
27
|
>
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
31
31
|
</div>
|
|
32
|
-
<div v-else class="grid grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 auto-rows-fr items-center relative">
|
|
32
|
+
<div v-else class="ml-5 grid grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 auto-rows-fr items-center relative">
|
|
33
33
|
<span :class="[getMemberInfo(member).fullName === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(member).fullName }}</span>
|
|
34
34
|
<span :class="[getMemberInfo(member).iin === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(member).iin }}</span>
|
|
35
35
|
<span :class="[getMemberInfo(member).gender === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ getMemberInfo(member).gender }} </span>
|
|
@@ -37,13 +37,21 @@
|
|
|
37
37
|
<span :class="[getMemberInfo(member).birthPlace === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(member).birthPlace }} </span>
|
|
38
38
|
<span :class="[getMemberInfo(member).sectorCode === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(member).sectorCode }} </span>
|
|
39
39
|
<div
|
|
40
|
-
class="transition-all h-[70px] w-[60px] place-self-end cursor-pointer"
|
|
40
|
+
class="rounded-br-lg transition-all h-[70px] w-[60px] place-self-end cursor-pointer"
|
|
41
41
|
:class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover]"
|
|
42
42
|
@click="$emit('onMore', { whichForm })"
|
|
43
43
|
>
|
|
44
44
|
<i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"> </i>
|
|
45
45
|
</div>
|
|
46
46
|
</div>
|
|
47
|
+
<div
|
|
48
|
+
v-if="isMultiple && more"
|
|
49
|
+
:class="[$libStyles.blueBg, $libStyles.whiteText, $libStyles.textSimple]"
|
|
50
|
+
class="cursor-pointer rounded-b-lg h-[36px] flex items-center font-medium justify-center"
|
|
51
|
+
@click="memberStore.addMember(whichForm)"
|
|
52
|
+
>
|
|
53
|
+
{{ $t('buttons.add') }}
|
|
54
|
+
</div>
|
|
47
55
|
</div>
|
|
48
56
|
</template>
|
|
49
57
|
|
|
@@ -62,11 +70,16 @@ export default defineComponent({
|
|
|
62
70
|
type: String as PropType<'policyholderForm' | 'insuredForm' | 'beneficiaryForm' | 'beneficialOwnerForm' | 'policyholdersRepresentativeForm' | 'productConditionsForm'>,
|
|
63
71
|
default: '',
|
|
64
72
|
},
|
|
73
|
+
more: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: false,
|
|
76
|
+
},
|
|
65
77
|
},
|
|
66
|
-
emits: ['onMore'],
|
|
78
|
+
emits: ['onMore', 'addMember'],
|
|
67
79
|
setup(props) {
|
|
68
80
|
const dataStore = useDataStore();
|
|
69
81
|
const formStore = useFormStore();
|
|
82
|
+
const memberStore = useMemberStore();
|
|
70
83
|
const multipleMembers = ['insuredForm', 'beneficiaryForm', 'beneficialOwnerForm'];
|
|
71
84
|
const isMultiple = ref(multipleMembers.includes(props.whichForm));
|
|
72
85
|
const member = formStore[props.whichForm as keyof typeof formStore];
|
|
@@ -85,6 +98,7 @@ export default defineComponent({
|
|
|
85
98
|
return {
|
|
86
99
|
// State
|
|
87
100
|
formStore,
|
|
101
|
+
memberStore,
|
|
88
102
|
member,
|
|
89
103
|
isMultiple,
|
|
90
104
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section :class="[$libStyles.blueBgLight, $libStyles.rounded]" class="mt-[14px] p-4 flex flex-col gap-[1px]">
|
|
3
|
+
<h2 :class="[$libStyles.textTitle]" class="font-medium text-center w-full mb-4">{{ title }}</h2>
|
|
4
|
+
<slot></slot>
|
|
5
|
+
</section>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
props: {
|
|
11
|
+
title: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: 'Заголовок',
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="h-[74px] !pl-2 md:!pl-5 rounded border-[1px] flex items-center justify-start gap-4" :class="[$libStyles.whiteBg]">
|
|
2
|
+
<div class="h-[74px] !pl-2 md:!pl-5 rounded-lg border-[1px] flex items-center justify-start gap-4" :class="[$libStyles.whiteBg]">
|
|
3
3
|
<v-switch class="base-toggle" :model-value="modelValue" @update:modelValue="$emit('update:modelValue', $event)" color="#009C73" hide-details :disabled="disabled"> </v-switch>
|
|
4
4
|
<p :class="[$libStyles.textSimple]">{{ `${title}` }}</p>
|
|
5
5
|
<p class="mr-3" :class="[modelValue ? $libStyles.greenText : '', $libStyles.textSimple]">{{ `${modelValue ? $dataStore.t('confirm.yes') : $dataStore.t('confirm.no')}` }}</p>
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="flex flex-col gap-4 px-[10px]">
|
|
3
|
+
<v-form v-if="member" ref="vForm" @submit="submitForm" class="max-h-[75vh] md:max-h-[77vh] overflow-y-scroll">
|
|
4
|
+
<base-form-section :title="$t('form.personalData')">
|
|
5
|
+
<base-form-input
|
|
6
|
+
v-model="member.iin"
|
|
7
|
+
:label="$t('form.iin')"
|
|
8
|
+
maska="###-###-###-###"
|
|
9
|
+
append-inner-icon="mdi mdi-magnify"
|
|
10
|
+
@append="searchMember"
|
|
11
|
+
:rules="$rules.required.concat($rules.iinRight)"
|
|
12
|
+
></base-form-input>
|
|
13
|
+
<base-form-input
|
|
14
|
+
v-model="member.phoneNumber"
|
|
15
|
+
:label="$t('form.phoneNumber')"
|
|
16
|
+
maska="+7 (7##) ### ## ##"
|
|
17
|
+
placeholder="+7 7"
|
|
18
|
+
:rules="$rules.required.concat($rules.phoneFormat)"
|
|
19
|
+
></base-form-input>
|
|
20
|
+
<base-form-input v-model="member.lastName" :label="$t('form.lastName')" :rules="$rules.required.concat($rules.cyrillic)"></base-form-input>
|
|
21
|
+
<base-form-input v-model="member.firstName" :label="$t('form.firstName')" :rules="$rules.required.concat($rules.cyrillic)"></base-form-input>
|
|
22
|
+
<base-form-input v-model="member.middleName" :label="$t('form.middleName')" :rules="$rules.required.concat($rules.cyrillic)"></base-form-input>
|
|
23
|
+
<base-form-input
|
|
24
|
+
v-model="member.birthDate"
|
|
25
|
+
:label="$t('form.birthDate')"
|
|
26
|
+
:rules="$rules.required.concat($rules.birthDate)"
|
|
27
|
+
maska="##.##.####"
|
|
28
|
+
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
29
|
+
></base-form-input>
|
|
30
|
+
<base-form-input v-model="member.age" :label="$t('form.age')" :rules="$rules.required.concat($rules.numbers)"></base-form-input>
|
|
31
|
+
<base-panel-input
|
|
32
|
+
v-model="member.gender"
|
|
33
|
+
:value="member.gender.nameRu"
|
|
34
|
+
:label="$t('form.gender')"
|
|
35
|
+
:rules="$rules.objectRequired"
|
|
36
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
37
|
+
@append="openPanel($t('form.gender'), $dataStore.gender, 'gender')"
|
|
38
|
+
></base-panel-input>
|
|
39
|
+
<base-panel-input
|
|
40
|
+
v-model="member.familyStatus"
|
|
41
|
+
:value="member.familyStatus.nameRu"
|
|
42
|
+
:label="$t('form.familyStatus')"
|
|
43
|
+
:rules="$rules.objectRequired"
|
|
44
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
45
|
+
@append="openPanel($t('form.familyStatus'), [], 'familyStatus', $dataStore.getFamilyStatuses)"
|
|
46
|
+
></base-panel-input>
|
|
47
|
+
</base-form-section>
|
|
48
|
+
<base-form-section :title="$t('form.jobData')">
|
|
49
|
+
<base-form-input v-model="member.job" :label="$t('form.job')" :rules="$rules.required"></base-form-input>
|
|
50
|
+
<base-form-input v-model="member.jobPosition" :label="$t('form.jobPosition')" :rules="$rules.required"></base-form-input>
|
|
51
|
+
<base-form-input v-model="member.jobPlace" :label="$t('form.jobPlace')" :rules="$rules.required"></base-form-input>
|
|
52
|
+
</base-form-section>
|
|
53
|
+
<base-form-section :title="$t('form.placeRegistration')">
|
|
54
|
+
<base-panel-input
|
|
55
|
+
v-model="member.registrationCountry"
|
|
56
|
+
:value="member.registrationCountry.nameRu"
|
|
57
|
+
:label="$t('form.Country')"
|
|
58
|
+
:rules="$rules.objectRequired"
|
|
59
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
60
|
+
@append="openPanel($t('form.Country'), [], 'registrationCountry', $dataStore.getCountries)"
|
|
61
|
+
></base-panel-input>
|
|
62
|
+
<div class="flex flex-col gap-[1px]" v-if="member.registrationCountry.nameRu === 'Казахстан' || member.registrationCountry.nameRu === null">
|
|
63
|
+
<base-panel-input
|
|
64
|
+
v-model="member.registrationProvince"
|
|
65
|
+
:value="member.registrationProvince.nameRu"
|
|
66
|
+
:label="$t('form.Province')"
|
|
67
|
+
:rules="$rules.objectRequired"
|
|
68
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
69
|
+
@append="openPanel($t('form.Province'), [], 'registrationProvince', $dataStore.getStates, 'registrationCountry')"
|
|
70
|
+
></base-panel-input>
|
|
71
|
+
<base-panel-input
|
|
72
|
+
v-model="member.registrationRegionType"
|
|
73
|
+
:value="member.registrationRegionType.nameRu"
|
|
74
|
+
:label="$t('form.RegionType')"
|
|
75
|
+
:rules="$rules.objectRequired"
|
|
76
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
77
|
+
@append="openPanel($t('form.RegionType'), [], 'registrationRegionType', $dataStore.getLocalityTypes)"
|
|
78
|
+
></base-panel-input>
|
|
79
|
+
<base-panel-input
|
|
80
|
+
v-if="member.registrationRegionType.nameRu !== 'город'"
|
|
81
|
+
v-model="member.registrationRegion"
|
|
82
|
+
:value="member.registrationRegion.nameRu"
|
|
83
|
+
:label="$t('form.Region')"
|
|
84
|
+
:rules="$rules.objectRequired"
|
|
85
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
86
|
+
@append="openPanel($t('form.Region'), [], 'registrationRegion', $dataStore.getRegions, 'registrationProvince')"
|
|
87
|
+
></base-panel-input>
|
|
88
|
+
<base-panel-input
|
|
89
|
+
v-model="member.registrationCity"
|
|
90
|
+
:value="member.registrationCity.nameRu"
|
|
91
|
+
:label="$t('form.City')"
|
|
92
|
+
:rules="$rules.objectRequired"
|
|
93
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
94
|
+
@append="openPanel($t('form.City'), [], 'registrationCity', $dataStore.getCities, 'registrationProvince')"
|
|
95
|
+
></base-panel-input>
|
|
96
|
+
<base-form-input v-model="member.registrationQuarter" :label="$t('form.Quarter')"></base-form-input>
|
|
97
|
+
<base-form-input v-model="member.registrationMicroDistrict" :label="$t('form.MicroDistrict')"></base-form-input>
|
|
98
|
+
<base-form-input v-model="member.registrationStreet" :rules="$rules.required" :label="$t('form.Street')"></base-form-input>
|
|
99
|
+
<base-form-input v-model="member.registrationNumberHouse" :rules="$rules.required" :label="$t('form.NumberHouse')"></base-form-input>
|
|
100
|
+
<base-form-input v-model="member.registrationNumberApartment" :label="$t('form.NumberApartment')"></base-form-input>
|
|
101
|
+
</div>
|
|
102
|
+
</base-form-section>
|
|
103
|
+
<base-form-section :title="$t('form.birthData')">
|
|
104
|
+
<base-panel-input
|
|
105
|
+
v-model="member.birthPlace"
|
|
106
|
+
:value="member.birthPlace.nameRu"
|
|
107
|
+
:label="$t('form.Country')"
|
|
108
|
+
:rules="$rules.objectRequired"
|
|
109
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
110
|
+
@append="openPanel($t('form.Country'), [], 'birthPlace', $dataStore.getCountries)"
|
|
111
|
+
></base-panel-input>
|
|
112
|
+
<!-- TODO -->
|
|
113
|
+
<!-- <base-panel-input
|
|
114
|
+
v-model="member.birthRegion"
|
|
115
|
+
:value="member.birthRegion.nameRu"
|
|
116
|
+
:label="$t('form.Region')"
|
|
117
|
+
:rules="$rules.objectRequired"
|
|
118
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
119
|
+
@append="openPanel($t('form.Region'), [], 'birthRegion', $dataStore.getRegions)"
|
|
120
|
+
></base-panel-input> -->
|
|
121
|
+
</base-form-section>
|
|
122
|
+
<base-form-section :title="$t('form.documentData')">
|
|
123
|
+
<base-panel-input
|
|
124
|
+
v-model="member.documentType"
|
|
125
|
+
:value="member.documentType.nameRu"
|
|
126
|
+
:label="$t('form.documentType')"
|
|
127
|
+
:rules="$rules.objectRequired"
|
|
128
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
129
|
+
@append="openPanel($t('form.documentType'), [], 'documentType', $dataStore.getDocumentTypes)"
|
|
130
|
+
></base-panel-input>
|
|
131
|
+
<base-form-input v-model="member.documentNumber" :label="$t('form.documentNumber')" :rules="$rules.required"></base-form-input>
|
|
132
|
+
<base-panel-input
|
|
133
|
+
v-model="member.documentIssuers"
|
|
134
|
+
:value="member.documentIssuers.nameRu"
|
|
135
|
+
:label="$t('form.documentIssuers')"
|
|
136
|
+
:rules="$rules.objectRequired"
|
|
137
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
138
|
+
@append="openPanel($t('form.documentIssuers'), [], 'documentIssuers', $dataStore.getDocumentIssuers)"
|
|
139
|
+
></base-panel-input>
|
|
140
|
+
<base-form-input
|
|
141
|
+
v-model="member.documentDate"
|
|
142
|
+
:label="$t('form.documentDate')"
|
|
143
|
+
:rules="$rules.required.concat($rules.date)"
|
|
144
|
+
maska="##.##.####"
|
|
145
|
+
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
146
|
+
></base-form-input>
|
|
147
|
+
<base-form-input
|
|
148
|
+
v-if="member.documentType.ids !== 'SBI' && member.documentType.ids !== 'VNZ'"
|
|
149
|
+
v-model="member.documentExpire"
|
|
150
|
+
:label="$t('form.documentExpire')"
|
|
151
|
+
:rules="$rules.required.concat($rules.date)"
|
|
152
|
+
maska="##.##.####"
|
|
153
|
+
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
154
|
+
></base-form-input>
|
|
155
|
+
<base-panel-input
|
|
156
|
+
v-model="member.signOfResidency"
|
|
157
|
+
:value="member.signOfResidency.nameRu"
|
|
158
|
+
:label="$t('form.signOfResidency')"
|
|
159
|
+
:rules="$rules.objectRequired"
|
|
160
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
161
|
+
@append="openPanel($t('form.signOfResidency'), [], 'signOfResidency', $dataStore.getResidents)"
|
|
162
|
+
></base-panel-input>
|
|
163
|
+
<base-panel-input
|
|
164
|
+
v-model="member.countryOfTaxResidency"
|
|
165
|
+
:value="member.countryOfTaxResidency.nameRu"
|
|
166
|
+
:label="$t('form.countryOfTaxResidency')"
|
|
167
|
+
:rules="$rules.objectRequired"
|
|
168
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
169
|
+
@append="openPanel($t('form.countryOfTaxResidency'), [], 'countryOfTaxResidency', $dataStore.getTaxCountries)"
|
|
170
|
+
></base-panel-input>
|
|
171
|
+
<base-panel-input
|
|
172
|
+
v-if="member.countryOfTaxResidency.ids === '500014.3'"
|
|
173
|
+
v-model="member.addTaxResidency"
|
|
174
|
+
:value="member.addTaxResidency.nameRu"
|
|
175
|
+
:label="$t('form.addTaxResidency')"
|
|
176
|
+
:rules="$rules.objectRequired"
|
|
177
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
178
|
+
@append="openPanel($t('form.addTaxResidency'), [], 'addTaxResidency', $dataStore.getAdditionalTaxCountries)"
|
|
179
|
+
></base-panel-input>
|
|
180
|
+
<base-panel-input
|
|
181
|
+
v-model="member.signOfIPDL"
|
|
182
|
+
:value="member.signOfIPDL.nameRu"
|
|
183
|
+
:label="$t('form.signOfIPDL')"
|
|
184
|
+
:rules="$rules.objectRequired"
|
|
185
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
186
|
+
@append="openPanel($t('form.signOfIPDL'), $dataStore.ipdl, 'signOfIPDL')"
|
|
187
|
+
></base-panel-input>
|
|
188
|
+
<base-panel-input
|
|
189
|
+
v-model="member.countryOfCitizenship"
|
|
190
|
+
:value="member.countryOfCitizenship.nameRu"
|
|
191
|
+
:label="$t('form.countryOfCitizenship')"
|
|
192
|
+
:rules="$rules.objectRequired"
|
|
193
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
194
|
+
@append="openPanel($t('form.countryOfCitizenship'), [], 'countryOfCitizenship', $dataStore.getCitizenshipCountries)"
|
|
195
|
+
></base-panel-input>
|
|
196
|
+
<base-panel-input
|
|
197
|
+
v-model="member.economySectorCode"
|
|
198
|
+
:value="member.economySectorCode.nameRu"
|
|
199
|
+
:label="$t('form.economySectorCode')"
|
|
200
|
+
:rules="$rules.objectRequired"
|
|
201
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
202
|
+
@append="openPanel($t('form.economySectorCode'), [], 'economySectorCode', $dataStore.getSectorCodeList)"
|
|
203
|
+
></base-panel-input>
|
|
204
|
+
</base-form-section>
|
|
205
|
+
<base-form-section :title="$t('form.contactsData')">
|
|
206
|
+
<base-form-input
|
|
207
|
+
v-model="member.homePhone"
|
|
208
|
+
maska="+7 (7##) ### ## ##"
|
|
209
|
+
placeholder="+7 7"
|
|
210
|
+
:label="$t('form.homePhone')"
|
|
211
|
+
:rules="whichForm === formStore.beneficiaryFormKey ? [] : $rules.phoneFormat"
|
|
212
|
+
></base-form-input>
|
|
213
|
+
<base-form-input v-model="member.email" :label="$t('form.email')" :rules="$rules.email"></base-form-input>
|
|
214
|
+
</base-form-section>
|
|
215
|
+
</v-form>
|
|
216
|
+
<base-btn :text="$t('buttons.save')" @click="submitForm"></base-btn>
|
|
217
|
+
<Teleport v-if="isPanelOpen" to="#panel-actions">
|
|
218
|
+
<div :class="[$libStyles.scrollPage]">
|
|
219
|
+
<base-rounded-input v-model="searchQuery" :label="$t('labels.search')" class="p-2" :hide-details="true"></base-rounded-input>
|
|
220
|
+
<div v-if="panelList && isPanelLoading === false">
|
|
221
|
+
<base-panel-item class="cursor-pointer border-t-[1px]" @click="pickPanelValue(new Value())">{{ $t('form.notChosen') }}</base-panel-item>
|
|
222
|
+
<base-panel-item
|
|
223
|
+
v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
|
|
224
|
+
:key="index"
|
|
225
|
+
class="cursor-pointer"
|
|
226
|
+
:class="[item.nameRu === panelValue.nameRu && $libStyles.greenText]"
|
|
227
|
+
@click="pickPanelValue(item)"
|
|
228
|
+
>
|
|
229
|
+
{{ item.nameRu }}
|
|
230
|
+
</base-panel-item>
|
|
231
|
+
</div>
|
|
232
|
+
<base-loader v-if="isPanelLoading" class="absolute mx-auto mt-10" :size="50"></base-loader>
|
|
233
|
+
</div>
|
|
234
|
+
</Teleport>
|
|
235
|
+
</section>
|
|
236
|
+
</template>
|
|
237
|
+
|
|
238
|
+
<script lang="ts">
|
|
239
|
+
import { LocationQueryValue } from 'vue-router';
|
|
240
|
+
import { Value } from '@/composables/classes';
|
|
241
|
+
|
|
242
|
+
export default defineComponent({
|
|
243
|
+
setup() {
|
|
244
|
+
const componentKey = ref<number>(0);
|
|
245
|
+
const vForm = ref<any>();
|
|
246
|
+
const route = useRoute();
|
|
247
|
+
const router = useRouter();
|
|
248
|
+
const dataStore = useDataStore();
|
|
249
|
+
const formStore = useFormStore();
|
|
250
|
+
const memberStore = useMemberStore();
|
|
251
|
+
const getMember = (whichForm: LocationQueryValue | LocationQueryValue[], whichIndex?: LocationQueryValue | LocationQueryValue[]) =>
|
|
252
|
+
memberStore.getMemberFromStore(whichForm as keyof typeof formStore, Number((whichIndex ? whichIndex : '0') as string))!;
|
|
253
|
+
const member = ref(getMember(route.query.tab, route.query.i));
|
|
254
|
+
const isPanelOpen = ref<boolean>(false);
|
|
255
|
+
const isPanelLoading = ref<boolean>(false);
|
|
256
|
+
const panelValue = ref<Value>(new Value());
|
|
257
|
+
const panelList = ref<Value[]>([]);
|
|
258
|
+
const currentPanel = ref<string>('');
|
|
259
|
+
const searchQuery = ref<string>('');
|
|
260
|
+
|
|
261
|
+
const whichForm = computed(() => route.query.tab);
|
|
262
|
+
const whichIndex = computed(() => route.query.i);
|
|
263
|
+
|
|
264
|
+
const searchMember = async () => {
|
|
265
|
+
console.log('Search');
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
const openPanel = async (title: string, list: Value[], key: string, asyncFunction?: Function, filterKey?: string) => {
|
|
269
|
+
if (formStore.isDisabled[whichForm.value as keyof typeof formStore.isDisabled] === false) {
|
|
270
|
+
const notAllowedToChange = ['gender', 'documentType', 'documentIssuers'];
|
|
271
|
+
if (member.value.gotFromInsis === false && notAllowedToChange.includes(key)) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
currentPanel.value = key;
|
|
275
|
+
isPanelOpen.value = true;
|
|
276
|
+
dataStore.panelAction = null;
|
|
277
|
+
dataStore.panel.open = true;
|
|
278
|
+
dataStore.panel.title = title;
|
|
279
|
+
|
|
280
|
+
let newList = list;
|
|
281
|
+
if (asyncFunction) {
|
|
282
|
+
isPanelLoading.value = true;
|
|
283
|
+
newList = await asyncFunction(filterKey, whichForm.value);
|
|
284
|
+
}
|
|
285
|
+
panelList.value = newList;
|
|
286
|
+
panelValue.value = member.value[key as keyof typeof member.value];
|
|
287
|
+
isPanelLoading.value = false;
|
|
288
|
+
} else {
|
|
289
|
+
dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
const pickPanelValue = (item: Value) => {
|
|
294
|
+
if (formStore.isDisabled[whichForm.value as keyof typeof formStore.isDisabled] === false) {
|
|
295
|
+
dataStore.panel.open = false;
|
|
296
|
+
isPanelOpen.value = false;
|
|
297
|
+
member.value[currentPanel.value as keyof typeof member.value] = item.nameRu === null ? new Value() : item;
|
|
298
|
+
} else {
|
|
299
|
+
dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
const submitForm = async () => {
|
|
304
|
+
await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
305
|
+
if (v.valid) {
|
|
306
|
+
console.log(v);
|
|
307
|
+
} else {
|
|
308
|
+
const errors = document.querySelector('.v-input--error');
|
|
309
|
+
if (errors) {
|
|
310
|
+
const errorText = errors.querySelector('.v-label.v-field-label');
|
|
311
|
+
if (errorText) {
|
|
312
|
+
dataStore.showToaster('error', dataStore.t('toaster.errorFormField').replace('{text}', errorText.innerHTML?.replace(/[-<>!//.]/g, '')));
|
|
313
|
+
} else {
|
|
314
|
+
const errorFieldText = errors.querySelector('.v-input__control');
|
|
315
|
+
if (errorFieldText) {
|
|
316
|
+
dataStore.showToaster('error', dataStore.t('toaster.errorFormField').replace('{text}', errorFieldText.innerHTML?.replace(/[-<>!//.]/g, '')));
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
errors.scrollIntoView({
|
|
320
|
+
behavior: 'smooth',
|
|
321
|
+
block: 'center',
|
|
322
|
+
inline: 'nearest',
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
onBeforeRouteUpdate(to => {
|
|
330
|
+
member.value = getMember(to.query.tab, to.query.i);
|
|
331
|
+
componentKey.value++;
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
watch(
|
|
335
|
+
() => dataStore.panel.open,
|
|
336
|
+
() => {
|
|
337
|
+
if (dataStore.panel.open === false) {
|
|
338
|
+
isPanelOpen.value = false;
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
{ immediate: true },
|
|
342
|
+
);
|
|
343
|
+
|
|
344
|
+
watch(searchQuery, () => {
|
|
345
|
+
if (searchQuery.value === null) {
|
|
346
|
+
searchQuery.value = '';
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
return {
|
|
351
|
+
// State
|
|
352
|
+
vForm,
|
|
353
|
+
formStore,
|
|
354
|
+
memberStore,
|
|
355
|
+
member,
|
|
356
|
+
isPanelOpen,
|
|
357
|
+
isPanelLoading,
|
|
358
|
+
componentKey,
|
|
359
|
+
panelValue,
|
|
360
|
+
panelList,
|
|
361
|
+
searchQuery,
|
|
362
|
+
Value,
|
|
363
|
+
|
|
364
|
+
// Computed
|
|
365
|
+
whichForm,
|
|
366
|
+
whichIndex,
|
|
367
|
+
|
|
368
|
+
// Functions
|
|
369
|
+
searchMember,
|
|
370
|
+
openPanel,
|
|
371
|
+
pickPanelValue,
|
|
372
|
+
submitForm,
|
|
373
|
+
};
|
|
374
|
+
},
|
|
375
|
+
});
|
|
376
|
+
</script>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="flex flex-col gap-4 px-[10px]">
|
|
3
|
+
<v-form ref="vForm" @submit="submitForm">
|
|
4
|
+
<base-form-section :title="$t('generalConditions')">
|
|
5
|
+
<base-form-input
|
|
6
|
+
v-model="formStore.productConditionsForm.requestedSumInsured"
|
|
7
|
+
:rules="$dataStore.rules.numbers"
|
|
8
|
+
:label="$t('productConditionsForm.requestedSumInsured')"
|
|
9
|
+
></base-form-input>
|
|
10
|
+
<base-form-input
|
|
11
|
+
v-model="formStore.productConditionsForm.insurancePremiumPerMonth"
|
|
12
|
+
:rules="$dataStore.rules.numbers"
|
|
13
|
+
:label="$t('productConditionsForm.insurancePremiumAmount')"
|
|
14
|
+
></base-form-input>
|
|
15
|
+
</base-form-section>
|
|
16
|
+
</v-form>
|
|
17
|
+
<base-btn :text="$t('buttons.calculate')" @click="submitForm"></base-btn>
|
|
18
|
+
</section>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script lang="ts">
|
|
22
|
+
export default defineComponent({
|
|
23
|
+
setup() {
|
|
24
|
+
const formStore = useFormStore();
|
|
25
|
+
const vForm = ref<any>();
|
|
26
|
+
|
|
27
|
+
const submitForm = async () => {
|
|
28
|
+
vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
29
|
+
console.log(v);
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
// State
|
|
35
|
+
formStore,
|
|
36
|
+
vForm,
|
|
37
|
+
|
|
38
|
+
// Functions
|
|
39
|
+
submitForm,
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="pt-3 pl-5 rounded border-[1px]" :class="[$libStyles.whiteBg]">
|
|
2
|
+
<div class="pt-3 pl-5 rounded-lg border-[1px]" :class="[$libStyles.whiteBg]">
|
|
3
3
|
<div>
|
|
4
4
|
<p :class="[$libStyles.textTitle, $libStyles.greenText]">
|
|
5
5
|
{{ $t('productConditions') }}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
{{ paymentPeriod }}
|
|
21
21
|
</span>
|
|
22
22
|
<div
|
|
23
|
-
class="transition-all h-[70px] w-[60px] relative place-self-end cursor-pointer"
|
|
23
|
+
class="rounded-br-lg transition-all h-[70px] w-[60px] relative place-self-end cursor-pointer"
|
|
24
24
|
:class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover]"
|
|
25
25
|
@click="$emit('onMore', { whichForm: 'productConditions' })"
|
|
26
26
|
>
|