hl-core 0.0.10-beta.2 → 0.0.10-beta.21
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 +221 -195
- package/components/Complex/TextBlock.vue +2 -0
- package/components/Dialog/Dialog.vue +7 -1
- package/components/Dialog/FamilyDialog.vue +2 -0
- package/components/Form/DigitalDocument.vue +52 -0
- package/components/Form/DynamicForm.vue +1 -0
- package/components/Form/FormData.vue +1 -0
- package/components/Form/ManagerAttachment.vue +2 -4
- package/components/Input/DynamicInput.vue +2 -0
- package/components/Input/FormInput.vue +2 -0
- package/components/Input/OtpInput.vue +25 -0
- package/components/Input/PanelInput.vue +1 -0
- package/components/Input/RoundedInput.vue +2 -0
- package/components/Input/RoundedSelect.vue +4 -0
- package/components/Input/SwitchInput.vue +2 -0
- package/components/Input/TextInput.vue +2 -0
- package/components/Layout/Drawer.vue +2 -0
- package/components/Pages/Anketa.vue +165 -166
- package/components/Pages/Auth.vue +2 -0
- package/components/Pages/ContragentForm.vue +1 -0
- package/components/Pages/Documents.vue +237 -6
- package/components/Pages/MemberForm.vue +204 -56
- package/components/Pages/ProductConditions.vue +153 -74
- package/components/Panel/PanelHandler.vue +231 -105
- package/components/Transitions/Animation.vue +2 -0
- package/components/Utilities/Chip.vue +2 -0
- package/components/Utilities/JsonViewer.vue +1 -2
- package/composables/classes.ts +102 -41
- package/composables/fields.ts +6 -4
- package/composables/index.ts +220 -7
- package/composables/styles.ts +8 -24
- package/configs/pwa.ts +1 -7
- package/locales/ru.json +11 -4
- package/nuxt.config.ts +10 -13
- package/package.json +13 -12
- package/plugins/head.ts +1 -1
- package/store/data.store.ts +235 -357
- package/store/member.store.ts +3 -2
- package/tsconfig.json +3 -0
- package/types/enum.ts +17 -2
- package/types/form.ts +71 -75
- package/types/index.ts +889 -877
|
@@ -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="
|
|
@@ -195,7 +184,13 @@
|
|
|
195
184
|
<base-btn :loading="loading" :text="$dataStore.t('payment.copyUrl')" @click="$dataStore.copyToClipboard(formStore.epayLink)" />
|
|
196
185
|
<base-btn :loading="loading" :text="$dataStore.t('payment.recipientNumber')" @click="openEpayPanel" />
|
|
197
186
|
<base-btn :loading="loading" :text="$dataStore.t('sign.convertQr')" @click="convertQr(formStore.epayLink)" />
|
|
198
|
-
<base-btn
|
|
187
|
+
<base-btn
|
|
188
|
+
v-if="!useEnv().isProduction"
|
|
189
|
+
:loading="loading"
|
|
190
|
+
:btn="$styles.greenBtn"
|
|
191
|
+
:text="$dataStore.t('payment.halykLink')"
|
|
192
|
+
@click="convertQr(formStore.epayLink, 'halyk_pay_link_template')"
|
|
193
|
+
/>
|
|
199
194
|
</div>
|
|
200
195
|
</base-form-section>
|
|
201
196
|
<div v-if="isSendNumberOpen" :class="[$styles.flexColNav]">
|
|
@@ -254,6 +249,8 @@
|
|
|
254
249
|
import { DocumentItem, Value } from '../../composables/classes';
|
|
255
250
|
import { HubConnectionBuilder } from '@microsoft/signalr';
|
|
256
251
|
import { uuid } from 'vue-uuid';
|
|
252
|
+
import type { Api, SignUrlType } from '../../types';
|
|
253
|
+
import { CoreEnums } from '../../types/enum';
|
|
257
254
|
|
|
258
255
|
export default defineComponent({
|
|
259
256
|
emits: ['task'],
|
|
@@ -275,14 +272,16 @@ export default defineComponent({
|
|
|
275
272
|
const isOfflinePay = ref<boolean>(false);
|
|
276
273
|
const isQrDialog = ref<boolean>(false);
|
|
277
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[]>([]);
|
|
278
279
|
|
|
279
280
|
const vForm = ref<any>();
|
|
280
281
|
const isSendNumberOpen = ref<boolean>(false);
|
|
281
282
|
const phoneNumber = ref<string | null>(formStore.policyholderForm.phoneNumber ?? '');
|
|
282
283
|
const selectedClient = ref<SignUrlType>();
|
|
283
284
|
const documentDict = computed(() => dataStore.dicFileTypeList.find(i => i.nameRu === 'Решение АС'));
|
|
284
|
-
const pensionForm = formStore.applicationData?.pensionApp ?? undefined;
|
|
285
|
-
const consentGiven = computed(() => !!formStore.signedDocumentList.find(i => i.fileTypeCode === '43' && i.signed === true));
|
|
286
285
|
const affiliationDocument = computed(() => formStore.signedDocumentList.find((file: DocumentItem) => file.fileTypeName === 'Решение АС'));
|
|
287
286
|
const affiliationData = ref<{
|
|
288
287
|
processInstanceId: string | number;
|
|
@@ -327,10 +326,53 @@ export default defineComponent({
|
|
|
327
326
|
}
|
|
328
327
|
};
|
|
329
328
|
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
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') => {
|
|
334
376
|
if (event.target) {
|
|
335
377
|
const files = (event.target as HTMLInputElement).files;
|
|
336
378
|
if (files && files.length) {
|
|
@@ -352,31 +394,20 @@ export default defineComponent({
|
|
|
352
394
|
}
|
|
353
395
|
};
|
|
354
396
|
|
|
355
|
-
const onClearFile = async (
|
|
356
|
-
type: 'statement' | 'pa_statement' | 'pa_refundstatement' | 'contract' | 'pa_contract' | 'pa_refundagreement' | 'app' | 'attorney' | 'agreement',
|
|
357
|
-
) => {
|
|
397
|
+
const onClearFile = async (type: 'statement' | 'contract' | 'pa_refundstatement' | 'pa_refundagreement' | 'app' | 'attorney' | 'agreement') => {
|
|
358
398
|
const doc = await selectedDocument(type);
|
|
359
399
|
const result = scansFiles.value.filter(i => JSON.parse(i.fileData)[0].fileTypeCode !== doc.code);
|
|
360
400
|
scansFiles.value = result;
|
|
361
401
|
};
|
|
362
402
|
|
|
363
|
-
const selectedDocument = (type: 'statement' | '
|
|
403
|
+
const selectedDocument = (type: 'statement' | 'contract' | 'pa_refundstatement' | 'pa_refundagreement' | 'app' | 'attorney' | 'agreement') => {
|
|
364
404
|
let selectedDocument: any;
|
|
365
405
|
if (type === 'statement') {
|
|
366
406
|
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '32');
|
|
367
407
|
}
|
|
368
|
-
if (type === 'pa_statement') {
|
|
369
|
-
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '37');
|
|
370
|
-
}
|
|
371
|
-
if (type === 'pa_refundstatement') {
|
|
372
|
-
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '41');
|
|
373
|
-
}
|
|
374
408
|
if (type === 'contract') {
|
|
375
409
|
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '6');
|
|
376
410
|
}
|
|
377
|
-
if (type === 'pa_contract') {
|
|
378
|
-
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '38');
|
|
379
|
-
}
|
|
380
411
|
if (type === 'pa_refundagreement') {
|
|
381
412
|
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '42');
|
|
382
413
|
}
|
|
@@ -392,14 +423,29 @@ export default defineComponent({
|
|
|
392
423
|
return selectedDocument;
|
|
393
424
|
};
|
|
394
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
|
+
|
|
395
447
|
const sendFiles = async () => {
|
|
396
|
-
if (
|
|
397
|
-
dataStore.isPension
|
|
398
|
-
? formStore.applicationData.statusCode === 'ContractSignedFrom'
|
|
399
|
-
? scansFiles.value.length !== 1
|
|
400
|
-
: scansFiles.value.length !== 2
|
|
401
|
-
: scansFiles.value.length !== 4
|
|
402
|
-
) {
|
|
448
|
+
if (scansFiles.value.length !== 4) {
|
|
403
449
|
dataStore.showToaster('warning', dataStore.t('toaster.notAllDocumentsAttached'));
|
|
404
450
|
return;
|
|
405
451
|
}
|
|
@@ -411,7 +457,7 @@ export default defineComponent({
|
|
|
411
457
|
}
|
|
412
458
|
closePanel();
|
|
413
459
|
dataStore.showToaster('success', dataStore.t('toaster.successOperation'));
|
|
414
|
-
await dataStore.handleTask(
|
|
460
|
+
await dataStore.handleTask(constants.actions.signed, route.params.taskId as string, 'scans');
|
|
415
461
|
};
|
|
416
462
|
const submitForm = async () => {
|
|
417
463
|
await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
@@ -528,7 +574,7 @@ export default defineComponent({
|
|
|
528
574
|
const affiliateActions = computed(() => dataStore.panelAction === constants.actions.affiliate);
|
|
529
575
|
const chooseSignActions = computed(() => dataStore.controls.hasChooseSign && dataStore.panelAction === constants.actions.chooseSign);
|
|
530
576
|
const choosePayActions = computed(() => dataStore.controls.hasChoosePay && dataStore.panelAction === constants.actions.choosePay);
|
|
531
|
-
|
|
577
|
+
const isNewSign = computed(() => (dataStore.isPension || dataStore.isGons) && !useEnv().isProduction);
|
|
532
578
|
const paymentPeriod = computed(() => formStore.productConditionsForm.paymentPeriod.nameRu);
|
|
533
579
|
const insurancePremiumPerMonth = computed(() => dataStore.getNumberWithSpaces(formStore.productConditionsForm.insurancePremiumPerMonth));
|
|
534
580
|
const requestedSumInsured = computed(() => {
|
|
@@ -561,7 +607,7 @@ export default defineComponent({
|
|
|
561
607
|
return true;
|
|
562
608
|
});
|
|
563
609
|
const isElectronicDisabled = computed(() => {
|
|
564
|
-
if (dataStore.isGons || dataStore.isLifeBusiness || dataStore.isGns
|
|
610
|
+
if (dataStore.isGons || dataStore.isLifeBusiness || dataStore.isGns) {
|
|
565
611
|
return true;
|
|
566
612
|
}
|
|
567
613
|
return false;
|
|
@@ -570,37 +616,25 @@ export default defineComponent({
|
|
|
570
616
|
if (dataStore.isGons) {
|
|
571
617
|
return true;
|
|
572
618
|
}
|
|
573
|
-
if ((!consentGiven.value || formStore.applicationData.statusCode === 'HeadManagerForm') && dataStore.isPension && processCode !== 2) {
|
|
574
|
-
return true;
|
|
575
|
-
}
|
|
576
619
|
return false;
|
|
577
620
|
});
|
|
578
621
|
const isQrDisabled = computed(() => {
|
|
579
|
-
if (consentGiven.value && dataStore.isPension && processCode !== 2) {
|
|
580
|
-
return false;
|
|
581
|
-
}
|
|
582
622
|
return true;
|
|
583
623
|
});
|
|
584
624
|
const isQrXmlDisabled = computed(() => {
|
|
585
|
-
if (!consentGiven.value && dataStore.isPension && processCode !== 2) {
|
|
586
|
-
return false;
|
|
587
|
-
}
|
|
588
625
|
if (dataStore.isLifeBusiness || dataStore.isGns) {
|
|
589
626
|
return false;
|
|
590
627
|
}
|
|
591
628
|
return true;
|
|
592
629
|
});
|
|
593
630
|
const isSignatureDisabled = computed(() => {
|
|
594
|
-
if ((!consentGiven.value || formStore.applicationData.statusCode === 'HeadManagerForm') && dataStore.isPension && processCode !== 2) {
|
|
595
|
-
return false;
|
|
596
|
-
}
|
|
597
631
|
return true;
|
|
598
632
|
});
|
|
599
633
|
const downloadTemplate = async (documentType: number, fileType: string) => {
|
|
600
634
|
await dataStore.downloadTemplate(documentType, fileType, formStore.applicationData.processInstanceId);
|
|
601
635
|
};
|
|
602
636
|
|
|
603
|
-
const handleSignAction = async (type: 'paper' | 'electronic' | 'scans' | 'qr' | 'qrXml'
|
|
637
|
+
const handleSignAction = async (type: 'paper' | 'electronic' | 'scans' | 'qr' | 'qrXml') => {
|
|
604
638
|
loading.value = true;
|
|
605
639
|
if (type === 'electronic') {
|
|
606
640
|
await dataStore.signDocument();
|
|
@@ -629,9 +663,6 @@ export default defineComponent({
|
|
|
629
663
|
isQr.value = true;
|
|
630
664
|
}
|
|
631
665
|
}
|
|
632
|
-
if (type === 'signature') {
|
|
633
|
-
await dataStore.signDocument('signature');
|
|
634
|
-
}
|
|
635
666
|
loading.value = false;
|
|
636
667
|
};
|
|
637
668
|
|
|
@@ -705,7 +736,7 @@ export default defineComponent({
|
|
|
705
736
|
data.append('name', 'PAEnpf_Agreement');
|
|
706
737
|
data.append('format', 'xml');
|
|
707
738
|
data.append('EdsXmlId', groupId ?? '');
|
|
708
|
-
await dataStore.api.uploadXml(data);
|
|
739
|
+
await dataStore.api.file.uploadXml(data);
|
|
709
740
|
await dataStore.getSignedDocList(dataStore.formStore.applicationData.processInstanceId);
|
|
710
741
|
dataStore.showToaster('success', dataStore.t('pension.consentGiven'), 3000);
|
|
711
742
|
}
|
|
@@ -792,6 +823,90 @@ export default defineComponent({
|
|
|
792
823
|
dataStore.panelAction = constants.actions.pay;
|
|
793
824
|
};
|
|
794
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
|
+
|
|
795
910
|
return {
|
|
796
911
|
// State
|
|
797
912
|
formStore,
|
|
@@ -813,6 +928,10 @@ export default defineComponent({
|
|
|
813
928
|
processCode,
|
|
814
929
|
isQrDialog,
|
|
815
930
|
email,
|
|
931
|
+
signOptions,
|
|
932
|
+
signingFiles,
|
|
933
|
+
allDocumentsSigned,
|
|
934
|
+
currentFilePanel,
|
|
816
935
|
|
|
817
936
|
// Functions
|
|
818
937
|
closePanel,
|
|
@@ -824,6 +943,7 @@ export default defineComponent({
|
|
|
824
943
|
downloadTemplate,
|
|
825
944
|
onFileChangeScans,
|
|
826
945
|
sendFiles,
|
|
946
|
+
sendFilesNew,
|
|
827
947
|
onClearFile,
|
|
828
948
|
closeQrPanel,
|
|
829
949
|
handlePayAction,
|
|
@@ -857,7 +977,13 @@ export default defineComponent({
|
|
|
857
977
|
isQrXmlDisabled,
|
|
858
978
|
isSignatureDisabled,
|
|
859
979
|
choosePayActions,
|
|
860
|
-
|
|
980
|
+
groupBy,
|
|
981
|
+
newSign,
|
|
982
|
+
onFileChangeScansNew,
|
|
983
|
+
onClearFileNew,
|
|
984
|
+
getFileNew,
|
|
985
|
+
inSigningOrder,
|
|
986
|
+
isNewSign,
|
|
861
987
|
};
|
|
862
988
|
},
|
|
863
989
|
});
|
|
@@ -14,13 +14,12 @@
|
|
|
14
14
|
<script lang="ts">
|
|
15
15
|
import VueJsonPretty from 'vue-json-pretty';
|
|
16
16
|
import 'vue-json-pretty/lib/styles.css';
|
|
17
|
-
import { type JSONDataType } from 'vue-json-pretty/types/utils';
|
|
18
17
|
|
|
19
18
|
export default defineComponent({
|
|
20
19
|
components: { VueJsonPretty },
|
|
21
20
|
props: {
|
|
22
21
|
data: {
|
|
23
|
-
type: Object as PropType<
|
|
22
|
+
type: Object as PropType<any>,
|
|
24
23
|
required: false,
|
|
25
24
|
},
|
|
26
25
|
},
|