hl-core 0.0.9-beta.1 → 0.0.9-beta.11
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 +147 -147
- package/api/interceptors.ts +16 -14
- package/components/Button/Btn.vue +3 -3
- package/components/Complex/ContentBlock.vue +1 -1
- package/components/Complex/MessageBlock.vue +26 -0
- package/components/Complex/Page.vue +7 -1
- package/components/Complex/WhiteBlock.vue +7 -0
- package/components/Dialog/Dialog.vue +2 -2
- package/components/Dialog/FamilyDialog.vue +5 -5
- package/components/Form/FormBlock.vue +25 -27
- package/components/Form/FormSection.vue +2 -2
- package/components/Form/FormTextSection.vue +3 -3
- package/components/Form/FormToggle.vue +3 -3
- package/components/Form/ManagerAttachment.vue +55 -42
- package/components/Form/ProductConditionsBlock.vue +16 -16
- package/components/Input/EmptyFormField.vue +1 -1
- package/components/Input/FileInput.vue +0 -1
- package/components/Input/Monthpicker.vue +33 -0
- package/components/Input/RoundedEmptyField.vue +5 -0
- package/components/Input/RoundedSelect.vue +13 -0
- package/components/Layout/Drawer.vue +2 -1
- package/components/Layout/Header.vue +1 -1
- package/components/Layout/SettingsPanel.vue +5 -9
- package/components/List/ListEmpty.vue +1 -1
- package/components/Menu/MenuHover.vue +1 -1
- package/components/Menu/MenuNav.vue +1 -1
- package/components/Menu/MenuNavItem.vue +4 -4
- package/components/Pages/Anketa.vue +86 -45
- package/components/Pages/Auth.vue +9 -9
- package/components/Pages/ContragentForm.vue +505 -0
- package/components/Pages/Documents.vue +5 -5
- package/components/Pages/InvoiceInfo.vue +1 -1
- package/components/Pages/MemberForm.vue +35 -28
- package/components/Pages/ProductAgreement.vue +1 -3
- package/components/Pages/ProductConditions.vue +58 -21
- package/components/Panel/PanelHandler.vue +32 -15
- package/components/Panel/PanelSelectItem.vue +3 -3
- package/components/Utilities/IconBorder.vue +17 -0
- package/composables/axios.ts +1 -1
- package/composables/classes.ts +23 -11
- package/composables/constants.ts +5 -0
- package/composables/index.ts +30 -4
- package/composables/styles.ts +19 -9
- package/configs/i18n.ts +0 -2
- package/layouts/default.vue +5 -2
- package/layouts/full.vue +1 -1
- package/locales/ru.json +106 -2
- package/nuxt.config.ts +1 -1
- package/package.json +12 -21
- package/pages/500.vue +2 -2
- package/pages/Token.vue +1 -0
- package/plugins/helperFunctionsPlugins.ts +6 -7
- package/store/data.store.ts +111 -100
- package/store/rules.ts +12 -2
- package/types/index.ts +45 -27
- package/components/Button/BtnIcon.vue +0 -47
- package/locales/kz.json +0 -585
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<vue-date-picker
|
|
3
|
+
:model-value="modelValue"
|
|
4
|
+
:clearable="false"
|
|
5
|
+
:disabled="disabled"
|
|
6
|
+
:reaonly="readonly"
|
|
7
|
+
month-picker
|
|
8
|
+
locale="ru"
|
|
9
|
+
format="MM.yyyy"
|
|
10
|
+
:close-on-scroll="true"
|
|
11
|
+
cancel-text="Отменить"
|
|
12
|
+
select-text="Выбрать"
|
|
13
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
14
|
+
/>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script lang="ts">
|
|
18
|
+
export default defineComponent({
|
|
19
|
+
props: {
|
|
20
|
+
modelValue: {
|
|
21
|
+
required: false,
|
|
22
|
+
},
|
|
23
|
+
disabled: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false,
|
|
26
|
+
},
|
|
27
|
+
readonly: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
</script>
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
:placeholder="placeholder"
|
|
8
8
|
:label="label"
|
|
9
9
|
:variant="variant"
|
|
10
|
+
:density="(density as any)"
|
|
11
|
+
:menu-icon="menuIcon"
|
|
10
12
|
:clear-icon="clearIcon"
|
|
11
13
|
:color="color"
|
|
12
14
|
:hint="hint"
|
|
@@ -78,10 +80,18 @@ export default defineComponent({
|
|
|
78
80
|
type: String as PropType<InputVariants>,
|
|
79
81
|
default: 'solo',
|
|
80
82
|
},
|
|
83
|
+
density: {
|
|
84
|
+
type: String,
|
|
85
|
+
default: 'compact',
|
|
86
|
+
},
|
|
81
87
|
color: {
|
|
82
88
|
type: String,
|
|
83
89
|
default: '#009c73',
|
|
84
90
|
},
|
|
91
|
+
menuIcon: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: 'mdi-chevron-down',
|
|
94
|
+
},
|
|
85
95
|
clearIcon: {
|
|
86
96
|
type: String,
|
|
87
97
|
default: 'mdi-close',
|
|
@@ -122,6 +132,9 @@ export default defineComponent({
|
|
|
122
132
|
border: none !important;
|
|
123
133
|
outline: none !important;
|
|
124
134
|
}
|
|
135
|
+
.rounded-select.v-input {
|
|
136
|
+
flex: unset !important;
|
|
137
|
+
}
|
|
125
138
|
.rounded-select .v-label.v-field-label {
|
|
126
139
|
top: 20px;
|
|
127
140
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<div v-if="$dataStore.panelAction === null" class="flex flex-col" id="panel-actions">
|
|
13
13
|
<slot></slot>
|
|
14
14
|
</div>
|
|
15
|
-
<base-panel-handler v-else />
|
|
15
|
+
<base-panel-handler v-else @task="$emit('task', $event)" />
|
|
16
16
|
<slot name="panel"></slot>
|
|
17
17
|
</v-navigation-drawer>
|
|
18
18
|
</template>
|
|
@@ -30,6 +30,7 @@ export default defineComponent({
|
|
|
30
30
|
default: 'panel',
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
|
+
emits: ['task'],
|
|
33
34
|
setup(props) {
|
|
34
35
|
const dataStore = useDataStore();
|
|
35
36
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<header class="relative w-full h-[70px] text-center font-medium align-middle flex items-center border-b-[1px]" :class="[$
|
|
2
|
+
<header class="relative w-full h-[70px] text-center font-medium align-middle flex items-center border-b-[1px]" :class="[$styles.blueBgLight, $styles.textSimple]">
|
|
3
3
|
<i v-if="hasBack" @click="$emit('onBack')" class="absolute left-5 mdi text-xl cursor-pointer transition-all" :class="[backIcon, backIconAnim]"></i>
|
|
4
4
|
<span class="mx-10">{{ title }}</span>
|
|
5
5
|
<i
|
|
@@ -9,11 +9,11 @@
|
|
|
9
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">
|
|
12
|
+
<base-panel-item v-if="$dataStore.isEFO && !isProduction && $dataStore.accessToken" @click="changeBridge('lka', $dataStore.accessToken)" class="cursor-pointer">
|
|
13
13
|
{{ $dataStore.t('labels.lkaLong') }}
|
|
14
14
|
<i class="mdi mdi-chevron-right text-2xl text-[#A0B3D8]"></i
|
|
15
15
|
></base-panel-item>
|
|
16
|
-
<base-panel-item v-if="$dataStore.isLKA" @click="changeBridge('efo')" class="cursor-pointer">
|
|
16
|
+
<base-panel-item v-if="$dataStore.isLKA && $dataStore.accessToken" @click="changeBridge('efo', $dataStore.accessToken)" class="cursor-pointer">
|
|
17
17
|
{{ $dataStore.t('labels.efoLong') }}
|
|
18
18
|
<i class="mdi mdi-web text-2xl text-[#A0B3D8]"></i
|
|
19
19
|
></base-panel-item>
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
{{ $dataStore.t('historyStatementsAndStatuses') }}
|
|
31
31
|
<i class="mdi mdi-history text-xl text-[#A0B3D8]"></i>
|
|
32
32
|
</base-panel-item>
|
|
33
|
-
<base-panel-item @click="dialogSignOut = true" class="cursor-pointer" :class="[$
|
|
33
|
+
<base-panel-item @click="dialogSignOut = true" class="cursor-pointer" :class="[$styles.redText]">
|
|
34
34
|
{{ $dataStore.t('buttons.logout') }}
|
|
35
35
|
<i class="mdi mdi-logout text-xl"></i>
|
|
36
36
|
</base-panel-item>
|
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
</template>
|
|
50
50
|
|
|
51
51
|
<script lang="ts" setup>
|
|
52
|
+
import { changeBridge } from '#imports';
|
|
53
|
+
|
|
52
54
|
import pkg from '../../package.json';
|
|
53
55
|
const dialogSignOut = ref(false);
|
|
54
56
|
const dataStore = useDataStore();
|
|
@@ -77,10 +79,4 @@ const hasHistory = computed(() => {
|
|
|
77
79
|
const openHistory = async () => {
|
|
78
80
|
dataStore.sendToParent(constants.postActions.toStatementHistory, dataStore.isBridge ? '' : dataStore.product);
|
|
79
81
|
};
|
|
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
|
-
};
|
|
86
82
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="border-[1px] rounded-lg h-[80px] mx-[10px] mt-[14px] flex place-content-center" :class="[$
|
|
2
|
+
<div class="border-[1px] rounded-lg h-[80px] mx-[10px] mt-[14px] flex place-content-center" :class="[$styles.blueBgLight, $styles.textTitle]">
|
|
3
3
|
<div class="flex justify-center items-center font-medium gap-2 opacity-40">
|
|
4
4
|
{{ text }}
|
|
5
5
|
<i class="text-2xl mdi" :class="[icon ? icon : 'mdi-database-off-outline']"></i>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<v-menu v-if="items.length" :activator="activator" location="bottom center" :offset="top" transition="scale-transition">
|
|
3
3
|
<base-form-text-section class="p-4 border-[1px] flex flex-col gap-3 elevation-3 w-[250px]">
|
|
4
4
|
<div v-for="item of items.filter(i => $dataStore.filters.show(i))" :key="item.id">
|
|
5
|
-
<base-menu-nav-item :class="[$
|
|
5
|
+
<base-menu-nav-item :class="[$styles.textSimple]" :menu-item="item" @click="$emit(item.id)" />
|
|
6
6
|
</div>
|
|
7
7
|
</base-form-text-section>
|
|
8
8
|
</v-menu>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
@onMore="$emit('onMore')"
|
|
13
13
|
/>
|
|
14
14
|
<slot key="slot-content" name="content"></slot>
|
|
15
|
-
<section key="main" :class="[$
|
|
15
|
+
<section key="main" :class="[$styles.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]">
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
:class="[
|
|
4
|
-
selected ? $
|
|
5
|
-
selected ? $
|
|
6
|
-
$
|
|
7
|
-
$
|
|
4
|
+
selected ? $styles.blueBg : $styles.blueBgLight,
|
|
5
|
+
selected ? $styles.whiteText : $styles.blackText,
|
|
6
|
+
$styles.rounded,
|
|
7
|
+
$styles.textSimple,
|
|
8
8
|
disabled ? 'cursor-not-allowed opacity-50' : '',
|
|
9
9
|
]"
|
|
10
10
|
class="h-[60px] flex items-center justify-between hover:bg-[#A0B3D8] hover:!text-white pl-4 cursor-pointer transition-all group"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<base-fade-transition>
|
|
3
3
|
<section v-if="firstQuestionList && firstQuestionList.length && !firstPanel && !secondPanel" class="flex flex-col">
|
|
4
|
-
<section :class="[$
|
|
4
|
+
<section :class="[$styles.blueBgLight, $styles.rounded]" class="mx-[10px] my-[14px] p-4 flex flex-col gap-4">
|
|
5
5
|
<base-form-toggle
|
|
6
6
|
v-model="answerToAll"
|
|
7
7
|
:title="$dataStore.t('questionnaireType.answerAllNo')"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<v-form ref="vForm" class="max-h-[70vh] overflow-y-scroll" @submit="submitForm">
|
|
14
14
|
<section
|
|
15
15
|
v-if="firstQuestionList.filter(i => i.first.definedAnswers === 'N').length"
|
|
16
|
-
:class="[$
|
|
16
|
+
:class="[$styles.blueBgLight, $styles.rounded]"
|
|
17
17
|
class="mx-[10px] p-4 flex flex-col gap-4"
|
|
18
18
|
>
|
|
19
19
|
<base-form-input
|
|
@@ -28,35 +28,35 @@
|
|
|
28
28
|
</section>
|
|
29
29
|
<section
|
|
30
30
|
v-if="firstQuestionList.filter(i => i.first.definedAnswers === 'Y').length"
|
|
31
|
-
:class="[$
|
|
31
|
+
:class="[$styles.blueBgLight, $styles.rounded]"
|
|
32
32
|
class="mx-[10px] mt-[14px] p-4 flex flex-col gap-4"
|
|
33
33
|
>
|
|
34
34
|
<base-form-text-section v-for="(question, index) in firstQuestionList.filter(i => i.first.definedAnswers === 'Y')" :key="index">
|
|
35
35
|
<base-fade-transition>
|
|
36
36
|
<div
|
|
37
|
-
v-if="question.first.answerName === 'Да' &&
|
|
38
|
-
:class="[$
|
|
37
|
+
v-if="question.first.answerName === 'Да' && question.second"
|
|
38
|
+
:class="[$styles.greenBg, $styles.whiteText, $styles.textSimple]"
|
|
39
39
|
class="rounded-t-lg pl-6 py-1 cursor-pointer"
|
|
40
40
|
@click="openFirstPanel(question)"
|
|
41
41
|
>
|
|
42
|
-
{{ $dataStore.t('questionnaireType.pleaseAnswer', { text:
|
|
42
|
+
{{ $dataStore.t('questionnaireType.pleaseAnswer', { text: question.second.length }) }}
|
|
43
43
|
</div>
|
|
44
44
|
</base-fade-transition>
|
|
45
|
-
<span :class="[$
|
|
45
|
+
<span :class="[$styles.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
48
|
<i
|
|
49
|
-
v-if="question.first.answerName === 'Да' &&
|
|
49
|
+
v-if="question.first.answerName === 'Да' && question.second && question.second.length"
|
|
50
50
|
class="mdi mdi-chevron-right text-2xl cursor-pointer"
|
|
51
51
|
@click="openFirstPanel(question)"
|
|
52
52
|
></i>
|
|
53
53
|
</base-fade-transition>
|
|
54
54
|
</span>
|
|
55
|
-
<div class="flex items-center justify-start gap-5 px-4 pt-4" :class="[$
|
|
55
|
+
<div class="flex items-center justify-start gap-5 px-4 pt-4" :class="[$styles.textSimple]">
|
|
56
56
|
<v-radio-group
|
|
57
57
|
v-model="question.first.answerName"
|
|
58
58
|
class="anketa-radio"
|
|
59
|
-
:true-icon="`mdi-radiobox-marked ${$
|
|
59
|
+
:true-icon="`mdi-radiobox-marked ${$styles.greenText}`"
|
|
60
60
|
false-icon="mdi-radiobox-blank text-[#636363]"
|
|
61
61
|
:rules="$rules.required"
|
|
62
62
|
:readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
|
|
@@ -78,39 +78,43 @@
|
|
|
78
78
|
/>
|
|
79
79
|
</section>
|
|
80
80
|
<v-btn
|
|
81
|
-
v-if="
|
|
81
|
+
v-if="currentQuestion && currentQuestion.second && currentQuestion.second.length && firstPanel"
|
|
82
82
|
icon="mdi mdi-close"
|
|
83
83
|
class="ml-3 !absolute z-10"
|
|
84
|
-
@click="
|
|
85
|
-
firstPanel = false;
|
|
86
|
-
secondPanel = false;
|
|
87
|
-
"
|
|
84
|
+
@click="submitSecondaryForm"
|
|
88
85
|
/>
|
|
89
|
-
<section
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
86
|
+
<section ref="firstPanelSection" v-if="currentQuestion && currentQuestion.second && firstPanel" class="flex flex-col px-[10px] pb-[14px]" :class="[$styles.scrollPage]">
|
|
87
|
+
<v-form
|
|
88
|
+
v-if="currentQuestion"
|
|
89
|
+
:class="[$styles.blueBgLight, $styles.rounded]"
|
|
90
|
+
class="mx-[10px] mt-[14px] p-4 flex flex-col gap-4"
|
|
91
|
+
ref="vSecondaryForm"
|
|
92
|
+
@submit="submitSecondaryForm"
|
|
93
|
+
>
|
|
96
94
|
<base-form-text-section v-for="question in currentQuestion.second" :title="question.name" :key="question.name">
|
|
97
95
|
<base-form-input
|
|
98
96
|
v-if="question.definedAnswers === 'N'"
|
|
99
97
|
v-model="question.answerText"
|
|
100
98
|
class="border-t-[1px] border-t-[#F3F6FC]"
|
|
101
|
-
placeholder="
|
|
99
|
+
:placeholder="$dataStore.t('labels.inputText')"
|
|
102
100
|
:readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
|
|
101
|
+
:rules="isSecondRequired ? $rules.required : []"
|
|
103
102
|
/>
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
103
|
+
<base-panel-input
|
|
104
|
+
v-else
|
|
105
|
+
:class="[$styles.textTitle, $styles.greenText]"
|
|
106
|
+
:value="question.answerName ? question.answerName : 'Выбрать вариант ответа'"
|
|
107
|
+
:readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
|
|
108
|
+
:clearable="false"
|
|
109
|
+
:error-messages="isSecondRequired ? (question.answerName ? [] : ['Выбрать вариант ответа']) : []"
|
|
110
|
+
@click="openSecondPanel(question)"
|
|
111
|
+
></base-panel-input>
|
|
108
112
|
</base-form-text-section>
|
|
109
|
-
</
|
|
113
|
+
</v-form>
|
|
110
114
|
</section>
|
|
111
115
|
</base-fade-transition>
|
|
112
116
|
<Teleport v-if="secondPanel" to="#panel-actions">
|
|
113
|
-
<div :class="[$
|
|
117
|
+
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
114
118
|
<base-rounded-input v-model="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
115
119
|
<div v-if="$dataStore.questionRefs && $dataStore.questionRefs.length && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
116
120
|
<base-panel-select-item
|
|
@@ -137,6 +141,7 @@ export default defineComponent({
|
|
|
137
141
|
const formStore = useFormStore();
|
|
138
142
|
const dataStore = useDataStore();
|
|
139
143
|
const vForm = ref<any>();
|
|
144
|
+
const vSecondaryForm = ref<any>();
|
|
140
145
|
const firstPanelSection = ref<any>();
|
|
141
146
|
const isButtonLoading = ref<boolean>(false);
|
|
142
147
|
const answerToAll = ref<boolean>(false);
|
|
@@ -153,13 +158,13 @@ export default defineComponent({
|
|
|
153
158
|
: 'surveyByCriticalBasePolicyholder',
|
|
154
159
|
);
|
|
155
160
|
const firstQuestionList = ref<AnketaBody[]>([]);
|
|
156
|
-
const secondQuestionList = ref<AnketaSecond[]>([]);
|
|
157
161
|
const currentQuestion = ref<AnketaBody>();
|
|
158
162
|
const currentSecond = ref<AnketaSecond>();
|
|
159
163
|
const isPanelLoading = ref<boolean>(false);
|
|
160
164
|
const searchQuery = ref<string>('');
|
|
161
165
|
|
|
162
166
|
const whichMember = computed(() => ('member' in route.query && !!route.query.member ? (route.query.member as 'insured' | 'policyholder') : 'insured'));
|
|
167
|
+
const isSecondRequired = computed(() => dataStore.controls.isSecondAnketaRequired);
|
|
163
168
|
const scrollForm = (direction: 'up' | 'down') => {
|
|
164
169
|
const scrollObject = { top: direction === 'up' ? 0 : screen.height * 10, behavior: 'smooth' };
|
|
165
170
|
if (firstPanel.value) {
|
|
@@ -173,11 +178,25 @@ export default defineComponent({
|
|
|
173
178
|
await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
174
179
|
if (v.valid) {
|
|
175
180
|
isButtonLoading.value = true;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
+
const isValid = dataStore.validateAnketa(whichSurvey.value);
|
|
182
|
+
if (!isValid) {
|
|
183
|
+
isButtonLoading.value = false;
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
if (formStore[whichSurvey.value] && formStore[whichSurvey.value]?.body) {
|
|
187
|
+
formStore[whichSurvey.value]?.body.forEach(question => {
|
|
188
|
+
if (question.first.definedAnswers === 'Y' && question.first.answerName?.match(new RegExp('Нет', 'i')) && question.second && question.second.length) {
|
|
189
|
+
question.second.forEach(second => {
|
|
190
|
+
if (second.definedAnswers === 'N') {
|
|
191
|
+
second.answerText = null;
|
|
192
|
+
} else {
|
|
193
|
+
second.answerId = null;
|
|
194
|
+
second.answerName = null;
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
}
|
|
181
200
|
formStore[whichSurvey.value]!.type = surveyType.value;
|
|
182
201
|
const anketaToken = await dataStore.setSurvey(formStore[whichSurvey.value]!);
|
|
183
202
|
if (typeof anketaToken === 'string') {
|
|
@@ -206,13 +225,36 @@ export default defineComponent({
|
|
|
206
225
|
});
|
|
207
226
|
};
|
|
208
227
|
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
228
|
+
const submitSecondaryForm = async () => {
|
|
229
|
+
await vSecondaryForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
230
|
+
if (v.valid) {
|
|
231
|
+
if (isSecondRequired.value && currentQuestion.value && currentQuestion.value.second) {
|
|
232
|
+
const hasError = currentQuestion.value.second.find(second => (second.definedAnswers === 'N' ? !second.answerText : !second.answerName));
|
|
233
|
+
if (hasError) {
|
|
234
|
+
dataStore.showToaster('error', dataStore.t('toaster.emptySecondAnketa', { text: hasError.name }), 5000);
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
firstPanel.value = false;
|
|
239
|
+
secondPanel.value = false;
|
|
240
|
+
} else {
|
|
241
|
+
const errors = document.querySelector('.v-input--error');
|
|
242
|
+
if (errors) {
|
|
243
|
+
const errorText = errors.parentElement?.children[0].innerHTML;
|
|
244
|
+
if (errorText) {
|
|
245
|
+
dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorText?.replace(/[-<>!//.]/g, '') }));
|
|
246
|
+
}
|
|
247
|
+
errors.scrollIntoView({
|
|
248
|
+
behavior: 'smooth',
|
|
249
|
+
block: 'center',
|
|
250
|
+
inline: 'nearest',
|
|
251
|
+
});
|
|
252
|
+
}
|
|
214
253
|
}
|
|
215
254
|
});
|
|
255
|
+
};
|
|
256
|
+
const openFirstPanel = async (question: AnketaBody) => {
|
|
257
|
+
currentQuestion.value = question;
|
|
216
258
|
firstPanel.value = true;
|
|
217
259
|
secondPanel.value = false;
|
|
218
260
|
};
|
|
@@ -241,7 +283,6 @@ export default defineComponent({
|
|
|
241
283
|
};
|
|
242
284
|
|
|
243
285
|
const getDefinedAnswerId = async (id: string, value: any, index: number) => {
|
|
244
|
-
// @ts-ignore
|
|
245
286
|
await dataStore.definedAnswers(id, whichSurvey.value, value, index);
|
|
246
287
|
};
|
|
247
288
|
|
|
@@ -277,18 +318,16 @@ export default defineComponent({
|
|
|
277
318
|
formStore.applicationData.processInstanceId,
|
|
278
319
|
whichMember.value === 'insured' ? formStore.applicationData.insuredApp[0].id : formStore.applicationData.clientApp.id,
|
|
279
320
|
whichSurvey.value,
|
|
280
|
-
surveyType.value === 'health' ? 'surveyByHealthSecond' : 'surveyByCriticalSecond',
|
|
281
321
|
whichMember.value,
|
|
282
322
|
);
|
|
283
323
|
firstQuestionList.value = formStore[whichSurvey.value]!.body;
|
|
284
|
-
secondQuestionList.value = formStore[surveyType.value === 'health' ? 'surveyByHealthSecond' : 'surveyByCriticalSecond']!;
|
|
285
324
|
formStore[whichSurvey.value]!.type = surveyType.value;
|
|
286
325
|
const negativeAnswer = firstQuestionList.value.every(i => i.first.answerName === 'Нет');
|
|
287
326
|
if (negativeAnswer) {
|
|
288
327
|
answerToAll.value = true;
|
|
289
328
|
}
|
|
290
329
|
await Promise.allSettled(
|
|
291
|
-
firstQuestionList.value.map(async
|
|
330
|
+
firstQuestionList.value.map(async question => {
|
|
292
331
|
await dataStore.definedAnswers(question.first.id, whichSurvey.value);
|
|
293
332
|
}),
|
|
294
333
|
);
|
|
@@ -325,10 +364,10 @@ export default defineComponent({
|
|
|
325
364
|
return {
|
|
326
365
|
// State
|
|
327
366
|
vForm,
|
|
367
|
+
vSecondaryForm,
|
|
328
368
|
formStore,
|
|
329
369
|
answerToAll,
|
|
330
370
|
firstQuestionList,
|
|
331
|
-
secondQuestionList,
|
|
332
371
|
whichSurvey,
|
|
333
372
|
isButtonLoading,
|
|
334
373
|
firstPanel,
|
|
@@ -338,9 +377,11 @@ export default defineComponent({
|
|
|
338
377
|
isPanelLoading,
|
|
339
378
|
searchQuery,
|
|
340
379
|
firstPanelSection,
|
|
380
|
+
isSecondRequired,
|
|
341
381
|
|
|
342
382
|
// Functions
|
|
343
383
|
submitForm,
|
|
384
|
+
submitSecondaryForm,
|
|
344
385
|
getDefinedAnswerId,
|
|
345
386
|
scrollForm,
|
|
346
387
|
handleToggler,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<section class="flex h-full" :class="$
|
|
2
|
+
<section class="flex h-full" :class="$styles.blueBgLight">
|
|
3
3
|
<!-- @vue-ignore -->
|
|
4
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">
|
|
5
5
|
<img draggable="false" class="w-[50%] mt-8" src="~/assets/auth-logo.svg" />
|
|
@@ -21,7 +21,7 @@
|
|
|
21
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" />
|
|
22
22
|
<div class="flex flex-col items-center mb-8 text-center">
|
|
23
23
|
<h1 class="text-[28px] font-medium mb-1">{{ $dataStore.t('labels.welcomeHL') }}</h1>
|
|
24
|
-
<span :class="[$
|
|
24
|
+
<span :class="[$styles.greyTextDark]" class="text-[16px]">{{ $dataStore.t('labels.needAuth') }}</span>
|
|
25
25
|
</div>
|
|
26
26
|
<v-form ref="vForm" class="w-2/3 lg:w-[25vw] self-center">
|
|
27
27
|
<base-rounded-input class="mb-1" v-model.trim="login" :rules="$rules.required" :loading="authLoading" :placeholder="$dataStore.t('buttons.userLogin')" type="text" />
|
|
@@ -35,19 +35,19 @@
|
|
|
35
35
|
@append="showPassword = !showPassword"
|
|
36
36
|
:type="showPassword ? ('' as InputTypes) : 'password'"
|
|
37
37
|
/>
|
|
38
|
-
<span v-if="$dataStore.isLKA" class="inline-block w-full text-end mb-4" :class="[$
|
|
38
|
+
<span v-if="$dataStore.isLKA" class="inline-block w-full text-end mb-4" :class="[$styles.textSimple, $styles.greyTextDark]" @click="isLogin = false">{{
|
|
39
39
|
$dataStore.t('labels.resetPassword')
|
|
40
40
|
}}</span>
|
|
41
|
-
<base-btn :text="$dataStore.t('buttons.login')" :disabled="authLoading" :btn="$
|
|
41
|
+
<base-btn :text="$dataStore.t('buttons.login')" :disabled="authLoading" :btn="$styles.greenBtn" @click="submitAuthForm" />
|
|
42
42
|
</v-form>
|
|
43
43
|
</section>
|
|
44
44
|
<section v-if="isLogin === false" class="w-full lg:w-3/4 flex flex-col justify-center items-center">
|
|
45
45
|
<div class="flex flex-col items-center mb-4">
|
|
46
46
|
<h1 class="text-[28px] font-medium mb-1">{{ $dataStore.t('labels.resetPassword') }}</h1>
|
|
47
|
-
<span :class="[$
|
|
47
|
+
<span :class="[$styles.greyTextDark]" class="text-[16px]">{{ $dataStore.t('labels.resetType') }}</span>
|
|
48
48
|
</div>
|
|
49
|
-
<div class="p-[2px] mb-8 rounded-[12px] border-[1px] w-2/3 lg:w-[25vw]" :class="[$
|
|
50
|
-
<v-tabs v-model="resetPasswordType" density="compact" slider-color="#009c73" class="w-full base-reset-password rounded-[12px]" :class="[$
|
|
49
|
+
<div class="p-[2px] mb-8 rounded-[12px] border-[1px] w-2/3 lg:w-[25vw]" :class="[$styles.whiteBg]">
|
|
50
|
+
<v-tabs v-model="resetPasswordType" density="compact" slider-color="#009c73" class="w-full base-reset-password rounded-[12px]" :class="[$styles.whiteBg]">
|
|
51
51
|
<v-tab :ripple="false" value="phone"> {{ $dataStore.t('form.phoneNumber') }} </v-tab>
|
|
52
52
|
<v-tab :ripple="false" value="email"> {{ $dataStore.t('form.email') }} </v-tab>
|
|
53
53
|
</v-tabs>
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
:placeholder="$dataStore.t('form.email')"
|
|
71
71
|
type="text"
|
|
72
72
|
/>
|
|
73
|
-
<span class="inline-block w-full text-end mb-4" :class="[$
|
|
74
|
-
<base-btn :text="$dataStore.t('buttons.reset')" :disabled="authLoading" :btn="$
|
|
73
|
+
<span class="inline-block w-full text-end mb-4" :class="[$styles.textSimple, $styles.greyTextDark]" @click="isLogin = true">{{ $dataStore.t('buttons.login') }}</span>
|
|
74
|
+
<base-btn :text="$dataStore.t('buttons.reset')" :disabled="authLoading" :btn="$styles.greenBtn" @click="submitAuthForm" />
|
|
75
75
|
</v-form>
|
|
76
76
|
</section>
|
|
77
77
|
</section>
|