hl-core 0.0.9-beta.5 → 0.0.9-beta.51
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/base.api.ts +1042 -0
- package/api/index.ts +2 -620
- package/api/interceptors.ts +53 -14
- package/components/Button/Btn.vue +2 -2
- package/components/Complex/MessageBlock.vue +2 -2
- package/components/Complex/Page.vue +1 -1
- package/components/Dialog/Dialog.vue +60 -15
- package/components/Form/DynamicForm.vue +100 -0
- package/components/Form/FormBlock.vue +12 -3
- package/components/Form/FormData.vue +110 -0
- package/components/Form/FormSection.vue +3 -3
- package/components/Form/FormToggle.vue +25 -5
- package/components/Form/ManagerAttachment.vue +150 -86
- package/components/Form/ProductConditionsBlock.vue +59 -6
- package/components/Input/Datepicker.vue +43 -7
- package/components/Input/DynamicInput.vue +23 -0
- package/components/Input/FileInput.vue +25 -5
- package/components/Input/FormInput.vue +7 -4
- package/components/Input/Monthpicker.vue +34 -0
- package/components/Input/PanelInput.vue +5 -1
- package/components/Input/RoundedEmptyField.vue +5 -0
- package/components/Input/RoundedSelect.vue +18 -0
- package/components/Input/SwitchInput.vue +64 -0
- package/components/Input/TextInput.vue +160 -0
- package/components/Layout/Drawer.vue +17 -4
- package/components/Layout/Header.vue +23 -2
- package/components/Layout/Loader.vue +1 -1
- package/components/Layout/SettingsPanel.vue +13 -7
- package/components/Menu/InfoMenu.vue +35 -0
- package/components/Menu/MenuNav.vue +17 -2
- package/components/Pages/Anketa.vue +140 -52
- package/components/Pages/Auth.vue +50 -9
- package/components/Pages/ContragentForm.vue +124 -50
- package/components/Pages/Documents.vue +179 -29
- package/components/Pages/InvoiceInfo.vue +1 -1
- package/components/Pages/MemberForm.vue +605 -116
- package/components/Pages/ProductAgreement.vue +1 -8
- package/components/Pages/ProductConditions.vue +1055 -183
- package/components/Panel/PanelHandler.vue +583 -46
- package/components/Panel/PanelSelectItem.vue +17 -2
- package/components/Panel/RightPanelCloser.vue +7 -0
- package/components/Transitions/Animation.vue +28 -0
- package/components/Utilities/Qr.vue +44 -0
- package/composables/axios.ts +1 -0
- package/composables/classes.ts +456 -8
- package/composables/constants.ts +114 -2
- package/composables/fields.ts +328 -0
- package/composables/index.ts +270 -19
- package/composables/styles.ts +29 -16
- package/layouts/default.vue +48 -3
- package/locales/ru.json +547 -14
- package/package.json +28 -24
- package/pages/Token.vue +1 -12
- package/plugins/vuetifyPlugin.ts +2 -0
- package/store/data.store.ts +1463 -275
- package/store/extractStore.ts +17 -0
- package/store/form.store.ts +13 -1
- package/store/member.store.ts +1 -1
- package/store/rules.ts +83 -5
- package/types/enum.ts +61 -0
- package/types/env.d.ts +1 -0
- package/types/form.ts +94 -0
- package/types/index.ts +259 -23
package/api/interceptors.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AxiosInstance } from 'axios';
|
|
1
|
+
import { AxiosError, AxiosInstance } from 'axios';
|
|
2
2
|
|
|
3
3
|
export default function (axios: AxiosInstance) {
|
|
4
4
|
axios.interceptors.request.use(
|
|
@@ -7,9 +7,43 @@ export default function (axios: AxiosInstance) {
|
|
|
7
7
|
if (dataStore.accessToken) {
|
|
8
8
|
request.headers.Authorization = `Bearer ${dataStore.accessToken}`;
|
|
9
9
|
}
|
|
10
|
+
if (request.url && request.baseURL) {
|
|
11
|
+
const host = window.location.hostname;
|
|
12
|
+
if (host.startsWith('bpmsrv02') || host.startsWith('vega')) {
|
|
13
|
+
if (request.baseURL === getStrValuePerEnv('baseApi')) {
|
|
14
|
+
request.baseURL = getStrValuePerEnv('baseApiLocal');
|
|
15
|
+
}
|
|
16
|
+
if (request.baseURL === getStrValuePerEnv('efoBaseApi')) {
|
|
17
|
+
request.baseURL = getStrValuePerEnv('efoBaseApiLocal');
|
|
18
|
+
}
|
|
19
|
+
if (request.baseURL === getStrValuePerEnv('amlBaseApi')) {
|
|
20
|
+
request.baseURL = getStrValuePerEnv('amlBaseApiLocal');
|
|
21
|
+
}
|
|
22
|
+
if (request.baseURL === getStrValuePerEnv('gatewayApiUrl')) {
|
|
23
|
+
request.baseURL = getStrValuePerEnv('gatewayApiUrlLocal');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (import.meta.env.VITE_ON_NEW_API === 'true') {
|
|
27
|
+
if (request.url.includes('api/Application')) {
|
|
28
|
+
if (request.baseURL === 'http://vega:84') {
|
|
29
|
+
request.baseURL = 'http://efo-dev.halyklife.nb/api';
|
|
30
|
+
}
|
|
31
|
+
if (request.baseURL === 'http://bpmsrv02.halyklife.nb') {
|
|
32
|
+
request.baseURL = 'http://efo-prod.halyklife.nb/api';
|
|
33
|
+
}
|
|
34
|
+
request.url = request.url.replace('/api/Application', '');
|
|
35
|
+
if (request.baseURL.includes('api/v1/insis')) {
|
|
36
|
+
request.baseURL = request.baseURL.replace('api/v1/insis', 'efo/api');
|
|
37
|
+
}
|
|
38
|
+
if (request.baseURL.includes('api/v1/test/insis')) {
|
|
39
|
+
request.baseURL = request.baseURL.replace('api/v1/test/insis', 'test/efo/api');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
10
44
|
return request;
|
|
11
45
|
},
|
|
12
|
-
error => {
|
|
46
|
+
(error: AxiosError) => {
|
|
13
47
|
return Promise.reject(error);
|
|
14
48
|
},
|
|
15
49
|
);
|
|
@@ -17,22 +51,27 @@ export default function (axios: AxiosInstance) {
|
|
|
17
51
|
response => {
|
|
18
52
|
return response;
|
|
19
53
|
},
|
|
20
|
-
error => {
|
|
54
|
+
(error: AxiosError) => {
|
|
21
55
|
const dataStore = useDataStore();
|
|
22
56
|
if (!dataStore.isCalculator) {
|
|
23
57
|
const router = useRouter();
|
|
24
|
-
if (error.response.status
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
58
|
+
if (error && error.response && error.response.status) {
|
|
59
|
+
if (error.response.status === 401) {
|
|
60
|
+
dataStore.$reset();
|
|
61
|
+
localStorage.clear();
|
|
62
|
+
if (dataStore.isBridge) {
|
|
63
|
+
router.push({ name: 'Auth', query: { error: 401 } });
|
|
64
|
+
} else {
|
|
65
|
+
dataStore.sendToParent(constants.postActions.Error401, 401);
|
|
66
|
+
}
|
|
31
67
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
68
|
+
if (error.response.status >= 500) {
|
|
69
|
+
if (router.currentRoute.value.name !== 'Auth') {
|
|
70
|
+
dataStore.showToaster('error', error.stack ?? dataStore.t('toaster.error'), 5000);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (error.response.status === 403 && error.response.config.url) {
|
|
74
|
+
dataStore.showToaster('error', `Нет доступа на запрос: ${error.response.config.url.substring(error.response.config.url.lastIndexOf('/') + 1)}`, 5000);
|
|
36
75
|
}
|
|
37
76
|
}
|
|
38
77
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<button
|
|
3
3
|
type="button"
|
|
4
|
-
class="transition-all"
|
|
4
|
+
class="transition-all border-solid"
|
|
5
5
|
@click="$emit('clicked')"
|
|
6
6
|
:disabled="disabled || loading"
|
|
7
7
|
:class="[
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
]"
|
|
13
13
|
>
|
|
14
14
|
<base-loader v-if="loading" :size="24" color="#FFF" bg-color="" :width="2" />
|
|
15
|
-
<span v-if="!loading">{{ text }}</span>
|
|
15
|
+
<span class="!text-inherit" v-if="!loading">{{ text }}</span>
|
|
16
16
|
</button>
|
|
17
17
|
</template>
|
|
18
18
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="text-left p-6
|
|
3
|
-
<v-icon :icon="icon" class="mr-4"
|
|
2
|
+
<div class="text-left p-6" :class="[color, $styles.rounded, $styles.textTitle]">
|
|
3
|
+
<v-icon :icon="icon" class="mr-4" />
|
|
4
4
|
{{ text }}
|
|
5
5
|
</div>
|
|
6
6
|
</template>
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-dialog :model-value="modelValue" @update:modelValue="$emit('update:modelValue', $event)" :persistent="true">
|
|
3
|
-
<v-card class="self-center w-full sm:w-
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
<v-dialog class="base-dialog" :model-value="modelValue" @update:modelValue="$emit('update:modelValue', $event)" :persistent="true">
|
|
3
|
+
<v-card class="self-center w-full sm:w-4/4 md:w-2/3 lg:w-[35%] xl:w-[500px] rounded-lg !p-[36px]">
|
|
4
|
+
<div class="flex sm:flex-row flex-col place-items-center sm:place-items-start">
|
|
5
|
+
<div class="h-20 w-20 place-items-start pt-1">
|
|
6
|
+
<div class="bg-[#F7F7F7] h-24 w-24 sm:h-16 sm:w-16 rounded grid place-items-center invisible sm:visible">
|
|
7
|
+
<i :class="'mdi-' + icon.mdi" class="mdi text-[100px] sm:text-[30px] color-blue visible !ml-[-10px] sm:!ml-[0px] mt-[-50px] sm:mt-0" :style="{ color: icon.color }"></i>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
<v-card-title class="!text-center sm:!text-start text-[34px]">
|
|
11
|
+
<slot v-if="!title" name="title"></slot>
|
|
12
|
+
<div></div>
|
|
13
|
+
{{ title }}
|
|
14
|
+
<v-card-subtitle class="!p-0">
|
|
15
|
+
<slot v-if="!subtitle" name="subtitle"></slot>
|
|
16
|
+
{{ subtitle }}
|
|
17
|
+
</v-card-subtitle>
|
|
18
|
+
</v-card-title>
|
|
19
|
+
</div>
|
|
20
|
+
<v-card-actions class="!p-0 pt-5 gap-[16px] sm:flex-row flex-col place-items-stretch sm:place-items-center">
|
|
21
|
+
<base-btn v-if="actions === 'default'" class="px-6" size="sm" :text="confirm" :btn="$styles.whiteBorderBtn" :classes="$styles.blueText" @click="$emit('yes')" />
|
|
22
|
+
<base-btn v-if="actions === 'default'" class="px-6" size="sm" :text="$dataStore.t('confirm.cancel')" :btn="$styles.blueBtn" @click="$emit('no')" />
|
|
16
23
|
<slot v-if="actions !== 'default'" name="actions"></slot>
|
|
17
24
|
</v-card-actions>
|
|
18
25
|
</v-card>
|
|
@@ -29,7 +36,7 @@ export default defineComponent({
|
|
|
29
36
|
title: {
|
|
30
37
|
type: String,
|
|
31
38
|
default() {
|
|
32
|
-
return useDataStore().t('dialog.
|
|
39
|
+
return useDataStore().t('dialog.confirmDo');
|
|
33
40
|
},
|
|
34
41
|
},
|
|
35
42
|
subtitle: {
|
|
@@ -40,7 +47,45 @@ export default defineComponent({
|
|
|
40
47
|
type: String,
|
|
41
48
|
default: 'default',
|
|
42
49
|
},
|
|
50
|
+
confirm: {
|
|
51
|
+
type: String,
|
|
52
|
+
default() {
|
|
53
|
+
return useDataStore().t('confirm.yes');
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
icon: {
|
|
57
|
+
type: Object as PropType<{ mdi?: string; color?: string; bg?: string }>,
|
|
58
|
+
default: {
|
|
59
|
+
mdi: 'information',
|
|
60
|
+
color: '#FAB31C',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
43
63
|
},
|
|
44
64
|
emits: ['update:modelValue', 'yes', 'no'],
|
|
45
65
|
});
|
|
46
66
|
</script>
|
|
67
|
+
<style>
|
|
68
|
+
.base-dialog .v-card-title {
|
|
69
|
+
font-size: 18px;
|
|
70
|
+
}
|
|
71
|
+
.base-dialog .v-card-subtitle {
|
|
72
|
+
font-size: 14px;
|
|
73
|
+
}
|
|
74
|
+
@media (max-width: 640px) {
|
|
75
|
+
.base-dialog .v-card-title {
|
|
76
|
+
margin-top: 10px;
|
|
77
|
+
font-size: 20px;
|
|
78
|
+
}
|
|
79
|
+
.base-dialog .v-card-subtitle {
|
|
80
|
+
font-size: 14px;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
.base-dialog .v-card-title,
|
|
84
|
+
.base-dialog .v-card-subtitle {
|
|
85
|
+
padding-top: 0;
|
|
86
|
+
flex: 1;
|
|
87
|
+
overflow-wrap: normal;
|
|
88
|
+
overflow: visible;
|
|
89
|
+
white-space: normal;
|
|
90
|
+
}
|
|
91
|
+
</style>
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-form class="dynamic-form">
|
|
3
|
+
<base-form-section v-for="(section, sectionIndex) in form.sections" :key="sectionIndex" class="rounded-lg" :title="section.title">
|
|
4
|
+
<base-dynamic-input :fields="section.fields" @onClickField="onClickField" />
|
|
5
|
+
</base-form-section>
|
|
6
|
+
<Teleport v-if="isPanelOpen" to="#right-panel-actions">
|
|
7
|
+
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
8
|
+
<base-rounded-input v-model="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
9
|
+
<div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
10
|
+
<base-panel-select-item :text="$dataStore.t('form.notChosen')" :selected="panelValue.nameRu === null" @click="pickPanelValue(new Value())" />
|
|
11
|
+
<base-panel-select-item
|
|
12
|
+
v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
|
|
13
|
+
:key="index"
|
|
14
|
+
:text="(item.nameRu as string)"
|
|
15
|
+
:selected="item.nameRu === panelValue"
|
|
16
|
+
@click="pickPanelValue(item)"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
|
|
20
|
+
</div>
|
|
21
|
+
</Teleport>
|
|
22
|
+
</v-form>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script lang="ts">
|
|
26
|
+
import { Value } from '#imports';
|
|
27
|
+
|
|
28
|
+
export default defineComponent({
|
|
29
|
+
props: {
|
|
30
|
+
form: {
|
|
31
|
+
type: Object as PropType<DynamicForm>,
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
setup() {
|
|
36
|
+
const dataStore = useDataStore();
|
|
37
|
+
const isPanelOpen = ref<boolean>(false);
|
|
38
|
+
const panelValue = ref<any>(new Value());
|
|
39
|
+
const panelList = ref<Value[]>([]);
|
|
40
|
+
const isPanelLoading = ref<boolean>(false);
|
|
41
|
+
const searchQuery = ref<string>('');
|
|
42
|
+
const listOfPanelTitles: {
|
|
43
|
+
[key in FetchFunctions]: string;
|
|
44
|
+
} = {
|
|
45
|
+
getResidents: 'form.signOfResidency',
|
|
46
|
+
getFamilyStatuses: 'form.familyStatus',
|
|
47
|
+
getRelationTypes: 'form.relations',
|
|
48
|
+
getCountries: 'form.Country',
|
|
49
|
+
getLocalityTypes: 'form.RegionType',
|
|
50
|
+
getStates: 'form.Province',
|
|
51
|
+
getCities: 'form.City',
|
|
52
|
+
getRegions: 'form.Region',
|
|
53
|
+
getDocumentTypes: 'form.documentType',
|
|
54
|
+
getTaxCountries: 'form.countryOfTaxResidency',
|
|
55
|
+
getCitizenshipCountries: 'form.countryOfCitizenship',
|
|
56
|
+
getSectorCodeList: 'form.economySectorCode',
|
|
57
|
+
getInsurancePay: 'form.insurancePay',
|
|
58
|
+
getEconomicActivityType: 'form.typeEconomicActivity',
|
|
59
|
+
getBanks: 'form.bankName',
|
|
60
|
+
getDocumentIssuers: 'form.documentIssuers',
|
|
61
|
+
getGenderList: 'form.gender',
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const currentField = ref<InputType | null>(null);
|
|
65
|
+
|
|
66
|
+
const pickPanelValue = (item: Value) => {
|
|
67
|
+
if (currentField.value) {
|
|
68
|
+
currentField.value.modelValue = item;
|
|
69
|
+
dataStore.rightPanel.open = false;
|
|
70
|
+
searchQuery.value = '';
|
|
71
|
+
currentField.value = null;
|
|
72
|
+
}
|
|
73
|
+
isPanelOpen.value = false;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const onClickField = async (field: InputType) => {
|
|
77
|
+
currentField.value = field;
|
|
78
|
+
if (field.fetchFrom) {
|
|
79
|
+
isPanelLoading.value = true;
|
|
80
|
+
isPanelOpen.value = true;
|
|
81
|
+
dataStore.rightPanel.open = true;
|
|
82
|
+
dataStore.rightPanel.title = dataStore.t(listOfPanelTitles[field.fetchFrom]);
|
|
83
|
+
panelValue.value = field.modelValue;
|
|
84
|
+
panelList.value = (await dataStore[field.fetchFrom]()) as Value[];
|
|
85
|
+
isPanelLoading.value = false;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
return {
|
|
90
|
+
panelValue,
|
|
91
|
+
panelList,
|
|
92
|
+
isPanelOpen,
|
|
93
|
+
isPanelLoading,
|
|
94
|
+
searchQuery,
|
|
95
|
+
pickPanelValue,
|
|
96
|
+
onClickField,
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
</script>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<div
|
|
7
7
|
v-if="isMultiple && more && !isShort && isActionsAvailable"
|
|
8
8
|
:class="[$styles.blueBg, $styles.whiteText, $styles.textSimple, disabled ? $styles.disabled : 'cursor-pointer']"
|
|
9
|
-
class="lg:flex transition-all rounded-lg h-[36px]
|
|
9
|
+
class="hidden lg:flex transition-all rounded-lg h-[36px] items-center font-medium justify-center opacity-50 hover:opacity-90 w-[120px]"
|
|
10
10
|
@click="!disabled && memberStore.addMember(whichForm)"
|
|
11
11
|
>
|
|
12
12
|
{{ $dataStore.t('buttons.add') }}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
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
34
|
>
|
|
35
35
|
<span :class="[getMemberInfo(each).fullName === null && $styles.emptyBlockCol]">{{ getMemberInfo(each).fullName }}</span>
|
|
36
|
-
<span :class="[getMemberInfo(each).iin === null && $styles.emptyBlockCol]">{{
|
|
36
|
+
<span :class="[getMemberInfo(each).iin === null && $styles.emptyBlockCol]">{{ getMemberIIN(each) }}</span>
|
|
37
37
|
<span v-if="!isShort" :class="[getMemberInfo(each).gender === null && $styles.emptyBlockCol]" class="hidden lg:block">{{ getMemberInfo(each).gender }} </span>
|
|
38
38
|
<span v-if="!isShort" :class="[getMemberInfo(each).birthDate === null && $styles.emptyBlockCol]"> {{ getMemberInfo(each).birthDate }} </span>
|
|
39
39
|
<span v-if="!isShort" :class="[getMemberInfo(each).birthPlace === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).birthPlace }} </span>
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
<div
|
|
76
76
|
v-if="isMultiple && more && !isShort && isActionsAvailable"
|
|
77
77
|
:class="[$styles.blueBg, $styles.whiteText, $styles.textSimple, disabled ? $styles.disabled : 'cursor-pointer']"
|
|
78
|
-
class="lg:hidden transition-all rounded-b-lg h-[36px]
|
|
78
|
+
class="flex lg:hidden transition-all rounded-b-lg h-[36px] items-center font-medium justify-center opacity-50 hover:opacity-90"
|
|
79
79
|
@click="!disabled && memberStore.addMember(whichForm)"
|
|
80
80
|
>
|
|
81
81
|
{{ $dataStore.t('buttons.add') }}
|
|
@@ -116,6 +116,7 @@ export default defineComponent({
|
|
|
116
116
|
},
|
|
117
117
|
emits: ['onMore', 'addMember'],
|
|
118
118
|
setup(props) {
|
|
119
|
+
const dataStore = useDataStore();
|
|
119
120
|
const formStore = useFormStore();
|
|
120
121
|
const memberStore = useMemberStore();
|
|
121
122
|
const isMultiple = computed(() => [StoreMembers.insuredForm, StoreMembers.beneficiaryForm, StoreMembers.beneficialOwnerForm].includes(props.whichForm as StoreMembers));
|
|
@@ -128,6 +129,13 @@ export default defineComponent({
|
|
|
128
129
|
|
|
129
130
|
const isShort = computed(() => props.type === 'short');
|
|
130
131
|
const isActionsAvailable = computed(() => memberStore.isStatementEditible(props.whichForm));
|
|
132
|
+
const getMemberIIN = (each: Member) => {
|
|
133
|
+
const iin = getMemberInfo(each).iin;
|
|
134
|
+
if (dataStore.isFinCenter() && iin) {
|
|
135
|
+
return iin.replaceAll('-', '');
|
|
136
|
+
}
|
|
137
|
+
return iin;
|
|
138
|
+
};
|
|
131
139
|
|
|
132
140
|
const getMemberInfo = (memberData: Member) => {
|
|
133
141
|
return {
|
|
@@ -153,6 +161,7 @@ export default defineComponent({
|
|
|
153
161
|
isActionsAvailable,
|
|
154
162
|
|
|
155
163
|
// Functions
|
|
164
|
+
getMemberIIN,
|
|
156
165
|
getMemberInfo,
|
|
157
166
|
};
|
|
158
167
|
},
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<base-animation :type="animation">
|
|
3
|
+
<div
|
|
4
|
+
v-if="block && !!block.show === true"
|
|
5
|
+
class="form-data-block rounded-lg border-[1px] relative transition-all"
|
|
6
|
+
:class="[$styles.whiteBg, block.disabled && $styles.disabled]"
|
|
7
|
+
>
|
|
8
|
+
<div class="py-3 px-6">
|
|
9
|
+
<div class="flex items-center justify-between">
|
|
10
|
+
<p :class="[$styles.textTitle, $styles.greenText]">{{ block.title }}</p>
|
|
11
|
+
<div
|
|
12
|
+
v-if="typeof block.headerBtn === 'object' ? (typeof block.headerBtn.showBtn === 'boolean' ? block.headerBtn.showBtn === true : true) : false"
|
|
13
|
+
:class="[$styles.blueBg, $styles.whiteText, $styles.textSimple, block.disabled ? $styles.disabled : 'cursor-pointer']"
|
|
14
|
+
class="hidden lg:flex transition-all rounded-lg h-[36px] items-center font-medium justify-center opacity-50 hover:opacity-90 w-[120px]"
|
|
15
|
+
@click="!block.disabled && block.headerBtn!.action()"
|
|
16
|
+
>
|
|
17
|
+
{{ block.headerBtn!.text }}
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
<p v-if="block.subtitle" :class="[$styles.greyText, $styles.textSimple]">{{ block.subtitle }}</p>
|
|
21
|
+
<v-row class="mt-1 max-w-[97%]">
|
|
22
|
+
<v-col v-for="(label, index) in visibleLabels" :key="index" :cols="block.shrinkLabels === true ? false : label.size">
|
|
23
|
+
<p :class="[$styles.textSimple]" class="font-medium">
|
|
24
|
+
{{ label.text }}
|
|
25
|
+
</p>
|
|
26
|
+
</v-col>
|
|
27
|
+
</v-row>
|
|
28
|
+
<div v-if="hasBlockData(block.data)">
|
|
29
|
+
<v-row v-for="(row, index) in getBlockDataValue(block.data)" :key="index" class="min-h-[65px] max-w-[97%]">
|
|
30
|
+
<v-col v-if="row.every((i: any) => !i)" :class="[$styles.textSimple, $styles.blueText]">{{ block.noValueText ?? $dataStore.t('clients.necessaryFillForm') }}</v-col>
|
|
31
|
+
<v-col v-else v-for="each of row.filter((_: any, i: number) => $display().lgAndUp.value ? true : block.labels[i].hideOnMobile === false)" :key="each">
|
|
32
|
+
<p :class="[$styles.textSimple]">
|
|
33
|
+
{{ each }}
|
|
34
|
+
</p>
|
|
35
|
+
</v-col>
|
|
36
|
+
<base-animation type="fade">
|
|
37
|
+
<div
|
|
38
|
+
v-if="block.btn && !!block.btn.showBtn === true"
|
|
39
|
+
class="absolute right-0 rounded-br-lg transition-all h-[70px] w-[60px] place-self-end flex items-center justify-center"
|
|
40
|
+
:class="[$styles.blueBgLight, $styles.blueBgLightHover, block.disabled ? $styles.disabled : 'cursor-pointer']"
|
|
41
|
+
@click="!block.disabled && block.btn.action({ value: row, index: index })"
|
|
42
|
+
>
|
|
43
|
+
<i class="mdi text-xl" :class="[block.btn.icon]"></i>
|
|
44
|
+
</div>
|
|
45
|
+
</base-animation>
|
|
46
|
+
</v-row>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
<div
|
|
50
|
+
v-if="typeof block.headerBtn === 'object'"
|
|
51
|
+
:class="[$styles.blueBg, $styles.whiteText, $styles.textSimple, block.disabled ? $styles.disabled : 'cursor-pointer']"
|
|
52
|
+
class="flex lg:hidden transition-all rounded-b-lg h-[36px] items-center font-medium justify-center opacity-50 hover:opacity-90"
|
|
53
|
+
@click="!block.disabled && block.headerBtn.action()"
|
|
54
|
+
>
|
|
55
|
+
{{ block.headerBtn.text }}
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</base-animation>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<script lang="ts">
|
|
62
|
+
import { ComputedRefWithControl } from '@vueuse/core';
|
|
63
|
+
import { FormBlock } from '../../composables/fields';
|
|
64
|
+
|
|
65
|
+
export default defineComponent({
|
|
66
|
+
props: {
|
|
67
|
+
block: {
|
|
68
|
+
type: Object as PropType<FormBlock>,
|
|
69
|
+
required: true,
|
|
70
|
+
},
|
|
71
|
+
animation: {
|
|
72
|
+
type: String as PropType<VuetifyAnimations>,
|
|
73
|
+
required: false,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
setup(props) {
|
|
77
|
+
const display = useDisplayInfo();
|
|
78
|
+
const visibleLabels = computed(() => (display.lgAndUp.value ? props.block.labels : props.block.labels.filter(i => i.hideOnMobile === false)));
|
|
79
|
+
|
|
80
|
+
const hasBlockData = (data: ComputedRefWithControl<any> | string[][]) => {
|
|
81
|
+
if (data) {
|
|
82
|
+
if ('value' in data && data.value && data.value.length) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
if ('value' in data === false && Array.isArray(data) && data.length) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return false;
|
|
90
|
+
};
|
|
91
|
+
const getBlockDataValue = (data: ComputedRefWithControl<any> | string[][]) => ('value' in data ? data.value : data);
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
// Computed
|
|
95
|
+
visibleLabels,
|
|
96
|
+
|
|
97
|
+
// Functions
|
|
98
|
+
hasBlockData,
|
|
99
|
+
getBlockDataValue,
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<style>
|
|
106
|
+
.form-data-block .v-col {
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
}
|
|
110
|
+
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section :class="[$styles.blueBgLight, $styles.rounded]" class="mt-[14px] p-4 flex flex-col gap-[1px]">
|
|
3
|
-
<h2 :class="[$styles.textTitle]" class="font-medium text-center w-full mb-4">
|
|
3
|
+
<h2 v-if="title && typeof title === 'string'" :class="[$styles.textTitle]" class="font-medium text-center w-full mb-4">
|
|
4
4
|
{{ title }}
|
|
5
5
|
<slot name="icon"></slot>
|
|
6
6
|
</h2>
|
|
@@ -13,8 +13,8 @@ export default defineComponent({
|
|
|
13
13
|
props: {
|
|
14
14
|
title: {
|
|
15
15
|
type: String,
|
|
16
|
-
default: '
|
|
17
|
-
required:
|
|
16
|
+
default: '',
|
|
17
|
+
required: false,
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="
|
|
4
|
-
:class="[$styles.whiteBg, hasBorder ? 'border-[1px] rounded-lg' : 'border-b-[1px] border-b-[#f3f6fc] rounded']"
|
|
3
|
+
class="!pl-2 md:!pl-5 flex items-center justify-start gap-5"
|
|
4
|
+
:class="[$styles.whiteBg, height, hasBorder ? 'border-[1px] rounded-lg' : 'border-b-[1px] border-b-[#f3f6fc] rounded']"
|
|
5
5
|
>
|
|
6
6
|
<v-switch
|
|
7
7
|
class="base-toggle"
|
|
@@ -12,10 +12,14 @@
|
|
|
12
12
|
"
|
|
13
13
|
color="#009C73"
|
|
14
14
|
hide-details
|
|
15
|
+
:true-value="trueValue"
|
|
16
|
+
:false-value="falseValue"
|
|
15
17
|
:disabled="disabled"
|
|
16
18
|
/>
|
|
17
|
-
<p :class="[$styles.textSimple]">{{ `${title}` }}</p>
|
|
18
|
-
<p class="mr-3" :class="[modelValue ? $styles.greenText : '', $styles.textSimple]">
|
|
19
|
+
<p class="p-2" :class="[$styles.textSimple]">{{ `${title}` }}</p>
|
|
20
|
+
<p v-if="showValue" class="mr-3" :class="[modelValue ? $styles.greenText : '', $styles.textSimple]">
|
|
21
|
+
{{ `${modelValue ? $dataStore.t('confirm.yes') : $dataStore.t('confirm.no')}` }}
|
|
22
|
+
</p>
|
|
19
23
|
</div>
|
|
20
24
|
</template>
|
|
21
25
|
|
|
@@ -23,7 +27,7 @@
|
|
|
23
27
|
export default defineComponent({
|
|
24
28
|
props: {
|
|
25
29
|
modelValue: {
|
|
26
|
-
type: Boolean
|
|
30
|
+
type: Boolean as PropType<any>,
|
|
27
31
|
default: '',
|
|
28
32
|
},
|
|
29
33
|
title: {
|
|
@@ -38,6 +42,22 @@ export default defineComponent({
|
|
|
38
42
|
type: Boolean,
|
|
39
43
|
default: true,
|
|
40
44
|
},
|
|
45
|
+
showValue: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: true,
|
|
48
|
+
},
|
|
49
|
+
trueValue: {
|
|
50
|
+
type: Boolean as PropType<any>,
|
|
51
|
+
default: true,
|
|
52
|
+
},
|
|
53
|
+
falseValue: {
|
|
54
|
+
type: Boolean as PropType<any>,
|
|
55
|
+
default: false,
|
|
56
|
+
},
|
|
57
|
+
height: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: 'min-h-[74px] '
|
|
60
|
+
}
|
|
41
61
|
},
|
|
42
62
|
emits: ['update:modelValue', 'clicked'],
|
|
43
63
|
});
|