hl-core 0.0.10-beta.3 → 0.0.10-beta.31
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/README.md +0 -2
- package/api/base.api.ts +300 -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 +17 -8
- package/components/Form/ProductConditionsBlock.vue +12 -6
- package/components/Input/Datepicker.vue +5 -0
- package/components/Input/DynamicInput.vue +2 -0
- package/components/Input/FormInput.vue +7 -0
- package/components/Input/OtpInput.vue +25 -0
- package/components/Input/PanelInput.vue +1 -0
- package/components/Input/RoundedInput.vue +4 -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 +429 -59
- package/components/Pages/MemberForm.vue +327 -159
- package/components/Pages/ProductConditions.vue +681 -150
- package/components/Panel/PanelHandler.vue +261 -114
- 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 +133 -42
- package/composables/constants.ts +41 -0
- package/composables/fields.ts +6 -4
- package/composables/index.ts +246 -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 +44 -14
- package/nuxt.config.ts +10 -13
- package/package.json +13 -12
- package/plugins/head.ts +2 -1
- package/store/data.store.ts +670 -480
- package/store/member.store.ts +18 -6
- package/store/rules.ts +21 -2
- package/tsconfig.json +3 -0
- package/types/enum.ts +20 -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,54 @@
|
|
|
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
|
|
77
|
+
v-if="(processCode === 19 || processCode === 25) && formStore.applicationData.statusCode === 'AttachAppContractForm'"
|
|
78
|
+
:class="[$styles.blueBgLight]"
|
|
79
|
+
class="rounded-lg p-4"
|
|
80
|
+
>
|
|
81
|
+
<base-form-toggle v-model="isOnlineEnpf" title="Онлайн подписание согласия для ЕНПФ" :has-border="false" @clicked="setActualEnpf" />
|
|
82
|
+
</div>
|
|
83
|
+
<div :class="[$styles.blueBgLight]" class="rounded-lg p-4">
|
|
84
|
+
<v-expansion-panels v-if="formStore.signatories.length" variant="accordion" :multiple="false">
|
|
85
|
+
<v-expansion-panel v-for="(person, index) of formStore.signatories" :key="person.personId!" class="border-[1px]" elevation="0" bg-color="#FFF">
|
|
86
|
+
<v-expansion-panel-title class="h-[80px]" :class="$styles.textTitle">
|
|
87
|
+
{{ person.longName }}
|
|
88
|
+
</v-expansion-panel-title>
|
|
89
|
+
<v-expansion-panel-text class="border-t-[1px]">
|
|
90
|
+
<section class="flex flex-col" :class="$styles.textSimple">
|
|
91
|
+
<v-expansion-panels v-if="person.fileDatas.length" v-model="currentFilePanel" :multiple="false">
|
|
92
|
+
<v-expansion-panel
|
|
93
|
+
v-for="(file, fileIndex) in groupBy(person.fileDatas, 'orderFile')"
|
|
94
|
+
:value="`${index} - ${fileIndex}`"
|
|
95
|
+
:disabled="inSigningOrder(person.fileDatas, fileIndex) || file.every((f: any) => f.isSigned === true)"
|
|
96
|
+
>
|
|
97
|
+
<v-expansion-panel-title v-for="name in file" class="h-[80px]" :class="$styles.textTitle">
|
|
98
|
+
{{ name.fileName }}
|
|
99
|
+
</v-expansion-panel-title>
|
|
100
|
+
<v-expansion-panel-text class="border-t-[1px]">
|
|
101
|
+
<section class="flex flex-col gap-4 py-3" :class="$styles.textSimple">
|
|
102
|
+
<base-btn
|
|
103
|
+
v-for="signtype in file[0].signTypes"
|
|
104
|
+
:text="signtype.documentSignTypeName"
|
|
105
|
+
:btn="$styles.greenBtn"
|
|
106
|
+
@click="newSign(signtype.documentSignTypeValue, file, index)"
|
|
107
|
+
:loading="loading"
|
|
108
|
+
/>
|
|
109
|
+
</section>
|
|
110
|
+
</v-expansion-panel-text>
|
|
111
|
+
</v-expansion-panel>
|
|
112
|
+
</v-expansion-panels>
|
|
113
|
+
</section>
|
|
114
|
+
</v-expansion-panel-text>
|
|
115
|
+
</v-expansion-panel>
|
|
116
|
+
</v-expansion-panels>
|
|
117
|
+
<base-list-empty v-else />
|
|
118
|
+
</div>
|
|
119
|
+
<base-animation>
|
|
120
|
+
<base-btn v-if="isAllPaperSigned" :text="$dataStore.t('buttons.send')" :loading="loading" @click="$dataStore.panelAction = constants.actions.signed" />
|
|
121
|
+
</base-animation>
|
|
122
|
+
</div>
|
|
124
123
|
</section>
|
|
125
124
|
<section v-if="choosePayActions">
|
|
126
125
|
<div v-if="!isEpayPay && !isOfflinePay" :class="[$styles.flexColNav]">
|
|
@@ -178,7 +177,7 @@
|
|
|
178
177
|
</div>
|
|
179
178
|
</base-fade-transition>
|
|
180
179
|
<base-btn
|
|
181
|
-
v-if="
|
|
180
|
+
v-if="isElectronicContract"
|
|
182
181
|
:text="$dataStore.t('buttons.cancel')"
|
|
183
182
|
:btn="$styles.whiteBtn"
|
|
184
183
|
@click="
|
|
@@ -254,6 +253,8 @@
|
|
|
254
253
|
import { DocumentItem, Value } from '../../composables/classes';
|
|
255
254
|
import { HubConnectionBuilder } from '@microsoft/signalr';
|
|
256
255
|
import { uuid } from 'vue-uuid';
|
|
256
|
+
import type * as Types from '../../types';
|
|
257
|
+
import { CoreEnums } from '../../types/enum';
|
|
257
258
|
|
|
258
259
|
export default defineComponent({
|
|
259
260
|
emits: ['task'],
|
|
@@ -275,14 +276,16 @@ export default defineComponent({
|
|
|
275
276
|
const isOfflinePay = ref<boolean>(false);
|
|
276
277
|
const isQrDialog = ref<boolean>(false);
|
|
277
278
|
const email = ref<string>('');
|
|
279
|
+
const signOptions = ref<Types.Api.Sign.New.Response>();
|
|
280
|
+
const signingFiles = ref<Types.Api.Sign.New.FileDatas[]>([]);
|
|
281
|
+
const isOnlineEnpf = ref<boolean>(true);
|
|
282
|
+
const currentFilePanel = ref<string[]>([]);
|
|
278
283
|
|
|
279
284
|
const vForm = ref<any>();
|
|
280
285
|
const isSendNumberOpen = ref<boolean>(false);
|
|
281
286
|
const phoneNumber = ref<string | null>(formStore.policyholderForm.phoneNumber ?? '');
|
|
282
|
-
const selectedClient = ref<SignUrlType>();
|
|
287
|
+
const selectedClient = ref<Types.SignUrlType>();
|
|
283
288
|
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
289
|
const affiliationDocument = computed(() => formStore.signedDocumentList.find((file: DocumentItem) => file.fileTypeName === 'Решение АС'));
|
|
287
290
|
const affiliationData = ref<{
|
|
288
291
|
processInstanceId: string | number;
|
|
@@ -297,9 +300,10 @@ export default defineComponent({
|
|
|
297
300
|
const affiliationFormData = ref(new FormData());
|
|
298
301
|
const scansFormData = ref(new FormData());
|
|
299
302
|
const scansFiles = ref<any[]>([]);
|
|
303
|
+
const isAllPaperSigned = computed(() => formStore.signatories.every((person: any) => person.fileDatas.every((file: any) => file.isSigned === true && file.signedType === 2)));
|
|
300
304
|
const processCode = formStore.applicationData.processCode;
|
|
301
305
|
|
|
302
|
-
const openSmsPanel = (signInfo: SignUrlType) => {
|
|
306
|
+
const openSmsPanel = (signInfo: Types.SignUrlType) => {
|
|
303
307
|
if (signInfo) {
|
|
304
308
|
isSendNumberOpen.value = true;
|
|
305
309
|
selectedClient.value = signInfo;
|
|
@@ -327,10 +331,53 @@ export default defineComponent({
|
|
|
327
331
|
}
|
|
328
332
|
};
|
|
329
333
|
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
+
const inSigningOrder = (files: any, index: number) => {
|
|
335
|
+
for (
|
|
336
|
+
let i = 0;
|
|
337
|
+
i <
|
|
338
|
+
files.sort(function (a: any, b: any) {
|
|
339
|
+
return a.orderFile > b.orderFile ? 1 : b.orderFile > a.orderFile ? -1 : 0;
|
|
340
|
+
}).length;
|
|
341
|
+
i++
|
|
342
|
+
) {
|
|
343
|
+
if (!files[i].isSigned) {
|
|
344
|
+
return files[i].orderFile != index;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
const getFileNew = async (file: any) => {
|
|
350
|
+
const newFile = signOptions.value?.signIds.find((i: any) => i.fileType == file.fileType);
|
|
351
|
+
if (newFile) await dataStore.getFileNew(newFile.id, 2, false, file.fileName);
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
const onFileChangeScansNew = async (event: InputEvent, file: any) => {
|
|
355
|
+
if (event.target) {
|
|
356
|
+
const files = (event.target as HTMLInputElement).files;
|
|
357
|
+
if (files && files.length) {
|
|
358
|
+
if (files[0].type !== 'application/pdf') return dataStore.showToaster('error', dataStore.t('toaster.onlyPDF'), 6000);
|
|
359
|
+
const { execute: getBase64 } = useBase64(files[0]);
|
|
360
|
+
const base64 = (await getBase64()).slice(28);
|
|
361
|
+
const data = {
|
|
362
|
+
FileBytes: base64,
|
|
363
|
+
FileName: file.fileName,
|
|
364
|
+
FileTypeCode: file.fileType,
|
|
365
|
+
};
|
|
366
|
+
if (!signOptions.value) return dataStore.showToaster('error', dataStore.t('pension.fileError'), 6000);
|
|
367
|
+
scansFiles.value.push({
|
|
368
|
+
groupId: signOptions.value.signIds.find((i: any) => i.fileType == data.FileTypeCode)?.id,
|
|
369
|
+
data: data,
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
const onClearFileNew = async (file: any) => {
|
|
376
|
+
const result = scansFiles.value.filter(i => i.data.FileTypeCode !== file.fileType);
|
|
377
|
+
scansFiles.value = result;
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
const onFileChangeScans = async (event: InputEvent, type: 'statement' | 'contract' | 'pa_refundstatement' | 'pa_refundagreement' | 'app' | 'attorney' | 'agreement') => {
|
|
334
381
|
if (event.target) {
|
|
335
382
|
const files = (event.target as HTMLInputElement).files;
|
|
336
383
|
if (files && files.length) {
|
|
@@ -352,31 +399,20 @@ export default defineComponent({
|
|
|
352
399
|
}
|
|
353
400
|
};
|
|
354
401
|
|
|
355
|
-
const onClearFile = async (
|
|
356
|
-
type: 'statement' | 'pa_statement' | 'pa_refundstatement' | 'contract' | 'pa_contract' | 'pa_refundagreement' | 'app' | 'attorney' | 'agreement',
|
|
357
|
-
) => {
|
|
402
|
+
const onClearFile = async (type: 'statement' | 'contract' | 'pa_refundstatement' | 'pa_refundagreement' | 'app' | 'attorney' | 'agreement') => {
|
|
358
403
|
const doc = await selectedDocument(type);
|
|
359
404
|
const result = scansFiles.value.filter(i => JSON.parse(i.fileData)[0].fileTypeCode !== doc.code);
|
|
360
405
|
scansFiles.value = result;
|
|
361
406
|
};
|
|
362
407
|
|
|
363
|
-
const selectedDocument = (type: 'statement' | '
|
|
408
|
+
const selectedDocument = (type: 'statement' | 'contract' | 'pa_refundstatement' | 'pa_refundagreement' | 'app' | 'attorney' | 'agreement') => {
|
|
364
409
|
let selectedDocument: any;
|
|
365
410
|
if (type === 'statement') {
|
|
366
411
|
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '32');
|
|
367
412
|
}
|
|
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
413
|
if (type === 'contract') {
|
|
375
414
|
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '6');
|
|
376
415
|
}
|
|
377
|
-
if (type === 'pa_contract') {
|
|
378
|
-
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '38');
|
|
379
|
-
}
|
|
380
416
|
if (type === 'pa_refundagreement') {
|
|
381
417
|
selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '42');
|
|
382
418
|
}
|
|
@@ -392,14 +428,28 @@ export default defineComponent({
|
|
|
392
428
|
return selectedDocument;
|
|
393
429
|
};
|
|
394
430
|
|
|
431
|
+
const sendFilesNew = async () => {
|
|
432
|
+
if (scansFiles.value.length !== signingFiles.value.length) {
|
|
433
|
+
dataStore.showToaster('warning', dataStore.t('toaster.notAllDocumentsAttached'));
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
try {
|
|
437
|
+
await Promise.allSettled(
|
|
438
|
+
Object.values(scansFiles.value).map(async f => {
|
|
439
|
+
await dataStore.api.file.uploadFilesNew(f.groupId, f.data);
|
|
440
|
+
}),
|
|
441
|
+
);
|
|
442
|
+
await checkIfAllSigned(true);
|
|
443
|
+
scansFiles.value = [];
|
|
444
|
+
isScansDocuments.value = false;
|
|
445
|
+
dataStore.showToaster('info', 'Документы загружены успешно');
|
|
446
|
+
} catch (err) {
|
|
447
|
+
return ErrorHandler(err);
|
|
448
|
+
}
|
|
449
|
+
};
|
|
450
|
+
|
|
395
451
|
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
|
-
) {
|
|
452
|
+
if (scansFiles.value.length !== 4) {
|
|
403
453
|
dataStore.showToaster('warning', dataStore.t('toaster.notAllDocumentsAttached'));
|
|
404
454
|
return;
|
|
405
455
|
}
|
|
@@ -411,7 +461,7 @@ export default defineComponent({
|
|
|
411
461
|
}
|
|
412
462
|
closePanel();
|
|
413
463
|
dataStore.showToaster('success', dataStore.t('toaster.successOperation'));
|
|
414
|
-
await dataStore.handleTask(
|
|
464
|
+
await dataStore.handleTask(constants.actions.signed, route.params.taskId as string, 'scans');
|
|
415
465
|
};
|
|
416
466
|
const submitForm = async () => {
|
|
417
467
|
await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
@@ -466,7 +516,11 @@ export default defineComponent({
|
|
|
466
516
|
}
|
|
467
517
|
}
|
|
468
518
|
if (dataStore.isPension) {
|
|
469
|
-
|
|
519
|
+
if (formStore.applicationData.pensionApp) {
|
|
520
|
+
const isOnlineEnpfAgreement = formStore.applicationData.pensionApp.isOnlineEnpfAgreement;
|
|
521
|
+
isOnlineEnpf.value = isOnlineEnpfAgreement === null ? true : isOnlineEnpfAgreement;
|
|
522
|
+
await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
|
|
523
|
+
}
|
|
470
524
|
}
|
|
471
525
|
};
|
|
472
526
|
|
|
@@ -522,25 +576,33 @@ export default defineComponent({
|
|
|
522
576
|
dataStore.panelAction === constants.actions.return ||
|
|
523
577
|
dataStore.panelAction === constants.actions.rejectclient,
|
|
524
578
|
);
|
|
525
|
-
const acceptAction = computed(() => dataStore.panelAction === constants.actions.accept);
|
|
579
|
+
const acceptAction = computed(() => dataStore.panelAction === constants.actions.accept || (dataStore.isPension && dataStore.panelAction === constants.actions.signed));
|
|
526
580
|
const signingActions = computed(() => dataStore.panelAction === constants.actions.sign);
|
|
527
581
|
const payingActions = computed(() => dataStore.panelAction === constants.actions.pay);
|
|
528
582
|
const affiliateActions = computed(() => dataStore.panelAction === constants.actions.affiliate);
|
|
529
583
|
const chooseSignActions = computed(() => dataStore.controls.hasChooseSign && dataStore.panelAction === constants.actions.chooseSign);
|
|
530
584
|
const choosePayActions = computed(() => dataStore.controls.hasChoosePay && dataStore.panelAction === constants.actions.choosePay);
|
|
531
|
-
|
|
585
|
+
const isNewSign = computed(() => dataStore.isPension || dataStore.isGons);
|
|
532
586
|
const paymentPeriod = computed(() => formStore.productConditionsForm.paymentPeriod.nameRu);
|
|
533
|
-
const insurancePremiumPerMonth = computed(() =>
|
|
587
|
+
const insurancePremiumPerMonth = computed(() => {
|
|
588
|
+
if (dataStore.isGons && formStore.productConditionsForm.currency.code === 'USD') {
|
|
589
|
+
return `${formStore.productConditionsForm.insurancePremiumPerMonthInDollar}$`;
|
|
590
|
+
}
|
|
591
|
+
return `${formStore.productConditionsForm.insurancePremiumPerMonth}₸`;
|
|
592
|
+
});
|
|
534
593
|
const requestedSumInsured = computed(() => {
|
|
535
594
|
if ((dataStore.isLifeBusiness || dataStore.isGns) && formStore.productConditionsForm.requestedSumInsured === null) {
|
|
536
595
|
return dataStore.getNumberWithSpaces(formStore.applicationData.policyAppDto!.mainInsSum);
|
|
537
596
|
}
|
|
538
|
-
|
|
597
|
+
if (dataStore.isGons && formStore.productConditionsForm.currency.code === 'USD') {
|
|
598
|
+
return `${formStore.productConditionsForm.requestedSumInsuredInDollar}$`;
|
|
599
|
+
}
|
|
600
|
+
return `${formStore.productConditionsForm.requestedSumInsured}₸`;
|
|
539
601
|
});
|
|
540
602
|
const price = computed(() => dataStore.getNumberWithSpaces(formStore.productConditionsForm.calculatorForm.price));
|
|
541
603
|
const insuredAmount = computed(() => formStore.productConditionsForm.calculatorForm.amount!.nameRu! + dataStore.currency);
|
|
542
604
|
const hasConditionsInfo = computed(() => {
|
|
543
|
-
if (dataStore.isLifetrip || dataStore.isDas || dataStore.isUU || dataStore.isPrePension) {
|
|
605
|
+
if (dataStore.isLifetrip || dataStore.isDas || dataStore.isUU || dataStore.isPrePension || dataStore.isPension) {
|
|
544
606
|
return false;
|
|
545
607
|
}
|
|
546
608
|
if (dataStore.isFinCenter()) {
|
|
@@ -561,7 +623,7 @@ export default defineComponent({
|
|
|
561
623
|
return true;
|
|
562
624
|
});
|
|
563
625
|
const isElectronicDisabled = computed(() => {
|
|
564
|
-
if (dataStore.isGons || dataStore.isLifeBusiness || dataStore.isGns
|
|
626
|
+
if (dataStore.isGons || dataStore.isLifeBusiness || dataStore.isGns) {
|
|
565
627
|
return true;
|
|
566
628
|
}
|
|
567
629
|
return false;
|
|
@@ -570,37 +632,25 @@ export default defineComponent({
|
|
|
570
632
|
if (dataStore.isGons) {
|
|
571
633
|
return true;
|
|
572
634
|
}
|
|
573
|
-
if ((!consentGiven.value || formStore.applicationData.statusCode === 'HeadManagerForm') && dataStore.isPension && processCode !== 2) {
|
|
574
|
-
return true;
|
|
575
|
-
}
|
|
576
635
|
return false;
|
|
577
636
|
});
|
|
578
637
|
const isQrDisabled = computed(() => {
|
|
579
|
-
if (consentGiven.value && dataStore.isPension && processCode !== 2) {
|
|
580
|
-
return false;
|
|
581
|
-
}
|
|
582
638
|
return true;
|
|
583
639
|
});
|
|
584
640
|
const isQrXmlDisabled = computed(() => {
|
|
585
|
-
if (!consentGiven.value && dataStore.isPension && processCode !== 2) {
|
|
586
|
-
return false;
|
|
587
|
-
}
|
|
588
641
|
if (dataStore.isLifeBusiness || dataStore.isGns) {
|
|
589
642
|
return false;
|
|
590
643
|
}
|
|
591
644
|
return true;
|
|
592
645
|
});
|
|
593
646
|
const isSignatureDisabled = computed(() => {
|
|
594
|
-
if ((!consentGiven.value || formStore.applicationData.statusCode === 'HeadManagerForm') && dataStore.isPension && processCode !== 2) {
|
|
595
|
-
return false;
|
|
596
|
-
}
|
|
597
647
|
return true;
|
|
598
648
|
});
|
|
599
649
|
const downloadTemplate = async (documentType: number, fileType: string) => {
|
|
600
650
|
await dataStore.downloadTemplate(documentType, fileType, formStore.applicationData.processInstanceId);
|
|
601
651
|
};
|
|
602
652
|
|
|
603
|
-
const handleSignAction = async (type: 'paper' | 'electronic' | 'scans' | 'qr' | 'qrXml'
|
|
653
|
+
const handleSignAction = async (type: 'paper' | 'electronic' | 'scans' | 'qr' | 'qrXml') => {
|
|
604
654
|
loading.value = true;
|
|
605
655
|
if (type === 'electronic') {
|
|
606
656
|
await dataStore.signDocument();
|
|
@@ -629,9 +679,6 @@ export default defineComponent({
|
|
|
629
679
|
isQr.value = true;
|
|
630
680
|
}
|
|
631
681
|
}
|
|
632
|
-
if (type === 'signature') {
|
|
633
|
-
await dataStore.signDocument('signature');
|
|
634
|
-
}
|
|
635
682
|
loading.value = false;
|
|
636
683
|
};
|
|
637
684
|
|
|
@@ -705,7 +752,7 @@ export default defineComponent({
|
|
|
705
752
|
data.append('name', 'PAEnpf_Agreement');
|
|
706
753
|
data.append('format', 'xml');
|
|
707
754
|
data.append('EdsXmlId', groupId ?? '');
|
|
708
|
-
await dataStore.api.uploadXml(data);
|
|
755
|
+
await dataStore.api.file.uploadXml(data);
|
|
709
756
|
await dataStore.getSignedDocList(dataStore.formStore.applicationData.processInstanceId);
|
|
710
757
|
dataStore.showToaster('success', dataStore.t('pension.consentGiven'), 3000);
|
|
711
758
|
}
|
|
@@ -741,7 +788,7 @@ export default defineComponent({
|
|
|
741
788
|
await dataStore.generateDocument();
|
|
742
789
|
};
|
|
743
790
|
|
|
744
|
-
const convertQr = async (url: string | null, template?: Api.GenerateShortLink.Templates) => {
|
|
791
|
+
const convertQr = async (url: string | null, template?: Types.Api.GenerateShortLink.Templates) => {
|
|
745
792
|
if (url) {
|
|
746
793
|
const shortedUrl = await dataStore.generateShortLink(url, template);
|
|
747
794
|
qrUrl.value = typeof shortedUrl === 'string' && !!shortedUrl ? shortedUrl : url;
|
|
@@ -792,6 +839,93 @@ export default defineComponent({
|
|
|
792
839
|
dataStore.panelAction = constants.actions.pay;
|
|
793
840
|
};
|
|
794
841
|
|
|
842
|
+
const groupBy = (data: any, key: string) => {
|
|
843
|
+
return data.reduce((results: any, item: any) => {
|
|
844
|
+
results[item[key]] = results[item[key]] || [];
|
|
845
|
+
results[item[key]].push(item);
|
|
846
|
+
return results;
|
|
847
|
+
}, {});
|
|
848
|
+
};
|
|
849
|
+
|
|
850
|
+
const checkIfAllSigned = async (sendTask: boolean = false) => {
|
|
851
|
+
await dataStore.generateSign(route.params.taskId as string);
|
|
852
|
+
formStore.signatories.find(async (person: any) => {
|
|
853
|
+
if (person.fileDatas.find((file: any) => file.isSigned === false) === undefined) {
|
|
854
|
+
if (formStore.applicationData.statusCode !== 'ContractSignedFrom') {
|
|
855
|
+
// TODO better if condition
|
|
856
|
+
// dataStore.showToaster(
|
|
857
|
+
// 'success',
|
|
858
|
+
// dataStore.t(`pension.${formStore.applicationData.statusCode === 'HeadManagerForm' ? 'signInProcessManager' : 'signInProcess'}`),
|
|
859
|
+
// 30000,
|
|
860
|
+
// );
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
});
|
|
864
|
+
};
|
|
865
|
+
|
|
866
|
+
const newSign = async (signType: number, file: any, index: number) => {
|
|
867
|
+
loading.value = true;
|
|
868
|
+
const data = {
|
|
869
|
+
...formStore.signatories[index],
|
|
870
|
+
signType: signType,
|
|
871
|
+
fileDatas: file,
|
|
872
|
+
} as Types.Api.Sign.New.GeneralResponse;
|
|
873
|
+
try {
|
|
874
|
+
signOptions.value = await dataStore.generalSign(data);
|
|
875
|
+
if (signOptions.value) {
|
|
876
|
+
switch (signType) {
|
|
877
|
+
case CoreEnums.Sign.Types.electronic:
|
|
878
|
+
// @ts-ignore
|
|
879
|
+
formStore.signUrls = [signOptions.value];
|
|
880
|
+
isElectronicContract.value = true;
|
|
881
|
+
dataStore.panelAction = constants.actions.sign;
|
|
882
|
+
break;
|
|
883
|
+
case CoreEnums.Sign.Types.scans:
|
|
884
|
+
isScansDocuments.value = true;
|
|
885
|
+
signingFiles.value = data.fileDatas && Array.isArray(data.fileDatas) ? data.fileDatas.filter(i => i.isSigned !== true) : [];
|
|
886
|
+
break;
|
|
887
|
+
case CoreEnums.Sign.Types.qr:
|
|
888
|
+
if (!signOptions.value.signatureDocumentGroupId) return dataStore.showToaster('error', 'Ошибка подписи документов', 10000);
|
|
889
|
+
await generateQR(signOptions.value.signatureDocumentGroupId);
|
|
890
|
+
isQr.value = true;
|
|
891
|
+
break;
|
|
892
|
+
case CoreEnums.Sign.Types.qrXml:
|
|
893
|
+
if (!signOptions.value.edsXmlId) return dataStore.showToaster('error', 'Ошибка подписи документов', 10000);
|
|
894
|
+
await generateQR(signOptions.value.edsXmlId, 'xml');
|
|
895
|
+
isQr.value = true;
|
|
896
|
+
break;
|
|
897
|
+
case CoreEnums.Sign.Types.nclayer:
|
|
898
|
+
for (let sign of signOptions.value.signIds) {
|
|
899
|
+
const response = await dataStore.nclayerSign(sign.id, signType, file[0].fileType === 43);
|
|
900
|
+
if (response === null) {
|
|
901
|
+
dataStore.showToaster('error', 'Ошибка подписи документов', 10000);
|
|
902
|
+
break;
|
|
903
|
+
}
|
|
904
|
+
if (!response) break;
|
|
905
|
+
}
|
|
906
|
+
break;
|
|
907
|
+
default:
|
|
908
|
+
break;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
await checkIfAllSigned();
|
|
912
|
+
currentFilePanel.value = [];
|
|
913
|
+
} catch (err) {
|
|
914
|
+
ErrorHandler(err);
|
|
915
|
+
}
|
|
916
|
+
loading.value = false;
|
|
917
|
+
};
|
|
918
|
+
|
|
919
|
+
const setActualEnpf = useDebounceFn(async () => {
|
|
920
|
+
try {
|
|
921
|
+
await dataStore.api.file.setActualEnpf({ processId: String(formStore.applicationData.processInstanceId), isOnlineEnpfAgreement: isOnlineEnpf.value });
|
|
922
|
+
await dataStore.generateSign(String(route.params.taskId));
|
|
923
|
+
} catch (err) {
|
|
924
|
+
ErrorHandler(err);
|
|
925
|
+
}
|
|
926
|
+
currentFilePanel.value = [];
|
|
927
|
+
}, 1000);
|
|
928
|
+
|
|
795
929
|
return {
|
|
796
930
|
// State
|
|
797
931
|
formStore,
|
|
@@ -813,6 +947,10 @@ export default defineComponent({
|
|
|
813
947
|
processCode,
|
|
814
948
|
isQrDialog,
|
|
815
949
|
email,
|
|
950
|
+
signOptions,
|
|
951
|
+
signingFiles,
|
|
952
|
+
isOnlineEnpf,
|
|
953
|
+
currentFilePanel,
|
|
816
954
|
|
|
817
955
|
// Functions
|
|
818
956
|
closePanel,
|
|
@@ -824,11 +962,13 @@ export default defineComponent({
|
|
|
824
962
|
downloadTemplate,
|
|
825
963
|
onFileChangeScans,
|
|
826
964
|
sendFiles,
|
|
965
|
+
sendFilesNew,
|
|
827
966
|
onClearFile,
|
|
828
967
|
closeQrPanel,
|
|
829
968
|
handlePayAction,
|
|
830
969
|
payEpay,
|
|
831
970
|
convertQr,
|
|
971
|
+
setActualEnpf,
|
|
832
972
|
sendInvoiceToEmail,
|
|
833
973
|
hasConditionsAction,
|
|
834
974
|
|
|
@@ -841,6 +981,7 @@ export default defineComponent({
|
|
|
841
981
|
affiliateActions,
|
|
842
982
|
chooseSignActions,
|
|
843
983
|
paymentPeriod,
|
|
984
|
+
isAllPaperSigned,
|
|
844
985
|
insurancePremiumPerMonth,
|
|
845
986
|
requestedSumInsured,
|
|
846
987
|
affiliationDocument,
|
|
@@ -857,7 +998,13 @@ export default defineComponent({
|
|
|
857
998
|
isQrXmlDisabled,
|
|
858
999
|
isSignatureDisabled,
|
|
859
1000
|
choosePayActions,
|
|
860
|
-
|
|
1001
|
+
groupBy,
|
|
1002
|
+
newSign,
|
|
1003
|
+
onFileChangeScansNew,
|
|
1004
|
+
onClearFileNew,
|
|
1005
|
+
getFileNew,
|
|
1006
|
+
inSigningOrder,
|
|
1007
|
+
isNewSign,
|
|
861
1008
|
};
|
|
862
1009
|
},
|
|
863
1010
|
});
|
|
@@ -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
|
},
|