hl-core 0.0.8-beta.9 → 0.0.9-beta.1
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 +100 -34
- package/api/interceptors.ts +17 -13
- package/components/Button/Btn.vue +1 -1
- package/components/Button/ScrollButtons.vue +2 -2
- 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 +51 -28
- package/components/Form/FormSection.vue +4 -1
- package/components/Form/FormToggle.vue +2 -3
- package/components/Form/ManagerAttachment.vue +21 -20
- package/components/Form/ProductConditionsBlock.vue +60 -10
- package/components/Input/Datepicker.vue +6 -2
- package/components/Input/FileInput.vue +2 -2
- package/components/Input/FormInput.vue +29 -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 +3 -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 +49 -31
- package/components/Pages/Auth.vue +139 -46
- package/components/Pages/Documents.vue +6 -6
- package/components/Pages/InvoiceInfo.vue +30 -0
- package/components/Pages/MemberForm.vue +503 -343
- package/components/Pages/ProductAgreement.vue +4 -2
- package/components/Pages/ProductConditions.vue +494 -95
- package/components/Panel/PanelHandler.vue +91 -20
- package/components/Panel/PanelSelectItem.vue +1 -1
- package/components/Utilities/Chip.vue +27 -0
- package/components/Utilities/JsonViewer.vue +27 -0
- package/composables/axios.ts +1 -1
- package/composables/classes.ts +165 -81
- package/composables/constants.ts +25 -52
- package/composables/index.ts +80 -2
- package/composables/styles.ts +8 -3
- package/configs/i18n.ts +2 -4
- package/layouts/default.vue +6 -6
- package/locales/kz.json +532 -346
- package/locales/ru.json +210 -22
- package/nuxt.config.ts +1 -1
- package/package.json +38 -12
- package/pages/500.vue +2 -2
- package/pages/Token.vue +51 -0
- package/plugins/helperFunctionsPlugins.ts +2 -1
- package/plugins/vuetifyPlugin.ts +3 -1
- package/store/{data.store.js → data.store.ts} +1116 -752
- package/store/form.store.ts +1 -1
- package/store/member.store.ts +94 -72
- package/store/{rules.js → rules.ts} +54 -26
- package/types/enum.ts +83 -0
- package/types/env.d.ts +10 -0
- package/types/index.ts +197 -7
- package/locales/en.json +0 -399
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<base-drawer :panel-title="$dataStore.menu.title" which-panel="settings">
|
|
3
3
|
<base-panel-item>
|
|
4
|
-
<v-btn size="x-small" icon="mdi-minus" color="#A0B3D8" class="text-white" variant="flat" @click="handleFontSize('decrease')"
|
|
4
|
+
<v-btn size="x-small" icon="mdi-minus" color="#A0B3D8" class="text-white" variant="flat" @click="handleFontSize('decrease')" />
|
|
5
5
|
Шрифт
|
|
6
|
-
<v-btn size="x-small" icon="mdi-plus" color="#A0B3D8" class="text-white" variant="flat" @click="handleFontSize('increase')"
|
|
6
|
+
<v-btn size="x-small" icon="mdi-plus" color="#A0B3D8" class="text-white" variant="flat" @click="handleFontSize('increase')" />
|
|
7
7
|
</base-panel-item>
|
|
8
8
|
<base-panel-item>
|
|
9
|
-
<v-text-field v-model="$dataStore.user.fullName" :readonly="true" hide-details variant="plain" :label="$dataStore.user.roles?.join(', ')"
|
|
9
|
+
<v-text-field v-model="$dataStore.user.fullName" :readonly="true" hide-details variant="plain" :label="$dataStore.user.roles?.join(', ')" />
|
|
10
10
|
<i class="mdi mdi-account-outline text-2xl text-[#A0B3D8]"></i
|
|
11
11
|
></base-panel-item>
|
|
12
|
+
<base-panel-item v-if="$dataStore.isEFO && !isProduction" @click="changeBridge('lka')" class="cursor-pointer">
|
|
13
|
+
{{ $dataStore.t('labels.lkaLong') }}
|
|
14
|
+
<i class="mdi mdi-chevron-right text-2xl text-[#A0B3D8]"></i
|
|
15
|
+
></base-panel-item>
|
|
16
|
+
<base-panel-item v-if="$dataStore.isLKA" @click="changeBridge('efo')" class="cursor-pointer">
|
|
17
|
+
{{ $dataStore.t('labels.efoLong') }}
|
|
18
|
+
<i class="mdi mdi-web text-2xl text-[#A0B3D8]"></i
|
|
19
|
+
></base-panel-item>
|
|
12
20
|
<base-panel-item
|
|
13
|
-
v-for="panelItem of dataStore.settings.items.filter(i =>
|
|
21
|
+
v-for="panelItem of dataStore.settings.items.filter(i => $dataStore.filters.show(i))"
|
|
14
22
|
:key="panelItem.title!"
|
|
15
23
|
class="cursor-pointer"
|
|
16
24
|
@click="panelItem.action ? panelItem.action() : null"
|
|
@@ -18,23 +26,37 @@
|
|
|
18
26
|
{{ panelItem.title }}
|
|
19
27
|
<i v-if="panelItem.icon" class="mdi text-xl text-[#A0B3D8]" :class="[panelItem.icon]"></i>
|
|
20
28
|
</base-panel-item>
|
|
21
|
-
<base-panel-item
|
|
22
|
-
|
|
23
|
-
<i class="mdi mdi-
|
|
29
|
+
<base-panel-item v-if="hasHistory" @click="openHistory" class="cursor-pointer">
|
|
30
|
+
{{ $dataStore.t('historyStatementsAndStatuses') }}
|
|
31
|
+
<i class="mdi mdi-history text-xl text-[#A0B3D8]"></i>
|
|
24
32
|
</base-panel-item>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
33
|
+
<base-panel-item @click="dialogSignOut = true" class="cursor-pointer" :class="[$libStyles.redText]">
|
|
34
|
+
{{ $dataStore.t('buttons.logout') }}
|
|
35
|
+
<i class="mdi mdi-logout text-xl"></i>
|
|
36
|
+
</base-panel-item>
|
|
37
|
+
<div v-if="$dataStore.settings.open && 'version' in pkg && pkg.version" class="absolute bottom-2 w-full flex items-center justify-center opacity-30 text-sm">
|
|
38
|
+
<p>{{ pkg.version }}</p>
|
|
39
|
+
</div>
|
|
40
|
+
<base-dialog
|
|
41
|
+
v-model="dialogSignOut"
|
|
42
|
+
:title="$dataStore.t('dialog.exit')"
|
|
43
|
+
:subtitle="$dataStore.t('dialog.dataWillClear')"
|
|
44
|
+
actions="default"
|
|
45
|
+
@yes="logoutUser"
|
|
46
|
+
@no="dialogSignOut = false"
|
|
47
|
+
/>
|
|
48
|
+
</base-drawer>
|
|
28
49
|
</template>
|
|
29
50
|
|
|
30
51
|
<script lang="ts" setup>
|
|
31
|
-
|
|
52
|
+
import pkg from '../../package.json';
|
|
53
|
+
const dialogSignOut = ref(false);
|
|
32
54
|
const dataStore = useDataStore();
|
|
33
55
|
|
|
34
56
|
const handleFontSize = (action: 'increase' | 'decrease') => {
|
|
35
57
|
if (action === 'increase' && dataStore.fontSize < 24) dataStore.fontSize += 2;
|
|
36
58
|
if (action === 'decrease' && dataStore.fontSize > 14) dataStore.fontSize -= 2;
|
|
37
|
-
if (dataStore.
|
|
59
|
+
if (dataStore.isBridge) {
|
|
38
60
|
dataStore.sendToChild(constants.postActions.font, dataStore.fontSize);
|
|
39
61
|
} else {
|
|
40
62
|
dataStore.sendToParent(constants.postActions.font, dataStore.fontSize);
|
|
@@ -42,7 +64,23 @@ const handleFontSize = (action: 'increase' | 'decrease') => {
|
|
|
42
64
|
};
|
|
43
65
|
|
|
44
66
|
const logoutUser = async () => {
|
|
45
|
-
|
|
67
|
+
dialogSignOut.value = false;
|
|
46
68
|
await dataStore.logoutUser();
|
|
47
69
|
};
|
|
70
|
+
|
|
71
|
+
const isProduction = import.meta.env.VITE_MODE === 'production';
|
|
72
|
+
|
|
73
|
+
const hasHistory = computed(() => {
|
|
74
|
+
return !dataStore.isLKA;
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const openHistory = async () => {
|
|
78
|
+
dataStore.sendToParent(constants.postActions.toStatementHistory, dataStore.isBridge ? '' : dataStore.product);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const changeBridge = async (toBridge: 'efo' | 'lka') => {
|
|
82
|
+
const bridgeUrl = import.meta.env[`VITE_${toBridge.toUpperCase()}_URL`] as string;
|
|
83
|
+
if (!bridgeUrl) return;
|
|
84
|
+
window.open(`${bridgeUrl}/#/Token?token=${dataStore.accessToken}`, '_blank');
|
|
85
|
+
};
|
|
48
86
|
</script>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-menu v-if="items.length" :activator="activator" location="bottom center" :offset="top" transition="scale-transition">
|
|
3
|
+
<base-form-text-section class="p-4 border-[1px] flex flex-col gap-3 elevation-3 w-[250px]">
|
|
4
|
+
<div v-for="item of items.filter(i => $dataStore.filters.show(i))" :key="item.id">
|
|
5
|
+
<base-menu-nav-item :class="[$libStyles.textSimple]" :menu-item="item" @click="$emit(item.id)" />
|
|
6
|
+
</div>
|
|
7
|
+
</base-form-text-section>
|
|
8
|
+
</v-menu>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { MenuItem } from '../../composables/classes';
|
|
13
|
+
|
|
14
|
+
export default defineComponent({
|
|
15
|
+
props: {
|
|
16
|
+
items: {
|
|
17
|
+
type: Array as PropType<MenuItem[]>,
|
|
18
|
+
default: [],
|
|
19
|
+
},
|
|
20
|
+
activator: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: 'parent',
|
|
23
|
+
},
|
|
24
|
+
top: {
|
|
25
|
+
type: Number,
|
|
26
|
+
default: 10,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
</script>
|
|
@@ -6,21 +6,21 @@
|
|
|
6
6
|
:has-back="hasBack"
|
|
7
7
|
:back-icon="backIcon"
|
|
8
8
|
:has-more="hasMore"
|
|
9
|
-
:hide-more-on-lg="
|
|
9
|
+
:hide-more-on-lg="hideOnLg"
|
|
10
10
|
:more-icon="moreIcon"
|
|
11
11
|
@onBack="$emit('onBack')"
|
|
12
12
|
@onMore="$emit('onMore')"
|
|
13
|
-
|
|
13
|
+
/>
|
|
14
14
|
<slot key="slot-content" name="content"></slot>
|
|
15
15
|
<section key="main" :class="[$libStyles.flexColNav]">
|
|
16
16
|
<slot name="start"></slot>
|
|
17
17
|
<base-fade-transition>
|
|
18
18
|
<div v-if="$dataStore.menuItems && $dataStore.menuItems.length" class="flex flex-col gap-[10px]">
|
|
19
|
-
<div v-for="(item, index) of $dataStore.menuItems.filter(i =>
|
|
19
|
+
<div v-for="(item, index) of $dataStore.menuItems.filter(i => $dataStore.filters.show(i))" :key="index">
|
|
20
20
|
<base-menu-nav-item
|
|
21
21
|
:menu-item="item"
|
|
22
22
|
:selected="!!selected.title && !!item.title && selected.title === item.title"
|
|
23
|
-
:disabled="
|
|
23
|
+
:disabled="$dataStore.filters.disabled(item)"
|
|
24
24
|
@click.left="pickItem(item)"
|
|
25
25
|
@click.middle="openTab(item)"
|
|
26
26
|
>
|
|
@@ -32,10 +32,17 @@
|
|
|
32
32
|
<slot name="end"></slot>
|
|
33
33
|
<slot name="actions"></slot>
|
|
34
34
|
<base-fade-transition>
|
|
35
|
-
<div v-if="$dataStore.buttons && $dataStore.buttons.length" class="flex flex-col gap-[10px] justify-self-end absolute bottom-5 lg:bottom-[
|
|
35
|
+
<div v-if="$dataStore.buttons && $dataStore.buttons.length" class="flex flex-col gap-[10px] justify-self-end absolute bottom-5 lg:bottom-[10%] w-full pr-4">
|
|
36
36
|
<div v-for="(item, index) of $dataStore.buttons" :key="index">
|
|
37
37
|
<transition enter-active-class="animate__animated animate__fadeIn animate__faster" leave-active-class="animate__animated animate__fadeOut animate__faster">
|
|
38
|
-
<base-btn
|
|
38
|
+
<base-btn
|
|
39
|
+
v-if="$dataStore.filters.show(item)"
|
|
40
|
+
:text="item.title!"
|
|
41
|
+
:btn="item.color"
|
|
42
|
+
:disabled="item.disabled"
|
|
43
|
+
:loading="$dataStore.isButtonsLoading"
|
|
44
|
+
@click="item.action"
|
|
45
|
+
/>
|
|
39
46
|
</transition>
|
|
40
47
|
</div></div
|
|
41
48
|
></base-fade-transition>
|
|
@@ -44,7 +51,7 @@
|
|
|
44
51
|
</template>
|
|
45
52
|
|
|
46
53
|
<script lang="ts">
|
|
47
|
-
import { MenuItem } from '
|
|
54
|
+
import { MenuItem } from '../../composables/classes';
|
|
48
55
|
import { RouteLocationNormalized } from 'vue-router';
|
|
49
56
|
|
|
50
57
|
export default defineComponent({
|
|
@@ -69,10 +76,6 @@ export default defineComponent({
|
|
|
69
76
|
type: Boolean,
|
|
70
77
|
default: false,
|
|
71
78
|
},
|
|
72
|
-
hideMoreOnLg: {
|
|
73
|
-
type: Boolean,
|
|
74
|
-
default: false,
|
|
75
|
-
},
|
|
76
79
|
moreIcon: {
|
|
77
80
|
type: String,
|
|
78
81
|
default: 'mdi-cog-outline',
|
|
@@ -84,7 +87,7 @@ export default defineComponent({
|
|
|
84
87
|
const router = useRouter();
|
|
85
88
|
|
|
86
89
|
const pickItem = async (item: MenuItem) => {
|
|
87
|
-
if (item.title !== dataStore.menu.selectedItem.title &&
|
|
90
|
+
if (item.title !== dataStore.menu.selectedItem.title && !dataStore.filters.disabled(item)) {
|
|
88
91
|
if (typeof item.link === 'object') {
|
|
89
92
|
if (item.link && 'name' in item.link) {
|
|
90
93
|
await router.push(item.link as RouteLocationNormalized);
|
|
@@ -102,7 +105,20 @@ export default defineComponent({
|
|
|
102
105
|
}
|
|
103
106
|
};
|
|
104
107
|
|
|
105
|
-
|
|
108
|
+
const hideOnLg = computed(() => {
|
|
109
|
+
switch (router.currentRoute.value.name) {
|
|
110
|
+
case 'Insurance-Product':
|
|
111
|
+
case 'Menu':
|
|
112
|
+
case 'History':
|
|
113
|
+
case 'Main':
|
|
114
|
+
case 'taskId':
|
|
115
|
+
return false;
|
|
116
|
+
default:
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
return { pickItem, openTab, hideOnLg };
|
|
106
122
|
},
|
|
107
123
|
});
|
|
108
124
|
</script>
|
|
@@ -7,16 +7,19 @@
|
|
|
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" />
|
|
16
|
+
</div>
|
|
14
17
|
<v-tooltip v-if="menuItem.description" activator="parent" location="bottom">{{ menuItem.description }}</v-tooltip>
|
|
15
18
|
</div>
|
|
16
19
|
</template>
|
|
17
20
|
|
|
18
21
|
<script lang="ts">
|
|
19
|
-
import { MenuItem } from '
|
|
22
|
+
import { MenuItem } from '../../composables/classes';
|
|
20
23
|
|
|
21
24
|
export default defineComponent({
|
|
22
25
|
props: {
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
<section :class="[$libStyles.blueBgLight, $libStyles.rounded]" class="mx-[10px] my-[14px] p-4 flex flex-col gap-4">
|
|
5
5
|
<base-form-toggle
|
|
6
6
|
v-model="answerToAll"
|
|
7
|
-
:title="$t('questionnaireType.answerAllNo')"
|
|
7
|
+
:title="$dataStore.t('questionnaireType.answerAllNo')"
|
|
8
8
|
:disabled="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
|
|
9
9
|
:has-border="false"
|
|
10
10
|
@clicked="handleToggler"
|
|
11
|
-
|
|
11
|
+
/>
|
|
12
12
|
</section>
|
|
13
13
|
<v-form ref="vForm" class="max-h-[70vh] overflow-y-scroll" @submit="submitForm">
|
|
14
14
|
<section
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
:maska="$maska.threeDigit"
|
|
25
25
|
:readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
|
|
26
26
|
:rules="$rules.required"
|
|
27
|
-
|
|
27
|
+
/>
|
|
28
28
|
</section>
|
|
29
29
|
<section
|
|
30
30
|
v-if="firstQuestionList.filter(i => i.first.definedAnswers === 'Y').length"
|
|
@@ -39,13 +39,17 @@
|
|
|
39
39
|
class="rounded-t-lg pl-6 py-1 cursor-pointer"
|
|
40
40
|
@click="openFirstPanel(question)"
|
|
41
41
|
>
|
|
42
|
-
{{ $t('questionnaireType.pleaseAnswer', { text: secondQuestionList.length }) }}
|
|
42
|
+
{{ $dataStore.t('questionnaireType.pleaseAnswer', { text: secondQuestionList.length }) }}
|
|
43
43
|
</div>
|
|
44
44
|
</base-fade-transition>
|
|
45
45
|
<span :class="[$libStyles.textTitle]" class="border-b-[1px] border-b-[#F3F6FC] p-6 flex items-center justify-between">
|
|
46
46
|
{{ question.first.name }}
|
|
47
47
|
<base-fade-transition>
|
|
48
|
-
<i
|
|
48
|
+
<i
|
|
49
|
+
v-if="question.first.answerName === 'Да' && secondQuestionList && secondQuestionList.length"
|
|
50
|
+
class="mdi mdi-chevron-right text-2xl cursor-pointer"
|
|
51
|
+
@click="openFirstPanel(question)"
|
|
52
|
+
></i>
|
|
49
53
|
</base-fade-transition>
|
|
50
54
|
</span>
|
|
51
55
|
<div class="flex items-center justify-start gap-5 px-4 pt-4" :class="[$libStyles.textSimple]">
|
|
@@ -58,38 +62,45 @@
|
|
|
58
62
|
:readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
|
|
59
63
|
inline
|
|
60
64
|
>
|
|
61
|
-
<v-radio label="Да" value="Да"
|
|
62
|
-
<v-radio label="Нет" value="Нет"
|
|
65
|
+
<v-radio label="Да" value="Да" />
|
|
66
|
+
<v-radio label="Нет" value="Нет" />
|
|
63
67
|
</v-radio-group>
|
|
64
68
|
</div>
|
|
65
69
|
</base-form-text-section>
|
|
66
70
|
</section>
|
|
67
71
|
</v-form>
|
|
68
|
-
<base-btn
|
|
72
|
+
<base-btn
|
|
73
|
+
class="my-[14px] self-center"
|
|
74
|
+
:loading="isButtonLoading"
|
|
75
|
+
:disabled="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
|
|
76
|
+
@click="submitForm"
|
|
77
|
+
:text="$dataStore.t('buttons.save')"
|
|
78
|
+
/>
|
|
69
79
|
</section>
|
|
80
|
+
<v-btn
|
|
81
|
+
v-if="secondQuestionList && secondQuestionList.length && firstPanel"
|
|
82
|
+
icon="mdi mdi-close"
|
|
83
|
+
class="ml-3 !absolute z-10"
|
|
84
|
+
@click="
|
|
85
|
+
firstPanel = false;
|
|
86
|
+
secondPanel = false;
|
|
87
|
+
"
|
|
88
|
+
/>
|
|
70
89
|
<section
|
|
71
90
|
ref="firstPanelSection"
|
|
72
91
|
v-if="secondQuestionList && secondQuestionList.length && firstPanel"
|
|
73
|
-
class="flex flex-col px-[10px]
|
|
92
|
+
class="flex flex-col px-[10px] pb-[14px]"
|
|
74
93
|
:class="[$libStyles.scrollPage]"
|
|
75
94
|
>
|
|
76
|
-
<v-
|
|
77
|
-
icon="mdi mdi-close"
|
|
78
|
-
variant="text"
|
|
79
|
-
size="large"
|
|
80
|
-
@click="
|
|
81
|
-
firstPanel = false;
|
|
82
|
-
secondPanel = false;
|
|
83
|
-
"
|
|
84
|
-
></v-btn>
|
|
85
|
-
<section v-if="currentQuestion" :class="[$libStyles.blueBgLight, $libStyles.rounded]" class="mx-[10px] my-[14px] p-4 flex flex-col gap-4">
|
|
95
|
+
<section v-if="currentQuestion" :class="[$libStyles.blueBgLight, $libStyles.rounded]" class="mx-[10px] mt-[14px] p-4 flex flex-col gap-4">
|
|
86
96
|
<base-form-text-section v-for="question in currentQuestion.second" :title="question.name" :key="question.name">
|
|
87
97
|
<base-form-input
|
|
88
98
|
v-if="question.definedAnswers === 'N'"
|
|
89
99
|
v-model="question.answerText"
|
|
90
100
|
class="border-t-[1px] border-t-[#F3F6FC]"
|
|
91
101
|
placeholder="Введите текст"
|
|
92
|
-
|
|
102
|
+
:readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
|
|
103
|
+
/>
|
|
93
104
|
<span v-else class="flex items-center justify-between p-4 cursor-pointer" :class="[$libStyles.textTitle, $libStyles.greenText]" @click="openSecondPanel(question)">
|
|
94
105
|
{{ question.answerName ? question.answerName : 'Выбрать вариант ответа' }}
|
|
95
106
|
<i class="mdi mdi-chevron-right text-[28px]"></i>
|
|
@@ -100,7 +111,7 @@
|
|
|
100
111
|
</base-fade-transition>
|
|
101
112
|
<Teleport v-if="secondPanel" to="#panel-actions">
|
|
102
113
|
<div :class="[$libStyles.scrollPage]" class="flex flex-col items-center">
|
|
103
|
-
<base-rounded-input v-model="searchQuery" :label="$t('labels.search')" class="w-full p-2" :hide-details="true"
|
|
114
|
+
<base-rounded-input v-model="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
104
115
|
<div v-if="$dataStore.questionRefs && $dataStore.questionRefs.length && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
105
116
|
<base-panel-select-item
|
|
106
117
|
v-for="(item, index) of $dataStore.questionRefs.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
|
|
@@ -108,16 +119,16 @@
|
|
|
108
119
|
:text="`${item.nameRu}`"
|
|
109
120
|
:selected="currentSecond!.answerId === item.ids"
|
|
110
121
|
@click="closeSecondPanel(item)"
|
|
111
|
-
|
|
122
|
+
/>
|
|
112
123
|
</div>
|
|
113
|
-
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50"
|
|
124
|
+
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
|
|
114
125
|
</div>
|
|
115
126
|
</Teleport>
|
|
116
127
|
<base-scroll-buttons @up="scrollForm('up')" @down="scrollForm('down')" />
|
|
117
128
|
</template>
|
|
118
129
|
|
|
119
130
|
<script lang="ts">
|
|
120
|
-
import { Value } from '
|
|
131
|
+
import { Value } from '../../composables/classes';
|
|
121
132
|
|
|
122
133
|
export default defineComponent({
|
|
123
134
|
setup() {
|
|
@@ -132,14 +143,23 @@ export default defineComponent({
|
|
|
132
143
|
const firstPanel = ref<boolean>(false);
|
|
133
144
|
const secondPanel = ref<boolean>(false);
|
|
134
145
|
const surveyType = ref<'health' | 'critical'>('tab' in route.query && route.query.tab === 'criticalBase' ? 'critical' : 'health');
|
|
135
|
-
const whichSurvey = computed(() =>
|
|
136
|
-
|
|
146
|
+
const whichSurvey = computed(() =>
|
|
147
|
+
surveyType.value === 'health'
|
|
148
|
+
? whichMember.value === 'insured'
|
|
149
|
+
? 'surveyByHealthBase'
|
|
150
|
+
: 'surveyByHealthBasePolicyholder'
|
|
151
|
+
: whichMember.value === 'insured'
|
|
152
|
+
? 'surveyByCriticalBase'
|
|
153
|
+
: 'surveyByCriticalBasePolicyholder',
|
|
154
|
+
);
|
|
155
|
+
const firstQuestionList = ref<AnketaBody[]>([]);
|
|
137
156
|
const secondQuestionList = ref<AnketaSecond[]>([]);
|
|
138
157
|
const currentQuestion = ref<AnketaBody>();
|
|
139
158
|
const currentSecond = ref<AnketaSecond>();
|
|
140
159
|
const isPanelLoading = ref<boolean>(false);
|
|
141
160
|
const searchQuery = ref<string>('');
|
|
142
161
|
|
|
162
|
+
const whichMember = computed(() => ('member' in route.query && !!route.query.member ? (route.query.member as 'insured' | 'policyholder') : 'insured'));
|
|
143
163
|
const scrollForm = (direction: 'up' | 'down') => {
|
|
144
164
|
const scrollObject = { top: direction === 'up' ? 0 : screen.height * 10, behavior: 'smooth' };
|
|
145
165
|
if (firstPanel.value) {
|
|
@@ -159,7 +179,7 @@ export default defineComponent({
|
|
|
159
179
|
}
|
|
160
180
|
});
|
|
161
181
|
formStore[whichSurvey.value]!.type = surveyType.value;
|
|
162
|
-
const anketaToken = await dataStore.setSurvey(formStore[whichSurvey.value]);
|
|
182
|
+
const anketaToken = await dataStore.setSurvey(formStore[whichSurvey.value]!);
|
|
163
183
|
if (typeof anketaToken === 'string') {
|
|
164
184
|
formStore[whichSurvey.value]!.id = anketaToken;
|
|
165
185
|
}
|
|
@@ -255,9 +275,10 @@ export default defineComponent({
|
|
|
255
275
|
await dataStore.getQuestionList(
|
|
256
276
|
surveyType.value,
|
|
257
277
|
formStore.applicationData.processInstanceId,
|
|
258
|
-
formStore.applicationData.insuredApp[0].id,
|
|
278
|
+
whichMember.value === 'insured' ? formStore.applicationData.insuredApp[0].id : formStore.applicationData.clientApp.id,
|
|
259
279
|
whichSurvey.value,
|
|
260
280
|
surveyType.value === 'health' ? 'surveyByHealthSecond' : 'surveyByCriticalSecond',
|
|
281
|
+
whichMember.value,
|
|
261
282
|
);
|
|
262
283
|
firstQuestionList.value = formStore[whichSurvey.value]!.body;
|
|
263
284
|
secondQuestionList.value = formStore[surveyType.value === 'health' ? 'surveyByHealthSecond' : 'surveyByCriticalSecond']!;
|
|
@@ -271,9 +292,6 @@ export default defineComponent({
|
|
|
271
292
|
await dataStore.definedAnswers(question.first.id, whichSurvey.value);
|
|
272
293
|
}),
|
|
273
294
|
);
|
|
274
|
-
if (formStore.isDisabled.surveyByHealthBase) {
|
|
275
|
-
dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
|
|
276
|
-
}
|
|
277
295
|
};
|
|
278
296
|
|
|
279
297
|
onMounted(async () => {
|