hl-core 0.0.10-beta.4 → 0.0.10-beta.41

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.
Files changed (53) hide show
  1. package/README.md +0 -2
  2. package/api/base.api.ts +338 -191
  3. package/api/interceptors.ts +3 -5
  4. package/components/Complex/TextBlock.vue +2 -0
  5. package/components/Dialog/Dialog.vue +7 -1
  6. package/components/Dialog/FamilyDialog.vue +2 -0
  7. package/components/Form/DigitalDocument.vue +52 -0
  8. package/components/Form/DynamicForm.vue +1 -0
  9. package/components/Form/FormData.vue +1 -0
  10. package/components/Form/ManagerAttachment.vue +48 -10
  11. package/components/Form/ProductConditionsBlock.vue +12 -6
  12. package/components/Input/Datepicker.vue +5 -0
  13. package/components/Input/DynamicInput.vue +2 -0
  14. package/components/Input/FormInput.vue +7 -0
  15. package/components/Input/OtpInput.vue +25 -0
  16. package/components/Input/PanelInput.vue +1 -0
  17. package/components/Input/RoundedInput.vue +4 -0
  18. package/components/Input/RoundedSelect.vue +4 -0
  19. package/components/Input/SwitchInput.vue +2 -0
  20. package/components/Input/TextAreaField.vue +71 -0
  21. package/components/Input/TextInput.vue +2 -0
  22. package/components/Layout/Drawer.vue +2 -0
  23. package/components/Menu/MenuNav.vue +1 -1
  24. package/components/Pages/Anketa.vue +168 -169
  25. package/components/Pages/Auth.vue +2 -0
  26. package/components/Pages/ContragentForm.vue +2 -1
  27. package/components/Pages/Documents.vue +432 -59
  28. package/components/Pages/MemberForm.vue +334 -160
  29. package/components/Pages/ProductConditions.vue +838 -226
  30. package/components/Panel/PanelHandler.vue +280 -121
  31. package/components/Transitions/Animation.vue +2 -0
  32. package/components/Utilities/Chip.vue +3 -1
  33. package/components/Utilities/JsonViewer.vue +1 -2
  34. package/composables/classes.ts +143 -49
  35. package/composables/constants.ts +44 -0
  36. package/composables/fields.ts +6 -4
  37. package/composables/index.ts +298 -7
  38. package/composables/styles.ts +8 -24
  39. package/configs/pwa.ts +1 -7
  40. package/layouts/clear.vue +1 -1
  41. package/layouts/default.vue +1 -1
  42. package/layouts/full.vue +1 -1
  43. package/locales/ru.json +80 -19
  44. package/nuxt.config.ts +10 -13
  45. package/package.json +12 -12
  46. package/plugins/head.ts +2 -1
  47. package/store/data.store.ts +802 -531
  48. package/store/member.store.ts +18 -6
  49. package/store/rules.ts +22 -2
  50. package/types/enum.ts +33 -2
  51. package/types/env.d.ts +2 -2
  52. package/types/form.ts +71 -74
  53. package/types/index.ts +924 -873
@@ -5,6 +5,7 @@ import { ErrorHandler } from '../composables';
5
5
  import { AxiosError } from 'axios';
6
6
  import { Member } from '../composables/classes';
7
7
  import { MemberAppCodes, MemberCodes, StoreMembers } from '../types/enum';
8
+ import type { MultipleMember, SendOtpResponse } from '../types';
8
9
 
9
10
  export const useMemberStore = defineStore('members', {
10
11
  state: () => ({
@@ -61,7 +62,7 @@ export const useMemberStore = defineStore('members', {
61
62
  }
62
63
  return false;
63
64
  },
64
- getMemberFromStore(whichForm: keyof typeof StoreMembers, whichIndex?: number): Member | null {
65
+ getMemberFromStore(whichForm: keyof typeof StoreMembers | 'slaveInsuredForm', whichIndex?: number): Member | null {
65
66
  switch (whichForm) {
66
67
  case this.formStore.policyholderFormKey:
67
68
  return this.formStore.policyholderForm;
@@ -69,6 +70,8 @@ export const useMemberStore = defineStore('members', {
69
70
  return this.formStore.policyholdersRepresentativeForm;
70
71
  case this.formStore.insuredFormKey:
71
72
  return this.formStore.insuredForm[whichIndex!];
73
+ case 'slaveInsuredForm':
74
+ return this.formStore.slaveInsuredForm;
72
75
  case this.formStore.beneficiaryFormKey:
73
76
  return this.formStore.beneficiaryForm[whichIndex!];
74
77
  case this.formStore.beneficialOwnerFormKey:
@@ -77,8 +80,11 @@ export const useMemberStore = defineStore('members', {
77
80
  return null;
78
81
  }
79
82
  },
80
- getMemberFromApplication(whichForm: keyof typeof StoreMembers, whichIndex?: number) {
81
- const id = whichForm !== 'policyholderForm' && whichForm !== 'policyholdersRepresentativeForm' ? this.formStore[whichForm][whichIndex!].id : this.formStore[whichForm].id;
83
+ getMemberFromApplication(whichForm: keyof typeof StoreMembers | 'slaveInsuredForm', whichIndex?: number) {
84
+ const id =
85
+ whichForm !== 'policyholderForm' && whichForm !== 'policyholdersRepresentativeForm' && whichForm !== 'slaveInsuredForm'
86
+ ? this.formStore[whichForm][whichIndex!]?.id
87
+ : this.formStore[whichForm]?.id;
82
88
  switch (whichForm) {
83
89
  case this.formStore.policyholderFormKey:
84
90
  return this.formStore.applicationData.clientApp;
@@ -88,6 +94,10 @@ export const useMemberStore = defineStore('members', {
88
94
  const inStore = this.formStore.applicationData.insuredApp.find((member: any) => member.insisId === id);
89
95
  return !!inStore ? inStore : false;
90
96
  }
97
+ case 'slaveInsuredForm': {
98
+ const inStore = this.formStore.applicationData.slave.insuredApp[0];
99
+ return !!inStore ? inStore : false;
100
+ }
91
101
  case this.formStore.beneficiaryFormKey: {
92
102
  const inStore = this.formStore.applicationData.beneficiaryApp.find((member: any) => member.insisId === id);
93
103
  return !!inStore ? inStore : false;
@@ -98,12 +108,14 @@ export const useMemberStore = defineStore('members', {
98
108
  }
99
109
  }
100
110
  },
101
- getMemberCode(whichForm: keyof typeof StoreMembers) {
111
+ getMemberCode(whichForm: keyof typeof StoreMembers | 'slaveInsuredForm') {
102
112
  switch (whichForm) {
103
113
  case this.formStore.policyholderFormKey:
104
114
  return MemberCodes.Client;
105
115
  case this.formStore.insuredFormKey:
106
116
  return MemberCodes.Insured;
117
+ case 'slaveInsuredForm':
118
+ return MemberCodes.Insured;
107
119
  case this.formStore.beneficiaryFormKey:
108
120
  return MemberCodes.Beneficiary;
109
121
  case this.formStore.beneficialOwnerFormKey:
@@ -307,11 +319,11 @@ export const useMemberStore = defineStore('members', {
307
319
  // TODO Доработать и менять значение hasAgreement.value => true
308
320
  this.dataStore.showToaster(otpResponse.status !== 2 ? 'error' : 'success', otpResponse.statusName, 3000);
309
321
  if (otpResponse.status === 2) {
310
- member.otpCode = null;
322
+ member.otpCode = '';
311
323
  return true;
312
324
  }
313
325
  if (otpResponse.status === 4 || otpResponse.status === 5) {
314
- member.otpCode = null;
326
+ member.otpCode = '';
315
327
  member.otpTokenId = null;
316
328
  return false;
317
329
  }
package/store/rules.ts CHANGED
@@ -6,6 +6,7 @@ const t = i18n.t;
6
6
  export const rules = {
7
7
  recalculationMultiply: [(v: any) => (v !== null && v !== '' && v >= 100) || t('toaster.valueShouldBeHigher', { text: '100' })],
8
8
  recalculationMultiplyBetween: [(v: any) => (v !== null && v !== '' && v >= 100 && v <= 200) || t('toaster.recalculationMultiplyBetween', { floor: '100', ceil: '200' })],
9
+ recalculationMultiplyBetween50And200: [(v: any) => (v !== null && v !== '' && v >= 50 && v <= 200) || t('toaster.recalculationMultiplyBetween', { floor: '50', ceil: '200' })],
9
10
  recalculationAdditive: [(v: any) => (v !== null && v !== '' && v <= 100 && v >= 0) || t('toaster.valueShouldBeBetween', { floor: '0', ceil: '100' })],
10
11
  required: [(v: any) => !!v || t('rules.required')],
11
12
  notZero: [(v: any) => Number(v) !== 0 || 'Не может быть равно нулю'],
@@ -53,6 +54,7 @@ export const rules = {
53
54
  cyrillic: [(v: any) => v === null || /^[\u0400-\u04FF -]+$/.test(v) || t('rules.cyrillic')],
54
55
  latin: [(v: any) => v === null || /^[a-zA-Z]+$/.test(v) || t('rules.latin')],
55
56
  latinAndNumber: [(v: any) => v === null || /^[0-9a-zA-Z]+$/.test(v) || t('rules.latinAndNumber')],
57
+ latinNumberSymbol: [(v: any) => v === null || /^[0-9a-zA-Z-/]+$/.test(v) || t('rules.latinNumberSymbol')],
56
58
  cyrillicNonRequired: [
57
59
  (v: any) => {
58
60
  if (!v) return true;
@@ -85,8 +87,8 @@ export const rules = {
85
87
  ageExceeds80ByDate: [(v: any) => Math.abs(new Date(Date.now() - new Date(formatDate(v)!).getTime()).getUTCFullYear() - 1970) <= 80 || t('rules.ageExceeds80')],
86
88
  sums: [
87
89
  (v: any) => {
88
- let str = v.replace(/\s/g, '');
89
- if (/^[0-9]+$/.test(str)) {
90
+ let str = String(v ?? '').replace(/\s/g, '');
91
+ if (!str || /^[0-9]+$/.test(str)) {
90
92
  return true;
91
93
  }
92
94
  return t('rules.sums');
@@ -271,6 +273,18 @@ export const rules = {
271
273
  }
272
274
  },
273
275
  ],
276
+ checkPastDate: [
277
+ (v: any) => {
278
+ let today = new Date();
279
+ const yourDate = new Date(formatDate(v)!);
280
+ today.setHours(0, 0, 0, 0);
281
+ if (yourDate >= today) {
282
+ return true;
283
+ } else {
284
+ return t('rules.checkDate');
285
+ }
286
+ },
287
+ ],
274
288
  fileRequired: [(v: any) => !!v || t('rules.fileRequired'), (v: any) => (v && v.length > 0) || t('rules.fileRequired')],
275
289
  guaranteedPeriodLimit(v: any, termAnnuityPayments: any) {
276
290
  if (Number(v) > Number(termAnnuityPayments)) {
@@ -284,4 +298,10 @@ export const rules = {
284
298
  }
285
299
  return true;
286
300
  },
301
+ lengthLimit(v: any, limit: number) {
302
+ if (!!v && typeof v === 'string' && v.length <= limit) {
303
+ return true;
304
+ }
305
+ return t('rules.lengthLimit', { len: limit });
306
+ },
287
307
  };
package/types/enum.ts CHANGED
@@ -51,6 +51,18 @@ export enum Actions {
51
51
 
52
52
  payed = 'payed',
53
53
  payedCustom = 'payedCustom',
54
+
55
+ rejectDocument = 'rejectDocument',
56
+ rejectDocumentCustom = 'rejectDocumentCustom',
57
+
58
+ recalc = 'recalc',
59
+ recalcCustom = 'recalcCustom',
60
+
61
+ annulment = 'annulment',
62
+ annulmentCustom = 'annulmentCustom',
63
+
64
+ otrs = 'otrs',
65
+ otrsCustom = 'otrsCustom',
54
66
  }
55
67
 
56
68
  export enum PostActions {
@@ -60,6 +72,7 @@ export enum PostActions {
60
72
  applicationCreated = 'applicationCreated',
61
73
  clipboard = 'clipboard',
62
74
  toHomePage = 'toHomePage',
75
+ toHistory = 'toHistory',
63
76
  toStatementHistory = 'toStatementHistory',
64
77
  toAuth = 'toAuth',
65
78
  DOMevent = 'DOMevent',
@@ -90,13 +103,21 @@ export enum Roles {
90
103
  HeadManager = 'HeadManager',
91
104
  AgentAuletti = 'AgentAuletti',
92
105
  USNS = 'USNS',
106
+ USNSsanctioner = 'USNSsanctioner',
93
107
  Accountant = 'Accountant',
94
108
  BranchDirector = 'BranchDirector',
95
109
  USNSACCINS = 'USNSACCINS',
96
110
  Dsuio = 'Dsuio',
97
- Adjuster = 'Adjuster',
111
+ HEADDSO = 'HEADDSO',
112
+ SettlementLosses = 'SettlementLosses',
113
+ HeadSettlementLosses = 'HeadSettlementLosses',
98
114
  DsoDirector = 'DsoDirector',
115
+ Archivist = 'Archivist',
99
116
  AccountantDirector = 'AccountantDirector',
117
+ ManagerAuletti = 'ManagerAuletti',
118
+ HeadOfDso = 'HeadOfDso',
119
+ URSP = 'URSP',
120
+ ExecutorGPH = 'ExecutorGPH'
100
121
  }
101
122
 
102
123
  export enum Statuses {
@@ -120,6 +141,7 @@ export enum Statuses {
120
141
  ControllerDpForm = 'ControllerDpForm',
121
142
  ActuaryForm = 'ActuaryForm',
122
143
  DsoUsnsForm = 'DsoUsnsForm',
144
+ JuristForm = 'JuristForm',
123
145
  AccountantForm = 'AccountantForm',
124
146
  HeadManagerForm = 'HeadManagerForm',
125
147
  }
@@ -145,7 +167,7 @@ export enum Methods {
145
167
  POST = 'POST',
146
168
  }
147
169
 
148
- export namespace Enums {
170
+ export namespace CoreEnums {
149
171
  export namespace GBD {
150
172
  export enum DocTypes {
151
173
  'PS' = '001',
@@ -161,4 +183,13 @@ export namespace Enums {
161
183
  'SBI' = 'SBI',
162
184
  }
163
185
  }
186
+ export namespace Sign {
187
+ export enum Types {
188
+ electronic = 1,
189
+ scans = 2,
190
+ qr = 3,
191
+ qrXml = 5,
192
+ nclayer = 6,
193
+ }
194
+ }
164
195
  }
package/types/env.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  /// <reference types="vite/client" />
2
2
 
3
- export interface ImportMetaEnv {
3
+ interface ImportMetaEnv {
4
4
  readonly VITE_MODE: EnvModes;
5
5
  readonly VITE_PRODUCT?: Projects;
6
6
  readonly VITE_PARENT_PRODUCT?: 'efo' | 'auletti';
7
7
  readonly VITE_COMMIT_VERSION?: string;
8
8
  }
9
9
 
10
- export interface ImportMeta {
10
+ interface ImportMeta {
11
11
  readonly env: ImportMetaEnv;
12
12
  }
package/types/form.ts CHANGED
@@ -6,88 +6,85 @@ export enum FieldTypes {
6
6
  PASSWORD = 'password',
7
7
  FILE = 'file',
8
8
  }
9
- export {};
10
9
 
11
- declare global {
12
- export type InputType = TextInput | NumberInput | FileInput | SwitchInput;
13
- export type FormMasks = 'numbers' | 'iin' | 'otp' | 'phone' | 'date' | 'post' | 'threeDigit' | 'iik';
14
- export type FormIcons = 'arrowRight' | 'search' | 'sms' | null;
15
- export type Suffix = 'kzt' | 'usd' | 'percent' | null;
10
+ export type InputType = TextInput | NumberInput | FileInput | SwitchInput;
11
+ export type FormMasks = 'numbers' | 'iin' | 'otp' | 'phone' | 'date' | 'post' | 'threeDigit' | 'iik';
12
+ export type FormIcons = 'arrowRight' | 'search' | 'sms' | null;
13
+ export type Suffix = 'kzt' | 'usd' | 'percent' | null;
16
14
 
17
- export type FetchFunctions =
18
- | 'getResidents'
19
- | 'getFamilyStatuses'
20
- | 'getRelationTypes'
21
- | 'getCountries'
22
- | 'getStates'
23
- | 'getLocalityTypes'
24
- | 'getRegions'
25
- | 'getCities'
26
- | 'getDocumentTypes'
27
- | 'getTaxCountries'
28
- | 'getCitizenshipCountries'
29
- | 'getSectorCodeList'
30
- | 'getInsurancePay'
31
- | 'getEconomicActivityType'
32
- | 'getBanks'
33
- | 'getDocumentIssuers'
34
- | 'getGenderList';
15
+ export type FetchFunctions =
16
+ | 'getResidents'
17
+ | 'getFamilyStatuses'
18
+ | 'getRelationTypes'
19
+ | 'getCountries'
20
+ | 'getStates'
21
+ | 'getLocalityTypes'
22
+ | 'getRegions'
23
+ | 'getCities'
24
+ | 'getDocumentTypes'
25
+ | 'getTaxCountries'
26
+ | 'getCitizenshipCountries'
27
+ | 'getSectorCodeList'
28
+ | 'getInsurancePay'
29
+ | 'getEconomicActivityType'
30
+ | 'getBanks'
31
+ | 'getDocumentIssuers'
32
+ | 'getGenderList';
35
33
 
36
- export interface DynamicForm {
37
- formRef: any;
38
- sections: SectionType[];
39
- fieldOrder?: string[];
40
- }
34
+ export interface DynamicForm {
35
+ formRef: any;
36
+ sections: SectionType[];
37
+ fieldOrder?: string[];
38
+ }
41
39
 
42
- export type InputBase = {
43
- key?: any;
44
- modelValue?: any;
45
- clearable?: boolean;
46
- label?: string;
47
- placeholder?: string;
48
- readonly?: boolean;
49
- disabled?: boolean;
50
- arrowRight?: boolean;
51
- maxLength?: number | null;
52
- rules?: ValidationRule[];
53
- iconName?: FormIcons;
54
- value?: number;
55
- suffix?: Suffix | null;
56
- hint?: string | undefined;
57
- maska?: FormMasks | null;
58
- fetchFrom?: FetchFunctions | null;
59
- };
40
+ export type InputBase = {
41
+ key?: any;
42
+ modelValue?: any;
43
+ clearable?: boolean;
44
+ label?: string;
45
+ placeholder?: string;
46
+ readonly?: boolean;
47
+ disabled?: boolean;
48
+ arrowRight?: boolean;
49
+ maxLength?: number | null;
50
+ rules?: ValidationRule[];
51
+ iconName?: FormIcons;
52
+ value?: number;
53
+ suffix?: Suffix | null;
54
+ hint?: string | undefined;
55
+ maska?: FormMasks | null;
56
+ fetchFrom?: FetchFunctions | null;
57
+ };
60
58
 
61
- export type FormControl<T extends InputType> = T & {
62
- valid: boolean;
63
- dirty: boolean;
64
- touched: boolean;
65
- };
59
+ export type FormControl<T extends InputType> = T & {
60
+ valid: boolean;
61
+ dirty: boolean;
62
+ touched: boolean;
63
+ };
66
64
 
67
- export type FileInput = InputBase & {
68
- type: FieldTypes.FILE;
69
- };
65
+ export type FileInput = InputBase & {
66
+ type: FieldTypes.FILE;
67
+ };
70
68
 
71
- export type TextInput = InputBase & {
72
- type: FieldTypes.TEXT;
73
- };
69
+ export type TextInput = InputBase & {
70
+ type: FieldTypes.TEXT;
71
+ };
74
72
 
75
- export type SwitchInput = InputBase & {
76
- type: FieldTypes.SWITCH;
77
- labeling: boolean | null;
78
- direction: 'horizontal' | 'vertical';
79
- falseValue: boolean | string | null;
80
- trueValue: boolean | string | null;
81
- };
73
+ export type SwitchInput = InputBase & {
74
+ type: FieldTypes.SWITCH;
75
+ labeling: boolean | null;
76
+ direction: 'horizontal' | 'vertical';
77
+ falseValue: boolean | string | null;
78
+ trueValue: boolean | string | null;
79
+ };
82
80
 
83
- export type NumberInput = InputBase & {
84
- type: FieldTypes.NUMBER;
85
- };
81
+ export type NumberInput = InputBase & {
82
+ type: FieldTypes.NUMBER;
83
+ };
86
84
 
87
- export type ValidationRule = (value: string) => boolean | string;
85
+ export type ValidationRule = (value: string) => boolean | string;
88
86
 
89
- export type SectionType = {
90
- title?: string;
91
- fields: InputType[];
92
- };
93
- }
87
+ export type SectionType = {
88
+ title?: string;
89
+ fields: InputType[];
90
+ };