hl-core 0.0.8 → 0.0.9-beta.2
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 +142 -101
- package/api/interceptors.ts +17 -13
- package/components/Button/Btn.vue +1 -1
- package/components/Button/ScrollButtons.vue +2 -2
- package/components/Complex/MessageBlock.vue +26 -0
- package/components/Complex/Page.vue +1 -1
- package/components/Dialog/Dialog.vue +9 -39
- package/components/Dialog/FamilyDialog.vue +7 -4
- package/components/Form/FormBlock.vue +90 -42
- package/components/Form/FormSection.vue +4 -1
- package/components/Form/FormToggle.vue +1 -2
- package/components/Form/ManagerAttachment.vue +197 -0
- package/components/Form/ProductConditionsBlock.vue +68 -14
- package/components/Input/Datepicker.vue +45 -0
- package/components/Input/FileInput.vue +2 -3
- package/components/Input/FormInput.vue +31 -7
- package/components/Input/PanelInput.vue +7 -2
- package/components/Input/RoundedInput.vue +2 -2
- package/components/Input/RoundedSelect.vue +137 -0
- package/components/Layout/Drawer.vue +4 -2
- package/components/Layout/Header.vue +40 -4
- package/components/Layout/Loader.vue +1 -1
- package/components/Layout/SettingsPanel.vue +51 -13
- package/components/Menu/MenuHover.vue +30 -0
- package/components/Menu/MenuNav.vue +29 -13
- package/components/Menu/MenuNavItem.vue +6 -3
- package/components/Pages/Anketa.vue +59 -33
- package/components/Pages/Auth.vue +139 -46
- package/components/Pages/Documents.vue +7 -7
- package/components/Pages/InvoiceInfo.vue +30 -0
- package/components/Pages/MemberForm.vue +544 -293
- package/components/Pages/ProductAgreement.vue +4 -2
- package/components/Pages/ProductConditions.vue +673 -75
- package/components/Panel/PanelHandler.vue +304 -0
- package/components/Panel/PanelSelectItem.vue +1 -1
- package/components/Transitions/SlideTransition.vue +5 -0
- package/components/Utilities/Chip.vue +27 -0
- package/components/Utilities/JsonViewer.vue +27 -0
- package/composables/axios.ts +1 -1
- package/composables/classes.ts +223 -101
- package/composables/constants.ts +26 -51
- package/composables/index.ts +80 -2
- package/composables/styles.ts +15 -3
- package/configs/i18n.ts +17 -0
- package/layouts/default.vue +6 -6
- package/locales/kz.json +585 -0
- package/locales/ru.json +587 -0
- package/nuxt.config.ts +13 -1
- package/package.json +43 -11
- package/pages/500.vue +2 -2
- package/pages/Token.vue +51 -0
- package/plugins/helperFunctionsPlugins.ts +6 -0
- package/plugins/storePlugin.ts +0 -1
- package/plugins/vuetifyPlugin.ts +8 -1
- package/store/data.store.ts +2649 -0
- package/store/form.store.ts +1 -1
- package/store/member.store.ts +164 -52
- package/store/{rules.js → rules.ts} +65 -34
- package/types/enum.ts +83 -0
- package/types/env.d.ts +10 -0
- package/types/index.ts +262 -5
- package/store/data.store.js +0 -2482
- package/store/messages.ts +0 -429
|
@@ -1,17 +1,18 @@
|
|
|
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>
|
|
6
6
|
{{ title }}
|
|
7
|
+
<v-btn class="!absolute top-2 right-3" icon="mdi mdi-window-close" variant="plain" @click="$emit('update:modelValue', null)" />
|
|
7
8
|
</v-card-title>
|
|
8
9
|
<v-card-subtitle>
|
|
9
10
|
<slot v-if="!subtitle" name="subtitle"></slot>
|
|
10
11
|
{{ subtitle }}
|
|
11
12
|
</v-card-subtitle>
|
|
12
|
-
<v-card-actions class="gap-[16px]">
|
|
13
|
-
<base-btn v-if="actions === 'default'" class="!w-fit px-6" size="sm" :text="$t('confirm.yes')" :btn="$libStyles.blueBtn" @click="$emit('yes')"
|
|
14
|
-
<base-btn v-if="actions === 'default'" class="!w-fit px-6" size="sm" :text="$t('confirm.no')" :btn="$libStyles.blueBtn" @click="$emit('no')" />
|
|
13
|
+
<v-card-actions class="gap-[16px] m-2">
|
|
14
|
+
<base-btn v-if="actions === 'default'" class="!w-fit px-6" size="sm" :text="$dataStore.t('confirm.yes')" :btn="$libStyles.blueBtn" @click="$emit('yes')" />
|
|
15
|
+
<base-btn v-if="actions === 'default'" class="!w-fit px-6" size="sm" :text="$dataStore.t('confirm.no')" :btn="$libStyles.blueBtn" @click="$emit('no')" />
|
|
15
16
|
<slot v-if="actions !== 'default'" name="actions"></slot>
|
|
16
17
|
</v-card-actions>
|
|
17
18
|
</v-card>
|
|
@@ -27,7 +28,9 @@ export default defineComponent({
|
|
|
27
28
|
},
|
|
28
29
|
title: {
|
|
29
30
|
type: String,
|
|
30
|
-
default
|
|
31
|
+
default() {
|
|
32
|
+
return useDataStore().t('dialog.title');
|
|
33
|
+
},
|
|
31
34
|
},
|
|
32
35
|
subtitle: {
|
|
33
36
|
type: String,
|
|
@@ -38,39 +41,6 @@ export default defineComponent({
|
|
|
38
41
|
default: 'default',
|
|
39
42
|
},
|
|
40
43
|
},
|
|
41
|
-
emits: ['update:modelValue', '
|
|
42
|
-
setup(props, { emit }) {
|
|
43
|
-
const fieldModel = ref(props.modelValue);
|
|
44
|
-
|
|
45
|
-
const updateValue = (event: boolean) => {
|
|
46
|
-
fieldModel.value = event;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const submitted = (event: any) => {
|
|
50
|
-
emit('submitted', event);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
watch(
|
|
54
|
-
fieldModel,
|
|
55
|
-
() => {
|
|
56
|
-
emit('update:modelValue', fieldModel.value);
|
|
57
|
-
},
|
|
58
|
-
{ immediate: true },
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
watch(
|
|
62
|
-
() => props.modelValue,
|
|
63
|
-
() => {
|
|
64
|
-
fieldModel.value = props.modelValue;
|
|
65
|
-
},
|
|
66
|
-
{ immediate: true },
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
return {
|
|
70
|
-
fieldModel,
|
|
71
|
-
submitted,
|
|
72
|
-
updateValue,
|
|
73
|
-
};
|
|
74
|
-
},
|
|
44
|
+
emits: ['update:modelValue', 'yes', 'no'],
|
|
75
45
|
});
|
|
76
46
|
</script>
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-list lines="two" v-if="formStore.birthInfos && formStore.birthInfos.length" class="w-full !py-0">
|
|
3
|
-
<v-list-item
|
|
4
|
-
|
|
3
|
+
<v-list-item
|
|
4
|
+
@click="$emit('reset')"
|
|
5
|
+
:append-icon="selected && Object.keys(selected).length === 0 ? `mdi-radiobox-marked ${$libStyles.greenText}` : 'mdi-radiobox-blank text-[#636363]'"
|
|
6
|
+
>
|
|
7
|
+
<v-list-item-title :class="[$libStyles.greenText, $libStyles.textTitle]">{{ $dataStore.t('form.notChosen') }}</v-list-item-title>
|
|
5
8
|
</v-list-item>
|
|
6
9
|
<v-list-item
|
|
7
10
|
v-for="familyMember of formStore.birthInfos"
|
|
@@ -13,12 +16,12 @@
|
|
|
13
16
|
`${familyMember.childSurName} ${familyMember.childName} ${familyMember.childPatronymic ? familyMember.childPatronymic : ''}`
|
|
14
17
|
}}</v-list-item-title>
|
|
15
18
|
<v-list-item-subtitle :class="[$libStyles.textSimple]"
|
|
16
|
-
><span>{{ `${$t('form.iin')}:` }}</span
|
|
19
|
+
><span>{{ `${$dataStore.t('form.iin')}:` }}</span
|
|
17
20
|
>{{ ` ${$reformatIin(familyMember.childIIN!)}` }}</v-list-item-subtitle
|
|
18
21
|
>
|
|
19
22
|
</v-list-item>
|
|
20
23
|
</v-list>
|
|
21
|
-
<base-list-empty class="w-full" v-else
|
|
24
|
+
<base-list-empty class="w-full" v-else />
|
|
22
25
|
</template>
|
|
23
26
|
|
|
24
27
|
<script lang="ts">
|
|
@@ -1,62 +1,93 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="pt-3 rounded-lg border-[1px]" :class="[$libStyles.whiteBg]">
|
|
2
|
+
<div class="pt-3 rounded-lg border-[1px]" :class="[$libStyles.whiteBg, disabled && $libStyles.disabled]">
|
|
3
3
|
<div class="ml-5">
|
|
4
|
-
<
|
|
4
|
+
<div class="flex justify-between mr-5">
|
|
5
|
+
<p :class="[$libStyles.textTitle, $libStyles.greenText]">{{ title }}</p>
|
|
6
|
+
<div
|
|
7
|
+
v-if="isMultiple && more && !isShort && isActionsAvailable"
|
|
8
|
+
:class="[$libStyles.blueBg, $libStyles.whiteText, $libStyles.textSimple, disabled ? $libStyles.disabled : 'cursor-pointer']"
|
|
9
|
+
class="lg:flex transition-all rounded-lg h-[36px] flex items-center font-medium justify-center opacity-50 hover:opacity-90 w-[120px]"
|
|
10
|
+
@click="!disabled && memberStore.addMember(whichForm)"
|
|
11
|
+
>
|
|
12
|
+
{{ $dataStore.t('buttons.add') }}
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
5
15
|
<p v-if="!!subtitle" :class="[$libStyles.greyText, $libStyles.textSimple]">{{ subtitle }}</p>
|
|
6
16
|
</div>
|
|
7
|
-
<div
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<span :class="[$libStyles.textSimple]" class="font-medium">
|
|
12
|
-
<span :class="[$libStyles.textSimple]" class="font-medium
|
|
13
|
-
<span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block"> {{ $t('
|
|
17
|
+
<div
|
|
18
|
+
class="ml-5 mt-6 grid auto-rows-fr items-center"
|
|
19
|
+
:class="[isShort ? 'grid-cols-2 md:gap-5 md:grid-cols-2 lg:grid-cols-2 mb-6' : 'grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 ']"
|
|
20
|
+
>
|
|
21
|
+
<span :class="[$libStyles.textSimple]" class="font-medium">{{ $dataStore.t('form.fullName') }}</span>
|
|
22
|
+
<span :class="[$libStyles.textSimple]" class="font-medium">{{ $dataStore.t('form.iin') }}</span>
|
|
23
|
+
<span v-if="!isShort" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block"> {{ $dataStore.t('form.gender') }}</span>
|
|
24
|
+
<span v-if="!isShort" :class="[$libStyles.textSimple]" class="font-medium"> {{ $dataStore.t('form.birthDate') }} </span>
|
|
25
|
+
<span v-if="!isShort" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('form.Country') }} </span>
|
|
26
|
+
<span v-if="!isShort" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block"> {{ $dataStore.t('code') }}</span>
|
|
14
27
|
</div>
|
|
15
|
-
<div v-if="isMultiple" class="ml-5 flex flex-col">
|
|
16
|
-
<div
|
|
28
|
+
<div v-if="isMultiple && multipleMember !== null" class="ml-5 flex flex-col" :class="[isShort ? 'mb-6' : '']">
|
|
29
|
+
<div
|
|
30
|
+
v-for="(each, index) of multipleMember"
|
|
31
|
+
:key="index"
|
|
32
|
+
class="grid auto-rows-fr items-center relative"
|
|
33
|
+
:class="[isShort ? 'grid-cols-2 md:gap-5 md:grid-cols-2 lg:grid-cols-2' : 'grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7']"
|
|
34
|
+
>
|
|
17
35
|
<span :class="[getMemberInfo(each).fullName === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(each).fullName }}</span>
|
|
18
36
|
<span :class="[getMemberInfo(each).iin === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(each).iin }}</span>
|
|
19
|
-
<span :class="[getMemberInfo(each).gender === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ getMemberInfo(each).gender }} </span>
|
|
20
|
-
<span :class="[getMemberInfo(each).birthDate === null && $libStyles.emptyBlockCol]"> {{ getMemberInfo(each).birthDate }} </span>
|
|
21
|
-
<span :class="[getMemberInfo(each).birthPlace === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).birthPlace }} </span>
|
|
22
|
-
<span :class="[getMemberInfo(each).sectorCode === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).sectorCode }} </span>
|
|
37
|
+
<span v-if="!isShort" :class="[getMemberInfo(each).gender === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ getMemberInfo(each).gender }} </span>
|
|
38
|
+
<span v-if="!isShort" :class="[getMemberInfo(each).birthDate === null && $libStyles.emptyBlockCol]"> {{ getMemberInfo(each).birthDate }} </span>
|
|
39
|
+
<span v-if="!isShort" :class="[getMemberInfo(each).birthPlace === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).birthPlace }} </span>
|
|
40
|
+
<span v-if="!isShort" :class="[getMemberInfo(each).sectorCode === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).sectorCode }} </span>
|
|
23
41
|
<div
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
42
|
+
v-if="!isShort"
|
|
43
|
+
class="rounded-br-lg transition-all h-[70px] w-[60px] place-self-end"
|
|
44
|
+
:class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover, disabled ? $libStyles.disabled : 'cursor-pointer']"
|
|
45
|
+
@click="!disabled && $emit('onMore', { whichForm, index })"
|
|
27
46
|
>
|
|
28
|
-
<i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"
|
|
47
|
+
<i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"></i>
|
|
29
48
|
</div>
|
|
30
49
|
</div>
|
|
31
50
|
</div>
|
|
32
|
-
<div
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<span :class="[getMemberInfo(
|
|
38
|
-
<span :class="[getMemberInfo(
|
|
51
|
+
<div
|
|
52
|
+
v-if="singleMember !== null"
|
|
53
|
+
class="ml-5 grid auto-rows-fr items-center relative"
|
|
54
|
+
:class="[isShort ? 'grid-cols-2 md:gap-5 md:grid-cols-2 lg:grid-cols-2' : 'grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7']"
|
|
55
|
+
>
|
|
56
|
+
<span :class="[getMemberInfo(singleMember).fullName === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(singleMember).fullName }}</span>
|
|
57
|
+
<span :class="[getMemberInfo(singleMember).iin === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(singleMember).iin }}</span>
|
|
58
|
+
<span v-if="!isShort" :class="[getMemberInfo(singleMember).gender === null && $libStyles.emptyBlockCol]" class="hidden lg:block"
|
|
59
|
+
>{{ getMemberInfo(singleMember).gender }}
|
|
60
|
+
</span>
|
|
61
|
+
<span v-if="!isShort" :class="[getMemberInfo(singleMember).birthDate === null && $libStyles.emptyBlockCol]"> {{ getMemberInfo(singleMember).birthDate }} </span>
|
|
62
|
+
<span v-if="!isShort" :class="[getMemberInfo(singleMember).birthPlace === null && $libStyles.emptyBlockCol]" class="hidden lg:block">
|
|
63
|
+
{{ getMemberInfo(singleMember).birthPlace }}
|
|
64
|
+
</span>
|
|
65
|
+
<span v-if="!isShort" :class="[getMemberInfo(singleMember).sectorCode === null && $libStyles.emptyBlockCol]" class="hidden lg:block">
|
|
66
|
+
{{ getMemberInfo(singleMember).sectorCode }}
|
|
67
|
+
</span>
|
|
39
68
|
<div
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
69
|
+
v-if="!isShort"
|
|
70
|
+
class="rounded-br-lg transition-all h-[70px] w-[60px] place-self-end"
|
|
71
|
+
:class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover, disabled ? $libStyles.disabled : 'cursor-pointer']"
|
|
72
|
+
@click="!disabled && $emit('onMore', { whichForm })"
|
|
43
73
|
>
|
|
44
|
-
<i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"
|
|
74
|
+
<i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"></i>
|
|
45
75
|
</div>
|
|
46
76
|
</div>
|
|
47
77
|
<div
|
|
48
|
-
v-if="isMultiple && more"
|
|
49
|
-
:class="[$libStyles.blueBg, $libStyles.whiteText, $libStyles.textSimple]"
|
|
50
|
-
class="
|
|
51
|
-
@click="memberStore.addMember(whichForm)"
|
|
78
|
+
v-if="isMultiple && more && !isShort && isActionsAvailable"
|
|
79
|
+
:class="[$libStyles.blueBg, $libStyles.whiteText, $libStyles.textSimple, disabled ? $libStyles.disabled : 'cursor-pointer']"
|
|
80
|
+
class="lg:hidden transition-all rounded-b-lg h-[36px] flex items-center font-medium justify-center opacity-50 hover:opacity-90"
|
|
81
|
+
@click="!disabled && memberStore.addMember(whichForm)"
|
|
52
82
|
>
|
|
53
|
-
{{ $t('buttons.add') }}
|
|
83
|
+
{{ $dataStore.t('buttons.add') }}
|
|
54
84
|
</div>
|
|
55
85
|
</div>
|
|
56
86
|
</template>
|
|
57
87
|
|
|
58
88
|
<script lang="ts">
|
|
59
|
-
import {
|
|
89
|
+
import { StoreMembers } from '../../types/enum';
|
|
90
|
+
import { Member } from '../../composables/classes';
|
|
60
91
|
|
|
61
92
|
export default defineComponent({
|
|
62
93
|
props: {
|
|
@@ -69,22 +100,36 @@ export default defineComponent({
|
|
|
69
100
|
default: '',
|
|
70
101
|
},
|
|
71
102
|
whichForm: {
|
|
72
|
-
type: String as PropType<
|
|
103
|
+
type: String as PropType<keyof typeof StoreMembers>,
|
|
73
104
|
default: '',
|
|
74
105
|
},
|
|
75
106
|
more: {
|
|
76
107
|
type: Boolean,
|
|
77
108
|
default: false,
|
|
78
109
|
},
|
|
110
|
+
disabled: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default: false,
|
|
113
|
+
},
|
|
114
|
+
type: {
|
|
115
|
+
type: String as PropType<'short' | 'default'>,
|
|
116
|
+
default: 'default',
|
|
117
|
+
},
|
|
79
118
|
},
|
|
80
119
|
emits: ['onMore', 'addMember'],
|
|
81
120
|
setup(props) {
|
|
82
|
-
const dataStore = useDataStore();
|
|
83
121
|
const formStore = useFormStore();
|
|
84
122
|
const memberStore = useMemberStore();
|
|
85
|
-
const
|
|
86
|
-
const
|
|
87
|
-
|
|
123
|
+
const isMultiple = computed(() => [StoreMembers.insuredForm, StoreMembers.beneficiaryForm, StoreMembers.beneficialOwnerForm].includes(props.whichForm as StoreMembers));
|
|
124
|
+
const singleMember: Member | null =
|
|
125
|
+
props.whichForm === StoreMembers.policyholderForm || props.whichForm === StoreMembers.policyholdersRepresentativeForm ? formStore[props.whichForm] : null;
|
|
126
|
+
const multipleMember: Member[] | null =
|
|
127
|
+
props.whichForm === StoreMembers.insuredForm || props.whichForm === StoreMembers.beneficiaryForm || props.whichForm === StoreMembers.beneficialOwnerForm
|
|
128
|
+
? formStore[props.whichForm]
|
|
129
|
+
: null;
|
|
130
|
+
|
|
131
|
+
const isShort = computed(() => props.type === 'short');
|
|
132
|
+
const isActionsAvailable = computed(() => memberStore.isStatementEditible(props.whichForm));
|
|
88
133
|
|
|
89
134
|
const getMemberInfo = (memberData: Member) => {
|
|
90
135
|
return {
|
|
@@ -101,10 +146,13 @@ export default defineComponent({
|
|
|
101
146
|
// State
|
|
102
147
|
formStore,
|
|
103
148
|
memberStore,
|
|
104
|
-
|
|
149
|
+
singleMember,
|
|
150
|
+
multipleMember,
|
|
105
151
|
isMultiple,
|
|
106
152
|
|
|
107
153
|
// Computed
|
|
154
|
+
isShort,
|
|
155
|
+
isActionsAvailable,
|
|
108
156
|
|
|
109
157
|
// Functions
|
|
110
158
|
getMemberInfo,
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
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">
|
|
3
|
+
<h2 :class="[$libStyles.textTitle]" class="font-medium text-center w-full mb-4">
|
|
4
|
+
{{ title }}
|
|
5
|
+
<slot name="icon"></slot>
|
|
6
|
+
</h2>
|
|
4
7
|
<slot></slot>
|
|
5
8
|
</section>
|
|
6
9
|
</template>
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
color="#009C73"
|
|
14
14
|
hide-details
|
|
15
15
|
:disabled="disabled"
|
|
16
|
-
|
|
17
|
-
</v-switch>
|
|
16
|
+
/>
|
|
18
17
|
<p :class="[$libStyles.textSimple]">{{ `${title}` }}</p>
|
|
19
18
|
<p class="mr-3" :class="[modelValue ? $libStyles.greenText : '', $libStyles.textSimple]">{{ `${modelValue ? $dataStore.t('confirm.yes') : $dataStore.t('confirm.no')}` }}</p>
|
|
20
19
|
</div>
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="rounded-lg border-[1px]" :class="[$libStyles.whiteBg, disabled && $libStyles.disabled]">
|
|
3
|
+
<div class="mt-3 ml-5">
|
|
4
|
+
<p :class="[$libStyles.textTitle, $libStyles.greenText]">{{ $dataStore.t('form.attachManager') }}</p>
|
|
5
|
+
</div>
|
|
6
|
+
<v-form ref="vForm" class="flex flex-col mt-1">
|
|
7
|
+
<base-panel-input
|
|
8
|
+
class="pl-1"
|
|
9
|
+
v-model="formStore.SaleChanellPolicy"
|
|
10
|
+
:value="formStore.SaleChanellPolicy.nameRu"
|
|
11
|
+
:readonly="isReadonly"
|
|
12
|
+
:clearable="!isReadonly"
|
|
13
|
+
:label="$dataStore.t('form.salesChanell')"
|
|
14
|
+
:rules="$rules.objectRequired"
|
|
15
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
16
|
+
@append="openPanel('SaleChanellPolicy', $dataStore.t('form.salesChanell'))"
|
|
17
|
+
/>
|
|
18
|
+
<base-panel-input
|
|
19
|
+
class="pl-1"
|
|
20
|
+
v-model="formStore.RegionPolicy"
|
|
21
|
+
:value="formStore.RegionPolicy.nameRu"
|
|
22
|
+
:readonly="isReadonly"
|
|
23
|
+
:clearable="!isReadonly"
|
|
24
|
+
:label="$dataStore.t('form.Region')"
|
|
25
|
+
:rules="$rules.objectRequired"
|
|
26
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
27
|
+
@append="openPanel('RegionPolicy', $dataStore.t('form.Region'))"
|
|
28
|
+
/>
|
|
29
|
+
<base-panel-input
|
|
30
|
+
class="pl-1"
|
|
31
|
+
v-model="formStore.ManagerPolicy"
|
|
32
|
+
:value="formStore.ManagerPolicy.nameRu"
|
|
33
|
+
:readonly="isReadonly"
|
|
34
|
+
:clearable="!isReadonly"
|
|
35
|
+
:label="$dataStore.t('form.manager')"
|
|
36
|
+
:rules="$rules.objectRequired"
|
|
37
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
38
|
+
@append="openPanel('ManagerPolicy', $dataStore.t('form.manager'))"
|
|
39
|
+
/>
|
|
40
|
+
<base-panel-input
|
|
41
|
+
class="pl-1"
|
|
42
|
+
v-model="formStore.AgentData"
|
|
43
|
+
:value="formStore.AgentData.fullName"
|
|
44
|
+
:readonly="isReadonly"
|
|
45
|
+
:clearable="!isReadonly"
|
|
46
|
+
:label="$dataStore.t('form.agent')"
|
|
47
|
+
:rules="$rules.agentDataRequired"
|
|
48
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
49
|
+
@append="openPanel('AgentData', $dataStore.t('form.agent'))"
|
|
50
|
+
/>
|
|
51
|
+
</v-form>
|
|
52
|
+
<Teleport v-if="isPanelOpen" to="#panel-actions">
|
|
53
|
+
<div :class="[$libStyles.scrollPage]" class="flex flex-col items-center">
|
|
54
|
+
<base-rounded-input
|
|
55
|
+
v-model.trim="searchQuery"
|
|
56
|
+
:label="$dataStore.t('labels.search')"
|
|
57
|
+
class="w-full p-2"
|
|
58
|
+
:hide-details="true"
|
|
59
|
+
:append-inner-icon="currentDictName === 'AgentData' ? 'mdi mdi-magnify' : ''"
|
|
60
|
+
@append="searchAgent"
|
|
61
|
+
/>
|
|
62
|
+
<div v-if="dictList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
63
|
+
<div v-for="(item, index) in dictList" :key="item.id">
|
|
64
|
+
<base-panel-select-item
|
|
65
|
+
:key="index"
|
|
66
|
+
:text="currentDictName === 'AgentData' ? item.fullName : (item.nameRu as string)"
|
|
67
|
+
:selected="currentDictName === 'AgentData' ? item.fullName === panelValue.fullName : item.nameRu === panelValue.nameRu"
|
|
68
|
+
@click="pickPanelValue(item)"
|
|
69
|
+
/>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
|
|
73
|
+
</div>
|
|
74
|
+
</Teleport>
|
|
75
|
+
</div>
|
|
76
|
+
</template>
|
|
77
|
+
|
|
78
|
+
<script lang="ts">
|
|
79
|
+
import { Value } from '../../composables/classes';
|
|
80
|
+
|
|
81
|
+
export default defineComponent({
|
|
82
|
+
props: {
|
|
83
|
+
title: {
|
|
84
|
+
type: String,
|
|
85
|
+
default: '',
|
|
86
|
+
},
|
|
87
|
+
disabled: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: false,
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
setup(props) {
|
|
93
|
+
const route = useRoute();
|
|
94
|
+
const dataStore = useDataStore();
|
|
95
|
+
const formStore = useFormStore();
|
|
96
|
+
const isPanelOpen = ref<boolean>(false);
|
|
97
|
+
const isPanelLoading = ref<boolean>(false);
|
|
98
|
+
const panelValue = ref<Value & AgentData>(new Value());
|
|
99
|
+
const searchQuery = ref<string>('');
|
|
100
|
+
const currentDictName = ref<string>();
|
|
101
|
+
|
|
102
|
+
const dictList = computed(() => {
|
|
103
|
+
if (!currentDictName.value) {
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
106
|
+
if (currentDictName.value === 'AgentData') {
|
|
107
|
+
return dataStore[currentDictName.value];
|
|
108
|
+
} else {
|
|
109
|
+
// @ts-ignore
|
|
110
|
+
return dataStore[currentDictName.value].filter((item: Value) => {
|
|
111
|
+
// @ts-ignore
|
|
112
|
+
return item.nameRu ? item.nameRu.toLowerCase().includes(searchQuery.value.toLowerCase()) : item.fullName.toLowerCase().includes(searchQuery.value.toLowerCase());
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
const isReadonly = computed(
|
|
117
|
+
() =>
|
|
118
|
+
props.disabled ||
|
|
119
|
+
route.params.taskId === '0' ||
|
|
120
|
+
!dataStore.isInitiator() ||
|
|
121
|
+
(route.params.taskId !== '0' && (!dataStore.isProcessEditable(formStore.applicationData.statusCode) || !dataStore.isTask())),
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
const openPanel = async (currentDict: string, title: string) => {
|
|
125
|
+
searchQuery.value = '';
|
|
126
|
+
if (dataStore.isTask() && !props.disabled) {
|
|
127
|
+
dataStore.panelAction = null;
|
|
128
|
+
dataStore.panel.open = true;
|
|
129
|
+
dataStore.panel.title = title;
|
|
130
|
+
currentDictName.value = currentDict;
|
|
131
|
+
|
|
132
|
+
if (currentDict === 'ManagerPolicy') {
|
|
133
|
+
isPanelLoading.value = true;
|
|
134
|
+
await dataStore.filterManagerByRegion(String(formStore.RegionPolicy.ids ?? ''));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
isPanelOpen.value = true;
|
|
138
|
+
panelValue.value = formStore[currentDict as keyof typeof formStore];
|
|
139
|
+
isPanelLoading.value = false;
|
|
140
|
+
} else {
|
|
141
|
+
dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const searchAgent = async () => {
|
|
146
|
+
if (searchQuery.value) {
|
|
147
|
+
isPanelLoading.value = true;
|
|
148
|
+
await dataStore.searchAgentByName(searchQuery.value);
|
|
149
|
+
isPanelLoading.value = false;
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const pickPanelValue = (answer: any) => {
|
|
154
|
+
// @ts-ignore
|
|
155
|
+
formStore[currentDictName.value] = answer;
|
|
156
|
+
isPanelOpen.value = false;
|
|
157
|
+
dataStore.panel.open = false;
|
|
158
|
+
searchQuery.value = '';
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
watch(searchQuery, () => {
|
|
162
|
+
if (searchQuery.value === null) {
|
|
163
|
+
searchQuery.value = '';
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
watch(
|
|
168
|
+
() => formStore.RegionPolicy,
|
|
169
|
+
(val, oldVal) => {
|
|
170
|
+
if (val.ids !== oldVal.ids) {
|
|
171
|
+
formStore.ManagerPolicy = new Value();
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
return {
|
|
177
|
+
// State
|
|
178
|
+
formStore,
|
|
179
|
+
isPanelOpen,
|
|
180
|
+
isPanelLoading,
|
|
181
|
+
panelValue,
|
|
182
|
+
searchQuery,
|
|
183
|
+
Value,
|
|
184
|
+
currentDictName,
|
|
185
|
+
|
|
186
|
+
// Computed
|
|
187
|
+
dictList,
|
|
188
|
+
isReadonly,
|
|
189
|
+
|
|
190
|
+
// Functions
|
|
191
|
+
openPanel,
|
|
192
|
+
searchAgent,
|
|
193
|
+
pickPanelValue,
|
|
194
|
+
};
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
</script>
|
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="pt-3 pl-5 rounded-lg border-[1px]" :class="[$libStyles.whiteBg]">
|
|
2
|
+
<div class="pt-3 pl-5 rounded-lg border-[1px]" :class="[$libStyles.whiteBg, disabled && $libStyles.disabled]">
|
|
3
3
|
<div>
|
|
4
4
|
<p :class="[$libStyles.textTitle, $libStyles.greenText]">
|
|
5
|
-
{{ $t('productConditions') }}
|
|
5
|
+
{{ $dataStore.t('productConditions') }}
|
|
6
6
|
</p>
|
|
7
7
|
<p v-if="!!subtitle" :class="[$libStyles.greyText, $libStyles.textSimple]">{{ subtitle }}</p>
|
|
8
8
|
</div>
|
|
9
9
|
<div class="mt-6 grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
|
|
10
|
-
<span :class="[$libStyles.textSimple]" class="font-medium">{{ $t('productConditionsForm.requestedSumInsured') }}</span>
|
|
11
|
-
<span :class="[$libStyles.textSimple]" class="font-medium">{{ $t('productConditionsForm.insurancePremiumPerMonth') }}</span>
|
|
12
|
-
<span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $t('
|
|
13
|
-
<span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $t('productConditionsForm.
|
|
10
|
+
<span v-if="hasSum" :class="[$libStyles.textSimple]" class="font-medium">{{ $dataStore.t('productConditionsForm.requestedSumInsured') }}</span>
|
|
11
|
+
<span v-if="hasPremium" :class="[$libStyles.textSimple]" class="font-medium">{{ $dataStore.t('productConditionsForm.insurancePremiumPerMonth') }}</span>
|
|
12
|
+
<span v-if="hasPolicyNumber" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('buttons.InsuranceContract') }}</span>
|
|
13
|
+
<span v-if="hasContractDate" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.contractDate') }}</span>
|
|
14
|
+
<span v-if="hasCoverPeriod" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.coverPeriod') }}</span>
|
|
15
|
+
<span v-if="hasPayPeriod" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.payPeriod') }}</span>
|
|
14
16
|
</div>
|
|
15
17
|
<div class="grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
|
|
16
|
-
<span :class="[amount === null && $libStyles.emptyBlockCol]">{{ amount }} </span>
|
|
17
|
-
<span :class="[premium === null && $libStyles.emptyBlockCol]"> {{ premium }}</span>
|
|
18
|
-
<span :class="[
|
|
19
|
-
<span :class="[
|
|
18
|
+
<span v-if="hasSum" :class="[amount === null && $libStyles.emptyBlockCol]">{{ amount }} </span>
|
|
19
|
+
<span v-if="hasPremium" :class="[premium === null && $libStyles.emptyBlockCol]"> {{ premium }}</span>
|
|
20
|
+
<span v-if="hasPolicyNumber" :class="[policyNumber === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ policyNumber }}</span>
|
|
21
|
+
<span v-if="hasContractDate" :class="[policyNumber === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ contractDate }}</span>
|
|
22
|
+
<span v-if="hasCoverPeriod" :class="[coverPeriod === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ coverPeriod }} </span>
|
|
23
|
+
<span v-if="hasPayPeriod" :class="[paymentPeriod === null && $libStyles.emptyBlockCol]" class="hidden lg:block">
|
|
20
24
|
{{ paymentPeriod }}
|
|
21
25
|
</span>
|
|
22
26
|
<div
|
|
23
|
-
class="rounded-br-lg transition-all h-[70px] w-[60px] relative place-self-end
|
|
24
|
-
:class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover]"
|
|
25
|
-
@click="$emit('onMore', { whichForm: 'productConditions' })"
|
|
27
|
+
class="rounded-br-lg transition-all h-[70px] w-[60px] relative place-self-end"
|
|
28
|
+
:class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover, disabled ? $libStyles.disabled : 'cursor-pointer']"
|
|
29
|
+
@click="!disabled && $emit('onMore', { whichForm: 'productConditions' })"
|
|
26
30
|
>
|
|
27
|
-
<i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"
|
|
31
|
+
<i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"></i>
|
|
28
32
|
</div>
|
|
29
33
|
</div>
|
|
30
34
|
</div>
|
|
@@ -37,8 +41,13 @@ export default defineComponent({
|
|
|
37
41
|
type: String,
|
|
38
42
|
default: '',
|
|
39
43
|
},
|
|
44
|
+
disabled: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false,
|
|
47
|
+
},
|
|
40
48
|
},
|
|
41
49
|
setup() {
|
|
50
|
+
const dataStore = useDataStore();
|
|
42
51
|
const formStore = useFormStore();
|
|
43
52
|
|
|
44
53
|
const amount = computed(() =>
|
|
@@ -47,12 +56,49 @@ export default defineComponent({
|
|
|
47
56
|
const premium = computed(() =>
|
|
48
57
|
formStore.productConditionsForm && formStore.productConditionsForm.insurancePremiumPerMonth ? formStore.productConditionsForm.insurancePremiumPerMonth : null,
|
|
49
58
|
);
|
|
59
|
+
const policyNumber = computed(() => (formStore.applicationData && formStore.applicationData.policyAppDto ? formStore.applicationData.policyAppDto.policyNumber : null));
|
|
60
|
+
const contractDate = computed(() =>
|
|
61
|
+
formStore.applicationData && formStore.applicationData.policyAppDto && formStore.applicationData.policyAppDto.contractDate
|
|
62
|
+
? reformatDate(formStore.applicationData.policyAppDto.contractDate)
|
|
63
|
+
: null,
|
|
64
|
+
);
|
|
50
65
|
const coverPeriod = computed(() => (formStore.productConditionsForm && formStore.productConditionsForm.coverPeriod ? formStore.productConditionsForm.coverPeriod : null));
|
|
51
66
|
const paymentPeriod = computed(() =>
|
|
52
67
|
formStore.productConditionsForm && formStore.productConditionsForm.paymentPeriod && !!formStore.productConditionsForm.paymentPeriod.nameRu
|
|
53
68
|
? formStore.productConditionsForm.paymentPeriod.nameRu
|
|
54
69
|
: null,
|
|
55
70
|
);
|
|
71
|
+
|
|
72
|
+
const hasSum = computed(() => {
|
|
73
|
+
return true;
|
|
74
|
+
});
|
|
75
|
+
const hasPremium = computed(() => {
|
|
76
|
+
return true;
|
|
77
|
+
});
|
|
78
|
+
const hasPolicyNumber = computed(() => {
|
|
79
|
+
if (dataStore.isFinCenter()) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
return false;
|
|
83
|
+
});
|
|
84
|
+
const hasContractDate = computed(() => {
|
|
85
|
+
if (dataStore.isFinCenter()) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
return false;
|
|
89
|
+
});
|
|
90
|
+
const hasCoverPeriod = computed(() => {
|
|
91
|
+
if (dataStore.isFinCenter()) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
return true;
|
|
95
|
+
});
|
|
96
|
+
const hasPayPeriod = computed(() => {
|
|
97
|
+
if (dataStore.isFinCenter()) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
return true;
|
|
101
|
+
});
|
|
56
102
|
return {
|
|
57
103
|
// State
|
|
58
104
|
formStore,
|
|
@@ -60,8 +106,16 @@ export default defineComponent({
|
|
|
60
106
|
// Computed
|
|
61
107
|
amount,
|
|
62
108
|
premium,
|
|
109
|
+
policyNumber,
|
|
110
|
+
contractDate,
|
|
63
111
|
coverPeriod,
|
|
64
112
|
paymentPeriod,
|
|
113
|
+
hasSum,
|
|
114
|
+
hasPremium,
|
|
115
|
+
hasPolicyNumber,
|
|
116
|
+
hasContractDate,
|
|
117
|
+
hasPayPeriod,
|
|
118
|
+
hasCoverPeriod,
|
|
65
119
|
};
|
|
66
120
|
},
|
|
67
121
|
});
|