hl-core 0.0.10-beta.3 → 0.0.10-beta.30
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 +259 -190
- package/api/interceptors.ts +3 -5
- 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 +18 -8
- package/components/Form/ProductConditionsBlock.vue +12 -6
- 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 +166 -167
- package/components/Pages/Auth.vue +2 -0
- package/components/Pages/ContragentForm.vue +2 -1
- package/components/Pages/Documents.vue +244 -6
- package/components/Pages/MemberForm.vue +276 -96
- package/components/Pages/ProductConditions.vue +275 -96
- package/components/Panel/PanelHandler.vue +236 -108
- package/components/Transitions/Animation.vue +2 -0
- package/components/Utilities/Chip.vue +3 -1
- package/components/Utilities/JsonViewer.vue +1 -2
- package/composables/classes.ts +117 -42
- package/composables/constants.ts +33 -0
- package/composables/fields.ts +6 -4
- package/composables/index.ts +243 -7
- package/composables/styles.ts +8 -24
- package/configs/pwa.ts +1 -7
- package/layouts/clear.vue +1 -1
- package/layouts/default.vue +1 -1
- package/layouts/full.vue +1 -1
- package/locales/ru.json +34 -10
- package/nuxt.config.ts +10 -13
- package/package.json +13 -12
- package/plugins/head.ts +2 -1
- package/store/data.store.ts +380 -389
- package/store/member.store.ts +3 -2
- package/store/rules.ts +19 -0
- package/tsconfig.json +3 -0
- package/types/enum.ts +19 -2
- package/types/env.d.ts +2 -2
- package/types/form.ts +71 -74
- package/types/index.ts +916 -873
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
<div :class="[$styles.flexColNav]">
|
|
12
12
|
<base-content-block v-if="hasConditionsInfo" class="flex flex-col gap-3">
|
|
13
13
|
<span
|
|
14
|
-
>{{ `Сумма страховой премии ${paymentPeriod}:` }} <b>{{ `${insurancePremiumPerMonth}
|
|
14
|
+
>{{ `Сумма страховой премии ${paymentPeriod}:` }} <b>{{ `${insurancePremiumPerMonth}` }}</b></span
|
|
15
15
|
>
|
|
16
16
|
<span
|
|
17
|
-
>{{ `Запрашиваемая страховая сумма: ` }} <b>{{ `${requestedSumInsured}
|
|
17
|
+
>{{ `Запрашиваемая страховая сумма: ` }} <b>{{ `${requestedSumInsured}` }}</b>
|
|
18
18
|
</span>
|
|
19
19
|
</base-content-block>
|
|
20
20
|
<base-content-block v-if="$dataStore.isLifetrip" class="flex flex-col gap-3">
|
|
@@ -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.length === 0" :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.length === 0) && !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="
|
|
@@ -254,6 +243,8 @@
|
|
|
254
243
|
import { DocumentItem, Value } from '../../composables/classes';
|
|
255
244
|
import { HubConnectionBuilder } from '@microsoft/signalr';
|
|
256
245
|
import { uuid } from 'vue-uuid';
|
|
246
|
+
import type { Api, SignUrlType } from '../../types';
|
|
247
|
+
import { CoreEnums } from '../../types/enum';
|
|
257
248
|
|
|
258
249
|
export default defineComponent({
|
|
259
250
|
emits: ['task'],
|
|
@@ -275,14 +266,16 @@ export default defineComponent({
|
|
|
275
266
|
const isOfflinePay = ref<boolean>(false);
|
|
276
267
|
const isQrDialog = ref<boolean>(false);
|
|
277
268
|
const email = ref<string>('');
|
|
269
|
+
const signOptions = ref<Api.Sign.New.Response>();
|
|
270
|
+
const signingFiles = ref<Api.Sign.New.FileDatas[]>([]);
|
|
271
|
+
const allDocumentsSigned = ref<boolean>(false);
|
|
272
|
+
const currentFilePanel = ref<string[]>([]);
|
|
278
273
|
|
|
279
274
|
const vForm = ref<any>();
|
|
280
275
|
const isSendNumberOpen = ref<boolean>(false);
|
|
281
276
|
const phoneNumber = ref<string | null>(formStore.policyholderForm.phoneNumber ?? '');
|
|
282
277
|
const selectedClient = ref<SignUrlType>();
|
|
283
278
|
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
279
|
const affiliationDocument = computed(() => formStore.signedDocumentList.find((file: DocumentItem) => file.fileTypeName === 'Решение АС'));
|
|
287
280
|
const affiliationData = ref<{
|
|
288
281
|
processInstanceId: string | number;
|
|
@@ -327,10 +320,53 @@ export default defineComponent({
|
|
|
327
320
|
}
|
|
328
321
|
};
|
|
329
322
|
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
323
|
+
const inSigningOrder = (files: any, index: number) => {
|
|
324
|
+
for (
|
|
325
|
+
let i = 0;
|
|
326
|
+
i <
|
|
327
|
+
files.sort(function (a: any, b: any) {
|
|
328
|
+
return a.orderFile > b.orderFile ? 1 : b.orderFile > a.orderFile ? -1 : 0;
|
|
329
|
+
}).length;
|
|
330
|
+
i++
|
|
331
|
+
) {
|
|
332
|
+
if (!files[i].isSigned) {
|
|
333
|
+
return files[i].orderFile != index;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
const getFileNew = async (file: any) => {
|
|
339
|
+
const newFile = signOptions.value?.signIds.find((i: any) => i.fileType == file.fileType);
|
|
340
|
+
if (newFile) await dataStore.getFileNew(newFile.id, 2, false, file.fileName);
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
const onFileChangeScansNew = async (event: InputEvent, file: any) => {
|
|
344
|
+
if (event.target) {
|
|
345
|
+
const files = (event.target as HTMLInputElement).files;
|
|
346
|
+
if (files && files.length) {
|
|
347
|
+
if (files[0].type !== 'application/pdf') return dataStore.showToaster('error', dataStore.t('toaster.onlyPDF'), 6000);
|
|
348
|
+
const { execute: getBase64 } = useBase64(files[0]);
|
|
349
|
+
const base64 = (await getBase64()).slice(28);
|
|
350
|
+
const data = {
|
|
351
|
+
FileBytes: base64,
|
|
352
|
+
FileName: file.fileName,
|
|
353
|
+
FileTypeCode: file.fileType,
|
|
354
|
+
};
|
|
355
|
+
if (!signOptions.value) return dataStore.showToaster('error', dataStore.t('pension.fileError'), 6000);
|
|
356
|
+
scansFiles.value.push({
|
|
357
|
+
groupId: signOptions.value.signIds.find((i: any) => i.fileType == data.FileTypeCode)?.id,
|
|
358
|
+
data: data,
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
const onClearFileNew = async (file: any) => {
|
|
365
|
+
const result = scansFiles.value.filter(i => i.data.FileTypeCode !== file.fileType);
|
|
366
|
+
scansFiles.value = result;
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
const onFileChangeScans = async (event: InputEvent, type: 'statement' | 'contract' | 'pa_refundstatement' | 'pa_refundagreement' | 'app' | 'attorney' | 'agreement') => {
|
|
334
370
|
if (event.target) {
|
|
335
371
|
const files = (event.target as HTMLInputElement).files;
|
|
336
372
|
if (files && files.length) {
|
|
@@ -352,31 +388,20 @@ export default defineComponent({
|
|
|
352
388
|
}
|
|
353
389
|
};
|
|
354
390
|
|
|
355
|
-
const onClearFile = async (
|
|
356
|
-
type: 'statement' | 'pa_statement' | 'pa_refundstatement' | 'contract' | 'pa_contract' | 'pa_refundagreement' | 'app' | 'attorney' | 'agreement',
|
|
357
|
-
) => {
|
|
391
|
+
const onClearFile = async (type: 'statement' | 'contract' | 'pa_refundstatement' | 'pa_refundagreement' | 'app' | 'attorney' | 'agreement') => {
|
|
358
392
|
const doc = await selectedDocument(type);
|
|
359
393
|
const result = scansFiles.value.filter(i => JSON.parse(i.fileData)[0].fileTypeCode !== doc.code);
|
|
360
394
|
scansFiles.value = result;
|
|
361
395
|
};
|
|
362
396
|
|
|
363
|
-
const selectedDocument = (type: 'statement' | '
|
|
397
|
+
const selectedDocument = (type: 'statement' | 'contract' | 'pa_refundstatement' | 'pa_refundagreement' | 'app' | 'attorney' | 'agreement') => {
|
|
364
398
|
let selectedDocument: any;
|
|
365
399
|
if (type === 'statement') {
|
|
366
400
|
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '32');
|
|
367
401
|
}
|
|
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
402
|
if (type === 'contract') {
|
|
375
403
|
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '6');
|
|
376
404
|
}
|
|
377
|
-
if (type === 'pa_contract') {
|
|
378
|
-
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '38');
|
|
379
|
-
}
|
|
380
405
|
if (type === 'pa_refundagreement') {
|
|
381
406
|
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '42');
|
|
382
407
|
}
|
|
@@ -392,14 +417,29 @@ export default defineComponent({
|
|
|
392
417
|
return selectedDocument;
|
|
393
418
|
};
|
|
394
419
|
|
|
420
|
+
const sendFilesNew = async () => {
|
|
421
|
+
if (scansFiles.value.length !== signOptions.value?.signIds.length) {
|
|
422
|
+
dataStore.showToaster('warning', dataStore.t('toaster.notAllDocumentsAttached'));
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
try {
|
|
426
|
+
await Promise.allSettled(
|
|
427
|
+
Object.values(scansFiles.value).map(async f => {
|
|
428
|
+
await dataStore.api.file.uploadFilesNew(f.groupId, f.data);
|
|
429
|
+
}),
|
|
430
|
+
);
|
|
431
|
+
scansFiles.value = [];
|
|
432
|
+
closePanel();
|
|
433
|
+
dataStore.showToaster('info', 'Документы подписаны');
|
|
434
|
+
await dataStore.handleTask(constants.actions.signed, route.params.taskId as string);
|
|
435
|
+
} catch (err) {
|
|
436
|
+
return ErrorHandler(err);
|
|
437
|
+
}
|
|
438
|
+
closePanel();
|
|
439
|
+
};
|
|
440
|
+
|
|
395
441
|
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
|
-
) {
|
|
442
|
+
if (scansFiles.value.length !== 4) {
|
|
403
443
|
dataStore.showToaster('warning', dataStore.t('toaster.notAllDocumentsAttached'));
|
|
404
444
|
return;
|
|
405
445
|
}
|
|
@@ -411,7 +451,7 @@ export default defineComponent({
|
|
|
411
451
|
}
|
|
412
452
|
closePanel();
|
|
413
453
|
dataStore.showToaster('success', dataStore.t('toaster.successOperation'));
|
|
414
|
-
await dataStore.handleTask(
|
|
454
|
+
await dataStore.handleTask(constants.actions.signed, route.params.taskId as string, 'scans');
|
|
415
455
|
};
|
|
416
456
|
const submitForm = async () => {
|
|
417
457
|
await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
@@ -528,14 +568,22 @@ export default defineComponent({
|
|
|
528
568
|
const affiliateActions = computed(() => dataStore.panelAction === constants.actions.affiliate);
|
|
529
569
|
const chooseSignActions = computed(() => dataStore.controls.hasChooseSign && dataStore.panelAction === constants.actions.chooseSign);
|
|
530
570
|
const choosePayActions = computed(() => dataStore.controls.hasChoosePay && dataStore.panelAction === constants.actions.choosePay);
|
|
531
|
-
|
|
571
|
+
const isNewSign = computed(() => (dataStore.isPension && !useEnv().isProduction) || dataStore.isGons);
|
|
532
572
|
const paymentPeriod = computed(() => formStore.productConditionsForm.paymentPeriod.nameRu);
|
|
533
|
-
const insurancePremiumPerMonth = computed(() =>
|
|
573
|
+
const insurancePremiumPerMonth = computed(() => {
|
|
574
|
+
if (dataStore.isGons && formStore.productConditionsForm.currency.code === 'USD') {
|
|
575
|
+
return `${formStore.productConditionsForm.insurancePremiumPerMonthInDollar}$`;
|
|
576
|
+
}
|
|
577
|
+
return `${formStore.productConditionsForm.insurancePremiumPerMonth}₸`;
|
|
578
|
+
});
|
|
534
579
|
const requestedSumInsured = computed(() => {
|
|
535
580
|
if ((dataStore.isLifeBusiness || dataStore.isGns) && formStore.productConditionsForm.requestedSumInsured === null) {
|
|
536
581
|
return dataStore.getNumberWithSpaces(formStore.applicationData.policyAppDto!.mainInsSum);
|
|
537
582
|
}
|
|
538
|
-
|
|
583
|
+
if (dataStore.isGons && formStore.productConditionsForm.currency.code === 'USD') {
|
|
584
|
+
return `${formStore.productConditionsForm.requestedSumInsuredInDollar}$`;
|
|
585
|
+
}
|
|
586
|
+
return `${formStore.productConditionsForm.requestedSumInsured}₸`;
|
|
539
587
|
});
|
|
540
588
|
const price = computed(() => dataStore.getNumberWithSpaces(formStore.productConditionsForm.calculatorForm.price));
|
|
541
589
|
const insuredAmount = computed(() => formStore.productConditionsForm.calculatorForm.amount!.nameRu! + dataStore.currency);
|
|
@@ -561,7 +609,7 @@ export default defineComponent({
|
|
|
561
609
|
return true;
|
|
562
610
|
});
|
|
563
611
|
const isElectronicDisabled = computed(() => {
|
|
564
|
-
if (dataStore.isGons || dataStore.isLifeBusiness || dataStore.isGns
|
|
612
|
+
if (dataStore.isGons || dataStore.isLifeBusiness || dataStore.isGns) {
|
|
565
613
|
return true;
|
|
566
614
|
}
|
|
567
615
|
return false;
|
|
@@ -570,37 +618,25 @@ export default defineComponent({
|
|
|
570
618
|
if (dataStore.isGons) {
|
|
571
619
|
return true;
|
|
572
620
|
}
|
|
573
|
-
if ((!consentGiven.value || formStore.applicationData.statusCode === 'HeadManagerForm') && dataStore.isPension && processCode !== 2) {
|
|
574
|
-
return true;
|
|
575
|
-
}
|
|
576
621
|
return false;
|
|
577
622
|
});
|
|
578
623
|
const isQrDisabled = computed(() => {
|
|
579
|
-
if (consentGiven.value && dataStore.isPension && processCode !== 2) {
|
|
580
|
-
return false;
|
|
581
|
-
}
|
|
582
624
|
return true;
|
|
583
625
|
});
|
|
584
626
|
const isQrXmlDisabled = computed(() => {
|
|
585
|
-
if (!consentGiven.value && dataStore.isPension && processCode !== 2) {
|
|
586
|
-
return false;
|
|
587
|
-
}
|
|
588
627
|
if (dataStore.isLifeBusiness || dataStore.isGns) {
|
|
589
628
|
return false;
|
|
590
629
|
}
|
|
591
630
|
return true;
|
|
592
631
|
});
|
|
593
632
|
const isSignatureDisabled = computed(() => {
|
|
594
|
-
if ((!consentGiven.value || formStore.applicationData.statusCode === 'HeadManagerForm') && dataStore.isPension && processCode !== 2) {
|
|
595
|
-
return false;
|
|
596
|
-
}
|
|
597
633
|
return true;
|
|
598
634
|
});
|
|
599
635
|
const downloadTemplate = async (documentType: number, fileType: string) => {
|
|
600
636
|
await dataStore.downloadTemplate(documentType, fileType, formStore.applicationData.processInstanceId);
|
|
601
637
|
};
|
|
602
638
|
|
|
603
|
-
const handleSignAction = async (type: 'paper' | 'electronic' | 'scans' | 'qr' | 'qrXml'
|
|
639
|
+
const handleSignAction = async (type: 'paper' | 'electronic' | 'scans' | 'qr' | 'qrXml') => {
|
|
604
640
|
loading.value = true;
|
|
605
641
|
if (type === 'electronic') {
|
|
606
642
|
await dataStore.signDocument();
|
|
@@ -629,9 +665,6 @@ export default defineComponent({
|
|
|
629
665
|
isQr.value = true;
|
|
630
666
|
}
|
|
631
667
|
}
|
|
632
|
-
if (type === 'signature') {
|
|
633
|
-
await dataStore.signDocument('signature');
|
|
634
|
-
}
|
|
635
668
|
loading.value = false;
|
|
636
669
|
};
|
|
637
670
|
|
|
@@ -705,7 +738,7 @@ export default defineComponent({
|
|
|
705
738
|
data.append('name', 'PAEnpf_Agreement');
|
|
706
739
|
data.append('format', 'xml');
|
|
707
740
|
data.append('EdsXmlId', groupId ?? '');
|
|
708
|
-
await dataStore.api.uploadXml(data);
|
|
741
|
+
await dataStore.api.file.uploadXml(data);
|
|
709
742
|
await dataStore.getSignedDocList(dataStore.formStore.applicationData.processInstanceId);
|
|
710
743
|
dataStore.showToaster('success', dataStore.t('pension.consentGiven'), 3000);
|
|
711
744
|
}
|
|
@@ -792,6 +825,90 @@ export default defineComponent({
|
|
|
792
825
|
dataStore.panelAction = constants.actions.pay;
|
|
793
826
|
};
|
|
794
827
|
|
|
828
|
+
const groupBy = (data: any, key: string) => {
|
|
829
|
+
return data.reduce((results: any, item: any) => {
|
|
830
|
+
results[item[key]] = results[item[key]] || [];
|
|
831
|
+
results[item[key]].push(item);
|
|
832
|
+
return results;
|
|
833
|
+
}, {});
|
|
834
|
+
};
|
|
835
|
+
|
|
836
|
+
const checkIfAllSigned = async () => {
|
|
837
|
+
await dataStore.generateSign(route.params.taskId as string);
|
|
838
|
+
formStore.signatories.find((person: any) => {
|
|
839
|
+
if (person.fileDatas.find((file: any) => file.isSigned === false) === undefined) {
|
|
840
|
+
if (formStore.applicationData.statusCode !== 'ContractSignedFrom')
|
|
841
|
+
dataStore.showToaster(
|
|
842
|
+
'success',
|
|
843
|
+
dataStore.t(`pension.${formStore.applicationData.statusCode === 'HeadManagerForm' ? 'signInProcessManager' : 'signInProcess'}`),
|
|
844
|
+
30000,
|
|
845
|
+
);
|
|
846
|
+
allDocumentsSigned.value = true;
|
|
847
|
+
}
|
|
848
|
+
});
|
|
849
|
+
};
|
|
850
|
+
|
|
851
|
+
const newSign = async (signType: number, file: any, index: number) => {
|
|
852
|
+
loading.value = true;
|
|
853
|
+
const data = {
|
|
854
|
+
...formStore.signatories[index],
|
|
855
|
+
signType: signType,
|
|
856
|
+
fileDatas: file,
|
|
857
|
+
};
|
|
858
|
+
try {
|
|
859
|
+
signOptions.value = await dataStore.api.file.generalSign(data);
|
|
860
|
+
const message = [];
|
|
861
|
+
for (let i of file) {
|
|
862
|
+
message.push(i.fileName);
|
|
863
|
+
}
|
|
864
|
+
if (signOptions.value) {
|
|
865
|
+
switch (signType) {
|
|
866
|
+
case CoreEnums.Sign.Types.electronic:
|
|
867
|
+
// @ts-ignore
|
|
868
|
+
formStore.signUrls = [signOptions.value];
|
|
869
|
+
isElectronicContract.value = true;
|
|
870
|
+
dataStore.panelAction = constants.actions.sign;
|
|
871
|
+
break;
|
|
872
|
+
case CoreEnums.Sign.Types.scans:
|
|
873
|
+
isScansDocuments.value = true;
|
|
874
|
+
signingFiles.value = data.fileDatas;
|
|
875
|
+
message.length = 0;
|
|
876
|
+
break;
|
|
877
|
+
case CoreEnums.Sign.Types.qr:
|
|
878
|
+
if (!signOptions.value.signatureDocumentGroupId) return dataStore.showToaster('error', 'Ошибка подписи документов', 10000);
|
|
879
|
+
await generateQR(signOptions.value.signatureDocumentGroupId);
|
|
880
|
+
isQr.value = true;
|
|
881
|
+
break;
|
|
882
|
+
case CoreEnums.Sign.Types.qrXml:
|
|
883
|
+
if (!signOptions.value.edsXmlId) return dataStore.showToaster('error', 'Ошибка подписи документов', 10000);
|
|
884
|
+
await generateQR(signOptions.value.edsXmlId, 'xml');
|
|
885
|
+
isQr.value = true;
|
|
886
|
+
break;
|
|
887
|
+
case CoreEnums.Sign.Types.nclayer:
|
|
888
|
+
for (let sign of signOptions.value.signIds) {
|
|
889
|
+
const response = await dataStore.nclayerSign(sign.id, signType, file[0].fileType === 43);
|
|
890
|
+
if (!response) {
|
|
891
|
+
dataStore.showToaster('error', 'Ошибка подписи документов', 10000);
|
|
892
|
+
message.length = 0;
|
|
893
|
+
break;
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
break;
|
|
897
|
+
default:
|
|
898
|
+
break;
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
if (message.length) {
|
|
902
|
+
// dataStore.showToaster('info', 'Подписывается: ' + message.join(', '), 5000);
|
|
903
|
+
await checkIfAllSigned();
|
|
904
|
+
}
|
|
905
|
+
currentFilePanel.value = [];
|
|
906
|
+
} catch (err) {
|
|
907
|
+
ErrorHandler(err);
|
|
908
|
+
}
|
|
909
|
+
loading.value = false;
|
|
910
|
+
};
|
|
911
|
+
|
|
795
912
|
return {
|
|
796
913
|
// State
|
|
797
914
|
formStore,
|
|
@@ -813,6 +930,10 @@ export default defineComponent({
|
|
|
813
930
|
processCode,
|
|
814
931
|
isQrDialog,
|
|
815
932
|
email,
|
|
933
|
+
signOptions,
|
|
934
|
+
signingFiles,
|
|
935
|
+
allDocumentsSigned,
|
|
936
|
+
currentFilePanel,
|
|
816
937
|
|
|
817
938
|
// Functions
|
|
818
939
|
closePanel,
|
|
@@ -824,6 +945,7 @@ export default defineComponent({
|
|
|
824
945
|
downloadTemplate,
|
|
825
946
|
onFileChangeScans,
|
|
826
947
|
sendFiles,
|
|
948
|
+
sendFilesNew,
|
|
827
949
|
onClearFile,
|
|
828
950
|
closeQrPanel,
|
|
829
951
|
handlePayAction,
|
|
@@ -857,7 +979,13 @@ export default defineComponent({
|
|
|
857
979
|
isQrXmlDisabled,
|
|
858
980
|
isSignatureDisabled,
|
|
859
981
|
choosePayActions,
|
|
860
|
-
|
|
982
|
+
groupBy,
|
|
983
|
+
newSign,
|
|
984
|
+
onFileChangeScansNew,
|
|
985
|
+
onClearFileNew,
|
|
986
|
+
getFileNew,
|
|
987
|
+
inSigningOrder,
|
|
988
|
+
isNewSign,
|
|
861
989
|
};
|
|
862
990
|
},
|
|
863
991
|
});
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<label v-if="chip && chip.title" class="transition-all leading-6 px-3
|
|
2
|
+
<label v-if="chip && chip.title" class="transition-all leading-6 px-3 rounded-pill border-[1px] border-white mr-4 whitespace-nowrap" :class="[textSize, color]"
|
|
3
3
|
>{{ chip.title }}<v-tooltip v-if="chip.description" activator="parent" location="bottom" :max-width="maxWidth">{{ chip.description }}</v-tooltip></label
|
|
4
4
|
>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script lang="ts">
|
|
8
|
+
import type { ChipComponent } from '../../types';
|
|
9
|
+
|
|
8
10
|
export default defineComponent({
|
|
9
11
|
props: {
|
|
10
12
|
chip: {
|
|
@@ -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
|
},
|