hl-core 0.0.10-beta.20 → 0.0.10-beta.22
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 +140 -134
- package/components/Dialog/Dialog.vue +5 -1
- package/components/Form/ManagerAttachment.vue +1 -4
- package/components/Input/RoundedSelect.vue +2 -0
- package/components/Pages/Anketa.vue +164 -166
- package/components/Pages/Documents.vue +1 -1
- package/components/Pages/MemberForm.vue +166 -28
- package/components/Pages/ProductConditions.vue +143 -72
- package/components/Panel/PanelHandler.vue +223 -104
- package/composables/classes.ts +28 -0
- package/composables/index.ts +10 -2
- package/composables/styles.ts +3 -8
- package/locales/ru.json +8 -2
- package/package.json +1 -1
- package/store/data.store.ts +110 -102
- package/types/enum.ts +12 -0
- package/types/index.ts +42 -0
|
@@ -29,74 +29,25 @@
|
|
|
29
29
|
</div>
|
|
30
30
|
</section>
|
|
31
31
|
<section v-if="chooseSignActions">
|
|
32
|
-
<div v-if="!isElectronicContract && !isPaperContract && !isScansDocuments && !isQr" :class="[$styles.flexColNav]">
|
|
32
|
+
<div v-if="!isElectronicContract && !isPaperContract && !isScansDocuments && !isQr && !formStore.signatories" :class="[$styles.flexColNav]">
|
|
33
33
|
<base-btn :text="$dataStore.t('buttons.sendOnPaper')" :disabled="isPaperDisabled" :loading="loading" @click="handleSignAction('paper')" />
|
|
34
34
|
<base-btn :text="$dataStore.t('buttons.sendElectronically')" :disabled="isElectronicDisabled" :loading="loading" @click="handleSignAction('electronic')" />
|
|
35
35
|
<base-btn :text="$dataStore.t('buttons.generatePrintedForms')" :disabled="isScansDisabled" :loading="loading" @click="handleSignAction('scans')" />
|
|
36
36
|
<base-btn v-if="!useEnv().isProduction" :text="$dataStore.t('buttons.sendEgovMob')" :disabled="isQrDisabled" :loading="loading" @click="handleSignAction('qr')" />
|
|
37
|
-
<base-btn
|
|
38
|
-
v-if="$dataStore.isPension"
|
|
39
|
-
:text="$dataStore.t('buttons.signWithSignature')"
|
|
40
|
-
:disabled="isSignatureDisabled"
|
|
41
|
-
:loading="loading"
|
|
42
|
-
@click="handleSignAction('signature')"
|
|
43
|
-
/>
|
|
44
|
-
<base-btn
|
|
45
|
-
v-if="$dataStore.isPension && !useEnv().isProduction"
|
|
46
|
-
:text="$dataStore.t('buttons.signWithSignatureXML')"
|
|
47
|
-
:disabled="isQrXmlDisabled"
|
|
48
|
-
:loading="loading"
|
|
49
|
-
@click="handleSignAction('qrXml')"
|
|
50
|
-
/>
|
|
51
37
|
</div>
|
|
52
38
|
<div v-if="isPaperContract" :class="[$styles.flexColNav]">
|
|
53
39
|
<base-btn :text="$dataStore.t('buttons.downloadContract')" :loading="$dataStore.isButtonsLoading" @click="generateDocument" />
|
|
54
40
|
</div>
|
|
55
41
|
<div v-if="isScansDocuments" :class="[$styles.flexColNav]">
|
|
56
|
-
<div v-if="
|
|
57
|
-
<div
|
|
58
|
-
<
|
|
59
|
-
<base-btn :text="$dataStore.t('buttons.downloadContract')" :loading="$dataStore.isButtonsLoading" @click="$dataStore.generatePDFDocument('PA_Contract', '38')" />
|
|
60
|
-
<base-form-section class="mt-4 flex flex-col !gap-2" :title="$dataStore.t('clients.attachScansSignDocs')">
|
|
61
|
-
<base-file-input :label="$dataStore.t('labels.attachContract')" @input.prevent="onFileChangeScans($event, 'pa_contract')" @onClear="onClearFile('pa_contract')" />
|
|
62
|
-
</base-form-section>
|
|
63
|
-
</div>
|
|
64
|
-
<div v-else class="flex flex-col gap-2">
|
|
65
|
-
<base-btn :text="$dataStore.t('buttons.downloadStatement')" :loading="$dataStore.isButtonsLoading" @click="$dataStore.generatePDFDocument('PA_Statement', '37')" />
|
|
66
|
-
<base-btn :text="$dataStore.t('buttons.downloadAgreement')" :loading="$dataStore.isButtonsLoading" @click="$dataStore.generatePDFDocument('Agreement', '19')" />
|
|
67
|
-
<base-form-section class="mt-4 flex flex-col !gap-2" :title="$dataStore.t('clients.attachScansSignDocs')">
|
|
68
|
-
<base-file-input :label="$dataStore.t('labels.attachStatement')" @input.prevent="onFileChangeScans($event, 'pa_statement')" @onClear="onClearFile('pa_statement')" />
|
|
69
|
-
<base-file-input :label="$dataStore.t('labels.attachAgreement')" @input.prevent="onFileChangeScans($event, 'agreement')" @onClear="onClearFile('agreement')" />
|
|
70
|
-
</base-form-section>
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
<div v-if="processCode == 2" class="flex flex-col gap-2">
|
|
74
|
-
<base-btn
|
|
75
|
-
:text="$dataStore.t('buttons.downloadPARefundStatement')"
|
|
76
|
-
:loading="$dataStore.isButtonsLoading"
|
|
77
|
-
@click="$dataStore.generatePDFDocument('PA_RefundStatement', '41')"
|
|
78
|
-
/>
|
|
79
|
-
<base-btn
|
|
80
|
-
:text="$dataStore.t('buttons.downloadPARefundAgreement')"
|
|
81
|
-
:loading="$dataStore.isButtonsLoading"
|
|
82
|
-
@click="$dataStore.generatePDFDocument('PA_RefundAgreement', '42')"
|
|
83
|
-
/>
|
|
84
|
-
|
|
42
|
+
<div v-if="isNewSign">
|
|
43
|
+
<div class="flex flex-col gap-2">
|
|
44
|
+
<base-btn v-for="file in signingFiles" :text="`Скачать ${file.fileName}`" :loading="$dataStore.isButtonsLoading" @click="getFileNew(file)" />
|
|
85
45
|
<base-form-section class="mt-4 flex flex-col !gap-2" :title="$dataStore.t('clients.attachScansSignDocs')">
|
|
86
|
-
<base-file-input
|
|
87
|
-
:label="$dataStore.t('buttons.downloadPARefundStatement')"
|
|
88
|
-
@input.prevent="onFileChangeScans($event, 'pa_refundstatement')"
|
|
89
|
-
@onClear="onClearFile('pa_refundstatement')"
|
|
90
|
-
/>
|
|
91
|
-
<base-file-input
|
|
92
|
-
:label="$dataStore.t('buttons.downloadPARefundAgreement')"
|
|
93
|
-
@input.prevent="onFileChangeScans($event, 'pa_refundagreement')"
|
|
94
|
-
@onClear="onClearFile('pa_refundagreement')"
|
|
95
|
-
/>
|
|
46
|
+
<base-file-input v-for="file in signingFiles" :label="`Вложить ${file.fileName}`" @input.prevent="onFileChangeScansNew($event, file)" @onClear="onClearFileNew(file)" />
|
|
96
47
|
</base-form-section>
|
|
97
48
|
</div>
|
|
98
49
|
</div>
|
|
99
|
-
<div :class="[$styles.flexColNav]"
|
|
50
|
+
<div v-else :class="[$styles.flexColNav]">
|
|
100
51
|
<base-btn :text="$dataStore.t('buttons.downloadStatement')" @click="downloadTemplate(constants.documentTypes.statement, 'docx')" />
|
|
101
52
|
<base-btn :text="$dataStore.t('buttons.downloadContract')" @click="downloadTemplate(constants.documentTypes.contract, 'doc')" />
|
|
102
53
|
<base-btn :text="$dataStore.t('buttons.downloadApplication')" @click="downloadTemplate(constants.documentTypes.application1, 'vnd.ms-excel')" />
|
|
@@ -107,7 +58,7 @@
|
|
|
107
58
|
<base-file-input :label="$dataStore.t('labels.attachPowerOfAttorney')" @input.prevent="onFileChangeScans($event, 'attorney')" @onClear="onClearFile('attorney')" />
|
|
108
59
|
</base-form-section>
|
|
109
60
|
</div>
|
|
110
|
-
<base-btn :text="$dataStore.t('buttons.sign')" :loading="$dataStore.isButtonsLoading" @click="sendFiles" />
|
|
61
|
+
<base-btn :text="$dataStore.t('buttons.sign')" :loading="$dataStore.isButtonsLoading" @click="isNewSign ? sendFilesNew() : sendFiles()" />
|
|
111
62
|
<base-btn :text="$dataStore.t('buttons.cancel')" :btn="$styles.whiteBtn" @click="isScansDocuments = false" />
|
|
112
63
|
</div>
|
|
113
64
|
<div v-if="isQr" :class="[$styles.flexColNav]">
|
|
@@ -121,6 +72,44 @@
|
|
|
121
72
|
<base-btn :text="$dataStore.t('buttons.cancel')" :btn="$styles.whiteBtn" @click="closeQrPanel" />
|
|
122
73
|
</base-form-section>
|
|
123
74
|
</div>
|
|
75
|
+
<div v-if="formStore.signatories && !isQr && !isScansDocuments" :class="[$styles.flexColNav]">
|
|
76
|
+
<div :class="[$styles.blueBgLight]" class="rounded-lg p-4">
|
|
77
|
+
<v-expansion-panels v-if="formStore.signatories.length" variant="accordion" multiple>
|
|
78
|
+
<v-expansion-panel v-for="(person, index) of formStore.signatories" :key="person.personId!" class="border-[1px]" elevation="0" bg-color="#FFF">
|
|
79
|
+
<v-expansion-panel-title class="h-[80px]" :class="$styles.textTitle">
|
|
80
|
+
{{ person.longName }}
|
|
81
|
+
</v-expansion-panel-title>
|
|
82
|
+
<v-expansion-panel-text class="border-t-[1px]">
|
|
83
|
+
<section class="flex flex-col" :class="$styles.textSimple">
|
|
84
|
+
<v-expansion-panels v-if="person.fileDatas.length" v-model="currentFilePanel">
|
|
85
|
+
<v-expansion-panel
|
|
86
|
+
v-for="(file, fileIndex) in groupBy(person.fileDatas, 'orderFile')"
|
|
87
|
+
:value="fileIndex"
|
|
88
|
+
:disabled="inSigningOrder(person.fileDatas, fileIndex) || file[0].isSigned"
|
|
89
|
+
>
|
|
90
|
+
<v-expansion-panel-title v-for="name in file" class="h-[80px]" :class="$styles.textTitle">
|
|
91
|
+
{{ name.fileName }}
|
|
92
|
+
</v-expansion-panel-title>
|
|
93
|
+
<v-expansion-panel-text class="border-t-[1px]">
|
|
94
|
+
<section class="flex flex-col gap-4 py-3" :class="$styles.textSimple">
|
|
95
|
+
<base-btn
|
|
96
|
+
v-for="signtype in file[0].signTypes"
|
|
97
|
+
:text="signtype.documentSignTypeName"
|
|
98
|
+
:btn="$styles.greenBtn"
|
|
99
|
+
@click="newSign(signtype.documentSignTypeValue, file, index)"
|
|
100
|
+
:loading="loading"
|
|
101
|
+
/>
|
|
102
|
+
</section>
|
|
103
|
+
</v-expansion-panel-text>
|
|
104
|
+
</v-expansion-panel>
|
|
105
|
+
</v-expansion-panels>
|
|
106
|
+
</section>
|
|
107
|
+
</v-expansion-panel-text>
|
|
108
|
+
</v-expansion-panel>
|
|
109
|
+
</v-expansion-panels>
|
|
110
|
+
<base-list-empty v-else />
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
124
113
|
</section>
|
|
125
114
|
<section v-if="choosePayActions">
|
|
126
115
|
<div v-if="!isEpayPay && !isOfflinePay" :class="[$styles.flexColNav]">
|
|
@@ -178,7 +167,7 @@
|
|
|
178
167
|
</div>
|
|
179
168
|
</base-fade-transition>
|
|
180
169
|
<base-btn
|
|
181
|
-
v-if="
|
|
170
|
+
v-if="isElectronicContract"
|
|
182
171
|
:text="$dataStore.t('buttons.cancel')"
|
|
183
172
|
:btn="$styles.whiteBtn"
|
|
184
173
|
@click="
|
|
@@ -261,6 +250,7 @@ import { DocumentItem, Value } from '../../composables/classes';
|
|
|
261
250
|
import { HubConnectionBuilder } from '@microsoft/signalr';
|
|
262
251
|
import { uuid } from 'vue-uuid';
|
|
263
252
|
import type { Api, SignUrlType } from '../../types';
|
|
253
|
+
import { CoreEnums } from '../../types/enum';
|
|
264
254
|
|
|
265
255
|
export default defineComponent({
|
|
266
256
|
emits: ['task'],
|
|
@@ -282,14 +272,16 @@ export default defineComponent({
|
|
|
282
272
|
const isOfflinePay = ref<boolean>(false);
|
|
283
273
|
const isQrDialog = ref<boolean>(false);
|
|
284
274
|
const email = ref<string>('');
|
|
275
|
+
const signOptions = ref<Api.Sign.New.Response>();
|
|
276
|
+
const signingFiles = ref<Api.Sign.New.FileDatas[]>([]);
|
|
277
|
+
const allDocumentsSigned = ref<boolean>(false);
|
|
278
|
+
const currentFilePanel = ref<string[]>([]);
|
|
285
279
|
|
|
286
280
|
const vForm = ref<any>();
|
|
287
281
|
const isSendNumberOpen = ref<boolean>(false);
|
|
288
282
|
const phoneNumber = ref<string | null>(formStore.policyholderForm.phoneNumber ?? '');
|
|
289
283
|
const selectedClient = ref<SignUrlType>();
|
|
290
284
|
const documentDict = computed(() => dataStore.dicFileTypeList.find(i => i.nameRu === 'Решение АС'));
|
|
291
|
-
const pensionForm = formStore.applicationData?.pensionApp ?? undefined;
|
|
292
|
-
const consentGiven = computed(() => !!formStore.signedDocumentList.find(i => i.fileTypeCode === '43' && i.signed === true));
|
|
293
285
|
const affiliationDocument = computed(() => formStore.signedDocumentList.find((file: DocumentItem) => file.fileTypeName === 'Решение АС'));
|
|
294
286
|
const affiliationData = ref<{
|
|
295
287
|
processInstanceId: string | number;
|
|
@@ -334,10 +326,53 @@ export default defineComponent({
|
|
|
334
326
|
}
|
|
335
327
|
};
|
|
336
328
|
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
329
|
+
const inSigningOrder = (files: any, index: number) => {
|
|
330
|
+
for (
|
|
331
|
+
let i = 0;
|
|
332
|
+
i <
|
|
333
|
+
files.sort(function (a: any, b: any) {
|
|
334
|
+
return a.orderFile > b.orderFile ? 1 : b.orderFile > a.orderFile ? -1 : 0;
|
|
335
|
+
}).length;
|
|
336
|
+
i++
|
|
337
|
+
) {
|
|
338
|
+
if (!files[i].isSigned) {
|
|
339
|
+
return files[i].orderFile != index;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
const getFileNew = async (file: any) => {
|
|
345
|
+
const newFile = signOptions.value?.signIds.find((i: any) => i.fileType == file.fileType);
|
|
346
|
+
if (newFile) await dataStore.getFileNew(newFile.id, 2, false, file.fileName);
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
const onFileChangeScansNew = async (event: InputEvent, file: any) => {
|
|
350
|
+
if (event.target) {
|
|
351
|
+
const files = (event.target as HTMLInputElement).files;
|
|
352
|
+
if (files && files.length) {
|
|
353
|
+
if (files[0].type !== 'application/pdf') return dataStore.showToaster('error', dataStore.t('toaster.onlyPDF'), 6000);
|
|
354
|
+
const { execute: getBase64 } = useBase64(files[0]);
|
|
355
|
+
const base64 = (await getBase64()).slice(28);
|
|
356
|
+
const data = {
|
|
357
|
+
FileBytes: base64,
|
|
358
|
+
FileName: file.fileName,
|
|
359
|
+
FileTypeCode: file.fileType,
|
|
360
|
+
};
|
|
361
|
+
if (!signOptions.value) return dataStore.showToaster('error', dataStore.t('pension.fileError'), 6000);
|
|
362
|
+
scansFiles.value.push({
|
|
363
|
+
groupId: signOptions.value.signIds.find((i: any) => i.fileType == data.FileTypeCode)?.id,
|
|
364
|
+
data: data,
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
const onClearFileNew = async (file: any) => {
|
|
371
|
+
const result = scansFiles.value.filter(i => i.data.FileTypeCode !== file.fileType);
|
|
372
|
+
scansFiles.value = result;
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
const onFileChangeScans = async (event: InputEvent, type: 'statement' | 'contract' | 'pa_refundstatement' | 'pa_refundagreement' | 'app' | 'attorney' | 'agreement') => {
|
|
341
376
|
if (event.target) {
|
|
342
377
|
const files = (event.target as HTMLInputElement).files;
|
|
343
378
|
if (files && files.length) {
|
|
@@ -359,31 +394,20 @@ export default defineComponent({
|
|
|
359
394
|
}
|
|
360
395
|
};
|
|
361
396
|
|
|
362
|
-
const onClearFile = async (
|
|
363
|
-
type: 'statement' | 'pa_statement' | 'pa_refundstatement' | 'contract' | 'pa_contract' | 'pa_refundagreement' | 'app' | 'attorney' | 'agreement',
|
|
364
|
-
) => {
|
|
397
|
+
const onClearFile = async (type: 'statement' | 'contract' | 'pa_refundstatement' | 'pa_refundagreement' | 'app' | 'attorney' | 'agreement') => {
|
|
365
398
|
const doc = await selectedDocument(type);
|
|
366
399
|
const result = scansFiles.value.filter(i => JSON.parse(i.fileData)[0].fileTypeCode !== doc.code);
|
|
367
400
|
scansFiles.value = result;
|
|
368
401
|
};
|
|
369
402
|
|
|
370
|
-
const selectedDocument = (type: 'statement' | '
|
|
403
|
+
const selectedDocument = (type: 'statement' | 'contract' | 'pa_refundstatement' | 'pa_refundagreement' | 'app' | 'attorney' | 'agreement') => {
|
|
371
404
|
let selectedDocument: any;
|
|
372
405
|
if (type === 'statement') {
|
|
373
406
|
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '32');
|
|
374
407
|
}
|
|
375
|
-
if (type === 'pa_statement') {
|
|
376
|
-
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '37');
|
|
377
|
-
}
|
|
378
|
-
if (type === 'pa_refundstatement') {
|
|
379
|
-
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '41');
|
|
380
|
-
}
|
|
381
408
|
if (type === 'contract') {
|
|
382
409
|
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '6');
|
|
383
410
|
}
|
|
384
|
-
if (type === 'pa_contract') {
|
|
385
|
-
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '38');
|
|
386
|
-
}
|
|
387
411
|
if (type === 'pa_refundagreement') {
|
|
388
412
|
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '42');
|
|
389
413
|
}
|
|
@@ -399,14 +423,29 @@ export default defineComponent({
|
|
|
399
423
|
return selectedDocument;
|
|
400
424
|
};
|
|
401
425
|
|
|
426
|
+
const sendFilesNew = async () => {
|
|
427
|
+
if (scansFiles.value.length !== signOptions.value?.signIds.length) {
|
|
428
|
+
dataStore.showToaster('warning', dataStore.t('toaster.notAllDocumentsAttached'));
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
try {
|
|
432
|
+
await Promise.allSettled(
|
|
433
|
+
Object.values(scansFiles.value).map(async f => {
|
|
434
|
+
await dataStore.api.file.uploadFilesNew(f.groupId, f.data);
|
|
435
|
+
}),
|
|
436
|
+
);
|
|
437
|
+
scansFiles.value = [];
|
|
438
|
+
closePanel();
|
|
439
|
+
dataStore.showToaster('info', 'Документы подписаны');
|
|
440
|
+
await dataStore.handleTask(constants.actions.signed, route.params.taskId as string);
|
|
441
|
+
} catch (err) {
|
|
442
|
+
return ErrorHandler(err);
|
|
443
|
+
}
|
|
444
|
+
closePanel();
|
|
445
|
+
};
|
|
446
|
+
|
|
402
447
|
const sendFiles = async () => {
|
|
403
|
-
if (
|
|
404
|
-
dataStore.isPension
|
|
405
|
-
? formStore.applicationData.statusCode === 'ContractSignedFrom'
|
|
406
|
-
? scansFiles.value.length !== 1
|
|
407
|
-
: scansFiles.value.length !== 2
|
|
408
|
-
: scansFiles.value.length !== 4
|
|
409
|
-
) {
|
|
448
|
+
if (scansFiles.value.length !== 4) {
|
|
410
449
|
dataStore.showToaster('warning', dataStore.t('toaster.notAllDocumentsAttached'));
|
|
411
450
|
return;
|
|
412
451
|
}
|
|
@@ -418,7 +457,7 @@ export default defineComponent({
|
|
|
418
457
|
}
|
|
419
458
|
closePanel();
|
|
420
459
|
dataStore.showToaster('success', dataStore.t('toaster.successOperation'));
|
|
421
|
-
await dataStore.handleTask(
|
|
460
|
+
await dataStore.handleTask(constants.actions.signed, route.params.taskId as string, 'scans');
|
|
422
461
|
};
|
|
423
462
|
const submitForm = async () => {
|
|
424
463
|
await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
@@ -535,7 +574,7 @@ export default defineComponent({
|
|
|
535
574
|
const affiliateActions = computed(() => dataStore.panelAction === constants.actions.affiliate);
|
|
536
575
|
const chooseSignActions = computed(() => dataStore.controls.hasChooseSign && dataStore.panelAction === constants.actions.chooseSign);
|
|
537
576
|
const choosePayActions = computed(() => dataStore.controls.hasChoosePay && dataStore.panelAction === constants.actions.choosePay);
|
|
538
|
-
|
|
577
|
+
const isNewSign = computed(() => (dataStore.isPension || dataStore.isGons) && !useEnv().isProduction);
|
|
539
578
|
const paymentPeriod = computed(() => formStore.productConditionsForm.paymentPeriod.nameRu);
|
|
540
579
|
const insurancePremiumPerMonth = computed(() => dataStore.getNumberWithSpaces(formStore.productConditionsForm.insurancePremiumPerMonth));
|
|
541
580
|
const requestedSumInsured = computed(() => {
|
|
@@ -568,7 +607,7 @@ export default defineComponent({
|
|
|
568
607
|
return true;
|
|
569
608
|
});
|
|
570
609
|
const isElectronicDisabled = computed(() => {
|
|
571
|
-
if (dataStore.isGons || dataStore.isLifeBusiness || dataStore.isGns
|
|
610
|
+
if (dataStore.isGons || dataStore.isLifeBusiness || dataStore.isGns) {
|
|
572
611
|
return true;
|
|
573
612
|
}
|
|
574
613
|
return false;
|
|
@@ -577,37 +616,25 @@ export default defineComponent({
|
|
|
577
616
|
if (dataStore.isGons) {
|
|
578
617
|
return true;
|
|
579
618
|
}
|
|
580
|
-
if ((!consentGiven.value || formStore.applicationData.statusCode === 'HeadManagerForm') && dataStore.isPension && processCode !== 2) {
|
|
581
|
-
return true;
|
|
582
|
-
}
|
|
583
619
|
return false;
|
|
584
620
|
});
|
|
585
621
|
const isQrDisabled = computed(() => {
|
|
586
|
-
if (consentGiven.value && dataStore.isPension && processCode !== 2) {
|
|
587
|
-
return false;
|
|
588
|
-
}
|
|
589
622
|
return true;
|
|
590
623
|
});
|
|
591
624
|
const isQrXmlDisabled = computed(() => {
|
|
592
|
-
if (!consentGiven.value && dataStore.isPension && processCode !== 2) {
|
|
593
|
-
return false;
|
|
594
|
-
}
|
|
595
625
|
if (dataStore.isLifeBusiness || dataStore.isGns) {
|
|
596
626
|
return false;
|
|
597
627
|
}
|
|
598
628
|
return true;
|
|
599
629
|
});
|
|
600
630
|
const isSignatureDisabled = computed(() => {
|
|
601
|
-
if ((!consentGiven.value || formStore.applicationData.statusCode === 'HeadManagerForm') && dataStore.isPension && processCode !== 2) {
|
|
602
|
-
return false;
|
|
603
|
-
}
|
|
604
631
|
return true;
|
|
605
632
|
});
|
|
606
633
|
const downloadTemplate = async (documentType: number, fileType: string) => {
|
|
607
634
|
await dataStore.downloadTemplate(documentType, fileType, formStore.applicationData.processInstanceId);
|
|
608
635
|
};
|
|
609
636
|
|
|
610
|
-
const handleSignAction = async (type: 'paper' | 'electronic' | 'scans' | 'qr' | 'qrXml'
|
|
637
|
+
const handleSignAction = async (type: 'paper' | 'electronic' | 'scans' | 'qr' | 'qrXml') => {
|
|
611
638
|
loading.value = true;
|
|
612
639
|
if (type === 'electronic') {
|
|
613
640
|
await dataStore.signDocument();
|
|
@@ -636,9 +663,6 @@ export default defineComponent({
|
|
|
636
663
|
isQr.value = true;
|
|
637
664
|
}
|
|
638
665
|
}
|
|
639
|
-
if (type === 'signature') {
|
|
640
|
-
await dataStore.signDocument('signature');
|
|
641
|
-
}
|
|
642
666
|
loading.value = false;
|
|
643
667
|
};
|
|
644
668
|
|
|
@@ -712,7 +736,7 @@ export default defineComponent({
|
|
|
712
736
|
data.append('name', 'PAEnpf_Agreement');
|
|
713
737
|
data.append('format', 'xml');
|
|
714
738
|
data.append('EdsXmlId', groupId ?? '');
|
|
715
|
-
await dataStore.api.uploadXml(data);
|
|
739
|
+
await dataStore.api.file.uploadXml(data);
|
|
716
740
|
await dataStore.getSignedDocList(dataStore.formStore.applicationData.processInstanceId);
|
|
717
741
|
dataStore.showToaster('success', dataStore.t('pension.consentGiven'), 3000);
|
|
718
742
|
}
|
|
@@ -799,6 +823,90 @@ export default defineComponent({
|
|
|
799
823
|
dataStore.panelAction = constants.actions.pay;
|
|
800
824
|
};
|
|
801
825
|
|
|
826
|
+
const groupBy = (data: any, key: string) => {
|
|
827
|
+
return data.reduce((results: any, item: any) => {
|
|
828
|
+
results[item[key]] = results[item[key]] || [];
|
|
829
|
+
results[item[key]].push(item);
|
|
830
|
+
return results;
|
|
831
|
+
}, {});
|
|
832
|
+
};
|
|
833
|
+
|
|
834
|
+
const checkIfAllSigned = async () => {
|
|
835
|
+
await dataStore.generateSign(route.params.taskId as string);
|
|
836
|
+
formStore.signatories.find((person: any) => {
|
|
837
|
+
if (person.fileDatas.find((file: any) => file.isSigned === false) === undefined) {
|
|
838
|
+
if (formStore.applicationData.statusCode !== 'ContractSignedFrom')
|
|
839
|
+
dataStore.showToaster(
|
|
840
|
+
'success',
|
|
841
|
+
dataStore.t(`pension.${formStore.applicationData.statusCode === 'HeadManagerForm' ? 'signInProcessManager' : 'signInProcess'}`),
|
|
842
|
+
30000,
|
|
843
|
+
);
|
|
844
|
+
allDocumentsSigned.value = true;
|
|
845
|
+
}
|
|
846
|
+
});
|
|
847
|
+
};
|
|
848
|
+
|
|
849
|
+
const newSign = async (signType: number, file: any, index: number) => {
|
|
850
|
+
loading.value = true;
|
|
851
|
+
const data = {
|
|
852
|
+
...formStore.signatories[index],
|
|
853
|
+
signType: signType,
|
|
854
|
+
fileDatas: file,
|
|
855
|
+
};
|
|
856
|
+
try {
|
|
857
|
+
signOptions.value = await dataStore.api.file.generalSign(data);
|
|
858
|
+
const message = [];
|
|
859
|
+
for (let i of file) {
|
|
860
|
+
message.push(i.fileName);
|
|
861
|
+
}
|
|
862
|
+
if (signOptions.value) {
|
|
863
|
+
switch (signType) {
|
|
864
|
+
case CoreEnums.Sign.Types.electronic:
|
|
865
|
+
// @ts-ignore
|
|
866
|
+
formStore.signUrls = [signOptions.value];
|
|
867
|
+
isElectronicContract.value = true;
|
|
868
|
+
dataStore.panelAction = constants.actions.sign;
|
|
869
|
+
break;
|
|
870
|
+
case CoreEnums.Sign.Types.scans:
|
|
871
|
+
isScansDocuments.value = true;
|
|
872
|
+
signingFiles.value = data.fileDatas;
|
|
873
|
+
message.length = 0;
|
|
874
|
+
break;
|
|
875
|
+
case CoreEnums.Sign.Types.qr:
|
|
876
|
+
if (!signOptions.value.signatureDocumentGroupId) return dataStore.showToaster('error', 'Ошибка подписи документов', 10000);
|
|
877
|
+
await generateQR(signOptions.value.signatureDocumentGroupId);
|
|
878
|
+
isQr.value = true;
|
|
879
|
+
break;
|
|
880
|
+
case CoreEnums.Sign.Types.qrXml:
|
|
881
|
+
if (!signOptions.value.edsXmlId) return dataStore.showToaster('error', 'Ошибка подписи документов', 10000);
|
|
882
|
+
await generateQR(signOptions.value.edsXmlId, 'xml');
|
|
883
|
+
isQr.value = true;
|
|
884
|
+
break;
|
|
885
|
+
case CoreEnums.Sign.Types.nclayer:
|
|
886
|
+
for (let sign of signOptions.value.signIds) {
|
|
887
|
+
const response = await dataStore.nclayerSign(sign.id, signType, file[0].fileType === 43);
|
|
888
|
+
if (!response) {
|
|
889
|
+
dataStore.showToaster('error', 'Ошибка подписи документов', 10000);
|
|
890
|
+
message.length = 0;
|
|
891
|
+
break;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
break;
|
|
895
|
+
default:
|
|
896
|
+
break;
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
if (message.length) {
|
|
900
|
+
dataStore.showToaster('info', 'Подписано: ' + message.join(', '), 5000);
|
|
901
|
+
await checkIfAllSigned();
|
|
902
|
+
}
|
|
903
|
+
currentFilePanel.value = [];
|
|
904
|
+
} catch (err) {
|
|
905
|
+
ErrorHandler(err);
|
|
906
|
+
}
|
|
907
|
+
loading.value = false;
|
|
908
|
+
};
|
|
909
|
+
|
|
802
910
|
return {
|
|
803
911
|
// State
|
|
804
912
|
formStore,
|
|
@@ -820,6 +928,10 @@ export default defineComponent({
|
|
|
820
928
|
processCode,
|
|
821
929
|
isQrDialog,
|
|
822
930
|
email,
|
|
931
|
+
signOptions,
|
|
932
|
+
signingFiles,
|
|
933
|
+
allDocumentsSigned,
|
|
934
|
+
currentFilePanel,
|
|
823
935
|
|
|
824
936
|
// Functions
|
|
825
937
|
closePanel,
|
|
@@ -831,6 +943,7 @@ export default defineComponent({
|
|
|
831
943
|
downloadTemplate,
|
|
832
944
|
onFileChangeScans,
|
|
833
945
|
sendFiles,
|
|
946
|
+
sendFilesNew,
|
|
834
947
|
onClearFile,
|
|
835
948
|
closeQrPanel,
|
|
836
949
|
handlePayAction,
|
|
@@ -864,7 +977,13 @@ export default defineComponent({
|
|
|
864
977
|
isQrXmlDisabled,
|
|
865
978
|
isSignatureDisabled,
|
|
866
979
|
choosePayActions,
|
|
867
|
-
|
|
980
|
+
groupBy,
|
|
981
|
+
newSign,
|
|
982
|
+
onFileChangeScansNew,
|
|
983
|
+
onClearFileNew,
|
|
984
|
+
getFileNew,
|
|
985
|
+
inSigningOrder,
|
|
986
|
+
isNewSign,
|
|
868
987
|
};
|
|
869
988
|
},
|
|
870
989
|
});
|
package/composables/classes.ts
CHANGED
|
@@ -1362,6 +1362,7 @@ export class FormStoreClass {
|
|
|
1362
1362
|
date: string | null;
|
|
1363
1363
|
};
|
|
1364
1364
|
signedDocumentList: IDocument[];
|
|
1365
|
+
signatories: any[];
|
|
1365
1366
|
surveyByHealthBase: Types.AnketaFirst | null;
|
|
1366
1367
|
surveyByHealthBasePolicyholder: Types.AnketaFirst | null;
|
|
1367
1368
|
surveyByCriticalBase: Types.AnketaFirst | null;
|
|
@@ -1475,6 +1476,7 @@ export class FormStoreClass {
|
|
|
1475
1476
|
date: null,
|
|
1476
1477
|
};
|
|
1477
1478
|
this.signedDocumentList = [];
|
|
1479
|
+
this.signatories = [];
|
|
1478
1480
|
this.surveyByHealthBase = null;
|
|
1479
1481
|
this.surveyByHealthBasePolicyholder = null;
|
|
1480
1482
|
this.surveyByCriticalBase = null;
|
|
@@ -1767,3 +1769,29 @@ export class BeneficialOwner {
|
|
|
1767
1769
|
this.id = '';
|
|
1768
1770
|
}
|
|
1769
1771
|
}
|
|
1772
|
+
|
|
1773
|
+
export class TransferContract {
|
|
1774
|
+
id: string | null;
|
|
1775
|
+
transferContractIsOppv: boolean;
|
|
1776
|
+
transferContractFirstPaymentDate: string;
|
|
1777
|
+
transferContractAmount: number;
|
|
1778
|
+
transferContractDate: string;
|
|
1779
|
+
transferContractNumber: string;
|
|
1780
|
+
transferContractRegNumber: string;
|
|
1781
|
+
transferContract: boolean;
|
|
1782
|
+
transferContractCompany: Value;
|
|
1783
|
+
transferContractMonthCount: number;
|
|
1784
|
+
|
|
1785
|
+
constructor() {
|
|
1786
|
+
this.id = null;
|
|
1787
|
+
this.transferContractIsOppv = false;
|
|
1788
|
+
this.transferContractFirstPaymentDate = '';
|
|
1789
|
+
this.transferContractAmount = 0;
|
|
1790
|
+
this.transferContractDate = '';
|
|
1791
|
+
this.transferContractNumber = '';
|
|
1792
|
+
this.transferContract = false;
|
|
1793
|
+
this.transferContractRegNumber = '';
|
|
1794
|
+
this.transferContractCompany = new Value();
|
|
1795
|
+
this.transferContractMonthCount = 0;
|
|
1796
|
+
}
|
|
1797
|
+
}
|
package/composables/index.ts
CHANGED
|
@@ -110,8 +110,16 @@ export const jwtDecode = (token?: string | null) => {
|
|
|
110
110
|
};
|
|
111
111
|
|
|
112
112
|
export const isValidToken = (token: string) => {
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
try {
|
|
114
|
+
if (token) {
|
|
115
|
+
const decoded = jwtDecode(token);
|
|
116
|
+
return !!decoded && (new Date(Number(decoded.exp) * 1000).getTime() - Date.now()) / 1000 > 0;
|
|
117
|
+
}
|
|
118
|
+
return false;
|
|
119
|
+
} catch (err) {
|
|
120
|
+
console.log(err);
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
115
123
|
};
|
|
116
124
|
|
|
117
125
|
export const isValidGUID = (value: string) => {
|
package/composables/styles.ts
CHANGED
|
@@ -80,9 +80,9 @@ export class Styles {
|
|
|
80
80
|
greenLightBtn: string;
|
|
81
81
|
|
|
82
82
|
// Complex
|
|
83
|
-
flexColNav: string;
|
|
84
|
-
emptyBlockCol: string;
|
|
85
|
-
scrollPage: string;
|
|
83
|
+
flexColNav: string = 'flex flex-col gap-[10px] px-2 pt-[14px]';
|
|
84
|
+
emptyBlockCol: string = 'w-[60px] sm:w-[100px] h-[30%] rounded-[8px] bg-[#f5f5f5]';
|
|
85
|
+
scrollPage: string = 'max-h-[85svh] overflow-y-scroll';
|
|
86
86
|
flexCenter: string = 'flex items-center justify-center';
|
|
87
87
|
|
|
88
88
|
// Muted or disabled
|
|
@@ -100,11 +100,6 @@ export class Styles {
|
|
|
100
100
|
this.whiteBorderBtn = ` ${this.blackText} ${this.textTitle} ${this.rounded} w-full ${this.blueLightBgHover} border-[#A0B3D8] border-[1px]`;
|
|
101
101
|
this.blueLightBtn = `${this.blueBgLight} ${this.greyTextLight} ${this.textTitle} ${this.rounded} w-full ${this.blueBgLightHover}`;
|
|
102
102
|
this.greenLightBtn = `${this.greenBgLight} ${this.greenText} ${this.textTitle} ${this.rounded} w-full ${this.greenBgLightHover}`;
|
|
103
|
-
|
|
104
|
-
// Complex
|
|
105
|
-
this.flexColNav = 'flex flex-col gap-[10px] px-2 pt-[14px]';
|
|
106
|
-
this.emptyBlockCol = 'w-[60px] sm:w-[100px] h-[30%] rounded-[8px] bg-[#f5f5f5]';
|
|
107
|
-
this.scrollPage = 'max-h-[85svh] overflow-y-scroll';
|
|
108
103
|
}
|
|
109
104
|
}
|
|
110
105
|
|
package/locales/ru.json
CHANGED
|
@@ -120,6 +120,7 @@
|
|
|
120
120
|
"noAmountBeforeTypeAndCountries": "Страховая сумма вычисляется после выбора полей типа поездки и страны поездки",
|
|
121
121
|
"noMaxDaysBeforePeriod": "Количество дней пребывания вычисляется после выбора поля периода",
|
|
122
122
|
"startMoreEnd": "Дата начала не должна равняться или превышать дату окончания поездки",
|
|
123
|
+
"daysPickAgain": "Перевыберите даты для определения правильного количества дней",
|
|
123
124
|
"passportNotFound": "Паспорт не найден",
|
|
124
125
|
"wrongInn": "Неправильный ИНН",
|
|
125
126
|
"underageShouldBeLess18": "Несовершеннолетний не может быть старше 18 лет",
|
|
@@ -238,7 +239,8 @@
|
|
|
238
239
|
"signContract": "Заключить Договор",
|
|
239
240
|
"sendDosie": "Отправить досье",
|
|
240
241
|
"downloadPaymentInvoice": "Скачать счет на оплату",
|
|
241
|
-
"copyToClient": "Скопировать ссылку для клиента"
|
|
242
|
+
"copyToClient": "Скопировать ссылку для клиента",
|
|
243
|
+
"searchByFio": "Поиск по ФИО"
|
|
242
244
|
},
|
|
243
245
|
"dialog": {
|
|
244
246
|
"title": "Подтверждение",
|
|
@@ -577,7 +579,11 @@
|
|
|
577
579
|
"bankInvalid": "Некорректные банковские данные",
|
|
578
580
|
"globalId": "Уникальный номер договора (globalId)",
|
|
579
581
|
"oppvMonthsCheck": "ВНИМАНИЕ! НЕОБХОДИМО ПРОВЕРИТЬ НАЛИЧИЕ ОТЧИСЛЕНИЙ 60 МЕСЯЦЕВ ПО ПРИЗНАКУ 'ОППВ'",
|
|
580
|
-
"signInProcess": "
|
|
582
|
+
"signInProcess": "После подписания всех документов данная заявка перейдет к Подписанту вашего Региона",
|
|
583
|
+
"signInProcessManager": "Договор будет подписан в течение минуты",
|
|
584
|
+
"transferRegNumber": "Номер и серия договора",
|
|
585
|
+
"contragentSelect": "Выбор контрагента",
|
|
586
|
+
"fileError": "Ошибка прикрепления файла"
|
|
581
587
|
},
|
|
582
588
|
"agent": {
|
|
583
589
|
"currency": "Валюта",
|