hl-core 0.0.10-beta.75 → 0.0.10-beta.77
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 +10 -0
- package/components/Pages/Documents.vue +215 -12
- package/components/Pages/ProductConditions.vue +16 -4
- package/composables/index.ts +84 -21
- package/package.json +2 -2
- package/store/data.store.ts +8 -2
- package/store/form.store.ts +1 -1
- package/store/member.store.ts +3 -1
- package/types/enum.ts +2 -0
package/api/base.api.ts
CHANGED
|
@@ -17,6 +17,7 @@ export class ApiClass {
|
|
|
17
17
|
method: Methods.GET,
|
|
18
18
|
baseURL: getStrValuePerEnv('gatewayApiUrl'),
|
|
19
19
|
url: `/application/front/${import.meta.env.VITE_PARENT_PRODUCT === 'auletti' ? `auletti-${import.meta.env.VITE_PRODUCT}` : import.meta.env.VITE_PRODUCT}`,
|
|
20
|
+
params: { silent: true },
|
|
20
21
|
});
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -993,6 +994,15 @@ export class ApiClass {
|
|
|
993
994
|
});
|
|
994
995
|
}
|
|
995
996
|
|
|
997
|
+
async generateDocDocument(data: any) {
|
|
998
|
+
return await this.axiosCall<any>({
|
|
999
|
+
method: Methods.POST,
|
|
1000
|
+
url: `/Arm/api/Bpm/generateDocDocument`,
|
|
1001
|
+
data: data,
|
|
1002
|
+
responseType: 'arraybuffer',
|
|
1003
|
+
});
|
|
1004
|
+
}
|
|
1005
|
+
|
|
996
1006
|
async getVariableData(type: number, processCode: number) {
|
|
997
1007
|
return await this.axiosCall<any>({
|
|
998
1008
|
method: Methods.GET,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section :class="[$styles.scrollPage]">
|
|
3
|
+
<section v-if="isSupportAttachmentSection" class="w-full px-[10px] pt-[14px]">
|
|
4
|
+
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Открыть панель вложения для Техподдержки" size="sm" @click="openSupportAttachPanel" />
|
|
5
|
+
</section>
|
|
3
6
|
<base-form-section v-if="isUnderwriterDocuments" title="Загрузить документы для Андеррайтинга" class="mx-[10px] mt-[14px]">
|
|
4
7
|
<base-file-input :readonly="isDisabled || documentLoading" @input.prevent="onUnderFiles($event)" @onClear="onClearUnderFiles()" />
|
|
5
8
|
<base-animation>
|
|
@@ -29,7 +32,13 @@
|
|
|
29
32
|
<i
|
|
30
33
|
class="transition-all cursor-pointer mdi mdi-tray-arrow-down pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
|
|
31
34
|
:class="[$styles.greenTextHover]"
|
|
32
|
-
@click="
|
|
35
|
+
@click="
|
|
36
|
+
openDownloadFormatPanel(
|
|
37
|
+
processCode === 19 ? 'PA_Statement' : processCode === 25 ? 'PAJ_Statement' : 'PA_RefundStatement',
|
|
38
|
+
'37',
|
|
39
|
+
`Заявления на ${processCode === 19 || processCode === 25 ? 'страхование' : 'возврат'}`,
|
|
40
|
+
)
|
|
41
|
+
"
|
|
33
42
|
></i>
|
|
34
43
|
</div>
|
|
35
44
|
</base-content-block>
|
|
@@ -40,7 +49,13 @@
|
|
|
40
49
|
<i
|
|
41
50
|
class="transition-all cursor-pointer mdi mdi-tray-arrow-down pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
|
|
42
51
|
:class="[$styles.greenTextHover]"
|
|
43
|
-
@click="
|
|
52
|
+
@click="
|
|
53
|
+
openDownloadFormatPanel(
|
|
54
|
+
processCode === 19 ? 'PA_Contract' : processCode === 25 ? 'PAJ_Contract' : 'PA_RefundAgreement',
|
|
55
|
+
'38',
|
|
56
|
+
`Договор ${processCode === 19 || processCode === 25 ? 'страхования' : 'возврата'}`,
|
|
57
|
+
)
|
|
58
|
+
"
|
|
44
59
|
></i>
|
|
45
60
|
</div>
|
|
46
61
|
</base-content-block>
|
|
@@ -51,7 +66,7 @@
|
|
|
51
66
|
<i
|
|
52
67
|
class="transition-all cursor-pointer mdi mdi-tray-arrow-down pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
|
|
53
68
|
:class="[$styles.greenTextHover]"
|
|
54
|
-
@click="
|
|
69
|
+
@click="openDownloadFormatPanel('Compliance_FinMonitoring', '39', $appContextStore.t('pension.complianceFinMonitoring'))"
|
|
55
70
|
></i>
|
|
56
71
|
</div>
|
|
57
72
|
</base-content-block>
|
|
@@ -62,7 +77,7 @@
|
|
|
62
77
|
<i
|
|
63
78
|
class="transition-all cursor-pointer mdi mdi-tray-arrow-down pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
|
|
64
79
|
:class="[$styles.greenTextHover]"
|
|
65
|
-
@click="
|
|
80
|
+
@click="openDownloadFormatPanel('PA_Dossier', '40', $appContextStore.t('pension.dossierPA'))"
|
|
66
81
|
></i>
|
|
67
82
|
</div>
|
|
68
83
|
</base-content-block>
|
|
@@ -241,13 +256,55 @@
|
|
|
241
256
|
@click="getDoc('view')"
|
|
242
257
|
/>
|
|
243
258
|
</base-animation>
|
|
244
|
-
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="getDoc('download')" />
|
|
259
|
+
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="getDoc('download', $dataStore.isSupport() ? downloadType : undefined)" />
|
|
245
260
|
<base-animation>
|
|
246
261
|
<base-btn v-if="canDeleteFiles" :disabled="documentLoading" :loading="documentLoading" text="Удалить" @click="deletionDialog = true" />
|
|
247
262
|
</base-animation>
|
|
248
263
|
</div>
|
|
249
264
|
</base-fade-transition>
|
|
250
265
|
</Teleport>
|
|
266
|
+
<Teleport v-if="isSupportAttachOpen" to="#right-panel-actions">
|
|
267
|
+
<base-fade-transition>
|
|
268
|
+
<div :class="[$styles.flexColNav]">
|
|
269
|
+
<base-form-section class="!mt-0">
|
|
270
|
+
<div class="flex flex-col gap-2">
|
|
271
|
+
<base-rounded-input v-model="supportTypeSearch" :label="$appContextStore.t('labels.search')" class="w-full" :hide-details="true" />
|
|
272
|
+
<div class="px-1 text-xs" :class="[$styles.mutedText]">Найдено: {{ filteredSupportFileTypeItems.length }}</div>
|
|
273
|
+
<div class="w-full flex flex-col gap-2 p-2 max-h-[220px] overflow-y-auto" :class="[$styles.blueBgLight, $styles.rounded]">
|
|
274
|
+
<base-panel-select-item :text="$appContextStore.t('form.notChosen')" :selected="supportSelectedFileTypeCode === null" @click="pickSupportFileType(null)" />
|
|
275
|
+
<base-panel-select-item
|
|
276
|
+
v-for="item in filteredSupportFileTypeItems"
|
|
277
|
+
:key="item.value"
|
|
278
|
+
:text="String(item.title)"
|
|
279
|
+
:selected="item.value === supportSelectedFileTypeCode"
|
|
280
|
+
@click="pickSupportFileType(item.value)"
|
|
281
|
+
/>
|
|
282
|
+
<div v-if="supportTypeSearch && filteredSupportFileTypeItems.length === 0" class="px-2 py-1 text-sm" :class="[$styles.mutedText]">Ничего не найдено</div>
|
|
283
|
+
</div>
|
|
284
|
+
<base-file-input :readonly="documentLoading" @input.prevent="onSupportFiles($event)" @onClear="onClearSupportFiles()" />
|
|
285
|
+
<base-animation>
|
|
286
|
+
<base-btn
|
|
287
|
+
:disabled="!supportSelectedFileTypeCode || !supportDocumentsList.length || documentLoading"
|
|
288
|
+
:loading="documentLoading"
|
|
289
|
+
text="Вложить"
|
|
290
|
+
size="sm"
|
|
291
|
+
@click="uploadSupportFiles"
|
|
292
|
+
/>
|
|
293
|
+
</base-animation>
|
|
294
|
+
</div>
|
|
295
|
+
</base-form-section>
|
|
296
|
+
</div>
|
|
297
|
+
</base-fade-transition>
|
|
298
|
+
</Teleport>
|
|
299
|
+
<Teleport v-if="isDownloadFormatOpen" to="#right-panel-actions">
|
|
300
|
+
<base-fade-transition>
|
|
301
|
+
<div :class="[$styles.flexColNav]">
|
|
302
|
+
<div class="px-2 py-2 text-sm" :class="[$styles.mutedText]">{{ downloadingDocData.docName }}</div>
|
|
303
|
+
<base-btn text="PDF" @click="downloadFile('pdf')" />
|
|
304
|
+
<base-btn text="DOCX" @click="downloadFile('docx')" />
|
|
305
|
+
</div>
|
|
306
|
+
</base-fade-transition>
|
|
307
|
+
</Teleport>
|
|
251
308
|
<Teleport v-if="isDigitalDocOpen" to="#right-panel-actions">
|
|
252
309
|
<div :class="[$styles.flexColNav]">
|
|
253
310
|
<base-form-section class="!mt-0">
|
|
@@ -323,6 +380,7 @@ export default defineComponent({
|
|
|
323
380
|
const deletionDialog = ref<boolean>(false);
|
|
324
381
|
const isPanelOpen = ref<boolean>(false);
|
|
325
382
|
const isDigitalDocOpen = ref<boolean>(false);
|
|
383
|
+
const isSupportAttachOpen = ref<boolean>(false);
|
|
326
384
|
const isDisabled = computed(() => !dataStore.isTask());
|
|
327
385
|
const contractDict = computed(() => dictionariesStore.dicFileTypeList.find(i => i.nameRu === 'Договор страхования' || i.nameRu === 'Договор'));
|
|
328
386
|
const processCode = formStore.applicationData.processCode;
|
|
@@ -339,9 +397,29 @@ export default defineComponent({
|
|
|
339
397
|
const isDigitalDocDisabled = computed(
|
|
340
398
|
() => !dataStore.isTask() || route.params.taskId === '0' || !dataStore.isInitiator() || !dataStore.isProcessEditable(formStore.applicationData.statusCode),
|
|
341
399
|
);
|
|
400
|
+
const isSupportAttachmentSection = computed(() => dataStore.isSupport() && route.params.taskId !== '0' && !!formStore.applicationData.processInstanceId);
|
|
342
401
|
const documentType = ref<DigitalDocNames | null>(null);
|
|
343
402
|
const otpCode = ref<string>('');
|
|
344
403
|
const currentIin = ref<string>('');
|
|
404
|
+
const downloadType = ref<'pdf' | 'docx'>('pdf');
|
|
405
|
+
const downloadTypes: Array<{ title: string; value: 'pdf' | 'docx' }> = [
|
|
406
|
+
{ title: 'PDF', value: 'pdf' },
|
|
407
|
+
{ title: 'DOCX', value: 'docx' },
|
|
408
|
+
];
|
|
409
|
+
const supportSelectedFileTypeCode = ref<string | null>(null);
|
|
410
|
+
const supportTypeSearch = ref<string>('');
|
|
411
|
+
const supportDocumentsList = ref<File[]>([]);
|
|
412
|
+
const supportFileTypeItems = computed(() =>
|
|
413
|
+
dictionariesStore.dicFileTypeList.map(i => ({
|
|
414
|
+
title: i.nameRu || i.nameKz || String(i.code),
|
|
415
|
+
value: String(i.code),
|
|
416
|
+
})),
|
|
417
|
+
);
|
|
418
|
+
const filteredSupportFileTypeItems = computed(() => {
|
|
419
|
+
const query = supportTypeSearch.value.trim().toLowerCase();
|
|
420
|
+
if (!query) return supportFileTypeItems.value;
|
|
421
|
+
return supportFileTypeItems.value.filter(i => i.title.toLowerCase().includes(query) || i.value.toLowerCase().includes(query));
|
|
422
|
+
});
|
|
345
423
|
const deleteFilesId = ['1', '2', '3', '4', '46'];
|
|
346
424
|
const documentItems: Array<{ title: DigitalDocNames; value: DigitalDocTypes }> = [
|
|
347
425
|
{ title: 'Удостоверение личности', value: 'IdentityCard' },
|
|
@@ -374,6 +452,8 @@ export default defineComponent({
|
|
|
374
452
|
processInstanceId: string;
|
|
375
453
|
}[]
|
|
376
454
|
>([]);
|
|
455
|
+
const isDownloadFormatOpen = ref<boolean>(false);
|
|
456
|
+
const downloadingDocData = ref<{ docType: string; fileCode: string; docName: string }>({ docType: '', fileCode: '', docName: '' });
|
|
377
457
|
|
|
378
458
|
const object_list = computed(() => Object.values(formStore.signedDocumentList));
|
|
379
459
|
const unSignedList = computed(() => document_list.value.filter((doc: DocumentItem) => doc.signed === false || doc.signed === null));
|
|
@@ -405,6 +485,7 @@ export default defineComponent({
|
|
|
405
485
|
(formStore.applicationData.statusCode === 'StartForm' || formStore.applicationData.statusCode === 'EditForm'),
|
|
406
486
|
);
|
|
407
487
|
const canDeleteFiles = computed(() => {
|
|
488
|
+
if (dataStore.isSupport()) return true;
|
|
408
489
|
const baseCondition = dataStore.isTask() && dataStore.isInitiator() && dataStore.isProcessEditable(formStore.applicationData.statusCode);
|
|
409
490
|
if (
|
|
410
491
|
appContextStore.isBaiterek ||
|
|
@@ -439,12 +520,120 @@ export default defineComponent({
|
|
|
439
520
|
const openPanel = async (document: DocumentItem) => {
|
|
440
521
|
dataStore.rightPanel.title = document.fileTypeName!;
|
|
441
522
|
currentDocument.value = document;
|
|
523
|
+
const extension = String(document.fileName ?? '')
|
|
524
|
+
.split('.')
|
|
525
|
+
.pop()
|
|
526
|
+
?.toLowerCase();
|
|
527
|
+
downloadType.value = extension === 'docx' ? 'docx' : 'pdf';
|
|
442
528
|
dataStore.rightPanel.open = true;
|
|
529
|
+
isDownloadFormatOpen.value = false;
|
|
530
|
+
isSupportAttachOpen.value = false;
|
|
443
531
|
isDigitalDocOpen.value = false;
|
|
444
532
|
isPanelOpen.value = true;
|
|
445
533
|
dataStore.panelAction = null;
|
|
446
534
|
};
|
|
447
535
|
|
|
536
|
+
const openSupportAttachPanel = () => {
|
|
537
|
+
dataStore.panelAction = null;
|
|
538
|
+
dataStore.rightPanel.title = 'Вложение документов';
|
|
539
|
+
dataStore.rightPanel.open = true;
|
|
540
|
+
isPanelOpen.value = false;
|
|
541
|
+
isDigitalDocOpen.value = false;
|
|
542
|
+
isDownloadFormatOpen.value = false;
|
|
543
|
+
isSupportAttachOpen.value = true;
|
|
544
|
+
supportTypeSearch.value = '';
|
|
545
|
+
supportSelectedFileTypeCode.value = null;
|
|
546
|
+
supportDocumentsList.value = [];
|
|
547
|
+
};
|
|
548
|
+
|
|
549
|
+
const openDownloadFormatPanel = (docType: string, fileCode: string, docName: string) => {
|
|
550
|
+
downloadingDocData.value = { docType, fileCode, docName };
|
|
551
|
+
dataStore.panelAction = null;
|
|
552
|
+
dataStore.rightPanel.title = 'Выберите формат';
|
|
553
|
+
dataStore.rightPanel.open = true;
|
|
554
|
+
isPanelOpen.value = false;
|
|
555
|
+
isDigitalDocOpen.value = false;
|
|
556
|
+
isSupportAttachOpen.value = false;
|
|
557
|
+
isDownloadFormatOpen.value = true;
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
const downloadFile = (format: 'pdf' | 'docx') => {
|
|
561
|
+
const { docType, fileCode } = downloadingDocData.value;
|
|
562
|
+
dataStore.generatePDFDocument(docType, fileCode, format);
|
|
563
|
+
isDownloadFormatOpen.value = false;
|
|
564
|
+
dataStore.rightPanel.open = false;
|
|
565
|
+
};
|
|
566
|
+
|
|
567
|
+
const onSupportFiles = (event: InputEvent) => {
|
|
568
|
+
if (!(event.target || event.dataTransfer)) return;
|
|
569
|
+
const files = event.target ? (event.target as HTMLInputElement).files : (event.dataTransfer as DataTransfer).files;
|
|
570
|
+
if (files !== null) {
|
|
571
|
+
supportDocumentsList.value = Object.values(files);
|
|
572
|
+
}
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
const onClearSupportFiles = () => {
|
|
576
|
+
supportDocumentsList.value = [];
|
|
577
|
+
};
|
|
578
|
+
|
|
579
|
+
const pickSupportFileType = (code: string | null) => {
|
|
580
|
+
supportSelectedFileTypeCode.value = code;
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
const uploadSupportFiles = async () => {
|
|
584
|
+
if (!supportSelectedFileTypeCode.value) {
|
|
585
|
+
showToaster('error', appContextStore.t('toaster.chooseDocumentType') || 'Выберите тип документа', 3000);
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
if (!supportDocumentsList.value.length) {
|
|
589
|
+
showToaster('error', appContextStore.t('toaster.noFileSelected') || 'Выберите файл', 3000);
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
const selectedDocument = dictionariesStore.dicFileTypeList.find((i: Value) => String(i.code) === supportSelectedFileTypeCode.value);
|
|
593
|
+
if (!selectedDocument) {
|
|
594
|
+
showToaster('error', appContextStore.t('toaster.chooseDocumentType') || 'Выберите тип документа', 3000);
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
documentLoading.value = true;
|
|
599
|
+
try {
|
|
600
|
+
await Promise.allSettled(
|
|
601
|
+
supportDocumentsList.value.map(async file => {
|
|
602
|
+
if (file.type !== constants.fileTypes.pdf && file.type !== constants.fileTypes.docx && file.type !== constants.fileTypes.doc) {
|
|
603
|
+
showToaster('error', appContextStore.t('toaster.onlyWithFormat', { format: 'PDF, Word' }), 6000);
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
if (file.size >= 20_000_000) {
|
|
607
|
+
showToaster('error', appContextStore.t('toaster.fileOnlyBelow20mb'), 6000);
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
const formData = new FormData();
|
|
612
|
+
const ext = file.name.substring(file.name.lastIndexOf('.'));
|
|
613
|
+
const uuidV4 = uuid.v4();
|
|
614
|
+
formData.append('file', file);
|
|
615
|
+
formData.append(
|
|
616
|
+
'fileData',
|
|
617
|
+
JSON.stringify([
|
|
618
|
+
{
|
|
619
|
+
identifier: `${uuidV4}${ext}`,
|
|
620
|
+
processInstanceId: formStore.applicationData.processInstanceId,
|
|
621
|
+
fileTypeCode: selectedDocument.code,
|
|
622
|
+
fileTypeId: selectedDocument.id,
|
|
623
|
+
fileName: file.name,
|
|
624
|
+
},
|
|
625
|
+
]),
|
|
626
|
+
);
|
|
627
|
+
await formStore.uploadFiles(formData, false);
|
|
628
|
+
}),
|
|
629
|
+
);
|
|
630
|
+
onClearSupportFiles();
|
|
631
|
+
await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
|
|
632
|
+
} finally {
|
|
633
|
+
documentLoading.value = false;
|
|
634
|
+
}
|
|
635
|
+
};
|
|
636
|
+
|
|
448
637
|
const onFileChange = async (event: InputEvent) => {
|
|
449
638
|
if (event.target) {
|
|
450
639
|
const files = (event.target as HTMLInputElement).files;
|
|
@@ -509,6 +698,7 @@ export default defineComponent({
|
|
|
509
698
|
|
|
510
699
|
const openDigitalDocPanel = async (iin: string, title: string) => {
|
|
511
700
|
isPanelOpen.value = false;
|
|
701
|
+
isSupportAttachOpen.value = false;
|
|
512
702
|
isDigitalDocOpen.value = true;
|
|
513
703
|
dataStore.panelAction = null;
|
|
514
704
|
dataStore.rightPanel.open = true;
|
|
@@ -534,10 +724,10 @@ export default defineComponent({
|
|
|
534
724
|
},
|
|
535
725
|
);
|
|
536
726
|
|
|
537
|
-
const getDoc = async (type: FileActions) => {
|
|
727
|
+
const getDoc = async (type: FileActions, selectedType?: 'pdf' | 'docx') => {
|
|
538
728
|
if (currentDocument.value) {
|
|
539
729
|
documentLoading.value = true;
|
|
540
|
-
const fileExtension = currentDocument.value.fileName
|
|
730
|
+
const fileExtension = selectedType || currentDocument.value.fileName?.match(/\.([0-9a-z]+)(?:[\?#]|$)/i)?.[1]?.toLowerCase() || 'pdf';
|
|
541
731
|
await formStore.getDoc(currentDocument.value, type, fileExtension);
|
|
542
732
|
documentLoading.value = false;
|
|
543
733
|
}
|
|
@@ -712,8 +902,13 @@ export default defineComponent({
|
|
|
712
902
|
memberStore,
|
|
713
903
|
processCode,
|
|
714
904
|
isPanelOpen,
|
|
905
|
+
isSupportAttachOpen,
|
|
906
|
+
isDownloadFormatOpen,
|
|
907
|
+
downloadingDocData,
|
|
715
908
|
jointMembers,
|
|
716
909
|
DocumentItem,
|
|
910
|
+
downloadType,
|
|
911
|
+
downloadTypes,
|
|
717
912
|
documentType,
|
|
718
913
|
documentItems,
|
|
719
914
|
signedContract,
|
|
@@ -722,6 +917,11 @@ export default defineComponent({
|
|
|
722
917
|
documentLoading,
|
|
723
918
|
isDigitalDocOpen,
|
|
724
919
|
underDocumentsList,
|
|
920
|
+
supportDocumentsList,
|
|
921
|
+
supportTypeSearch,
|
|
922
|
+
supportFileTypeItems,
|
|
923
|
+
filteredSupportFileTypeItems,
|
|
924
|
+
supportSelectedFileTypeCode,
|
|
725
925
|
|
|
726
926
|
// Computed
|
|
727
927
|
isDisabled,
|
|
@@ -729,6 +929,7 @@ export default defineComponent({
|
|
|
729
929
|
showContract,
|
|
730
930
|
noDocuments,
|
|
731
931
|
canDeleteFiles,
|
|
932
|
+
isSupportAttachmentSection,
|
|
732
933
|
insuredFiltered,
|
|
733
934
|
policyholderForm,
|
|
734
935
|
slaveInsuredForm,
|
|
@@ -742,26 +943,28 @@ export default defineComponent({
|
|
|
742
943
|
getCode,
|
|
743
944
|
getDoc,
|
|
744
945
|
openPanel,
|
|
946
|
+
openSupportAttachPanel,
|
|
947
|
+
openDownloadFormatPanel,
|
|
948
|
+
downloadFile,
|
|
745
949
|
deleteFile,
|
|
746
950
|
getDigitalDocument,
|
|
747
951
|
onFileChange,
|
|
748
952
|
onUnderFiles,
|
|
953
|
+
onSupportFiles,
|
|
749
954
|
openDigitalDocPanel,
|
|
750
955
|
uploadUnderFiles,
|
|
751
956
|
onClearUnderFiles,
|
|
957
|
+
onClearSupportFiles,
|
|
958
|
+
uploadSupportFiles,
|
|
752
959
|
uploadAdditionalFile,
|
|
753
960
|
memberHasDocumentsToSign,
|
|
961
|
+
pickSupportFileType,
|
|
754
962
|
};
|
|
755
963
|
},
|
|
756
964
|
});
|
|
757
965
|
</script>
|
|
758
966
|
|
|
759
967
|
<style>
|
|
760
|
-
.document-type-select .v-field {
|
|
761
|
-
border: none !important;
|
|
762
|
-
border-radius: 4px;
|
|
763
|
-
height: 56px;
|
|
764
|
-
}
|
|
765
968
|
.digital-document-otp .base-otp-input .v-otp-input__content {
|
|
766
969
|
gap: 8px;
|
|
767
970
|
padding-right: 0px !important;
|
|
@@ -1914,6 +1914,12 @@ export default defineComponent({
|
|
|
1914
1914
|
// if (key === 'paymentPeriod') return list.filter(i => i.code !== 'single');
|
|
1915
1915
|
// }
|
|
1916
1916
|
// }
|
|
1917
|
+
|
|
1918
|
+
//Временная заглушка для АО «СК «НОМАД ИНШУРАНС» (ids: 3334729354)
|
|
1919
|
+
if (whichProduct.value === 'pensionannuitynew') {
|
|
1920
|
+
const hiddenCompanyId = '3334729354';
|
|
1921
|
+
return list.filter(item => item.ids !== hiddenCompanyId);
|
|
1922
|
+
}
|
|
1917
1923
|
return list;
|
|
1918
1924
|
};
|
|
1919
1925
|
|
|
@@ -2170,8 +2176,8 @@ export default defineComponent({
|
|
|
2170
2176
|
transferContractCompanyId:
|
|
2171
2177
|
i.transferContractCompany && typeof i.transferContractCompany !== 'string' && 'ids' in i.transferContractCompany
|
|
2172
2178
|
? i.transferContractCompany.ids
|
|
2173
|
-
// @ts-ignore
|
|
2174
|
-
|
|
2179
|
+
: // @ts-ignore
|
|
2180
|
+
i.transferContractCompanyId,
|
|
2175
2181
|
id: i.id ?? null,
|
|
2176
2182
|
transferContractAmount: String(i.transferContractAmount).replace(/\s/g, ''),
|
|
2177
2183
|
transferContractNumber: getFullGlobalId(i),
|
|
@@ -2291,7 +2297,10 @@ export default defineComponent({
|
|
|
2291
2297
|
voluntaryContractAmount: formatSpacedNumber(formStore.pensionApp?.voluntaryContractAmount),
|
|
2292
2298
|
ownFundsRaisAmount: formatSpacedNumber(formStore.pensionApp?.ownFundsRaisAmount),
|
|
2293
2299
|
compulsoryProfContractAmount: formatSpacedNumber(formStore.pensionApp?.compulsoryProfContractAmount),
|
|
2294
|
-
compulsoryProfMonthCount: syncNullableNumberPair(
|
|
2300
|
+
compulsoryProfMonthCount: syncNullableNumberPair(
|
|
2301
|
+
formatSpacedNumber(formStore.pensionApp?.compulsoryProfContractAmount),
|
|
2302
|
+
formStore.pensionApp?.compulsoryProfMonthCount,
|
|
2303
|
+
),
|
|
2295
2304
|
transferContractAmount: formatSpacedNumber(formStore.pensionApp?.transferContractAmount),
|
|
2296
2305
|
transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
|
|
2297
2306
|
}
|
|
@@ -2307,7 +2316,10 @@ export default defineComponent({
|
|
|
2307
2316
|
voluntaryContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.voluntaryContractAmount),
|
|
2308
2317
|
ownFundsRaisAmount: formatSpacedNumber(formStore.pensionApp?.slave?.ownFundsRaisAmount),
|
|
2309
2318
|
compulsoryProfContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.compulsoryProfContractAmount),
|
|
2310
|
-
compulsoryProfMonthCount: syncNullableNumberPair(
|
|
2319
|
+
compulsoryProfMonthCount: syncNullableNumberPair(
|
|
2320
|
+
formatSpacedNumber(formStore.pensionApp?.slave?.compulsoryProfContractAmount),
|
|
2321
|
+
formStore.pensionApp?.slave?.compulsoryProfMonthCount,
|
|
2322
|
+
),
|
|
2311
2323
|
transferContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.transferContractAmount),
|
|
2312
2324
|
transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
|
|
2313
2325
|
}
|
package/composables/index.ts
CHANGED
|
@@ -22,7 +22,6 @@ const SW_UPDATE_AT_KEY = 'pwa_sw_update_at';
|
|
|
22
22
|
const SW_UPDATE_TTL_MS = 10 * 60 * 1000; // 10 минут
|
|
23
23
|
|
|
24
24
|
export async function ensureFreshPwa() {
|
|
25
|
-
console.log('ensuring pwa');
|
|
26
25
|
const { $pwa } = useNuxtApp();
|
|
27
26
|
const dataStore = useDataStore();
|
|
28
27
|
// 1) Один раз грузим конфиг
|
|
@@ -319,23 +318,95 @@ export const ESBDMessage = (ESBDObject: any, initialPoint: any) => {
|
|
|
319
318
|
};
|
|
320
319
|
|
|
321
320
|
export const ErrorHandler = (err: unknown, errorText?: string) => {
|
|
322
|
-
console.
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
if (typeof err === 'string')
|
|
321
|
+
console.error('[ErrorHandler]', err);
|
|
322
|
+
|
|
323
|
+
try {
|
|
324
|
+
if (typeof err === 'string') {
|
|
325
|
+
showToaster('error', err, 6000);
|
|
326
|
+
return false;
|
|
327
|
+
}
|
|
328
|
+
|
|
326
329
|
if (err instanceof AxiosError) {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
330
|
+
const response = err.response;
|
|
331
|
+
if (!response) {
|
|
332
|
+
const message =
|
|
333
|
+
err.code === 'ECONNABORTED'
|
|
334
|
+
? 'Время ожидания истекло'
|
|
335
|
+
: err.code === 'ENOTFOUND'
|
|
336
|
+
? 'Сервер недоступен'
|
|
337
|
+
: err.code === 'ERR_NETWORK'
|
|
338
|
+
? 'Ошибка сети'
|
|
339
|
+
: errorText || err.message || 'Произошла ошибка при выполнении запроса';
|
|
340
|
+
showToaster('error', message, 6000);
|
|
341
|
+
return false;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
const responseData = response.data as unknown;
|
|
345
|
+
|
|
346
|
+
if (responseData instanceof ArrayBuffer) {
|
|
347
|
+
const decoded = new TextDecoder('utf-8').decode(new Uint8Array(responseData)).trim();
|
|
348
|
+
showToaster('error', decoded || errorText || `Ошибка: ${response.status} ${response.statusText}`, 10000);
|
|
349
|
+
return false;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
if (typeof responseData === 'string') {
|
|
353
|
+
showToaster('error', responseData || errorText || `Ошибка: ${response.status} ${response.statusText}`, 10000);
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
if (
|
|
358
|
+
typeof responseData === 'object' &&
|
|
359
|
+
responseData !== null &&
|
|
360
|
+
'errors' in responseData &&
|
|
361
|
+
'title' in responseData &&
|
|
362
|
+
'traceId' in responseData &&
|
|
363
|
+
typeof (responseData as { errors?: unknown }).errors === 'object'
|
|
364
|
+
) {
|
|
365
|
+
Object.entries((responseData as { errors: Record<string, unknown> }).errors).forEach(([field, errors]) => {
|
|
366
|
+
const errorMessage = Array.isArray(errors) ? errors.join(', ') : String(errors);
|
|
367
|
+
showToaster('error', `Поле: ${field}. Ошибка: ${errorMessage}`, 10000);
|
|
368
|
+
});
|
|
369
|
+
return false;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
if (typeof responseData === 'object' && responseData !== null && 'message' in responseData) {
|
|
373
|
+
const message = String((responseData as { message?: unknown }).message || '').trim();
|
|
374
|
+
if (message) {
|
|
375
|
+
showToaster('error', message, 6000);
|
|
376
|
+
return false;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
if (
|
|
381
|
+
typeof responseData === 'object' &&
|
|
382
|
+
responseData !== null &&
|
|
383
|
+
'error' in responseData &&
|
|
384
|
+
typeof (responseData as { error?: unknown }).error === 'object' &&
|
|
385
|
+
(responseData as { error?: unknown }).error !== null
|
|
386
|
+
) {
|
|
387
|
+
const error = (responseData as { error: { message?: unknown } }).error;
|
|
388
|
+
if ('message' in error && typeof error.message === 'string') {
|
|
389
|
+
showToaster('error', error.message, 6000);
|
|
390
|
+
return false;
|
|
334
391
|
}
|
|
335
392
|
}
|
|
393
|
+
|
|
394
|
+
showToaster('error', errorText || `Ошибка: ${response.status} ${response.statusText}`, 6000);
|
|
395
|
+
return false;
|
|
336
396
|
}
|
|
397
|
+
|
|
398
|
+
if (err instanceof Error) {
|
|
399
|
+
showToaster('error', errorText || err.message, 6000);
|
|
400
|
+
return false;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
showToaster('error', errorText || 'Произошла неизвестная ошибка', 6000);
|
|
404
|
+
return false;
|
|
405
|
+
} catch (handlerErr) {
|
|
406
|
+
console.error('[ErrorHandler] Ошибка при обработке ошибки:', handlerErr);
|
|
407
|
+
showToaster('error', 'Ошибка при обработке запроса', 6000);
|
|
408
|
+
return false;
|
|
337
409
|
}
|
|
338
|
-
return false;
|
|
339
410
|
};
|
|
340
411
|
|
|
341
412
|
export const policyholderToBeneficialOwner = (isPolicyholderBeneficialOwner: boolean, policyholder?: PolicyholderClass) => {
|
|
@@ -1120,13 +1191,8 @@ export const redirectUtils = {
|
|
|
1120
1191
|
|
|
1121
1192
|
const excludedPaths = ['/Auth'];
|
|
1122
1193
|
|
|
1123
|
-
console.log('Saving redirect URL:', currentPath);
|
|
1124
|
-
|
|
1125
1194
|
if (!excludedPaths.some(path => currentPath.startsWith(path))) {
|
|
1126
1195
|
localStorage.setItem('redirect_url', currentPath);
|
|
1127
|
-
console.log('Redirect URL saved:', currentPath);
|
|
1128
|
-
} else {
|
|
1129
|
-
console.log('URL excluded from redirect:', currentPath);
|
|
1130
1196
|
}
|
|
1131
1197
|
},
|
|
1132
1198
|
|
|
@@ -1135,13 +1201,10 @@ export const redirectUtils = {
|
|
|
1135
1201
|
*/
|
|
1136
1202
|
getAndClearRedirectUrl(): string | null {
|
|
1137
1203
|
const redirectUrl = localStorage.getItem('redirect_url');
|
|
1138
|
-
console.log('Getting redirect URL:', redirectUrl);
|
|
1139
1204
|
if (redirectUrl) {
|
|
1140
1205
|
localStorage.removeItem('redirect_url');
|
|
1141
|
-
console.log('Redirect URL cleared and returned:', redirectUrl);
|
|
1142
1206
|
return redirectUrl;
|
|
1143
1207
|
}
|
|
1144
|
-
console.log('No redirect URL found');
|
|
1145
1208
|
return null;
|
|
1146
1209
|
},
|
|
1147
1210
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hl-core",
|
|
3
|
-
"version": "0.0.10-beta.
|
|
3
|
+
"version": "0.0.10-beta.77",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "nuxt.config.ts",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"vue-tsc": "1.8.27"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"hl-locales": "1.0.
|
|
50
|
+
"hl-locales": "1.0.19",
|
|
51
51
|
"@intlify/unplugin-vue-i18n": "2.0.0",
|
|
52
52
|
"@microsoft/signalr": "7.0.12",
|
|
53
53
|
"@nuxtjs/tailwindcss": "6.11.4",
|
package/store/data.store.ts
CHANGED
|
@@ -1078,7 +1078,7 @@ export const useDataStore = defineStore('data', {
|
|
|
1078
1078
|
}
|
|
1079
1079
|
this.isButtonsLoading = false;
|
|
1080
1080
|
},
|
|
1081
|
-
async generatePDFDocument(name: string, code: string, format: 'pdf' | '
|
|
1081
|
+
async generatePDFDocument(name: string, code: string, format: 'pdf' | 'docx' = 'pdf', open: boolean = false) {
|
|
1082
1082
|
const dictionariesStore = useDictionariesStore();
|
|
1083
1083
|
try {
|
|
1084
1084
|
this.isButtonsLoading = true;
|
|
@@ -1088,7 +1088,13 @@ export const useDataStore = defineStore('data', {
|
|
|
1088
1088
|
name: name,
|
|
1089
1089
|
format: format,
|
|
1090
1090
|
};
|
|
1091
|
-
|
|
1091
|
+
let response: any;
|
|
1092
|
+
if (format === 'pdf') {
|
|
1093
|
+
response = await this.api.generatePdfDocument(data);
|
|
1094
|
+
} else {
|
|
1095
|
+
response = await this.api.generateDocDocument(data);
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1092
1098
|
const blob = new Blob([response], {
|
|
1093
1099
|
type: format === 'pdf' ? `application/pdf` : `application/vnd.openxmlformats-officedocument.wordprocessingml.document`,
|
|
1094
1100
|
});
|
package/store/form.store.ts
CHANGED
|
@@ -72,7 +72,7 @@ export const useFormStore = defineStore('forms', {
|
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
} else {
|
|
75
|
-
await this.api.file.getDoc(file.id).then((response: any) => {
|
|
75
|
+
await this.api.file.getDoc(file.id).then((response: any) => {
|
|
76
76
|
if (!['pdf', 'docx'].includes(fileType)) {
|
|
77
77
|
const blob = new Blob([response], { type: `image/${fileType}` });
|
|
78
78
|
const url = window.URL.createObjectURL(blob);
|
package/store/member.store.ts
CHANGED
|
@@ -548,7 +548,9 @@ export const useMemberStore = defineStore('members', {
|
|
|
548
548
|
|
|
549
549
|
if ('documents' in user && user.documents && user.documents.length) {
|
|
550
550
|
member.documentsList = user.documents;
|
|
551
|
-
const filteredDocuments = user.documents.filter(i =>
|
|
551
|
+
const filteredDocuments = user.documents.filter(i => {
|
|
552
|
+
return i.expireDate ? new Date(i.expireDate) > new Date(Date.now()) : true;
|
|
553
|
+
});
|
|
552
554
|
if (filteredDocuments.length) {
|
|
553
555
|
const documentByPriority = filteredDocuments.find(i => {
|
|
554
556
|
if (this.appContextStore.isLifetrip && (whichForm !== this.formStore.policyholderFormKey || this.formStore.isPolicyholderInsured === true)) {
|
package/types/enum.ts
CHANGED
|
@@ -261,6 +261,7 @@ export namespace CoreEnums {
|
|
|
261
261
|
'PS' = '001',
|
|
262
262
|
'1UDL' = '002',
|
|
263
263
|
'VNZ' = '003',
|
|
264
|
+
'UDLBG' = '004',
|
|
264
265
|
}
|
|
265
266
|
}
|
|
266
267
|
export namespace Insis {
|
|
@@ -269,6 +270,7 @@ export namespace CoreEnums {
|
|
|
269
270
|
'1UDL' = '1UDL',
|
|
270
271
|
'VNZ' = 'VNZ',
|
|
271
272
|
'SBI' = 'SBI',
|
|
273
|
+
'UDLBG' = 'UDLBG',
|
|
272
274
|
}
|
|
273
275
|
}
|
|
274
276
|
export namespace Sign {
|