hl-core 0.0.10-beta.18 → 0.0.10-beta.19

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/base.api.ts CHANGED
@@ -1108,4 +1108,22 @@ export class ApiClass {
1108
1108
  url: `/pensionannuityNew/SetEnpfSharedId/${sharedId}/${infoId}`,
1109
1109
  });
1110
1110
  }
1111
+
1112
+ integration = {
1113
+ base: '/integration',
1114
+ onlineAccess: async (data: { iin: string; documentType: string }) => {
1115
+ return await this.axiosCall<void>({
1116
+ method: Methods.POST,
1117
+ url: `${this.integration.base}/api/External/OnlineAccess`,
1118
+ data: data,
1119
+ });
1120
+ },
1121
+ digitalDocuments: async (data: { iin: string; processInstanceId: string; code: string }) => {
1122
+ return await this.axiosCall<void>({
1123
+ method: Methods.POST,
1124
+ url: `${this.integration.base}/api/External/DigitalDocuments`,
1125
+ data: data,
1126
+ });
1127
+ },
1128
+ };
1111
1129
  }
@@ -0,0 +1,52 @@
1
+ <template>
2
+ <section v-if="member" class="mb-2">
3
+ <base-form-section :title="`${title} ${number === 0 ? '' : number}`" class="mx-[10px] mt-[14px] d-flex">
4
+ <base-form-input v-model="member.iin" :label="$dataStore.t('form.iin')" :readonly="true" />
5
+ <base-form-input v-model.trim="member.longName" :label="$dataStore.t('labels.userFullName')" :readonly="true" />
6
+ <base-panel-input
7
+ v-if="!!member.digitalDocument"
8
+ v-model="member.digitalDocument.fileName"
9
+ label="Цифровой документ"
10
+ :readonly="disabled"
11
+ :clearable="!disabled"
12
+ append-inner-icon="mdi mdi-chevron-right"
13
+ @click="$emit('openPanel', member.digitalDocument)"
14
+ />
15
+ <base-content-block
16
+ v-if="!disabled && !member.digitalDocument"
17
+ class="d-flex align-center justify-between !py-3.5 !pr-5"
18
+ :class="[$styles.whiteBg]"
19
+ @click="$emit('openDigitalDocPanel', member.iin)"
20
+ >
21
+ <p :class="[$styles.greyText]">Получить цифровой документ</p>
22
+ <div class="cursor-pointer">
23
+ <i class="mdi mdi-file-document text-xl" :class="[$styles.blueText]"></i>
24
+ </div>
25
+ </base-content-block>
26
+ </base-form-section>
27
+ </section>
28
+ </template>
29
+
30
+ <script setup lang="ts">
31
+ import type { Base } from '../../types';
32
+
33
+ defineEmits(['openDigitalDocPanel', 'openPanel']);
34
+ defineProps({
35
+ title: {
36
+ type: String,
37
+ default: '',
38
+ },
39
+ member: {
40
+ type: Object as PropType<Base.Document.Digital>,
41
+ default: null,
42
+ },
43
+ number: {
44
+ type: Number,
45
+ default: 0,
46
+ },
47
+ disabled: {
48
+ type: Boolean,
49
+ default: false,
50
+ },
51
+ });
52
+ </script>
@@ -17,7 +17,7 @@
17
17
  <base-form-input v-model="formStore.contractDate" :label="$dataStore.t('form.date')" :readonly="true" append-inner-icon="mdi mdi-calendar-blank-outline" />
18
18
  <base-file-input :readonly="isDisabled" @input.prevent="onFileChange($event)" />
19
19
  </base-content-block>
20
- <base-content-block v-for="document of formStore.signedDocumentList" :key="document.id" :class="[$styles.textSimple]">
20
+ <base-content-block v-for="document of !useEnv().isProduction ? documentListFiltered : formStore.signedDocumentList" :key="document.id" :class="[$styles.textSimple]">
21
21
  <h5 class="text-center font-medium mb-4">
22
22
  {{ document.fileTypeName }}
23
23
  </h5>
@@ -31,6 +31,40 @@
31
31
  </div>
32
32
  </base-content-block>
33
33
  </section>
34
+ <section v-if="hasDigitalDocuments">
35
+ <base-digital-document
36
+ v-if="$route.params.taskId !== '0'"
37
+ :member="policyholderForm"
38
+ :title="$dataStore.t('policyholderForm')"
39
+ :disabled="isDigitalDocDisabled"
40
+ @openDigitalDocPanel="openDigitalDocPanel($event, 'Страхователя')"
41
+ @openPanel="openPanel"
42
+ />
43
+ <div v-if="insuredFiltered.length !== 0">
44
+ <base-digital-document
45
+ v-for="(member, index) in insuredFiltered"
46
+ :key="index"
47
+ :member="member"
48
+ :number="index + 1"
49
+ :title="$dataStore.t('insuredForm')"
50
+ :disabled="isDigitalDocDisabled"
51
+ @openDigitalDocPanel="openDigitalDocPanel($event, 'Застрахованного')"
52
+ @openPanel="openPanel"
53
+ />
54
+ </div>
55
+ <div v-if="beneficiaryFiltered.length !== 0">
56
+ <base-digital-document
57
+ v-for="(member, index) in beneficiaryFiltered"
58
+ :key="index"
59
+ :member="member"
60
+ :number="index + 1"
61
+ :title="$dataStore.t('beneficiaryForm')"
62
+ :disabled="isDigitalDocDisabled"
63
+ @openDigitalDocPanel="openDigitalDocPanel($event, 'Выгодоприобретателя')"
64
+ @openPanel="openPanel"
65
+ />
66
+ </div>
67
+ </section>
34
68
  <div v-if="noDocuments" class="h-[calc(90vh-70px)] flex flex-col items-center justify-center gap-6">
35
69
  <svg xmlns="http://www.w3.org/2000/svg" width="125" height="131" viewBox="0 0 125 131" fill="none" class="cursor-help">
36
70
  <path
@@ -97,7 +131,7 @@
97
131
  </div>
98
132
  </base-content-block>
99
133
  </section>
100
- <Teleport v-if="$dataStore.panelAction === null" to="#right-panel-actions">
134
+ <Teleport v-if="isPanelOpen" to="#right-panel-actions">
101
135
  <base-fade-transition>
102
136
  <div :class="[$styles.flexColNav]">
103
137
  <base-btn :disabled="documentLoading" :loading="documentLoading" text="Открыть" @click="getFile('view')" />
@@ -108,6 +142,46 @@
108
142
  </div>
109
143
  </base-fade-transition>
110
144
  </Teleport>
145
+ <Teleport v-if="isDigitalDocOpen" to="#right-panel-actions">
146
+ <div :class="[$styles.flexColNav]">
147
+ <base-form-section class="!mt-0">
148
+ <v-expansion-panels :flat="true">
149
+ <v-expansion-panel class="digital-doc-info !rounded-[8px]">
150
+ <v-expansion-panel-title class="!text-[12px]"> Как получить цифровой документ: </v-expansion-panel-title>
151
+ <v-expansion-panel-text class="text-[12px] text-[#464f60]">
152
+ 1. Выберите тип документа.<br /><br />
153
+ 2. Через приложение eGov mobile и другие приложения: <br />
154
+ • Откройте раздел "Цифровые документы". <br />
155
+ • Выберите нужный документ и откройте доступ. <br />
156
+ • Введите 6-значный код в поле «Код подтверждения». <br />
157
+ • Нажмите "Получить документ".<br /><br />
158
+ 3. Через SMS: <br />
159
+ • Нажмите "Отправить код". <br />
160
+ • Введите полученный SMS-код. <br />
161
+ • Нажмите "Получить документ".<br />
162
+ </v-expansion-panel-text>
163
+ </v-expansion-panel>
164
+ </v-expansion-panels>
165
+ </base-form-section>
166
+ <div class="p-4 d-flex flex-col gap-0.5" :class="[$styles.blueBgLight, $styles.rounded]">
167
+ <base-rounded-select v-model="documentType" class="document-type-select" :items="documentItems" :label="$dataStore.t('form.documentType')" hide-details />
168
+ <div class="digital-document-otp flex flex-col">
169
+ <base-otp-input
170
+ v-model="otpCode"
171
+ @keyup.enter.prevent="otpCode.length === useMask().otpSixDigit.length && getCode()"
172
+ @input="otpCode.length === useMask().otpSixDigit.length && getDigitalDocument()"
173
+ />
174
+ <base-animation>
175
+ <span v-if="!documentLoading" class="text-center cursor-pointer" :class="[$styles.mutedText]" @click="getCode"
176
+ >Не получили код? <span class="underline underline-offset-2">Отправить код заново</span></span
177
+ >
178
+ </base-animation>
179
+ </div>
180
+ </div>
181
+ <base-btn :disabled="documentLoading" :loading="documentLoading" :btn="$styles.greenLightBtn" text="Отправить SMS-код" @click="getCode" />
182
+ <base-btn :disabled="documentLoading" :loading="documentLoading" text="Получить документ" @click="getDigitalDocument" />
183
+ </div>
184
+ </Teleport>
111
185
  <base-dialog
112
186
  v-model="deletionDialog"
113
187
  :title="$dataStore.t('dialog.confirmDelete')"
@@ -122,19 +196,39 @@
122
196
 
123
197
  <script lang="ts">
124
198
  import { DocumentItem } from '../../composables/classes';
199
+ import type { IDocument } from '../../composables/classes';
125
200
  import { uuid } from 'vue-uuid';
126
- import type { FileActions } from '../../types';
201
+ import type { Base, FileActions } from '../../types';
127
202
 
128
203
  export default defineComponent({
129
204
  setup() {
205
+ type DigitalDocNames = 'Удостоверение личности' | 'Паспорт';
206
+ type DigitalDocTypes = 'IdentityCard' | 'Passport';
207
+
208
+ const route = useRoute();
130
209
  const dataStore = useDataStore();
131
210
  const formStore = useFormStore();
132
211
  const currentDocument = ref<DocumentItem>(new DocumentItem());
133
212
  const documentLoading = ref<boolean>(false);
134
213
  const deletionDialog = ref<boolean>(false);
214
+ const isPanelOpen = ref<boolean>(false);
215
+ const isDigitalDocOpen = ref<boolean>(false);
135
216
  const isDisabled = computed(() => !dataStore.isTask());
136
217
  const contractDict = computed(() => dataStore.dicFileTypeList.find(i => i.nameRu === 'Договор страхования' || i.nameRu === 'Договор'));
137
218
  const processCode = formStore.applicationData.processCode;
219
+
220
+ const hasDigitalDocuments = computed(() => !useEnv().isProduction && dataStore.isEfoParent && !dataStore.isGns && !dataStore.isLifeBusiness && !!formStore.applicationData);
221
+ const isDigitalDocDisabled = computed(
222
+ () => !dataStore.isTask() || route.params.taskId === '0' || !dataStore.isInitiator() || !dataStore.isProcessEditable(formStore.applicationData.statusCode),
223
+ );
224
+ const documentType = ref<DigitalDocNames | null>(null);
225
+ const otpCode = ref<string>('');
226
+ const currentIin = ref<string>('');
227
+ const deleteFilesId = ['1', '2', '46'];
228
+ const documentItems: Array<{ title: DigitalDocNames; value: DigitalDocTypes }> = [
229
+ { title: 'Удостоверение личности', value: 'IdentityCard' },
230
+ { title: 'Паспорт', value: 'Passport' },
231
+ ];
138
232
  const signedContract = reactive<{
139
233
  processInstanceId: string | number;
140
234
  fileTypeId: string | number | null;
@@ -190,16 +284,24 @@ export default defineComponent({
190
284
  const canDeleteFiles = computed(() => {
191
285
  const baseCondition = dataStore.isTask() && dataStore.isInitiator() && dataStore.isProcessEditable(formStore.applicationData.statusCode);
192
286
  if (dataStore.isBaiterek || dataStore.isBolashak || dataStore.isLiferenta || dataStore.isKazyna || dataStore.isAmulet || dataStore.isGons) {
193
- return baseCondition && (currentDocument.value ? currentDocument.value.fileTypeCode === '46' : false);
287
+ return baseCondition && (currentDocument.value ? deleteFilesId.includes(String(currentDocument.value.fileTypeCode)) : false);
194
288
  }
195
289
  if (dataStore.isPension) return baseCondition;
196
290
  return false;
197
291
  });
198
292
 
293
+ const policyholderForm = computed(() => formStore.policyholderForm as Base.Document.Digital);
294
+ const insuredFiltered = computed(() => formStore.insuredForm.filter(i => i.iin !== formStore.policyholderForm.iin) as Base.Document.Digital[]);
295
+ const beneficiaryFiltered = computed(() => formStore.beneficiaryForm.filter(i => i.iin !== formStore.policyholderForm.iin) as Base.Document.Digital[]);
296
+ const documentListFiltered = computed(() => formStore.signedDocumentList.filter(i => !['1', '2'].includes(String(i.fileTypeCode))));
297
+
199
298
  const openPanel = async (document: DocumentItem) => {
200
299
  dataStore.rightPanel.title = document.fileTypeName!;
201
300
  currentDocument.value = document;
202
301
  dataStore.rightPanel.open = true;
302
+ isDigitalDocOpen.value = false;
303
+ isPanelOpen.value = true;
304
+ dataStore.panelAction = null;
203
305
  };
204
306
 
205
307
  const onFileChange = async (event: InputEvent) => {
@@ -264,6 +366,17 @@ export default defineComponent({
264
366
  }
265
367
  };
266
368
 
369
+ const openDigitalDocPanel = async (iin: string, title: string) => {
370
+ isPanelOpen.value = false;
371
+ isDigitalDocOpen.value = true;
372
+ dataStore.panelAction = null;
373
+ dataStore.rightPanel.open = true;
374
+ dataStore.rightPanel.title = `Получить ЦД ${title}`;
375
+ documentType.value = null;
376
+ otpCode.value = '';
377
+ currentIin.value = iin;
378
+ };
379
+
267
380
  watch(
268
381
  () => document_list.value,
269
382
  () => {
@@ -294,18 +407,93 @@ export default defineComponent({
294
407
  const data = {
295
408
  id: currentDocument.value.id,
296
409
  processInstanceId: currentDocument.value.processInstanceId,
410
+ iin: currentDocument.value.iin ?? '',
297
411
  };
298
412
  await dataStore.deleteFile(data);
299
413
  deletionDialog.value = false;
300
414
  dataStore.rightPanel.open = false;
301
415
  dataStore.panelAction = null;
302
416
  await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
417
+ if (hasDigitalDocuments.value && (currentDocument.value.fileTypeCode === '1' || currentDocument.value.fileTypeCode === '2')) {
418
+ getDigitalDocs();
419
+ }
420
+ }
421
+ };
422
+
423
+ const getCode = async () => {
424
+ if (!documentType.value) {
425
+ dataStore.showToaster('error', 'Выберите тип документа', 3000);
426
+ return;
427
+ }
428
+ documentLoading.value = true;
429
+ const response = await dataStore.onlineAccess(currentIin.value, String(documentType.value));
430
+ if (response) {
431
+ dataStore.showToaster('success', dataStore.t('toaster.successOtp'), 3000);
432
+ }
433
+ documentLoading.value = false;
434
+ };
435
+
436
+ const getDigitalDocument = async () => {
437
+ if (!otpCode.value) {
438
+ dataStore.showToaster('error', 'Введите код подтверждения', 3000);
439
+ return;
440
+ }
441
+ documentLoading.value = true;
442
+ const response = await dataStore.digitalDocuments(currentIin.value, String(formStore.applicationData.processInstanceId), otpCode.value);
443
+ if (response) {
444
+ await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
445
+ getDigitalDocs();
446
+ isDigitalDocOpen.value = false;
447
+ dataStore.panelAction = null;
448
+ dataStore.rightPanel.open = false;
449
+ documentType.value = null;
450
+ otpCode.value = '';
451
+ }
452
+ documentLoading.value = false;
453
+ };
454
+
455
+ const findCommonDocs = (members: Base.Document.Digital[]) => {
456
+ let commonDocs: IDocument[] = [];
457
+ for (let member of members) {
458
+ const matchingDoc = formStore.signedDocumentList.find(doc => doc.iin === String(member.iin).replaceAll('-', '') && (doc.fileTypeCode === '1' || doc.fileTypeCode === '2'));
459
+ if (matchingDoc) commonDocs.push(matchingDoc);
460
+ }
461
+ return commonDocs;
462
+ };
463
+
464
+ const setDigitalDocuments = (members: Base.Document.Digital[]) => {
465
+ const commonDocs = findCommonDocs(members);
466
+ if (commonDocs.length !== 0) {
467
+ for (let member of members) {
468
+ const matchingDoc = commonDocs.find(doc => doc.iin === String(member.iin).replaceAll('-', ''));
469
+ if (matchingDoc) member.digitalDocument = matchingDoc;
470
+ }
471
+ }
472
+ };
473
+
474
+ const clearDigitalDocuments = (members: Base.Document.Digital[]) => {
475
+ for (let member of members) member.digitalDocument = null;
476
+ };
477
+
478
+ const getDigitalDocs = () => {
479
+ if (route.params.taskId !== '0') {
480
+ clearDigitalDocuments([formStore.policyholderForm as Base.Document.Digital]);
481
+ setDigitalDocuments([formStore.policyholderForm as Base.Document.Digital]);
482
+ if (insuredFiltered.value.length !== 0) {
483
+ clearDigitalDocuments(insuredFiltered.value);
484
+ setDigitalDocuments(insuredFiltered.value);
485
+ }
486
+ if (beneficiaryFiltered.value.length !== 0) {
487
+ clearDigitalDocuments(beneficiaryFiltered.value);
488
+ setDigitalDocuments(beneficiaryFiltered.value);
489
+ }
303
490
  }
304
491
  };
305
492
 
306
493
  const onInit = async () => {
307
494
  await dataStore.getDicFileTypeList();
308
495
  await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
496
+ if (hasDigitalDocuments.value) getDigitalDocs();
309
497
  };
310
498
 
311
499
  onInit();
@@ -316,12 +504,17 @@ export default defineComponent({
316
504
 
317
505
  return {
318
506
  // State
507
+ otpCode,
319
508
  formStore,
320
- documentLoading,
509
+ processCode,
510
+ isPanelOpen,
321
511
  DocumentItem,
512
+ documentType,
513
+ documentItems,
322
514
  signedContract,
323
515
  deletionDialog,
324
- processCode,
516
+ documentLoading,
517
+ isDigitalDocOpen,
325
518
  underDocumentsList,
326
519
 
327
520
  // Computed
@@ -329,17 +522,54 @@ export default defineComponent({
329
522
  showContract,
330
523
  noDocuments,
331
524
  canDeleteFiles,
525
+ insuredFiltered,
526
+ policyholderForm,
527
+ beneficiaryFiltered,
528
+ hasDigitalDocuments,
529
+ documentListFiltered,
530
+ isDigitalDocDisabled,
332
531
  isUnderwriterDocuments,
333
532
 
334
533
  // Functions
534
+ getCode,
335
535
  getFile,
336
536
  openPanel,
337
537
  deleteFile,
538
+ getDigitalDocument,
338
539
  onFileChange,
339
540
  onUnderFiles,
541
+ openDigitalDocPanel,
340
542
  uploadUnderFiles,
341
543
  onClearUnderFiles,
342
544
  };
343
545
  },
344
546
  });
345
547
  </script>
548
+
549
+ <style>
550
+ .document-type-select .v-field {
551
+ border: none !important;
552
+ border-radius: 4px;
553
+ height: 56px;
554
+ }
555
+ .digital-document-otp .base-otp-input .v-otp-input__content {
556
+ gap: 8px;
557
+ padding-right: 0px !important;
558
+ padding-left: 0px !important;
559
+ }
560
+ .digital-doc-info .v-expansion-panel-text__wrapper {
561
+ padding: 8px 14px !important;
562
+ }
563
+ .digital-doc-info .v-expansion-panel-title {
564
+ max-height: 40px !important;
565
+ min-height: 39px !important;
566
+ padding: 0px 14px !important;
567
+ color: #464f60 !important;
568
+ }
569
+ .document-type-select .v-field-label--floating {
570
+ top: 5px !important;
571
+ }
572
+ .document-type-select .v-field__input {
573
+ padding-top: 21px;
574
+ }
575
+ </style>
@@ -723,7 +723,7 @@
723
723
  label="Выполните поиск должностей"
724
724
  class="w-full p-2"
725
725
  :hide-details="searchQuery.length >= 4"
726
- :rules="[searchQuery.length < 4 ? $dataStore.t('rules.searchQueryLen') : true]"
726
+ :rules="[searchQuery.length < 4 ? $dataStore.t('rules.searchQueryLen', { len: 4 }) : true]"
727
727
  append-inner-icon="mdi mdi-magnify"
728
728
  @append="searchPositions"
729
729
  />
@@ -1084,7 +1084,7 @@ export default {
1084
1084
 
1085
1085
  const searchPositions = async () => {
1086
1086
  if (searchQuery.value.length < 4) {
1087
- dataStore.showToaster('error', dataStore.t('rules.searchQueryLen'));
1087
+ dataStore.showToaster('error', dataStore.t('rules.searchQueryLen', { len: 4 }));
1088
1088
  return;
1089
1089
  }
1090
1090
  if (!isDisabled.value) {
@@ -1941,13 +1941,14 @@ export default {
1941
1941
  watch(
1942
1942
  () => member.value.age,
1943
1943
  val => {
1944
- if (val && Number(val) >= 18) {
1945
- if (member.value.hasAgreement !== true) {
1944
+ if (val) {
1945
+ if (Number(val) >= 18 && member.value.hasAgreement !== true) {
1946
1946
  member.value.hasAgreement = false;
1947
+ } else {
1948
+ member.value.hasAgreement = true;
1947
1949
  }
1948
- } else {
1949
- member.value.hasAgreement = true;
1950
1950
  }
1951
+
1951
1952
  member.value.isInsuredUnderage = Number(val) >= 18 ? false : true;
1952
1953
  },
1953
1954
  { immediate: true },
@@ -198,13 +198,25 @@ export class User {
198
198
  roles: string[];
199
199
  id: string | null;
200
200
  fullName: string | null;
201
+ code: string;
202
+ branchCode: string;
201
203
 
202
- constructor(login: string | null = null, password: string | null = null, roles: string[] = [], id: string | null = null, fullName: string | null = null) {
204
+ constructor(
205
+ login: string | null = null,
206
+ password: string | null = null,
207
+ roles: string[] = [],
208
+ id: string | null = null,
209
+ fullName: string | null = null,
210
+ code: string = '',
211
+ branchCode: string = '',
212
+ ) {
203
213
  this.login = login;
204
214
  this.password = password;
205
215
  this.roles = roles;
206
216
  this.id = id;
207
217
  this.fullName = fullName;
218
+ this.code = code;
219
+ this.branchCode = branchCode;
208
220
  }
209
221
 
210
222
  resetUser() {
@@ -213,6 +225,8 @@ export class User {
213
225
  this.roles = [];
214
226
  this.id = null;
215
227
  this.fullName = null;
228
+ this.code = '';
229
+ this.branchCode = '';
216
230
  }
217
231
  }
218
232
 
@@ -479,6 +493,7 @@ export class Member extends Person {
479
493
  isInsuredUnderage?: boolean = false;
480
494
  bankInfo: BankInfoClass;
481
495
  transferContractCompany: Value;
496
+ digitalDocument: IDocument | null;
482
497
  identityDocument: {
483
498
  documentType: Value;
484
499
  documentNumber: string | null;
@@ -623,6 +638,7 @@ export class Member extends Person {
623
638
  this.hasAgreement = null;
624
639
  this.bankInfo = new BankInfoClass();
625
640
  this.transferContractCompany = new Value();
641
+ this.digitalDocument = null;
626
642
  this.identityDocument = {
627
643
  documentType: new Value(),
628
644
  documentNumber: null,
@@ -18,6 +18,7 @@ export const useEnv = () => {
18
18
  export class Masks {
19
19
  numbers: string = '#*';
20
20
  otp: string = '####';
21
+ otpSixDigit: string = '######';
21
22
  spacedNumbers: string = '### ### ### ### ### ### ###';
22
23
  iin: string = '###-###-###-###';
23
24
  phone: string = '+7 (7##) ### ## ##';
package/locales/ru.json CHANGED
@@ -863,7 +863,7 @@
863
863
  "agentCommission": "Агентская комиссия не должно превышать 50",
864
864
  "agePrePensionInsured": "Пороговое значение по возрасту с 55 по 63",
865
865
  "checkDate": "Укажите корректную дату",
866
- "searchQueryLen": "Поиск должности должен осуществляться по запросу не менее чем из 4 символов",
866
+ "searchQueryLen": "Поиск должности должен осуществляться по запросу не менее чем из {len} символов",
867
867
  "fixInsSumLimit": "Фиксированная сумма не должна превышать {sum}тг"
868
868
  },
869
869
  "code": "КСЭ",
package/nuxt.config.ts CHANGED
@@ -11,7 +11,7 @@ export default defineNuxtConfig({
11
11
  },
12
12
 
13
13
  build: {
14
- transpile: ['@vuepic/vue-datepicker', '@microsoft/signalr', 'vue-uuid', 'qrcode.vue'],
14
+ transpile: ['@vuepic/vue-datepicker', '@microsoft/signalr', 'vue-uuid', 'qrcode.vue', 'vue-i18n'],
15
15
  },
16
16
 
17
17
  vite: {
@@ -26,7 +26,7 @@ export default defineNuxtConfig({
26
26
  },
27
27
  plugins: [
28
28
  VueI18nVitePlugin.vite({
29
- include: [path.resolve(__dirname, './src/locales/**')],
29
+ include: [path.resolve(__dirname, './locales/**')],
30
30
  }),
31
31
  ],
32
32
  build: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.10-beta.18",
3
+ "version": "0.0.10-beta.19",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -163,6 +163,8 @@ export const useDataStore = defineStore('data', {
163
163
  if (decoded) {
164
164
  this.user.id = String(decoded.sub);
165
165
  this.user.fullName = `${decoded.lastName} ${decoded.firstName} ${decoded.middleName ?? ''}`;
166
+ this.user.code = decoded.code;
167
+ this.user.branchCode = decoded.branchCode;
166
168
  const key = getKeyWithPattern(decoded, 'role');
167
169
  if (key) {
168
170
  const roles = decoded[key as keyof Types.Utils.JwtToken];
@@ -3423,12 +3425,11 @@ export const useDataStore = defineStore('data', {
3423
3425
  if (person.regAddress.flat) member.registrationNumberApartment = person.regAddress.flat;
3424
3426
 
3425
3427
  if (Array.isArray(person.documents.document)) {
3426
- const validDocument = person.documents.document.find(
3427
- i =>
3428
- new Date(i.endDate) > new Date(Date.now()) &&
3429
- i.status.code === '00' &&
3430
- (i.type.code === CoreEnums.GBD.DocTypes['1UDL'] || i.type.code === CoreEnums.GBD.DocTypes.VNZ || i.type.code === CoreEnums.GBD.DocTypes.PS),
3431
- );
3428
+ const filteredDocuments = person.documents.document.filter(i => new Date(i.endDate) > new Date(Date.now()) && i.status.code === '00');
3429
+ const validDocument =
3430
+ filteredDocuments.find(i => i.type.code === CoreEnums.GBD.DocTypes['1UDL']) ??
3431
+ filteredDocuments.find(i => i.type.code === CoreEnums.GBD.DocTypes.VNZ) ??
3432
+ filteredDocuments.find(i => i.type.code === CoreEnums.GBD.DocTypes.PS);
3432
3433
  if (validDocument) {
3433
3434
  const documentType = this.documentTypes.find(
3434
3435
  (i: Value) => i.ids === Object.keys(CoreEnums.GBD.DocTypes)[Object.values(CoreEnums.GBD.DocTypes).indexOf(validDocument.type.code)],
@@ -3497,7 +3498,6 @@ export const useDataStore = defineStore('data', {
3497
3498
  'clientData.authoritedPerson.economySectorCode',
3498
3499
  'clientData.authoritedPerson.legalAddress',
3499
3500
  'clientData.authoritedPerson.placeOfBirth',
3500
- 'clientData.authoritedPerson.resident',
3501
3501
  'clientData.authoritedPerson.taxResidentCountry',
3502
3502
  'clientData.authoritedPerson.addTaxResidency',
3503
3503
  ]);
@@ -3814,6 +3814,37 @@ export const useDataStore = defineStore('data', {
3814
3814
 
3815
3815
  return true;
3816
3816
  },
3817
+ async onlineAccess(iin: string, documentType: string) {
3818
+ try {
3819
+ const data = {
3820
+ userName: this.user.code,
3821
+ branchName: this.user.branchCode,
3822
+ iin: iin.replaceAll('-', ''),
3823
+ documentType: documentType,
3824
+ };
3825
+ await this.api.integration.onlineAccess(data);
3826
+ return true;
3827
+ } catch (err) {
3828
+ ErrorHandler(err);
3829
+ return null;
3830
+ }
3831
+ },
3832
+ async digitalDocuments(iin: string, processInstanceId: string, code: string) {
3833
+ try {
3834
+ const data = {
3835
+ userName: this.user.code,
3836
+ branchName: this.user.branchCode,
3837
+ iin: iin.replaceAll('-', ''),
3838
+ processInstanceId: processInstanceId,
3839
+ code: code.replace(/\s/g, ''),
3840
+ };
3841
+ await this.api.integration.digitalDocuments(data);
3842
+ return true;
3843
+ } catch (err) {
3844
+ ErrorHandler(err);
3845
+ return null;
3846
+ }
3847
+ },
3817
3848
  async getVariableData(processCode: number) {
3818
3849
  try {
3819
3850
  const response = await this.api.getVariableData(0, processCode);
@@ -3875,7 +3906,7 @@ export const useDataStore = defineStore('data', {
3875
3906
  }
3876
3907
  },
3877
3908
  hasBirthSection(whichForm: keyof typeof StoreMembers) {
3878
- if (this.isGons || this.isPension) return false;
3909
+ if (this.isPension) return false;
3879
3910
  switch (whichForm) {
3880
3911
  case this.formStore.beneficiaryFormKey:
3881
3912
  return false;
@@ -3967,7 +3998,8 @@ export const useDataStore = defineStore('data', {
3967
3998
  this.isDsuio() ||
3968
3999
  this.isAdjuster() ||
3969
4000
  this.isDsoDirector() ||
3970
- this.isAccountantDirector(),
4001
+ this.isAccountantDirector() ||
4002
+ this.isHeadAdjuster(),
3971
4003
  };
3972
4004
  },
3973
4005
  },
package/types/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Value } from '../composables/classes';
2
+ import type { IDocument } from '../composables/classes';
2
3
  import type { RouteLocationNormalizedLoaded, RouteLocationNormalized } from 'vue-router';
3
4
  import type { AxiosRequestConfig } from 'axios';
4
5
  import { Methods, CoreEnums, Actions, Statuses } from './enum';
@@ -724,6 +725,12 @@ export type SignedState = {
724
725
  code: string;
725
726
  };
726
727
 
728
+ export namespace Base {
729
+ export namespace Document {
730
+ export type Digital = { iin: string; longName: string; digitalDocument: IDocument | null };
731
+ }
732
+ }
733
+
727
734
  export namespace Utils {
728
735
  export type ProjectConfig = {
729
736
  version: string;