hl-core 0.0.8-beta.2 → 0.0.8-beta.21
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 +42 -14
- package/api/interceptors.ts +1 -1
- package/components/Dialog/Dialog.vue +6 -3
- package/components/Form/FormBlock.vue +63 -28
- package/components/Form/FormSection.vue +4 -1
- package/components/Form/ManagerAttachment.vue +196 -0
- package/components/Form/ProductConditionsBlock.vue +64 -12
- package/components/Input/Datepicker.vue +5 -1
- package/components/Input/FormInput.vue +20 -4
- package/components/Input/PanelInput.vue +5 -0
- package/components/Layout/Drawer.vue +1 -0
- package/components/Layout/Header.vue +40 -4
- package/components/Layout/SettingsPanel.vue +35 -8
- package/components/Menu/MenuHover.vue +30 -0
- package/components/Menu/MenuNav.vue +28 -11
- package/components/Pages/Anketa.vue +19 -15
- package/components/Pages/Auth.vue +147 -30
- package/components/Pages/InvoiceInfo.vue +30 -0
- package/components/Pages/MemberForm.vue +284 -89
- package/components/Pages/ProductConditions.vue +291 -7
- package/components/Panel/PanelHandler.vue +74 -1
- package/components/Utilities/JsonViewer.vue +27 -0
- package/composables/classes.ts +128 -23
- package/composables/constants.ts +12 -1
- package/composables/index.ts +5 -1
- package/composables/styles.ts +9 -3
- package/configs/i18n.ts +19 -0
- package/layouts/default.vue +2 -2
- package/locales/en.json +560 -0
- package/locales/kz.json +560 -0
- package/locales/ru.json +560 -0
- package/nuxt.config.ts +8 -0
- package/package.json +7 -2
- package/pages/500.vue +1 -1
- package/pages/Token.vue +51 -0
- package/plugins/helperFunctionsPlugins.ts +2 -0
- package/plugins/storePlugin.ts +0 -1
- package/plugins/vuetifyPlugin.ts +8 -1
- package/store/data.store.js +475 -530
- package/store/member.store.ts +120 -15
- package/store/rules.js +27 -3
- package/types/index.ts +34 -0
- package/store/messages.ts +0 -434
package/api/index.ts
CHANGED
|
@@ -13,7 +13,7 @@ export class ApiClass {
|
|
|
13
13
|
|
|
14
14
|
private async axiosCall<T>(config: AxiosRequestConfig): Promise<T> {
|
|
15
15
|
const dataStore = useDataStore();
|
|
16
|
-
if ((dataStore.
|
|
16
|
+
if ((dataStore.isBridge && !this.baseURL) || (!dataStore.isEFO && !dataStore.isAML && !dataStore.isLKA && (!this.baseURL || !this.productUrl))) {
|
|
17
17
|
console.error('No Axios baseURL or productURL');
|
|
18
18
|
}
|
|
19
19
|
const { data } = await useAxios(this.baseURL).request<T>(config);
|
|
@@ -137,31 +137,38 @@ export class ApiClass {
|
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
async getCurrencies(): Promise<{ eur: number; usd: number }> {
|
|
141
|
+
return this.axiosCall({
|
|
142
|
+
method: Methods.GET,
|
|
143
|
+
url: '/Ekk/api/Currency/GetExchange',
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
140
147
|
async getContragent(queryData: any) {
|
|
141
148
|
return this.axiosCall({
|
|
142
149
|
method: Methods.GET,
|
|
143
|
-
url: `/Ekk/api/Contragentinsis/Contragent?Iin=${queryData.iin}&FirstName=${queryData.firstName}&LastName=${queryData.lastName}&MiddleName
|
|
150
|
+
url: `/Ekk/api/Contragentinsis/Contragent?Iin=${queryData.iin}&FirstName=${queryData.firstName}&LastName=${queryData.lastName}&MiddleName=${queryData.middleName}`,
|
|
144
151
|
});
|
|
145
152
|
}
|
|
146
153
|
|
|
147
154
|
async getQuestionList(surveyType: string, processInstanceId: string, insuredId: number | string): Promise<AnketaFirst> {
|
|
148
155
|
return this.axiosCall({
|
|
149
156
|
method: Methods.GET,
|
|
150
|
-
url:
|
|
157
|
+
url: `/${this.productUrl}/api/Application/Anketa/${surveyType}/${processInstanceId}/${insuredId}`,
|
|
151
158
|
});
|
|
152
159
|
}
|
|
153
160
|
|
|
154
161
|
async getQuestionListSecond(surveyType: string, processInstanceId: string, insuredId: number | string): Promise<AnketaSecond[]> {
|
|
155
162
|
return this.axiosCall({
|
|
156
163
|
method: Methods.GET,
|
|
157
|
-
url:
|
|
164
|
+
url: `/${this.productUrl}/api/Application/Anketa/${surveyType}/${processInstanceId}/${insuredId}`,
|
|
158
165
|
});
|
|
159
166
|
}
|
|
160
167
|
|
|
161
168
|
async definedAnswers(filter: string) {
|
|
162
169
|
return this.axiosCall({
|
|
163
170
|
method: Methods.GET,
|
|
164
|
-
url: `/
|
|
171
|
+
url: `/Ekk/api/Contragentinsis/DictionaryItems/Questionary?filter=${filter}`,
|
|
165
172
|
});
|
|
166
173
|
}
|
|
167
174
|
|
|
@@ -227,7 +234,7 @@ export class ApiClass {
|
|
|
227
234
|
});
|
|
228
235
|
}
|
|
229
236
|
|
|
230
|
-
async getDicFileTypeList() {
|
|
237
|
+
async getDicFileTypeList(): Promise<Value[]> {
|
|
231
238
|
return this.axiosCall({
|
|
232
239
|
method: Methods.GET,
|
|
233
240
|
url: '/Arm/api/Dictionary/GetDictionaryItems/DicFileType',
|
|
@@ -276,6 +283,14 @@ export class ApiClass {
|
|
|
276
283
|
});
|
|
277
284
|
}
|
|
278
285
|
|
|
286
|
+
async registerNumber(data: RegNumberDataType): Promise<string> {
|
|
287
|
+
return this.axiosCall({
|
|
288
|
+
method: Methods.POST,
|
|
289
|
+
url: `/${this.productUrl}/api/Application/FinCenterRegNumberSave`,
|
|
290
|
+
data: data,
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
|
|
279
294
|
async sendSms(data: SmsDataType): Promise<void> {
|
|
280
295
|
return this.axiosCall({
|
|
281
296
|
method: Methods.POST,
|
|
@@ -319,7 +334,6 @@ export class ApiClass {
|
|
|
319
334
|
return this.axiosCall({
|
|
320
335
|
method: Methods.GET,
|
|
321
336
|
url: '/Arm/api/Bpm/ProcessList',
|
|
322
|
-
timeout: 10000,
|
|
323
337
|
});
|
|
324
338
|
}
|
|
325
339
|
|
|
@@ -404,6 +418,13 @@ export class ApiClass {
|
|
|
404
418
|
});
|
|
405
419
|
}
|
|
406
420
|
|
|
421
|
+
async getProcessHistoryLog(historyId: string) {
|
|
422
|
+
return this.axiosCall({
|
|
423
|
+
method: Methods.GET,
|
|
424
|
+
url: `/Arm/api/Bpm/ProcessHistoryLog/${historyId}`,
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
|
|
407
428
|
async createInvoice(processInstanceId: string, amount: number | string): Promise<string> {
|
|
408
429
|
return this.axiosCall({
|
|
409
430
|
method: Methods.POST,
|
|
@@ -498,7 +519,7 @@ export class ApiClass {
|
|
|
498
519
|
}
|
|
499
520
|
|
|
500
521
|
async getProcessTariff(code: number | string = 5) {
|
|
501
|
-
return this.axiosCall({ url: `/
|
|
522
|
+
return this.axiosCall({ url: `/Arm/api/Dictionary/ProcessTariff/${code}` });
|
|
502
523
|
}
|
|
503
524
|
|
|
504
525
|
async setConfirmation(data: any) {
|
|
@@ -516,33 +537,40 @@ export class ApiClass {
|
|
|
516
537
|
});
|
|
517
538
|
}
|
|
518
539
|
|
|
519
|
-
async sendUnderwritingCouncilTask(data:
|
|
540
|
+
async sendUnderwritingCouncilTask(data: Partial<SendTask>): Promise<void> {
|
|
520
541
|
return this.axiosCall({
|
|
521
542
|
method: Methods.POST,
|
|
522
|
-
url: '/
|
|
543
|
+
url: '/Arm/api/UnderwritingCouncil/SendTask',
|
|
523
544
|
data: data,
|
|
524
545
|
});
|
|
525
546
|
}
|
|
526
547
|
|
|
548
|
+
async getDictionaryItems(dictName: string): Promise<Value[]> {
|
|
549
|
+
return this.axiosCall({
|
|
550
|
+
method: Methods.GET,
|
|
551
|
+
url: `/Ekk/api/ContragentInsis/DictionaryItems/${dictName}`,
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
|
|
527
555
|
async filterManagerByRegion(dictName: string, filterName: string) {
|
|
528
556
|
return this.axiosCall({
|
|
529
557
|
method: Methods.GET,
|
|
530
|
-
url: `/
|
|
558
|
+
url: `/Ekk/api/ContragentInsis/DictionaryItems/${dictName}?filter=${filterName}`,
|
|
531
559
|
});
|
|
532
560
|
}
|
|
533
561
|
|
|
534
562
|
async setINSISWorkData(data: any) {
|
|
535
563
|
return this.axiosCall({
|
|
536
564
|
method: Methods.POST,
|
|
537
|
-
url: `/
|
|
565
|
+
url: `/Arm/api/Bpm/SetInsisWorkData`,
|
|
538
566
|
data: data,
|
|
539
567
|
});
|
|
540
568
|
}
|
|
541
569
|
|
|
542
|
-
async searchAgentByName(name: string) {
|
|
570
|
+
async searchAgentByName(name: string): Promise<AgentData[]> {
|
|
543
571
|
return this.axiosCall({
|
|
544
572
|
method: Methods.GET,
|
|
545
|
-
url: `/
|
|
573
|
+
url: `/Ekk/api/ContragentInsis/AgentByName?fullName=${name}`,
|
|
546
574
|
});
|
|
547
575
|
}
|
|
548
576
|
}
|
package/api/interceptors.ts
CHANGED
|
@@ -21,7 +21,7 @@ export default function (axios: AxiosInstance) {
|
|
|
21
21
|
if (error.response.status === 401) {
|
|
22
22
|
dataStore.$reset();
|
|
23
23
|
localStorage.clear();
|
|
24
|
-
if (dataStore.
|
|
24
|
+
if (dataStore.isBridge) {
|
|
25
25
|
router.push({ name: 'Auth', query: { error: 401 } });
|
|
26
26
|
} else {
|
|
27
27
|
dataStore.sendToParent(constants.postActions.Error401, 401);
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-dialog v-model="fieldModel">
|
|
2
|
+
<v-dialog v-model="fieldModel" :persistent="true">
|
|
3
3
|
<v-card class="self-center w-full sm:w-3/4 md:w-2/3 lg:w-2/4 xl:w-[600px] rounded-lg !p-2">
|
|
4
4
|
<v-card-title>
|
|
5
5
|
<slot v-if="!title" name="title"></slot>
|
|
6
6
|
{{ title }}
|
|
7
|
+
<v-btn class="!absolute top-2 right-3" icon="mdi mdi-window-close" variant="plain" @click="$emit('update:modelValue', null)"></v-btn>
|
|
7
8
|
</v-card-title>
|
|
8
9
|
<v-card-subtitle>
|
|
9
10
|
<slot v-if="!subtitle" name="subtitle"></slot>
|
|
10
11
|
{{ subtitle }}
|
|
11
12
|
</v-card-subtitle>
|
|
12
|
-
<v-card-actions class="gap-[16px]">
|
|
13
|
+
<v-card-actions class="gap-[16px] m-2">
|
|
13
14
|
<base-btn v-if="actions === 'default'" class="!w-fit px-6" size="sm" :text="$t('confirm.yes')" :btn="$libStyles.blueBtn" @click="$emit('yes')"></base-btn>
|
|
14
15
|
<base-btn v-if="actions === 'default'" class="!w-fit px-6" size="sm" :text="$t('confirm.no')" :btn="$libStyles.blueBtn" @click="$emit('no')" />
|
|
15
16
|
<slot v-if="actions !== 'default'" name="actions"></slot>
|
|
@@ -27,7 +28,9 @@ export default defineComponent({
|
|
|
27
28
|
},
|
|
28
29
|
title: {
|
|
29
30
|
type: String,
|
|
30
|
-
default
|
|
31
|
+
default() {
|
|
32
|
+
return useDataStore().t('dialog.title');
|
|
33
|
+
},
|
|
31
34
|
},
|
|
32
35
|
subtitle: {
|
|
33
36
|
type: String,
|
|
@@ -1,54 +1,78 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="pt-3 rounded-lg border-[1px]" :class="[$libStyles.whiteBg]">
|
|
2
|
+
<div class="pt-3 rounded-lg border-[1px]" :class="[$libStyles.whiteBg, disabled && $libStyles.disabled]">
|
|
3
3
|
<div class="ml-5">
|
|
4
|
-
<
|
|
4
|
+
<div class="flex justify-between mr-5">
|
|
5
|
+
<p :class="[$libStyles.textTitle, $libStyles.greenText]">{{ title }}</p>
|
|
6
|
+
<div
|
|
7
|
+
v-if="isMultiple && more && !isShort"
|
|
8
|
+
:class="[$libStyles.blueBg, $libStyles.whiteText, $libStyles.textSimple, disabled ? $libStyles.disabled : 'cursor-pointer']"
|
|
9
|
+
class="hidden lg:flex transition-all rounded-lg h-[36px] flex items-center font-medium justify-center opacity-50 hover:opacity-90 w-[120px]"
|
|
10
|
+
@click="!disabled && memberStore.addMember(whichForm)"
|
|
11
|
+
>
|
|
12
|
+
{{ $t('buttons.add') }}
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
5
15
|
<p v-if="!!subtitle" :class="[$libStyles.greyText, $libStyles.textSimple]">{{ subtitle }}</p>
|
|
6
16
|
</div>
|
|
7
|
-
<div
|
|
17
|
+
<div
|
|
18
|
+
class="ml-5 mt-6 grid auto-rows-fr items-center"
|
|
19
|
+
:class="[isShort ? 'grid-cols-2 md:gap-5 md:grid-cols-2 lg:grid-cols-2 mb-6' : 'grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 ']"
|
|
20
|
+
>
|
|
8
21
|
<span :class="[$libStyles.textSimple]" class="font-medium">{{ $t('form.fullName') }}</span>
|
|
9
22
|
<span :class="[$libStyles.textSimple]" class="font-medium">{{ $t('form.iin') }}</span>
|
|
10
|
-
<span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block"> {{ $t('form.gender') }}</span>
|
|
11
|
-
<span :class="[$libStyles.textSimple]" class="font-medium"> {{ $t('form.birthDate') }} </span>
|
|
12
|
-
<span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $t('form.Country') }} </span>
|
|
13
|
-
<span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block"> {{ $t('code') }}</span>
|
|
23
|
+
<span v-if="!isShort" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block"> {{ $t('form.gender') }}</span>
|
|
24
|
+
<span v-if="!isShort" :class="[$libStyles.textSimple]" class="font-medium"> {{ $t('form.birthDate') }} </span>
|
|
25
|
+
<span v-if="!isShort" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $t('form.Country') }} </span>
|
|
26
|
+
<span v-if="!isShort" :class="[$libStyles.textSimple]" class="font-medium hidden lg:block"> {{ $t('code') }}</span>
|
|
14
27
|
</div>
|
|
15
|
-
<div v-if="isMultiple" class="ml-5 flex flex-col">
|
|
16
|
-
<div
|
|
28
|
+
<div v-if="isMultiple" class="ml-5 flex flex-col" :class="[isShort ? 'mb-6' : '']">
|
|
29
|
+
<div
|
|
30
|
+
v-for="(each, index) of member"
|
|
31
|
+
:key="index"
|
|
32
|
+
class="grid auto-rows-fr items-center relative"
|
|
33
|
+
:class="[isShort ? 'grid-cols-2 md:gap-5 md:grid-cols-2 lg:grid-cols-2' : 'grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7']"
|
|
34
|
+
>
|
|
17
35
|
<span :class="[getMemberInfo(each).fullName === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(each).fullName }}</span>
|
|
18
36
|
<span :class="[getMemberInfo(each).iin === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(each).iin }}</span>
|
|
19
|
-
<span :class="[getMemberInfo(each).gender === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ getMemberInfo(each).gender }} </span>
|
|
20
|
-
<span :class="[getMemberInfo(each).birthDate === null && $libStyles.emptyBlockCol]"> {{ getMemberInfo(each).birthDate }} </span>
|
|
21
|
-
<span :class="[getMemberInfo(each).birthPlace === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).birthPlace }} </span>
|
|
22
|
-
<span :class="[getMemberInfo(each).sectorCode === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).sectorCode }} </span>
|
|
37
|
+
<span v-if="!isShort" :class="[getMemberInfo(each).gender === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ getMemberInfo(each).gender }} </span>
|
|
38
|
+
<span v-if="!isShort" :class="[getMemberInfo(each).birthDate === null && $libStyles.emptyBlockCol]"> {{ getMemberInfo(each).birthDate }} </span>
|
|
39
|
+
<span v-if="!isShort" :class="[getMemberInfo(each).birthPlace === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).birthPlace }} </span>
|
|
40
|
+
<span v-if="!isShort" :class="[getMemberInfo(each).sectorCode === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).sectorCode }} </span>
|
|
23
41
|
<div
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
42
|
+
v-if="!isShort"
|
|
43
|
+
class="rounded-br-lg transition-all h-[70px] w-[60px] place-self-end"
|
|
44
|
+
:class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover, disabled ? $libStyles.disabled : 'cursor-pointer']"
|
|
45
|
+
@click="!disabled && $emit('onMore', { whichForm, index })"
|
|
27
46
|
>
|
|
28
47
|
<i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"> </i>
|
|
29
48
|
</div>
|
|
30
49
|
</div>
|
|
31
50
|
</div>
|
|
32
|
-
<div
|
|
51
|
+
<div
|
|
52
|
+
v-else
|
|
53
|
+
class="ml-5 grid auto-rows-fr items-center relative"
|
|
54
|
+
:class="[isShort ? 'grid-cols-2 md:gap-5 md:grid-cols-2 lg:grid-cols-2' : 'grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7']"
|
|
55
|
+
>
|
|
33
56
|
<span :class="[getMemberInfo(member).fullName === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(member).fullName }}</span>
|
|
34
57
|
<span :class="[getMemberInfo(member).iin === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(member).iin }}</span>
|
|
35
|
-
<span :class="[getMemberInfo(member).gender === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ getMemberInfo(member).gender }} </span>
|
|
36
|
-
<span :class="[getMemberInfo(member).birthDate === null && $libStyles.emptyBlockCol]"> {{ getMemberInfo(member).birthDate }} </span>
|
|
37
|
-
<span :class="[getMemberInfo(member).birthPlace === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(member).birthPlace }} </span>
|
|
38
|
-
<span :class="[getMemberInfo(member).sectorCode === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(member).sectorCode }} </span>
|
|
58
|
+
<span v-if="!isShort" :class="[getMemberInfo(member).gender === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ getMemberInfo(member).gender }} </span>
|
|
59
|
+
<span v-if="!isShort" :class="[getMemberInfo(member).birthDate === null && $libStyles.emptyBlockCol]"> {{ getMemberInfo(member).birthDate }} </span>
|
|
60
|
+
<span v-if="!isShort" :class="[getMemberInfo(member).birthPlace === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(member).birthPlace }} </span>
|
|
61
|
+
<span v-if="!isShort" :class="[getMemberInfo(member).sectorCode === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(member).sectorCode }} </span>
|
|
39
62
|
<div
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
63
|
+
v-if="!isShort"
|
|
64
|
+
class="rounded-br-lg transition-all h-[70px] w-[60px] place-self-end"
|
|
65
|
+
:class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover, disabled ? $libStyles.disabled : 'cursor-pointer']"
|
|
66
|
+
@click="!disabled && $emit('onMore', { whichForm })"
|
|
43
67
|
>
|
|
44
68
|
<i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"> </i>
|
|
45
69
|
</div>
|
|
46
70
|
</div>
|
|
47
71
|
<div
|
|
48
|
-
v-if="isMultiple && more"
|
|
49
|
-
:class="[$libStyles.blueBg, $libStyles.whiteText, $libStyles.textSimple]"
|
|
50
|
-
class="
|
|
51
|
-
@click="memberStore.addMember(whichForm)"
|
|
72
|
+
v-if="isMultiple && more && !isShort"
|
|
73
|
+
:class="[$libStyles.blueBg, $libStyles.whiteText, $libStyles.textSimple, disabled ? $libStyles.disabled : 'cursor-pointer']"
|
|
74
|
+
class="block lg:hidden transition-all rounded-b-lg h-[36px] flex items-center font-medium justify-center opacity-50 hover:opacity-90"
|
|
75
|
+
@click="!disabled && memberStore.addMember(whichForm)"
|
|
52
76
|
>
|
|
53
77
|
{{ $t('buttons.add') }}
|
|
54
78
|
</div>
|
|
@@ -76,6 +100,14 @@ export default defineComponent({
|
|
|
76
100
|
type: Boolean,
|
|
77
101
|
default: false,
|
|
78
102
|
},
|
|
103
|
+
disabled: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
default: false,
|
|
106
|
+
},
|
|
107
|
+
type: {
|
|
108
|
+
type: String as PropType<'short' | 'default'>,
|
|
109
|
+
default: 'default',
|
|
110
|
+
},
|
|
79
111
|
},
|
|
80
112
|
emits: ['onMore', 'addMember'],
|
|
81
113
|
setup(props) {
|
|
@@ -86,6 +118,8 @@ export default defineComponent({
|
|
|
86
118
|
const isMultiple = ref(multipleMembers.includes(props.whichForm));
|
|
87
119
|
const member: Member = formStore[props.whichForm as MemberKeys];
|
|
88
120
|
|
|
121
|
+
const isShort = computed(() => props.type === 'short');
|
|
122
|
+
|
|
89
123
|
const getMemberInfo = (memberData: Member) => {
|
|
90
124
|
return {
|
|
91
125
|
fullName: computed(() => (memberData && memberData.getFullNameShorted() ? memberData.getFullNameShorted() : null)).value,
|
|
@@ -105,6 +139,7 @@ export default defineComponent({
|
|
|
105
139
|
isMultiple,
|
|
106
140
|
|
|
107
141
|
// Computed
|
|
142
|
+
isShort,
|
|
108
143
|
|
|
109
144
|
// Functions
|
|
110
145
|
getMemberInfo,
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section :class="[$libStyles.blueBgLight, $libStyles.rounded]" class="mt-[14px] p-4 flex flex-col gap-[1px]">
|
|
3
|
-
<h2 :class="[$libStyles.textTitle]" class="font-medium text-center w-full mb-4">
|
|
3
|
+
<h2 :class="[$libStyles.textTitle]" class="font-medium text-center w-full mb-4">
|
|
4
|
+
{{ title }}
|
|
5
|
+
<slot name="icon"></slot>
|
|
6
|
+
</h2>
|
|
4
7
|
<slot></slot>
|
|
5
8
|
</section>
|
|
6
9
|
</template>
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="rounded-lg border-[1px]" :class="[$libStyles.whiteBg, disabled && $libStyles.disabled]">
|
|
3
|
+
<div class="mt-3 ml-5">
|
|
4
|
+
<p :class="[$libStyles.textTitle, $libStyles.greenText]">{{ $t('form.attachManager') }}</p>
|
|
5
|
+
</div>
|
|
6
|
+
<v-form ref="vForm" class="flex flex-col mt-1">
|
|
7
|
+
<base-panel-input
|
|
8
|
+
class="pl-1"
|
|
9
|
+
v-model="formStore.SaleChanellPolicy"
|
|
10
|
+
:value="formStore.SaleChanellPolicy.nameRu"
|
|
11
|
+
:readonly="isReadonly"
|
|
12
|
+
:clearable="!isReadonly"
|
|
13
|
+
:label="$t('form.salesChanell')"
|
|
14
|
+
:rules="$rules.objectRequired"
|
|
15
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
16
|
+
@append="openPanel('SaleChanellPolicy', $t('form.salesChanell'))"
|
|
17
|
+
></base-panel-input>
|
|
18
|
+
<base-panel-input
|
|
19
|
+
class="pl-1"
|
|
20
|
+
v-model="formStore.RegionPolicy"
|
|
21
|
+
:value="formStore.RegionPolicy.nameRu"
|
|
22
|
+
:readonly="isReadonly"
|
|
23
|
+
:clearable="!isReadonly"
|
|
24
|
+
:label="$t('form.Region')"
|
|
25
|
+
:rules="$rules.objectRequired"
|
|
26
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
27
|
+
@append="openPanel('RegionPolicy', $t('form.Region'))"
|
|
28
|
+
></base-panel-input>
|
|
29
|
+
<base-panel-input
|
|
30
|
+
class="pl-1"
|
|
31
|
+
v-model="formStore.ManagerPolicy"
|
|
32
|
+
:value="formStore.ManagerPolicy.nameRu"
|
|
33
|
+
:readonly="isReadonly"
|
|
34
|
+
:clearable="!isReadonly"
|
|
35
|
+
:label="$t('form.manager')"
|
|
36
|
+
:rules="$rules.objectRequired"
|
|
37
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
38
|
+
@append="openPanel('ManagerPolicy', $t('form.manager'))"
|
|
39
|
+
></base-panel-input>
|
|
40
|
+
<base-panel-input
|
|
41
|
+
class="pl-1"
|
|
42
|
+
v-model="formStore.AgentData"
|
|
43
|
+
:value="formStore.AgentData.fullName"
|
|
44
|
+
:readonly="isReadonly"
|
|
45
|
+
:clearable="!isReadonly"
|
|
46
|
+
:label="$t('form.agent')"
|
|
47
|
+
:rules="$rules.agentDataRequired"
|
|
48
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
49
|
+
@append="openPanel('AgentData', $t('form.agent'))"
|
|
50
|
+
></base-panel-input>
|
|
51
|
+
</v-form>
|
|
52
|
+
<Teleport v-if="isPanelOpen" to="#panel-actions">
|
|
53
|
+
<div :class="[$libStyles.scrollPage]" class="flex flex-col items-center">
|
|
54
|
+
<base-rounded-input
|
|
55
|
+
v-model="searchQuery"
|
|
56
|
+
:label="$t('labels.search')"
|
|
57
|
+
class="w-full p-2"
|
|
58
|
+
:hide-details="true"
|
|
59
|
+
:append-inner-icon="currentDictName === 'AgentData' ? 'mdi mdi-magnify' : ''"
|
|
60
|
+
@append="searchAgent"
|
|
61
|
+
></base-rounded-input>
|
|
62
|
+
<div v-if="dictList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
63
|
+
<div v-for="(item, index) in dictList" :key="item.id">
|
|
64
|
+
<base-panel-select-item
|
|
65
|
+
:key="index"
|
|
66
|
+
:text="currentDictName === 'AgentData' ? item.fullName : (item.nameRu as string)"
|
|
67
|
+
:selected="currentDictName === 'AgentData' ? item.fullName === panelValue.fullName : item.nameRu === panelValue.nameRu"
|
|
68
|
+
@click="pickPanelValue(item)"
|
|
69
|
+
></base-panel-select-item>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50"></base-loader>
|
|
73
|
+
</div>
|
|
74
|
+
</Teleport>
|
|
75
|
+
</div>
|
|
76
|
+
</template>
|
|
77
|
+
|
|
78
|
+
<script lang="ts">
|
|
79
|
+
import { Value } from '@/composables/classes';
|
|
80
|
+
|
|
81
|
+
export default defineComponent({
|
|
82
|
+
props: {
|
|
83
|
+
title: {
|
|
84
|
+
type: String,
|
|
85
|
+
default: '',
|
|
86
|
+
},
|
|
87
|
+
disabled: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: false,
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
setup(props) {
|
|
93
|
+
const route = useRoute();
|
|
94
|
+
const dataStore = useDataStore();
|
|
95
|
+
const formStore = useFormStore();
|
|
96
|
+
const isPanelOpen = ref<boolean>(false);
|
|
97
|
+
const isPanelLoading = ref<boolean>(false);
|
|
98
|
+
const panelValue = ref<Value & AgentData>(new Value());
|
|
99
|
+
const searchQuery = ref<string>('');
|
|
100
|
+
const currentDictName = ref<string>();
|
|
101
|
+
|
|
102
|
+
const dictList = computed(() => {
|
|
103
|
+
if (!currentDictName.value) {
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
106
|
+
if (currentDictName.value === 'AgentData') {
|
|
107
|
+
return dataStore[currentDictName.value];
|
|
108
|
+
} else {
|
|
109
|
+
// @ts-ignore
|
|
110
|
+
return dataStore[currentDictName.value].filter((item: Value) => {
|
|
111
|
+
// @ts-ignore
|
|
112
|
+
return item.nameRu ? item.nameRu.toLowerCase().includes(searchQuery.value.toLowerCase()) : item.fullName.toLowerCase().includes(searchQuery.value.toLowerCase());
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
const isReadonly = computed(
|
|
117
|
+
() =>
|
|
118
|
+
props.disabled ||
|
|
119
|
+
route.params.taskId === '0' ||
|
|
120
|
+
(route.params.taskId !== '0' && (!dataStore.isProcessEditable(formStore.applicationData.statusCode) || !dataStore.isTask())),
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
const openPanel = async (currentDict: string, title: string) => {
|
|
124
|
+
searchQuery.value = '';
|
|
125
|
+
if (dataStore.isTask() && !props.disabled) {
|
|
126
|
+
dataStore.panelAction = null;
|
|
127
|
+
dataStore.panel.open = true;
|
|
128
|
+
dataStore.panel.title = title;
|
|
129
|
+
currentDictName.value = currentDict;
|
|
130
|
+
|
|
131
|
+
if (currentDict === 'ManagerPolicy') {
|
|
132
|
+
isPanelLoading.value = true;
|
|
133
|
+
await dataStore.filterManagerByRegion(formStore.RegionPolicy?.ids);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
isPanelOpen.value = true;
|
|
137
|
+
panelValue.value = formStore[currentDict as keyof typeof formStore];
|
|
138
|
+
isPanelLoading.value = false;
|
|
139
|
+
} else {
|
|
140
|
+
dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const searchAgent = async () => {
|
|
145
|
+
if (searchQuery.value) {
|
|
146
|
+
isPanelLoading.value = true;
|
|
147
|
+
await dataStore.searchAgentByName(searchQuery.value);
|
|
148
|
+
isPanelLoading.value = false;
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
const pickPanelValue = (answer: any) => {
|
|
153
|
+
// @ts-ignore
|
|
154
|
+
formStore[currentDictName.value] = answer;
|
|
155
|
+
isPanelOpen.value = false;
|
|
156
|
+
dataStore.panel.open = false;
|
|
157
|
+
searchQuery.value = '';
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
watch(searchQuery, () => {
|
|
161
|
+
if (searchQuery.value === null) {
|
|
162
|
+
searchQuery.value = '';
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
watch(
|
|
167
|
+
() => formStore.RegionPolicy,
|
|
168
|
+
(val, oldVal) => {
|
|
169
|
+
if (val.ids !== oldVal.ids) {
|
|
170
|
+
formStore.ManagerPolicy = new Value();
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
return {
|
|
176
|
+
// State
|
|
177
|
+
formStore,
|
|
178
|
+
isPanelOpen,
|
|
179
|
+
isPanelLoading,
|
|
180
|
+
panelValue,
|
|
181
|
+
searchQuery,
|
|
182
|
+
Value,
|
|
183
|
+
currentDictName,
|
|
184
|
+
|
|
185
|
+
// Computed
|
|
186
|
+
dictList,
|
|
187
|
+
isReadonly,
|
|
188
|
+
|
|
189
|
+
// Functions
|
|
190
|
+
openPanel,
|
|
191
|
+
searchAgent,
|
|
192
|
+
pickPanelValue,
|
|
193
|
+
};
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
</script>
|