hl-core 0.0.8-beta.1 → 0.0.8-beta.3
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 +1 -1
- package/components/Input/Datepicker.vue +41 -0
- package/components/Input/FormInput.vue +4 -1
- package/components/Menu/MenuNav.vue +1 -1
- package/components/Pages/Anketa.vue +10 -2
- package/components/Pages/Documents.vue +1 -1
- package/components/Pages/MemberForm.vue +17 -3
- package/components/Pages/ProductConditions.vue +86 -10
- package/components/Panel/PanelHandler.vue +11 -11
- package/composables/classes.ts +2 -0
- package/composables/constants.ts +1 -0
- package/composables/styles.ts +4 -0
- package/nuxt.config.ts +4 -0
- package/package.json +5 -3
- package/plugins/helperFunctionsPlugins.ts +3 -0
- package/store/data.store.js +8 -4
- package/store/messages.ts +2 -1
- package/store/rules.js +3 -10
package/api/index.ts
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<vue-date-picker
|
|
3
|
+
:model-value="modelValue"
|
|
4
|
+
:clearable="false"
|
|
5
|
+
:disabled="disabled"
|
|
6
|
+
:reaonly="readonly"
|
|
7
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
|
+
locale="ru"
|
|
9
|
+
model-type="dd.MM.yyyy"
|
|
10
|
+
position="left"
|
|
11
|
+
menu-class-name="!left-[30vw] md:!left-[70vw] lg:!left-[75vw]"
|
|
12
|
+
teleport=".v-form"
|
|
13
|
+
:offset="-50"
|
|
14
|
+
:close-on-scroll="true"
|
|
15
|
+
:enable-time-picker="false"
|
|
16
|
+
cancel-text="Отменить"
|
|
17
|
+
select-text="Выбрать"
|
|
18
|
+
>
|
|
19
|
+
<template #trigger>
|
|
20
|
+
<v-icon icon="mdi mdi-calendar-blank-outline cursor-pointer"></v-icon>
|
|
21
|
+
</template>
|
|
22
|
+
</vue-date-picker>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script lang="ts">
|
|
26
|
+
export default defineComponent({
|
|
27
|
+
props: {
|
|
28
|
+
modelValue: {
|
|
29
|
+
required: false,
|
|
30
|
+
},
|
|
31
|
+
disabled: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false,
|
|
34
|
+
},
|
|
35
|
+
readonly: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: false,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
</script>
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
:prepend-icon="prependIcon ? prependIcon : ''"
|
|
20
20
|
:append-icon="appendIcon ? appendIcon : ''"
|
|
21
21
|
:prepend-inner-icon="prependInnerIcon ? prependInnerIcon : ''"
|
|
22
|
-
:append-inner-icon="appendInnerIcon ? appendInnerIcon : ''"
|
|
23
22
|
:bg-color="bgColor ? bgColor : ''"
|
|
24
23
|
@keyup.enter.prevent="submitted"
|
|
25
24
|
@click:append="!props.readonly && $emit('append-out')"
|
|
@@ -28,6 +27,10 @@
|
|
|
28
27
|
@click:prepend-inner="!props.readonly && $emit('prepend')"
|
|
29
28
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
30
29
|
>
|
|
30
|
+
<template v-if="appendInnerIcon && appendInnerIcon.length" v-slot:append-inner>
|
|
31
|
+
<v-icon v-if="appendInnerIcon !== 'mdi mdi-calendar-blank-outline'" icon="appendInnerIcon"></v-icon>
|
|
32
|
+
<base-datepicker v-else :model-value="modelValue" @update:modelValue="$emit('update:modelValue', $event)"></base-datepicker>
|
|
33
|
+
</template>
|
|
31
34
|
<template v-if="loading" #loader>
|
|
32
35
|
<v-progress-linear :active="loading" :color="color" absolute height="1" indeterminate></v-progress-linear>
|
|
33
36
|
</template>
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
<div v-if="$dataStore.buttons && $dataStore.buttons.length" class="flex flex-col gap-[10px] justify-self-end absolute bottom-5 lg:bottom-[30%] w-full pr-4">
|
|
36
36
|
<div v-for="(item, index) of $dataStore.buttons" :key="index">
|
|
37
37
|
<transition enter-active-class="animate__animated animate__fadeIn animate__faster" leave-active-class="animate__animated animate__fadeOut animate__faster">
|
|
38
|
-
<base-btn v-if="typeof item.show === 'boolean' ? item.show : true" :text="item.title!" :btn="item.color" :disabled="item.disabled" @click="item.action"> </base-btn>
|
|
38
|
+
<base-btn v-if="typeof item.show === 'boolean' ? item.show : true" :text="item.title!" :btn="item.color" :disabled="item.disabled" :loading="$dataStore.isButtonsLoading" @click="item.action"> </base-btn>
|
|
39
39
|
</transition>
|
|
40
40
|
</div></div
|
|
41
41
|
></base-fade-transition>
|
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
<base-fade-transition>
|
|
3
3
|
<section v-if="firstQuestionList && firstQuestionList.length && !firstPanel && !secondPanel" class="flex flex-col">
|
|
4
4
|
<section :class="[$libStyles.blueBgLight, $libStyles.rounded]" class="mx-[10px] my-[14px] p-4 flex flex-col gap-4">
|
|
5
|
-
<base-form-toggle
|
|
5
|
+
<base-form-toggle
|
|
6
|
+
v-model="answerToAll"
|
|
7
|
+
:title="$t('questionnaireType.answerAllNo')"
|
|
8
|
+
:disabled="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
|
|
9
|
+
:has-border="false"
|
|
10
|
+
@clicked="handleToggler"
|
|
11
|
+
></base-form-toggle>
|
|
6
12
|
</section>
|
|
7
13
|
<v-form ref="vForm" class="max-h-[70vh] overflow-y-scroll" @submit="submitForm">
|
|
8
14
|
<section
|
|
@@ -154,7 +160,9 @@ export default defineComponent({
|
|
|
154
160
|
});
|
|
155
161
|
formStore[whichSurvey.value]!.type = surveyType.value;
|
|
156
162
|
const anketaToken = await dataStore.setSurvey(formStore[whichSurvey.value]);
|
|
157
|
-
|
|
163
|
+
if (typeof anketaToken === 'string') {
|
|
164
|
+
formStore[whichSurvey.value]!.id = anketaToken;
|
|
165
|
+
}
|
|
158
166
|
isButtonLoading.value = false;
|
|
159
167
|
} else {
|
|
160
168
|
const errors = document.querySelector('.v-input--error');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section class="w-full px-[10px] pt-[14px] flex flex-col gap-2" :class="[$libStyles.scrollPage]" v-if="formStore.signedDocumentList && formStore.signedDocumentList.length">
|
|
3
|
-
<base-content-block v-for="document of formStore.signedDocumentList
|
|
3
|
+
<base-content-block v-for="document of formStore.signedDocumentList" :key="document.id" :class="[$libStyles.textSimple]">
|
|
4
4
|
<h5 class="text-center font-medium mb-4">
|
|
5
5
|
{{ document.fileTypeName }}
|
|
6
6
|
</h5>
|
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
:label="$t('form.signOfResidency')"
|
|
380
380
|
:readonly="isDisabled"
|
|
381
381
|
:clearable="!isDisabled"
|
|
382
|
-
:rules="
|
|
382
|
+
:rules="residencyRule"
|
|
383
383
|
append-inner-icon="mdi mdi-chevron-right"
|
|
384
384
|
@append="openPanel($t('form.signOfResidency'), [], 'signOfResidency', $dataStore.getResidents)"
|
|
385
385
|
></base-panel-input>
|
|
@@ -459,7 +459,7 @@
|
|
|
459
459
|
<base-panel-select-item
|
|
460
460
|
v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
|
|
461
461
|
:key="index"
|
|
462
|
-
:text="item.nameRu as string"
|
|
462
|
+
:text="(item.nameRu as string)"
|
|
463
463
|
:selected="item.nameRu === panelValue.nameRu"
|
|
464
464
|
@click="pickPanelValue(item)"
|
|
465
465
|
></base-panel-select-item>
|
|
@@ -603,6 +603,18 @@ export default {
|
|
|
603
603
|
return byMemberAndProductRule();
|
|
604
604
|
});
|
|
605
605
|
|
|
606
|
+
const residencyRule = computed(() => {
|
|
607
|
+
switch (whichForm.value) {
|
|
608
|
+
case formStore.policyholderFormKey: {
|
|
609
|
+
if (dataStore.isBolashak || dataStore.isBaiterek) {
|
|
610
|
+
return dataStore.rules.objectRequired.concat(dataStore.rules.noResident);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
default:
|
|
614
|
+
return dataStore.rules.objectRequired;
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
|
+
|
|
606
618
|
const getOtpConditionByMember = () => {
|
|
607
619
|
switch (whichForm.value) {
|
|
608
620
|
case formStore.policyholderFormKey:
|
|
@@ -933,7 +945,7 @@ export default {
|
|
|
933
945
|
const initialPoint = `${member.value.iin!.replaceAll('-', '')}.`;
|
|
934
946
|
const RESPONSE = ESBDMessage(ESBDResponse, initialPoint);
|
|
935
947
|
let errorMessage = RESPONSE !== false ? RESPONSE : 'Что-то произошло не так';
|
|
936
|
-
if (ESBDResponse.errorCode === 0) {
|
|
948
|
+
if (typeof ESBDResponse === 'object' && ESBDResponse.errorCode === 0) {
|
|
937
949
|
member.value.verifyType = 'ESBD';
|
|
938
950
|
member.value.verifyDate = ESBDResponse.verifiedDate;
|
|
939
951
|
const hasMemberSaved = await saveMember();
|
|
@@ -1108,9 +1120,11 @@ export default {
|
|
|
1108
1120
|
hasGBDFL,
|
|
1109
1121
|
hasInsis,
|
|
1110
1122
|
hasGKB,
|
|
1123
|
+
|
|
1111
1124
|
// Rules
|
|
1112
1125
|
ageRule,
|
|
1113
1126
|
phoneRule,
|
|
1127
|
+
residencyRule,
|
|
1114
1128
|
|
|
1115
1129
|
// Functions
|
|
1116
1130
|
searchMember,
|
|
@@ -13,6 +13,66 @@
|
|
|
13
13
|
subtitle="Если несовершеннолетний не достиг возраста 14 лет - законному представителю в соответствии с законодательством Республики Казахстан"
|
|
14
14
|
></base-form-text-section>
|
|
15
15
|
</base-form-section>
|
|
16
|
+
<base-form-section v-if="isUnderwriterRole" :title="$t('recalculationInfo')">
|
|
17
|
+
<base-form-input
|
|
18
|
+
v-model="productConditionsForm.lifeMultiply"
|
|
19
|
+
:maska="$maska.numbers"
|
|
20
|
+
:clearable="isRecalculationDisabled === false"
|
|
21
|
+
:label="$t('percent') + `Life Multiply`"
|
|
22
|
+
:readonly="isRecalculationDisabled"
|
|
23
|
+
:rules="$dataStore.rules.recalculationMultiply"
|
|
24
|
+
></base-form-input>
|
|
25
|
+
<base-form-input
|
|
26
|
+
v-model="productConditionsForm.lifeAdditive"
|
|
27
|
+
:maska="$maska.numbers"
|
|
28
|
+
:clearable="isRecalculationDisabled === false"
|
|
29
|
+
:label="$t('percent') + `Life Additive`"
|
|
30
|
+
:readonly="isRecalculationDisabled"
|
|
31
|
+
:rules="$dataStore.rules.recalculationAdditive"
|
|
32
|
+
></base-form-input>
|
|
33
|
+
<base-form-input
|
|
34
|
+
v-model="productConditionsForm.adbMultiply"
|
|
35
|
+
:maska="$maska.numbers"
|
|
36
|
+
:clearable="isRecalculationDisabled === false"
|
|
37
|
+
:label="$t('percent') + `Adb Multiply`"
|
|
38
|
+
:readonly="isRecalculationDisabled"
|
|
39
|
+
:rules="$dataStore.rules.recalculationMultiply"
|
|
40
|
+
></base-form-input>
|
|
41
|
+
<base-form-input
|
|
42
|
+
v-model="productConditionsForm.adbAdditive"
|
|
43
|
+
:maska="$maska.numbers"
|
|
44
|
+
:clearable="isRecalculationDisabled === false"
|
|
45
|
+
:label="$t('percent') + `Adb Additive`"
|
|
46
|
+
:readonly="isRecalculationDisabled"
|
|
47
|
+
:rules="$dataStore.rules.recalculationAdditive"
|
|
48
|
+
></base-form-input>
|
|
49
|
+
<base-form-input
|
|
50
|
+
v-model="productConditionsForm.disabilityMultiply"
|
|
51
|
+
:maska="$maska.numbers"
|
|
52
|
+
:clearable="isRecalculationDisabled === false"
|
|
53
|
+
:label="$t('percent') + `Disability Multiply`"
|
|
54
|
+
:readonly="isRecalculationDisabled"
|
|
55
|
+
:rules="$dataStore.rules.recalculationMultiply"
|
|
56
|
+
></base-form-input>
|
|
57
|
+
<base-form-input
|
|
58
|
+
v-model="productConditionsForm.disabilityAdditive"
|
|
59
|
+
:maska="$maska.numbers"
|
|
60
|
+
:clearable="isRecalculationDisabled === false"
|
|
61
|
+
:label="$t('percent') + `Disability Additive`"
|
|
62
|
+
:readonly="isRecalculationDisabled"
|
|
63
|
+
:rules="$dataStore.rules.recalculationAdditive"
|
|
64
|
+
>
|
|
65
|
+
</base-form-input>
|
|
66
|
+
<base-panel-input
|
|
67
|
+
v-model="productConditionsForm.riskGroup"
|
|
68
|
+
:value="productConditionsForm.riskGroup.nameRu"
|
|
69
|
+
:label="$t('productConditionsForm.riskGroup')"
|
|
70
|
+
:clearable="isRecalculationDisabled === false"
|
|
71
|
+
:readonly="isRecalculationDisabled"
|
|
72
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
73
|
+
@append="openPanel($t('productConditionsForm.riskGroup'), $dataStore.riskGroup, 'riskGroup')"
|
|
74
|
+
></base-panel-input>
|
|
75
|
+
</base-form-section>
|
|
16
76
|
<base-form-section :title="$t('generalConditions')">
|
|
17
77
|
<div v-if="isRecalculation && $route.params.taskId === '0'">
|
|
18
78
|
<base-form-input
|
|
@@ -83,6 +143,10 @@
|
|
|
83
143
|
:text="$t('buttons.calculate')"
|
|
84
144
|
@click="submitForm"
|
|
85
145
|
></base-btn>
|
|
146
|
+
<div v-if="$dataStore.isTask() && $dataStore.isUnderwriter() && !isRecalculationDisabled" class="flex gap-3">
|
|
147
|
+
<base-btn :text="$t('buttons.calcSum')" type="submit" @click.prevent="underwriterCalculate('sum')" :loading="isCalculating" />
|
|
148
|
+
<base-btn :text="$t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
|
|
149
|
+
</div>
|
|
86
150
|
<Teleport v-if="isPanelOpen" to="#panel-actions">
|
|
87
151
|
<div :class="[$libStyles.scrollPage]" class="flex flex-col items-center">
|
|
88
152
|
<base-rounded-input v-model="searchQuery" :label="$t('labels.search')" class="w-full p-2" :hide-details="true"></base-rounded-input>
|
|
@@ -91,7 +155,7 @@
|
|
|
91
155
|
<base-panel-select-item
|
|
92
156
|
v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
|
|
93
157
|
:key="index"
|
|
94
|
-
:text="item.nameRu as string"
|
|
158
|
+
:text="(item.nameRu as string)"
|
|
95
159
|
:selected="item.nameRu === panelValue.nameRu"
|
|
96
160
|
@click="pickPanelValue(item)"
|
|
97
161
|
></base-panel-select-item>
|
|
@@ -139,22 +203,20 @@ export default defineComponent({
|
|
|
139
203
|
});
|
|
140
204
|
const isDisabled = computed(() => !memberStore.isStatementEditible(formStore.productConditionsFormKey));
|
|
141
205
|
const isTask = computed(() => (route.params.taskId === '0' && props.isRecalculation === true) || dataStore.isTask());
|
|
206
|
+
const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm);
|
|
207
|
+
const isUnderwriterRole = computed(() => dataStore.isUnderwriter() || dataStore.isAdmin() || dataStore.isSupport());
|
|
142
208
|
const insurancePremiumPerMonth = computed(() => (!!productConditionsForm.insurancePremiumPerMonth ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
143
209
|
const requestedSumInsured = computed(() => (!!productConditionsForm.requestedSumInsured ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
144
210
|
|
|
145
211
|
const pickPanelValue = (item: Value) => {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
productConditionsForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
151
|
-
} else {
|
|
152
|
-
dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
|
|
153
|
-
}
|
|
212
|
+
dataStore.panel.open = false;
|
|
213
|
+
isPanelOpen.value = false;
|
|
214
|
+
// @ts-ignore
|
|
215
|
+
productConditionsForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
154
216
|
};
|
|
155
217
|
|
|
156
218
|
const openPanel = async (title: string, list: Value[], key: string, asyncFunction?: Function, filterKey?: string) => {
|
|
157
|
-
if (!isDisabled.value) {
|
|
219
|
+
if (!isDisabled.value || (key === 'riskGroup' && !isRecalculationDisabled.value)) {
|
|
158
220
|
searchQuery.value = '';
|
|
159
221
|
currentPanel.value = key as keyof typeof productConditionsForm;
|
|
160
222
|
isPanelOpen.value = true;
|
|
@@ -176,6 +238,17 @@ export default defineComponent({
|
|
|
176
238
|
}
|
|
177
239
|
};
|
|
178
240
|
|
|
241
|
+
const underwriterCalculate = async (type: 'sum' | 'premium') => {
|
|
242
|
+
if (!type) return;
|
|
243
|
+
if (type === 'sum') {
|
|
244
|
+
whichSum.value = 'insurancePremiumPerMonth';
|
|
245
|
+
}
|
|
246
|
+
if (type === 'premium') {
|
|
247
|
+
whichSum.value = 'requestedSumInsured';
|
|
248
|
+
}
|
|
249
|
+
await submitForm();
|
|
250
|
+
};
|
|
251
|
+
|
|
179
252
|
const pickCalculation = async (type: 'insurancePremiumPerMonth' | 'requestedSumInsured') => {
|
|
180
253
|
if (!type) return false;
|
|
181
254
|
whichSum.value = type;
|
|
@@ -348,12 +421,15 @@ export default defineComponent({
|
|
|
348
421
|
isUnderwriterForm,
|
|
349
422
|
insurancePremiumPerMonth,
|
|
350
423
|
requestedSumInsured,
|
|
424
|
+
isRecalculationDisabled,
|
|
425
|
+
isUnderwriterRole,
|
|
351
426
|
|
|
352
427
|
// Functions
|
|
353
428
|
submitForm,
|
|
354
429
|
pickPanelValue,
|
|
355
430
|
openPanel,
|
|
356
431
|
pickCalculation,
|
|
432
|
+
underwriterCalculate,
|
|
357
433
|
};
|
|
358
434
|
},
|
|
359
435
|
});
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
<v-form ref="vForm">
|
|
78
78
|
<base-rounded-input
|
|
79
79
|
v-model="phoneNumber"
|
|
80
|
-
|
|
80
|
+
:maska="$maska.phone"
|
|
81
81
|
:rules="$rules.required.concat($rules.phoneFormat)"
|
|
82
82
|
:label="$t('form.phoneNumber')"
|
|
83
83
|
placeholder="+7 7"
|
|
@@ -104,16 +104,6 @@ export default defineComponent({
|
|
|
104
104
|
const phoneNumber = ref<string | null>(formStore.policyholderForm.phoneNumber ?? '');
|
|
105
105
|
const selectedClient = ref<SignUrlType>();
|
|
106
106
|
|
|
107
|
-
watch(
|
|
108
|
-
() => dataStore.panelAction,
|
|
109
|
-
val => {
|
|
110
|
-
if (!!val) {
|
|
111
|
-
dataStore.panel.title = buttonText.value!;
|
|
112
|
-
dataStore.panel.open = true;
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
);
|
|
116
|
-
|
|
117
107
|
const openSmsPanel = (signInfo: SignUrlType) => {
|
|
118
108
|
if (signInfo) {
|
|
119
109
|
isSendNumberOpen.value = true;
|
|
@@ -170,6 +160,16 @@ export default defineComponent({
|
|
|
170
160
|
}
|
|
171
161
|
});
|
|
172
162
|
|
|
163
|
+
watch(
|
|
164
|
+
() => dataStore.panelAction,
|
|
165
|
+
val => {
|
|
166
|
+
if (!!val) {
|
|
167
|
+
dataStore.panel.title = buttonText.value!;
|
|
168
|
+
dataStore.panel.open = true;
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{ immediate: true },
|
|
172
|
+
);
|
|
173
173
|
const sendingActions = computed(
|
|
174
174
|
() => dataStore.panelAction === constants.actions.reject || dataStore.panelAction === constants.actions.return || dataStore.panelAction === constants.actions.rejectclient,
|
|
175
175
|
);
|
package/composables/classes.ts
CHANGED
|
@@ -801,6 +801,7 @@ export class DataStoreClass {
|
|
|
801
801
|
items: MenuItem[];
|
|
802
802
|
};
|
|
803
803
|
buttons: MenuItem[];
|
|
804
|
+
isButtonsLoading: boolean;
|
|
804
805
|
panelAction: string | null;
|
|
805
806
|
panel: {
|
|
806
807
|
open: boolean;
|
|
@@ -891,6 +892,7 @@ export class DataStoreClass {
|
|
|
891
892
|
items: [],
|
|
892
893
|
};
|
|
893
894
|
this.buttons = [];
|
|
895
|
+
this.isButtonsLoading = false;
|
|
894
896
|
this.panel = {
|
|
895
897
|
open: false,
|
|
896
898
|
overlay: false,
|
package/composables/constants.ts
CHANGED
package/composables/styles.ts
CHANGED
|
@@ -23,6 +23,8 @@ export class Styles {
|
|
|
23
23
|
|
|
24
24
|
// Yellow
|
|
25
25
|
yellowText: string = 'text-[#FAB31C]';
|
|
26
|
+
yellowBg: string = 'bg-[#FAB31C]';
|
|
27
|
+
yellowBgHover: string = 'hover:bg-[#FAB31C]';
|
|
26
28
|
|
|
27
29
|
// Grey
|
|
28
30
|
greyBg: string = 'bg-[#B8B8B8]';
|
|
@@ -56,6 +58,7 @@ export class Styles {
|
|
|
56
58
|
greenBtn: string;
|
|
57
59
|
blueBtn: string;
|
|
58
60
|
redBtn: string;
|
|
61
|
+
yellowBtn: string;
|
|
59
62
|
whiteBtn: string;
|
|
60
63
|
blueLightBtn: string;
|
|
61
64
|
|
|
@@ -71,6 +74,7 @@ export class Styles {
|
|
|
71
74
|
// Button
|
|
72
75
|
this.greenBtn = `${this.greenBg} ${this.whiteText} ${this.textTitle} ${this.rounded} w-full ${this.greenBgHover}`;
|
|
73
76
|
this.redBtn = `${this.redBg} ${this.whiteText} ${this.textTitle} ${this.rounded} w-full ${this.redBgHover}`;
|
|
77
|
+
this.yellowBtn = `${this.yellowBg} ${this.whiteText} ${this.textTitle} ${this.rounded} w-full ${this.yellowBgHover}`;
|
|
74
78
|
this.blueBtn = `${this.blueBg} ${this.whiteText} ${this.textTitle} ${this.rounded} w-full ${this.blueBgHover}`;
|
|
75
79
|
this.whiteBtn = ` ${this.blackText} ${this.textTitle} ${this.rounded} w-full ${this.blueLightBgHover}`;
|
|
76
80
|
this.blueLightBtn = `${this.blueBgLight} ${this.greyTextLight} ${this.textTitle} ${this.rounded} w-full ${this.blueBgLightHover}`;
|
package/nuxt.config.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hl-core",
|
|
3
|
-
"version": "0.0.8-beta.
|
|
3
|
+
"version": "0.0.8-beta.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "nuxt.config.ts",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"build": "nuxt build",
|
|
22
22
|
"dev": "nuxt clean && nuxt dev",
|
|
23
23
|
"generate": "nuxt generate",
|
|
24
|
-
"preview": "nuxt preview"
|
|
24
|
+
"preview": "nuxt preview",
|
|
25
|
+
"typecheck": "nuxt typecheck"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
28
|
"@nuxt/devtools": "^0.4.5",
|
|
@@ -34,6 +35,7 @@
|
|
|
34
35
|
"@mdi/font": "^7.2.96",
|
|
35
36
|
"@nuxtjs/tailwindcss": "^6.6.7",
|
|
36
37
|
"@pinia/nuxt": "^0.4.9",
|
|
38
|
+
"@vuepic/vue-datepicker": "^5.0.1",
|
|
37
39
|
"animate.css": "^4.1.1",
|
|
38
40
|
"axios": "^1.4.0",
|
|
39
41
|
"fast-xml-parser": "4.0.12",
|
|
@@ -43,6 +45,6 @@
|
|
|
43
45
|
"v-idle-3": "^0.3.14",
|
|
44
46
|
"vue-toastification": "^2.0.0-rc.5",
|
|
45
47
|
"vue-uuid": "^3.0.0",
|
|
46
|
-
"vuetify": "^3.2.
|
|
48
|
+
"vuetify": "^3.2.2"
|
|
47
49
|
}
|
|
48
50
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { capitalize, getFullNameShorted, reformatIin, Masks } from '../composables';
|
|
2
2
|
import { constants } from '../composables/constants';
|
|
3
3
|
import { Styles } from '../composables/styles';
|
|
4
|
+
import VueDatePicker from '@vuepic/vue-datepicker';
|
|
5
|
+
import '@vuepic/vue-datepicker/dist/main.css';
|
|
4
6
|
import Vidle from 'v-idle-3';
|
|
5
7
|
import Maska from 'maska';
|
|
6
8
|
|
|
7
9
|
export default defineNuxtPlugin(nuxtApp => {
|
|
8
10
|
nuxtApp.vueApp.use(Vidle, {});
|
|
9
11
|
nuxtApp.vueApp.use(Maska);
|
|
12
|
+
nuxtApp.vueApp.component('VueDatePicker', VueDatePicker);
|
|
10
13
|
|
|
11
14
|
return {
|
|
12
15
|
provide: {
|
package/store/data.store.js
CHANGED
|
@@ -190,6 +190,9 @@ export const useDataStore = defineStore('data', {
|
|
|
190
190
|
isUpk() {
|
|
191
191
|
return this.isRole(constants.roles.upk);
|
|
192
192
|
},
|
|
193
|
+
isDrn() {
|
|
194
|
+
return this.isRole(constants.roles.drn);
|
|
195
|
+
},
|
|
193
196
|
isSupport() {
|
|
194
197
|
return this.isRole(constants.roles.support);
|
|
195
198
|
},
|
|
@@ -221,6 +224,7 @@ export const useDataStore = defineStore('data', {
|
|
|
221
224
|
const token = localStorage.getItem('accessToken') || null;
|
|
222
225
|
if (token) {
|
|
223
226
|
this.$reset();
|
|
227
|
+
this.formStore.$reset();
|
|
224
228
|
localStorage.clear();
|
|
225
229
|
|
|
226
230
|
if (whichProduct === 'efo') {
|
|
@@ -1390,7 +1394,6 @@ export const useDataStore = defineStore('data', {
|
|
|
1390
1394
|
paymentPeriodId: this.formStore.productConditionsForm.paymentPeriod.id,
|
|
1391
1395
|
addCovers: this.formStore.additionalInsuranceTermsWithout,
|
|
1392
1396
|
};
|
|
1393
|
-
console.log(calculationData);
|
|
1394
1397
|
const calculationResponse = await this.api.calculateWithoutApplication(calculationData);
|
|
1395
1398
|
this.formStore.productConditionsForm.requestedSumInsured = this.getNumberWithSpaces(calculationResponse.amount);
|
|
1396
1399
|
this.formStore.productConditionsForm.insurancePremiumPerMonth = this.getNumberWithSpaces(calculationResponse.premium);
|
|
@@ -1446,7 +1449,7 @@ export const useDataStore = defineStore('data', {
|
|
|
1446
1449
|
try {
|
|
1447
1450
|
result = await this.api.getCalculation(id);
|
|
1448
1451
|
} catch (err) {
|
|
1449
|
-
|
|
1452
|
+
ErrorHandler(err);
|
|
1450
1453
|
}
|
|
1451
1454
|
|
|
1452
1455
|
const applicationData = await this.api.getApplicationData(taskId);
|
|
@@ -1459,11 +1462,10 @@ export const useDataStore = defineStore('data', {
|
|
|
1459
1462
|
}
|
|
1460
1463
|
this.showToaster('success', this.t('toaster.calculated'), 1000);
|
|
1461
1464
|
} catch (err) {
|
|
1462
|
-
|
|
1465
|
+
ErrorHandler(err);
|
|
1463
1466
|
}
|
|
1464
1467
|
} catch (err) {
|
|
1465
1468
|
ErrorHandler(err);
|
|
1466
|
-
console.log(err, 'error');
|
|
1467
1469
|
}
|
|
1468
1470
|
this.isLoading = false;
|
|
1469
1471
|
},
|
|
@@ -1714,6 +1716,7 @@ export const useDataStore = defineStore('data', {
|
|
|
1714
1716
|
},
|
|
1715
1717
|
async handleTask(action, taskId, comment) {
|
|
1716
1718
|
if (action && Object.keys(constants.actions).includes(action)) {
|
|
1719
|
+
this.isButtonsLoading = true;
|
|
1717
1720
|
switch (action) {
|
|
1718
1721
|
case constants.actions.claim: {
|
|
1719
1722
|
try {
|
|
@@ -1743,6 +1746,7 @@ export const useDataStore = defineStore('data', {
|
|
|
1743
1746
|
}
|
|
1744
1747
|
}
|
|
1745
1748
|
}
|
|
1749
|
+
this.isButtonsLoading = false;
|
|
1746
1750
|
} else {
|
|
1747
1751
|
console.error('No handleTask action');
|
|
1748
1752
|
}
|
package/store/messages.ts
CHANGED
|
@@ -95,7 +95,7 @@ export const messages = {
|
|
|
95
95
|
affiliationDocumentNotUploaded: 'Не прикреплен файл в решении андеррайтингового совета',
|
|
96
96
|
documentNumberWasNotFilled: 'Номер документа и дата не были заполнены',
|
|
97
97
|
valueShouldBeHigher: `Значение должно быть больше {text} процентов`,
|
|
98
|
-
valueShouldBeBetween: `Значение должно быть в промежутке от {
|
|
98
|
+
valueShouldBeBetween: `Значение должно быть в промежутке от {floor} до {ceil} процентов`,
|
|
99
99
|
needAgreement: 'Нужно получить согласие клиента',
|
|
100
100
|
successOtp: 'Код подтверждения отправлен успешно',
|
|
101
101
|
hasSuccessOtp: 'По клиенту уже имеется согласие',
|
|
@@ -128,6 +128,7 @@ export const messages = {
|
|
|
128
128
|
editApplication: 'Редактировать заявку',
|
|
129
129
|
cancel: 'Отменить',
|
|
130
130
|
cancelApplication: 'Отменить заявку',
|
|
131
|
+
viewApplication: 'Просмотреть заявку',
|
|
131
132
|
approve: 'Согласовать',
|
|
132
133
|
rejectStatement: 'Отклонить',
|
|
133
134
|
returnStatement: 'Вернуть на доработку',
|
package/store/rules.js
CHANGED
|
@@ -3,14 +3,7 @@ import { formatDate } from '../composables';
|
|
|
3
3
|
|
|
4
4
|
export const rules = {
|
|
5
5
|
recalculationMultiply: [v => (v !== null && v !== '' && v >= 100) || t('toaster.valueShouldBeHigher').replace('{text}', '100')],
|
|
6
|
-
recalculationAdditive: [
|
|
7
|
-
v =>
|
|
8
|
-
(v !== null && v !== '' && v <= 100 && v >= 0) ||
|
|
9
|
-
t('toaster.valueShouldBeBetween', {
|
|
10
|
-
floor: 0,
|
|
11
|
-
ceil: 100,
|
|
12
|
-
}),
|
|
13
|
-
],
|
|
6
|
+
recalculationAdditive: [v => (v !== null && v !== '' && v <= 100 && v >= 0) || t('toaster.valueShouldBeBetween').replace('{floor}', '0').replace('{ceil}', '100')],
|
|
14
7
|
required: [v => !!v || t('rules.required')],
|
|
15
8
|
objectRequired: [
|
|
16
9
|
v => {
|
|
@@ -22,10 +15,10 @@ export const rules = {
|
|
|
22
15
|
],
|
|
23
16
|
noResident: [
|
|
24
17
|
v => {
|
|
25
|
-
if (!!v && 'nameRu' in v && v.nameRu
|
|
18
|
+
if (!!v && 'nameRu' in v && v.nameRu === 'Нерезидент') {
|
|
26
19
|
return t('rules.noResident');
|
|
27
20
|
}
|
|
28
|
-
if (!!v && 'nameRu' in v && v.nameRu
|
|
21
|
+
if (!!v && 'nameRu' in v && !!v.nameRu) {
|
|
29
22
|
return true;
|
|
30
23
|
}
|
|
31
24
|
return t('rules.required');
|