hl-core 0.0.8-beta.3 → 0.0.8-beta.31
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 +77 -21
- package/api/interceptors.ts +17 -13
- package/components/Dialog/Dialog.vue +7 -37
- package/components/Form/FormBlock.vue +65 -28
- package/components/Form/FormSection.vue +4 -1
- package/components/Form/ManagerAttachment.vue +197 -0
- package/components/Form/ProductConditionsBlock.vue +64 -12
- package/components/Input/Datepicker.vue +5 -1
- package/components/Input/FormInput.vue +28 -7
- package/components/Input/PanelInput.vue +5 -0
- package/components/Input/RoundedSelect.vue +137 -0
- package/components/Layout/Drawer.vue +1 -0
- package/components/Layout/Header.vue +40 -4
- package/components/Layout/SettingsPanel.vue +39 -9
- package/components/Menu/MenuHover.vue +30 -0
- package/components/Menu/MenuNav.vue +28 -11
- package/components/Menu/MenuNavItem.vue +5 -2
- package/components/Pages/Anketa.vue +38 -21
- package/components/Pages/Auth.vue +145 -30
- package/components/Pages/InvoiceInfo.vue +30 -0
- package/components/Pages/MemberForm.vue +381 -144
- package/components/Pages/ProductConditions.vue +496 -17
- package/components/Panel/PanelHandler.vue +75 -2
- package/components/Utilities/Chip.vue +27 -0
- package/components/Utilities/JsonViewer.vue +27 -0
- package/composables/classes.ts +165 -25
- package/composables/constants.ts +13 -1
- package/composables/index.ts +58 -2
- package/composables/styles.ts +9 -3
- package/configs/i18n.ts +19 -0
- package/layouts/default.vue +2 -2
- package/locales/en.json +583 -0
- package/locales/kz.json +583 -0
- package/locales/ru.json +585 -0
- package/nuxt.config.ts +8 -0
- package/package.json +15 -9
- package/pages/500.vue +1 -1
- package/pages/Token.vue +51 -0
- package/plugins/helperFunctionsPlugins.ts +3 -0
- package/plugins/storePlugin.ts +0 -1
- package/plugins/vuetifyPlugin.ts +8 -1
- package/store/data.store.js +705 -624
- package/store/member.store.ts +147 -22
- package/store/rules.js +41 -3
- package/types/index.ts +39 -0
- package/store/messages.ts +0 -434
package/composables/index.ts
CHANGED
|
@@ -141,10 +141,11 @@ export const parseXML = (xml: boolean | string = true, withTag = false, tag: str
|
|
|
141
141
|
};
|
|
142
142
|
|
|
143
143
|
export const ESBDMessage = (ESBDObject: any, initialPoint: any) => {
|
|
144
|
+
return ESBDObject.errorMsg;
|
|
144
145
|
let result;
|
|
145
146
|
if (ESBDObject.errorCode === 2) {
|
|
146
147
|
if (ESBDObject.errorMsg.indexOf('EMSG') === -1) {
|
|
147
|
-
result = '
|
|
148
|
+
result = 'Контрагент не является резидентом РК!';
|
|
148
149
|
} else {
|
|
149
150
|
result = ESBDObject.errorMsg.substring(ESBDObject.errorMsg.indexOf('EMSG') + 6, ESBDObject.errorMsg.lastIndexOf('EWS-100')).replace(initialPoint, '');
|
|
150
151
|
}
|
|
@@ -165,8 +166,63 @@ export const ErrorHandler = (err: unknown, errorText?: string) => {
|
|
|
165
166
|
console.log(err);
|
|
166
167
|
if (err instanceof AxiosError) {
|
|
167
168
|
if ('response' in err && err.response && err.response.data) {
|
|
168
|
-
|
|
169
|
+
if ('status' in err.response && err.response.status === 403) {
|
|
170
|
+
useDataStore().showToaster('error', useDataStore().t('toaster.noPermission'), 10000);
|
|
171
|
+
} else if (err.response.data) {
|
|
172
|
+
useDataStore().showToaster('error', errorText ? errorText : err.response.data, 10000);
|
|
173
|
+
}
|
|
169
174
|
}
|
|
170
175
|
}
|
|
171
176
|
return false;
|
|
172
177
|
};
|
|
178
|
+
|
|
179
|
+
export const setAddressBeneficiary = (whichIndex: number, sameAddress: boolean) => {
|
|
180
|
+
const formStore = useFormStore();
|
|
181
|
+
const dataStore = useDataStore();
|
|
182
|
+
const beneficiary = formStore.beneficiaryForm[Number(whichIndex)];
|
|
183
|
+
const policyholder = formStore.policyholderForm;
|
|
184
|
+
if (sameAddress === true) {
|
|
185
|
+
beneficiary.registrationCity = policyholder.registrationCity;
|
|
186
|
+
beneficiary.registrationCountry = policyholder.registrationCountry;
|
|
187
|
+
beneficiary.birthPlace = policyholder.birthPlace;
|
|
188
|
+
beneficiary.registrationMicroDistrict = policyholder.registrationMicroDistrict;
|
|
189
|
+
beneficiary.registrationNumberApartment = policyholder.registrationNumberApartment;
|
|
190
|
+
beneficiary.registrationNumberApartment = policyholder.registrationNumberApartment;
|
|
191
|
+
beneficiary.registrationNumberHouse = policyholder.registrationNumberHouse;
|
|
192
|
+
beneficiary.registrationProvince = policyholder.registrationProvince;
|
|
193
|
+
beneficiary.registrationQuarter = policyholder.registrationQuarter;
|
|
194
|
+
beneficiary.registrationRegion = policyholder.registrationRegion;
|
|
195
|
+
beneficiary.registrationRegionType = policyholder.registrationRegionType;
|
|
196
|
+
beneficiary.registrationStreet = policyholder.registrationStreet;
|
|
197
|
+
} else {
|
|
198
|
+
if (beneficiary.id === 0) {
|
|
199
|
+
beneficiary.registrationCity = new Value();
|
|
200
|
+
beneficiary.registrationCountry = new Value();
|
|
201
|
+
beneficiary.registrationMicroDistrict = '';
|
|
202
|
+
beneficiary.registrationNumberApartment = '';
|
|
203
|
+
beneficiary.registrationNumberApartment = '';
|
|
204
|
+
beneficiary.registrationNumberHouse = '';
|
|
205
|
+
beneficiary.registrationProvince = new Value();
|
|
206
|
+
beneficiary.registrationQuarter = '';
|
|
207
|
+
beneficiary.registrationRegion = new Value();
|
|
208
|
+
beneficiary.registrationRegionType = new Value();
|
|
209
|
+
beneficiary.registrationStreet = '';
|
|
210
|
+
} else {
|
|
211
|
+
const country = dataStore.countries.find(i => (i.nameRu as string).match(new RegExp(beneficiary.response?.addresses[0].countryName, 'i')));
|
|
212
|
+
const city = dataStore.cities.find(i => i.nameRu === beneficiary.response?.addresses[0].cityName.replace('г.', ''));
|
|
213
|
+
const province = dataStore.states.find(i => i.ids === beneficiary.response?.addresses[0].stateCode);
|
|
214
|
+
const localityType = dataStore.localityTypes.find(i => i.nameRu === beneficiary.response?.addresses[0].cityTypeName);
|
|
215
|
+
const region = dataStore.regions.find(i => i.ids == beneficiary.response?.addresses[0].regionCode);
|
|
216
|
+
beneficiary.registrationCountry = country ?? new Value();
|
|
217
|
+
beneficiary.registrationCity = city ?? new Value();
|
|
218
|
+
beneficiary.registrationMicroDistrict = beneficiary.response?.addresses[0].microRaion ?? '';
|
|
219
|
+
beneficiary.registrationNumberApartment = beneficiary.response?.addresses[0].apartmentNumber ?? '';
|
|
220
|
+
beneficiary.registrationNumberHouse = beneficiary.response?.addresses[0].blockNumber ?? '';
|
|
221
|
+
beneficiary.registrationProvince = province ?? new Value();
|
|
222
|
+
beneficiary.registrationQuarter = beneficiary.response?.addresses[0].kvartal ?? '';
|
|
223
|
+
beneficiary.registrationRegion = region ?? new Value();
|
|
224
|
+
beneficiary.registrationRegionType = localityType ?? new Value();
|
|
225
|
+
beneficiary.registrationStreet = beneficiary.response?.addresses[0].streetName ?? '';
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
};
|
package/composables/styles.ts
CHANGED
|
@@ -17,9 +17,10 @@ export class Styles {
|
|
|
17
17
|
// Green
|
|
18
18
|
greenBg: string = 'bg-[#009C73]';
|
|
19
19
|
greenBgHover: string = 'hover:bg-[#00a277]';
|
|
20
|
-
greenBgLight: string = 'bg-[#
|
|
21
|
-
greenText: string = 'text-[#009C73]';
|
|
20
|
+
greenBgLight: string = 'bg-[#EAF6EF]';
|
|
21
|
+
greenText: string = '!text-[#009C73]';
|
|
22
22
|
greenTextHover: string = 'hover:text-[#009C73]';
|
|
23
|
+
greenBgLightHover: string = 'hover:bg-[#dbf0e4]';
|
|
23
24
|
|
|
24
25
|
// Yellow
|
|
25
26
|
yellowText: string = 'text-[#FAB31C]';
|
|
@@ -35,8 +36,10 @@ export class Styles {
|
|
|
35
36
|
greyBtnBg: string = 'bg-[#EEE6E6]';
|
|
36
37
|
greyBtnDisabledBg: string = 'bg-[#919191]';
|
|
37
38
|
blueLightBgHover: string = 'hover:bg-[#F3F6FC]';
|
|
39
|
+
greyTextDark: string = 'text-[#9197A1]';
|
|
40
|
+
|
|
38
41
|
// Red
|
|
39
|
-
redText: string = 'text-[#
|
|
42
|
+
redText: string = 'text-[#FD2D39]';
|
|
40
43
|
redBg: string = 'bg-[#FF897D]';
|
|
41
44
|
redBgHover: string = 'hover:bg-[#ff9b91]';
|
|
42
45
|
// Error
|
|
@@ -61,6 +64,7 @@ export class Styles {
|
|
|
61
64
|
yellowBtn: string;
|
|
62
65
|
whiteBtn: string;
|
|
63
66
|
blueLightBtn: string;
|
|
67
|
+
greenLightBtn: string;
|
|
64
68
|
|
|
65
69
|
// Complex
|
|
66
70
|
flexColNav: string;
|
|
@@ -69,6 +73,7 @@ export class Styles {
|
|
|
69
73
|
|
|
70
74
|
// Muted or disabled
|
|
71
75
|
mutedText: string = 'text-[#99A3B3]';
|
|
76
|
+
disabled: string = 'cursor-not-allowed opacity-50';
|
|
72
77
|
|
|
73
78
|
constructor() {
|
|
74
79
|
// Button
|
|
@@ -78,6 +83,7 @@ export class Styles {
|
|
|
78
83
|
this.blueBtn = `${this.blueBg} ${this.whiteText} ${this.textTitle} ${this.rounded} w-full ${this.blueBgHover}`;
|
|
79
84
|
this.whiteBtn = ` ${this.blackText} ${this.textTitle} ${this.rounded} w-full ${this.blueLightBgHover}`;
|
|
80
85
|
this.blueLightBtn = `${this.blueBgLight} ${this.greyTextLight} ${this.textTitle} ${this.rounded} w-full ${this.blueBgLightHover}`;
|
|
86
|
+
this.greenLightBtn = `${this.greenBgLight} ${this.greenText} ${this.textTitle} ${this.rounded} w-full ${this.greenBgLightHover}`;
|
|
81
87
|
|
|
82
88
|
// Complex
|
|
83
89
|
this.flexColNav = 'flex flex-col gap-[10px] px-2 pt-[14px]';
|
package/configs/i18n.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createI18n } from 'vue-i18n';
|
|
2
|
+
import en from '@/locales/en.json';
|
|
3
|
+
import ru from '@/locales/ru.json';
|
|
4
|
+
import kz from '@/locales/kz.json';
|
|
5
|
+
|
|
6
|
+
const instance = createI18n({
|
|
7
|
+
legacy: false,
|
|
8
|
+
globalInjection: true,
|
|
9
|
+
locale: 'ru',
|
|
10
|
+
messages: {
|
|
11
|
+
en,
|
|
12
|
+
ru,
|
|
13
|
+
kz,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export default instance;
|
|
18
|
+
|
|
19
|
+
export const i18n = instance.global;
|
package/layouts/default.vue
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
:title="$dataStore.menu.title ?? 'Страховые продукты'"
|
|
9
9
|
:has-back="$dataStore.menu.hasBack ?? false"
|
|
10
10
|
:back-icon="$dataStore.menu.backIcon ?? 'mdi-arrow-left'"
|
|
11
|
+
:more-icon="$dataStore.menu.moreIcon ?? 'mdi-cog-outline'"
|
|
11
12
|
:has-more="'hasMore' in $route.meta && $route.meta.hasMore ? !!$route.meta.hasMore : false"
|
|
12
|
-
:hide-more-on-lg="true"
|
|
13
13
|
:class="{
|
|
14
14
|
// @ts-ignore
|
|
15
15
|
'!hidden': !$display().lgAndUp.value && !!$dataStore.menu.selectedItem.title,
|
|
@@ -38,7 +38,7 @@ const openSettings = async () => {
|
|
|
38
38
|
|
|
39
39
|
const onLink = async (item: MenuItem) => {
|
|
40
40
|
if (dataStore.menu.onLink) await dataStore.menu.onLink(item);
|
|
41
|
-
if (
|
|
41
|
+
if (!dataStore.filters.disabled(item)) dataStore.menu.selectedItem = item;
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
const onBack = async (item: MenuItem) => {
|