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
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(
|
|
@@ -9,7 +9,7 @@ export default function (axios: AxiosInstance) {
|
|
|
9
9
|
}
|
|
10
10
|
return request;
|
|
11
11
|
},
|
|
12
|
-
error => {
|
|
12
|
+
(error: AxiosError) => {
|
|
13
13
|
return Promise.reject(error);
|
|
14
14
|
},
|
|
15
15
|
);
|
|
@@ -17,22 +17,24 @@ export default function (axios: AxiosInstance) {
|
|
|
17
17
|
response => {
|
|
18
18
|
return response;
|
|
19
19
|
},
|
|
20
|
-
error => {
|
|
20
|
+
(error: AxiosError) => {
|
|
21
21
|
const dataStore = useDataStore();
|
|
22
22
|
if (!dataStore.isCalculator) {
|
|
23
23
|
const router = useRouter();
|
|
24
|
-
if (error.response.status
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
if (error && error.response && error.response.status) {
|
|
25
|
+
if (error.response.status === 401) {
|
|
26
|
+
dataStore.$reset();
|
|
27
|
+
localStorage.clear();
|
|
28
|
+
if (dataStore.isBridge) {
|
|
29
|
+
router.push({ name: 'Auth', query: { error: 401 } });
|
|
30
|
+
} else {
|
|
31
|
+
dataStore.sendToParent(constants.postActions.Error401, 401);
|
|
32
|
+
}
|
|
31
33
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
if (error.response.status >= 500) {
|
|
35
|
+
if (router.currentRoute.value.name !== 'Auth') {
|
|
36
|
+
dataStore.showToaster('error', error.stack ?? dataStore.t('toaster.error'), 5000);
|
|
37
|
+
}
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
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="[
|
|
8
8
|
disabled ? 'disabled' : '',
|
|
9
9
|
classes,
|
|
10
10
|
btn,
|
|
11
|
-
$
|
|
11
|
+
$styles[`btnH${$capitalize(size)}` as keyof typeof $styles],
|
|
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
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="text-left p-6" :class="[color, $styles.rounded, $styles.textTitle]">
|
|
3
|
+
<v-icon :icon="icon" class="mr-4"></v-icon>
|
|
4
|
+
{{ text }}
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
name: 'BaseMessageBlock',
|
|
11
|
+
props: {
|
|
12
|
+
text: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: '',
|
|
15
|
+
},
|
|
16
|
+
icon: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: 'mdi-alert',
|
|
19
|
+
},
|
|
20
|
+
color: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: 'bg-rose-500 text-white',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
</script>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<base-content class="flex-col" :class="[$
|
|
2
|
+
<base-content class="flex-col" :class="[$styles.whiteBg]">
|
|
3
3
|
<base-header
|
|
4
|
+
v-if="customHeader === false"
|
|
4
5
|
class="justify-center lg:pl-14"
|
|
5
6
|
:has-back="hasBack"
|
|
6
7
|
:back-icon="backIcon"
|
|
@@ -10,6 +11,7 @@
|
|
|
10
11
|
@onBack="$emit('onBack')"
|
|
11
12
|
@onMore="$emit('onMore')"
|
|
12
13
|
/>
|
|
14
|
+
<slot name="header"></slot>
|
|
13
15
|
<slot></slot>
|
|
14
16
|
</base-content>
|
|
15
17
|
</template>
|
|
@@ -37,6 +39,10 @@ export default defineComponent({
|
|
|
37
39
|
type: String,
|
|
38
40
|
default: '',
|
|
39
41
|
},
|
|
42
|
+
customHeader: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false,
|
|
45
|
+
},
|
|
40
46
|
},
|
|
41
47
|
emits: ['onBack', 'onMore'],
|
|
42
48
|
});
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
{{ subtitle }}
|
|
12
12
|
</v-card-subtitle>
|
|
13
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="$
|
|
15
|
-
<base-btn v-if="actions === 'default'" class="!w-fit px-6" size="sm" :text="$dataStore.t('confirm.no')" :btn="$
|
|
14
|
+
<base-btn v-if="actions === 'default'" class="!w-fit px-6" size="sm" :text="$dataStore.t('confirm.yes')" :btn="$styles.blueBtn" @click="$emit('yes')" />
|
|
15
|
+
<base-btn v-if="actions === 'default'" class="!w-fit px-6" size="sm" :text="$dataStore.t('confirm.no')" :btn="$styles.blueBtn" @click="$emit('no')" />
|
|
16
16
|
<slot v-if="actions !== 'default'" name="actions"></slot>
|
|
17
17
|
</v-card-actions>
|
|
18
18
|
</v-card>
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
<v-list lines="two" v-if="formStore.birthInfos && formStore.birthInfos.length" class="w-full !py-0">
|
|
3
3
|
<v-list-item
|
|
4
4
|
@click="$emit('reset')"
|
|
5
|
-
:append-icon="selected && Object.keys(selected).length === 0 ? `mdi-radiobox-marked ${$
|
|
5
|
+
:append-icon="selected && Object.keys(selected).length === 0 ? `mdi-radiobox-marked ${$styles.greenText}` : 'mdi-radiobox-blank text-[#636363]'"
|
|
6
6
|
>
|
|
7
|
-
<v-list-item-title :class="[$
|
|
7
|
+
<v-list-item-title :class="[$styles.greenText, $styles.textTitle]">{{ $dataStore.t('form.notChosen') }}</v-list-item-title>
|
|
8
8
|
</v-list-item>
|
|
9
9
|
<v-list-item
|
|
10
10
|
v-for="familyMember of formStore.birthInfos"
|
|
11
11
|
:key="familyMember.childIIN"
|
|
12
12
|
@click="$emit('selectFamilyMember', familyMember)"
|
|
13
|
-
:append-icon="familyMember && selected && selected.childIIN === familyMember.childIIN ? `mdi-radiobox-marked ${$
|
|
13
|
+
:append-icon="familyMember && selected && selected.childIIN === familyMember.childIIN ? `mdi-radiobox-marked ${$styles.greenText}` : 'mdi-radiobox-blank text-[#636363]'"
|
|
14
14
|
>
|
|
15
|
-
<v-list-item-title :class="[$
|
|
15
|
+
<v-list-item-title :class="[$styles.greenText, $styles.textTitle]">{{
|
|
16
16
|
`${familyMember.childSurName} ${familyMember.childName} ${familyMember.childPatronymic ? familyMember.childPatronymic : ''}`
|
|
17
17
|
}}</v-list-item-title>
|
|
18
|
-
<v-list-item-subtitle :class="[$
|
|
18
|
+
<v-list-item-subtitle :class="[$styles.textSimple]"
|
|
19
19
|
><span>{{ `${$dataStore.t('form.iin')}:` }}</span
|
|
20
20
|
>{{ ` ${$reformatIin(familyMember.childIIN!)}` }}</v-list-item-subtitle
|
|
21
21
|
>
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="pt-3 rounded-lg border-[1px]" :class="[$
|
|
2
|
+
<div class="pt-3 rounded-lg border-[1px]" :class="[$styles.whiteBg, disabled && $styles.disabled]">
|
|
3
3
|
<div class="ml-5">
|
|
4
4
|
<div class="flex justify-between mr-5">
|
|
5
|
-
<p :class="[$
|
|
5
|
+
<p :class="[$styles.textTitle, $styles.greenText]">{{ title }}</p>
|
|
6
6
|
<div
|
|
7
7
|
v-if="isMultiple && more && !isShort && isActionsAvailable"
|
|
8
|
-
:class="[$
|
|
8
|
+
:class="[$styles.blueBg, $styles.whiteText, $styles.textSimple, disabled ? $styles.disabled : 'cursor-pointer']"
|
|
9
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
10
|
@click="!disabled && memberStore.addMember(whichForm)"
|
|
11
11
|
>
|
|
12
12
|
{{ $dataStore.t('buttons.add') }}
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
|
-
<p v-if="!!subtitle" :class="[$
|
|
15
|
+
<p v-if="!!subtitle" :class="[$styles.greyText, $styles.textSimple]">{{ subtitle }}</p>
|
|
16
16
|
</div>
|
|
17
17
|
<div
|
|
18
18
|
class="ml-5 mt-6 grid auto-rows-fr items-center"
|
|
19
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
20
|
>
|
|
21
|
-
<span :class="[$
|
|
22
|
-
<span :class="[$
|
|
23
|
-
<span v-if="!isShort" :class="[$
|
|
24
|
-
<span v-if="!isShort" :class="[$
|
|
25
|
-
<span v-if="!isShort" :class="[$
|
|
26
|
-
<span v-if="!isShort" :class="[$
|
|
21
|
+
<span :class="[$styles.textSimple]" class="font-medium">{{ $dataStore.t('form.fullName') }}</span>
|
|
22
|
+
<span :class="[$styles.textSimple]" class="font-medium">{{ $dataStore.t('form.iin') }}</span>
|
|
23
|
+
<span v-if="!isShort" :class="[$styles.textSimple]" class="font-medium hidden lg:block"> {{ $dataStore.t('form.gender') }}</span>
|
|
24
|
+
<span v-if="!isShort" :class="[$styles.textSimple]" class="font-medium"> {{ $dataStore.t('form.birthDate') }} </span>
|
|
25
|
+
<span v-if="!isShort" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('form.Country') }} </span>
|
|
26
|
+
<span v-if="!isShort" :class="[$styles.textSimple]" class="font-medium hidden lg:block"> {{ $dataStore.t('code') }}</span>
|
|
27
27
|
</div>
|
|
28
28
|
<div v-if="isMultiple && multipleMember !== null" class="ml-5 flex flex-col" :class="[isShort ? 'mb-6' : '']">
|
|
29
29
|
<div
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
class="grid auto-rows-fr items-center relative"
|
|
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
|
-
<span :class="[getMemberInfo(each).fullName === null && $
|
|
36
|
-
<span :class="[getMemberInfo(each).iin === null && $
|
|
37
|
-
<span v-if="!isShort" :class="[getMemberInfo(each).gender === null && $
|
|
38
|
-
<span v-if="!isShort" :class="[getMemberInfo(each).birthDate === null && $
|
|
39
|
-
<span v-if="!isShort" :class="[getMemberInfo(each).birthPlace === null && $
|
|
40
|
-
<span v-if="!isShort" :class="[getMemberInfo(each).sectorCode === null && $
|
|
35
|
+
<span :class="[getMemberInfo(each).fullName === null && $styles.emptyBlockCol]">{{ getMemberInfo(each).fullName }}</span>
|
|
36
|
+
<span :class="[getMemberInfo(each).iin === null && $styles.emptyBlockCol]">{{ getMemberInfo(each).iin }}</span>
|
|
37
|
+
<span v-if="!isShort" :class="[getMemberInfo(each).gender === null && $styles.emptyBlockCol]" class="hidden lg:block">{{ getMemberInfo(each).gender }} </span>
|
|
38
|
+
<span v-if="!isShort" :class="[getMemberInfo(each).birthDate === null && $styles.emptyBlockCol]"> {{ getMemberInfo(each).birthDate }} </span>
|
|
39
|
+
<span v-if="!isShort" :class="[getMemberInfo(each).birthPlace === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).birthPlace }} </span>
|
|
40
|
+
<span v-if="!isShort" :class="[getMemberInfo(each).sectorCode === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).sectorCode }} </span>
|
|
41
41
|
<div
|
|
42
42
|
v-if="!isShort"
|
|
43
43
|
class="rounded-br-lg transition-all h-[70px] w-[60px] place-self-end"
|
|
44
|
-
:class="[$
|
|
44
|
+
:class="[$styles.blueBgLight, $styles.blueBgLightHover, disabled ? $styles.disabled : 'cursor-pointer']"
|
|
45
45
|
@click="!disabled && $emit('onMore', { whichForm, index })"
|
|
46
46
|
>
|
|
47
47
|
<i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"></i>
|
|
@@ -53,22 +53,20 @@
|
|
|
53
53
|
class="ml-5 grid auto-rows-fr items-center relative"
|
|
54
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
55
|
>
|
|
56
|
-
<span :class="[getMemberInfo(singleMember).fullName === null && $
|
|
57
|
-
<span :class="[getMemberInfo(singleMember).iin === null && $
|
|
58
|
-
<span v-if="!isShort" :class="[getMemberInfo(singleMember).gender === null && $
|
|
59
|
-
|
|
60
|
-
|
|
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">
|
|
56
|
+
<span :class="[getMemberInfo(singleMember).fullName === null && $styles.emptyBlockCol]">{{ getMemberInfo(singleMember).fullName }}</span>
|
|
57
|
+
<span :class="[getMemberInfo(singleMember).iin === null && $styles.emptyBlockCol]">{{ getMemberInfo(singleMember).iin }}</span>
|
|
58
|
+
<span v-if="!isShort" :class="[getMemberInfo(singleMember).gender === null && $styles.emptyBlockCol]" class="hidden lg:block">{{ getMemberInfo(singleMember).gender }} </span>
|
|
59
|
+
<span v-if="!isShort" :class="[getMemberInfo(singleMember).birthDate === null && $styles.emptyBlockCol]"> {{ getMemberInfo(singleMember).birthDate }} </span>
|
|
60
|
+
<span v-if="!isShort" :class="[getMemberInfo(singleMember).birthPlace === null && $styles.emptyBlockCol]" class="hidden lg:block">
|
|
63
61
|
{{ getMemberInfo(singleMember).birthPlace }}
|
|
64
62
|
</span>
|
|
65
|
-
<span v-if="!isShort" :class="[getMemberInfo(singleMember).sectorCode === null && $
|
|
63
|
+
<span v-if="!isShort" :class="[getMemberInfo(singleMember).sectorCode === null && $styles.emptyBlockCol]" class="hidden lg:block">
|
|
66
64
|
{{ getMemberInfo(singleMember).sectorCode }}
|
|
67
65
|
</span>
|
|
68
66
|
<div
|
|
69
67
|
v-if="!isShort"
|
|
70
68
|
class="rounded-br-lg transition-all h-[70px] w-[60px] place-self-end"
|
|
71
|
-
:class="[$
|
|
69
|
+
:class="[$styles.blueBgLight, $styles.blueBgLightHover, disabled ? $styles.disabled : 'cursor-pointer']"
|
|
72
70
|
@click="!disabled && $emit('onMore', { whichForm })"
|
|
73
71
|
>
|
|
74
72
|
<i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"></i>
|
|
@@ -76,7 +74,7 @@
|
|
|
76
74
|
</div>
|
|
77
75
|
<div
|
|
78
76
|
v-if="isMultiple && more && !isShort && isActionsAvailable"
|
|
79
|
-
:class="[$
|
|
77
|
+
:class="[$styles.blueBg, $styles.whiteText, $styles.textSimple, disabled ? $styles.disabled : 'cursor-pointer']"
|
|
80
78
|
class="lg:hidden transition-all rounded-b-lg h-[36px] flex items-center font-medium justify-center opacity-50 hover:opacity-90"
|
|
81
79
|
@click="!disabled && memberStore.addMember(whichForm)"
|
|
82
80
|
>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<section :class="[$
|
|
3
|
-
<h2 :class="[$
|
|
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">
|
|
4
4
|
{{ title }}
|
|
5
5
|
<slot name="icon"></slot>
|
|
6
6
|
</h2>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="flex flex-col justify-between rounded-lg" :class="[$
|
|
3
|
-
<span v-if="title" class="p-4" :class="[$
|
|
4
|
-
<span v-if="subtitle" class="p-4 text-[#99A3B3] border-t-[1px]" :class="[$
|
|
2
|
+
<div class="flex flex-col justify-between rounded-lg" :class="[$styles.whiteBg]">
|
|
3
|
+
<span v-if="title" class="p-4" :class="[$styles.textTitle]">{{ title }}</span>
|
|
4
|
+
<span v-if="subtitle" class="p-4 text-[#99A3B3] border-t-[1px]" :class="[$styles.textSimple]">{{ subtitle }}</span>
|
|
5
5
|
<slot></slot>
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
class="h-[74px] !pl-2 md:!pl-5 flex items-center justify-start gap-4"
|
|
4
|
-
:class="[$
|
|
4
|
+
:class="[$styles.whiteBg, hasBorder ? 'border-[1px] rounded-lg' : 'border-b-[1px] border-b-[#f3f6fc] rounded']"
|
|
5
5
|
>
|
|
6
6
|
<v-switch
|
|
7
7
|
class="base-toggle"
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
hide-details
|
|
15
15
|
:disabled="disabled"
|
|
16
16
|
/>
|
|
17
|
-
<p :class="[$
|
|
18
|
-
<p class="mr-3" :class="[modelValue ? $
|
|
17
|
+
<p :class="[$styles.textSimple]">{{ `${title}` }}</p>
|
|
18
|
+
<p class="mr-3" :class="[modelValue ? $styles.greenText : '', $styles.textSimple]">{{ `${modelValue ? $dataStore.t('confirm.yes') : $dataStore.t('confirm.no')}` }}</p>
|
|
19
19
|
</div>
|
|
20
20
|
</template>
|
|
21
21
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="rounded-lg border-[1px]" :class="[$
|
|
2
|
+
<div class="rounded-lg border-[1px]" :class="[$styles.whiteBg, disabled && $styles.disabled]">
|
|
3
3
|
<div class="mt-3 ml-5">
|
|
4
|
-
<p :class="[$
|
|
4
|
+
<p :class="[$styles.textTitle, $styles.greenText]">{{ $dataStore.t('form.attachManager') }}</p>
|
|
5
5
|
</div>
|
|
6
6
|
<v-form ref="vForm" class="flex flex-col mt-1">
|
|
7
7
|
<base-panel-input
|
|
8
8
|
class="pl-1"
|
|
9
9
|
v-model="formStore.SaleChanellPolicy"
|
|
10
|
-
:value="formStore.SaleChanellPolicy
|
|
10
|
+
:value="formStore.SaleChanellPolicy?.nameRu"
|
|
11
11
|
:readonly="isReadonly"
|
|
12
12
|
:clearable="!isReadonly"
|
|
13
13
|
:label="$dataStore.t('form.salesChanell')"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<base-panel-input
|
|
19
19
|
class="pl-1"
|
|
20
20
|
v-model="formStore.RegionPolicy"
|
|
21
|
-
:value="formStore.RegionPolicy
|
|
21
|
+
:value="formStore.RegionPolicy?.nameRu"
|
|
22
22
|
:readonly="isReadonly"
|
|
23
23
|
:clearable="!isReadonly"
|
|
24
24
|
:label="$dataStore.t('form.Region')"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<base-panel-input
|
|
30
30
|
class="pl-1"
|
|
31
31
|
v-model="formStore.ManagerPolicy"
|
|
32
|
-
:value="formStore.ManagerPolicy
|
|
32
|
+
:value="formStore.ManagerPolicy?.nameRu"
|
|
33
33
|
:readonly="isReadonly"
|
|
34
34
|
:clearable="!isReadonly"
|
|
35
35
|
:label="$dataStore.t('form.manager')"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
<base-panel-input
|
|
41
41
|
class="pl-1"
|
|
42
42
|
v-model="formStore.AgentData"
|
|
43
|
-
:value="formStore.AgentData
|
|
43
|
+
:value="formStore.AgentData?.fullName"
|
|
44
44
|
:readonly="isReadonly"
|
|
45
45
|
:clearable="!isReadonly"
|
|
46
46
|
:label="$dataStore.t('form.agent')"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
/>
|
|
51
51
|
</v-form>
|
|
52
52
|
<Teleport v-if="isPanelOpen" to="#panel-actions">
|
|
53
|
-
<div :class="[$
|
|
53
|
+
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
54
54
|
<base-rounded-input
|
|
55
55
|
v-model.trim="searchQuery"
|
|
56
56
|
:label="$dataStore.t('labels.search')"
|
|
@@ -59,16 +59,34 @@
|
|
|
59
59
|
:append-inner-icon="currentDictName === 'AgentData' ? 'mdi mdi-magnify' : ''"
|
|
60
60
|
@append="searchAgent"
|
|
61
61
|
/>
|
|
62
|
-
<div v-if="
|
|
63
|
-
<div v-
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
<div v-if="isPanelLoading === false" class="w-full">
|
|
63
|
+
<div v-if="currentDictName === 'AgentData'" class="w-full flex flex-col gap-2 p-2">
|
|
64
|
+
<div v-for="(agent, index) of $dataStore[currentDictName]" :key="index">
|
|
65
|
+
<div
|
|
66
|
+
class="flex justify-between p-4 items-center cursor-pointer"
|
|
67
|
+
:class="[$styles.rounded, $styles.blueBgLight, $styles.blueBgLightHover]"
|
|
68
|
+
@click="pickPanelValue(agent)"
|
|
69
|
+
>
|
|
70
|
+
<div class="flex flex-col">
|
|
71
|
+
<span :class="[$styles.textSimple]">{{ $getFullNameShorted(agent.fullName ?? '', 2) }}</span>
|
|
72
|
+
<span :class="[$styles.mutedText]">
|
|
73
|
+
{{ agent.saleChannel ? `${agent.saleChannel} / ${$getFullNameShorted(agent.managerName ?? '', 2)}` : `${agent.managerName}` }}
|
|
74
|
+
</span>
|
|
75
|
+
</div>
|
|
76
|
+
<i
|
|
77
|
+
class="mdi text-xl"
|
|
78
|
+
:class="[agent.agentId === (panelValue as AgentData).agentId ? `mdi-radiobox-marked ${$styles.greenText}` : 'mdi-radiobox-blank text-[#636363]']"
|
|
79
|
+
></i>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
<div v-if="currentDictName === 'ManagerPolicy' || currentDictName === 'RegionPolicy' || currentDictName === 'SaleChanellPolicy'" class="w-full flex flex-col gap-2 p-2">
|
|
84
|
+
<div v-for="(item, index) in $dataStore[currentDictName].filter(i => (i.nameRu as string).toLowerCase().includes(searchQuery.toLowerCase()))" :key="index">
|
|
85
|
+
<base-panel-select-item :key="index" :text="item.nameRu ?? ''" :selected="item.ids === (panelValue as Value).ids" @click="pickPanelValue(item)" />
|
|
86
|
+
</div>
|
|
70
87
|
</div>
|
|
71
88
|
</div>
|
|
89
|
+
|
|
72
90
|
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
|
|
73
91
|
</div>
|
|
74
92
|
</Teleport>
|
|
@@ -77,6 +95,7 @@
|
|
|
77
95
|
|
|
78
96
|
<script lang="ts">
|
|
79
97
|
import { Value } from '../../composables/classes';
|
|
98
|
+
import { watchDebounced } from '@vueuse/core';
|
|
80
99
|
|
|
81
100
|
export default defineComponent({
|
|
82
101
|
props: {
|
|
@@ -90,29 +109,17 @@ export default defineComponent({
|
|
|
90
109
|
},
|
|
91
110
|
},
|
|
92
111
|
setup(props) {
|
|
112
|
+
type ManagerAttachmentFiels = 'SaleChanellPolicy' | 'RegionPolicy' | 'ManagerPolicy' | 'AgentData';
|
|
113
|
+
type FieldTypes = Value | AgentData;
|
|
93
114
|
const route = useRoute();
|
|
94
115
|
const dataStore = useDataStore();
|
|
95
116
|
const formStore = useFormStore();
|
|
96
117
|
const isPanelOpen = ref<boolean>(false);
|
|
97
118
|
const isPanelLoading = ref<boolean>(false);
|
|
98
|
-
const panelValue = ref<
|
|
119
|
+
const panelValue = ref<FieldTypes>(new Value());
|
|
99
120
|
const searchQuery = ref<string>('');
|
|
100
|
-
const currentDictName = ref<
|
|
121
|
+
const currentDictName = ref<ManagerAttachmentFiels>();
|
|
101
122
|
|
|
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
123
|
const isReadonly = computed(
|
|
117
124
|
() =>
|
|
118
125
|
props.disabled ||
|
|
@@ -121,7 +128,7 @@ export default defineComponent({
|
|
|
121
128
|
(route.params.taskId !== '0' && (!dataStore.isProcessEditable(formStore.applicationData.statusCode) || !dataStore.isTask())),
|
|
122
129
|
);
|
|
123
130
|
|
|
124
|
-
const openPanel = async (currentDict:
|
|
131
|
+
const openPanel = async (currentDict: ManagerAttachmentFiels, title: string) => {
|
|
125
132
|
searchQuery.value = '';
|
|
126
133
|
if (dataStore.isTask() && !props.disabled) {
|
|
127
134
|
dataStore.panelAction = null;
|
|
@@ -129,13 +136,13 @@ export default defineComponent({
|
|
|
129
136
|
dataStore.panel.title = title;
|
|
130
137
|
currentDictName.value = currentDict;
|
|
131
138
|
|
|
132
|
-
if (currentDict === 'ManagerPolicy') {
|
|
139
|
+
if (currentDict === 'ManagerPolicy' && formStore.RegionPolicy.ids) {
|
|
133
140
|
isPanelLoading.value = true;
|
|
134
|
-
await dataStore.filterManagerByRegion(
|
|
141
|
+
await dataStore.filterManagerByRegion(formStore.RegionPolicy.ids as string);
|
|
135
142
|
}
|
|
136
143
|
|
|
137
144
|
isPanelOpen.value = true;
|
|
138
|
-
panelValue.value = formStore[currentDict
|
|
145
|
+
panelValue.value = formStore[currentDict];
|
|
139
146
|
isPanelLoading.value = false;
|
|
140
147
|
} else {
|
|
141
148
|
dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
|
|
@@ -150,7 +157,7 @@ export default defineComponent({
|
|
|
150
157
|
}
|
|
151
158
|
};
|
|
152
159
|
|
|
153
|
-
const pickPanelValue = (answer:
|
|
160
|
+
const pickPanelValue = (answer: FieldTypes) => {
|
|
154
161
|
// @ts-ignore
|
|
155
162
|
formStore[currentDictName.value] = answer;
|
|
156
163
|
isPanelOpen.value = false;
|
|
@@ -158,11 +165,18 @@ export default defineComponent({
|
|
|
158
165
|
searchQuery.value = '';
|
|
159
166
|
};
|
|
160
167
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
168
|
+
watchDebounced(
|
|
169
|
+
searchQuery,
|
|
170
|
+
async searchQuery => {
|
|
171
|
+
if (searchQuery === null) {
|
|
172
|
+
searchQuery = '';
|
|
173
|
+
}
|
|
174
|
+
if (!!searchQuery && currentDictName.value === 'AgentData') {
|
|
175
|
+
await searchAgent();
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
{ debounce: 1000 },
|
|
179
|
+
);
|
|
166
180
|
|
|
167
181
|
watch(
|
|
168
182
|
() => formStore.RegionPolicy,
|
|
@@ -184,7 +198,6 @@ export default defineComponent({
|
|
|
184
198
|
currentDictName,
|
|
185
199
|
|
|
186
200
|
// Computed
|
|
187
|
-
dictList,
|
|
188
201
|
isReadonly,
|
|
189
202
|
|
|
190
203
|
// Functions
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="pt-3 pl-5 rounded-lg border-[1px]" :class="[$
|
|
2
|
+
<div class="pt-3 pl-5 rounded-lg border-[1px]" :class="[$styles.whiteBg, disabled && $styles.disabled]">
|
|
3
3
|
<div>
|
|
4
|
-
<p :class="[$
|
|
4
|
+
<p :class="[$styles.textTitle, $styles.greenText]">
|
|
5
5
|
{{ $dataStore.t('productConditions') }}
|
|
6
6
|
</p>
|
|
7
|
-
<p v-if="!!subtitle" :class="[$
|
|
7
|
+
<p v-if="!!subtitle" :class="[$styles.greyText, $styles.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 v-if="hasSum" :class="[$
|
|
11
|
-
<span v-if="hasPremium" :class="[$
|
|
12
|
-
<span v-if="hasPolicyNumber" :class="[$
|
|
13
|
-
<span v-if="hasContractDate" :class="[$
|
|
14
|
-
<span v-if="hasCoverPeriod" :class="[$
|
|
15
|
-
<span v-if="hasPayPeriod" :class="[$
|
|
10
|
+
<span v-if="hasSum" :class="[$styles.textSimple]" class="font-medium">{{ $dataStore.t('productConditionsForm.requestedSumInsured') }}</span>
|
|
11
|
+
<span v-if="hasPremium" :class="[$styles.textSimple]" class="font-medium">{{ $dataStore.t('productConditionsForm.insurancePremiumPerMonth') }}</span>
|
|
12
|
+
<span v-if="hasPolicyNumber" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('buttons.InsuranceContract') }}</span>
|
|
13
|
+
<span v-if="hasContractDate" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.contractDate') }}</span>
|
|
14
|
+
<span v-if="hasCoverPeriod" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.coverPeriod') }}</span>
|
|
15
|
+
<span v-if="hasPayPeriod" :class="[$styles.textSimple]" class="font-medium hidden lg:block">{{ $dataStore.t('productConditionsForm.payPeriod') }}</span>
|
|
16
16
|
</div>
|
|
17
17
|
<div class="grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
|
|
18
|
-
<span v-if="hasSum" :class="[amount === null && $
|
|
19
|
-
<span v-if="hasPremium" :class="[premium === null && $
|
|
20
|
-
<span v-if="hasPolicyNumber" :class="[policyNumber === null && $
|
|
21
|
-
<span v-if="hasContractDate" :class="[policyNumber === null && $
|
|
22
|
-
<span v-if="hasCoverPeriod" :class="[coverPeriod === null && $
|
|
23
|
-
<span v-if="hasPayPeriod" :class="[paymentPeriod === null && $
|
|
18
|
+
<span v-if="hasSum" :class="[amount === null && $styles.emptyBlockCol]">{{ amount }} </span>
|
|
19
|
+
<span v-if="hasPremium" :class="[premium === null && $styles.emptyBlockCol]"> {{ premium }}</span>
|
|
20
|
+
<span v-if="hasPolicyNumber" :class="[policyNumber === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ policyNumber }}</span>
|
|
21
|
+
<span v-if="hasContractDate" :class="[policyNumber === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ contractDate }}</span>
|
|
22
|
+
<span v-if="hasCoverPeriod" :class="[coverPeriod === null && $styles.emptyBlockCol]" class="hidden lg:block">{{ coverPeriod }} </span>
|
|
23
|
+
<span v-if="hasPayPeriod" :class="[paymentPeriod === null && $styles.emptyBlockCol]" class="hidden lg:block">
|
|
24
24
|
{{ paymentPeriod }}
|
|
25
25
|
</span>
|
|
26
26
|
<div
|
|
27
27
|
class="rounded-br-lg transition-all h-[70px] w-[60px] relative place-self-end"
|
|
28
|
-
:class="[$
|
|
28
|
+
:class="[$styles.blueBgLight, $styles.blueBgLightHover, disabled ? $styles.disabled : 'cursor-pointer']"
|
|
29
29
|
@click="!disabled && $emit('onMore', { whichForm: 'productConditions' })"
|
|
30
30
|
>
|
|
31
31
|
<i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"></i>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="h-[60px] bg-white rounded border-b-[1px] border-b-[#f3f6fc] flex items-center pl-4" :class="[$
|
|
2
|
+
<div class="h-[60px] bg-white rounded border-b-[1px] border-b-[#f3f6fc] flex items-center pl-4" :class="[$styles.textTitle]">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|