hl-core 0.0.9-beta.9 → 0.0.10-beta.1
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 +1109 -0
- package/api/index.ts +2 -620
- package/api/interceptors.ts +38 -1
- package/components/Button/Btn.vue +1 -6
- package/components/Complex/MessageBlock.vue +1 -1
- package/components/Complex/Page.vue +1 -1
- package/components/Complex/TextBlock.vue +23 -0
- package/components/Dialog/Dialog.vue +70 -16
- package/components/Dialog/FamilyDialog.vue +1 -1
- package/components/Form/DynamicForm.vue +100 -0
- package/components/Form/FormBlock.vue +12 -3
- package/components/Form/FormData.vue +110 -0
- package/components/Form/FormSection.vue +3 -3
- package/components/Form/FormTextSection.vue +11 -3
- package/components/Form/FormToggle.vue +25 -5
- package/components/Form/ManagerAttachment.vue +177 -89
- package/components/Form/ProductConditionsBlock.vue +59 -6
- package/components/Input/Datepicker.vue +43 -7
- package/components/Input/DynamicInput.vue +23 -0
- package/components/Input/FileInput.vue +25 -5
- package/components/Input/FormInput.vue +7 -4
- package/components/Input/Monthpicker.vue +34 -0
- package/components/Input/PanelInput.vue +5 -1
- package/components/Input/RoundedSelect.vue +7 -2
- package/components/Input/SwitchInput.vue +64 -0
- package/components/Input/TextInput.vue +160 -0
- package/components/Layout/Drawer.vue +16 -4
- package/components/Layout/Header.vue +23 -2
- package/components/Layout/Loader.vue +2 -1
- package/components/Layout/SettingsPanel.vue +24 -11
- package/components/Menu/InfoMenu.vue +35 -0
- package/components/Menu/MenuNav.vue +25 -3
- package/components/Pages/Anketa.vue +254 -65
- package/components/Pages/Auth.vue +56 -9
- package/components/Pages/ContragentForm.vue +9 -9
- package/components/Pages/Documents.vue +266 -30
- package/components/Pages/InvoiceInfo.vue +1 -1
- package/components/Pages/MemberForm.vue +774 -102
- package/components/Pages/ProductAgreement.vue +1 -8
- package/components/Pages/ProductConditions.vue +1132 -180
- package/components/Panel/PanelHandler.vue +626 -49
- package/components/Panel/PanelSelectItem.vue +17 -2
- package/components/Panel/RightPanelCloser.vue +7 -0
- package/components/Transitions/Animation.vue +28 -0
- package/components/Utilities/JsonViewer.vue +3 -2
- package/components/Utilities/Qr.vue +44 -0
- package/composables/axios.ts +1 -0
- package/composables/classes.ts +501 -14
- package/composables/constants.ts +126 -6
- package/composables/fields.ts +328 -0
- package/composables/index.ts +355 -20
- package/composables/styles.ts +23 -6
- package/configs/pwa.ts +63 -0
- package/layouts/clear.vue +21 -0
- package/layouts/default.vue +62 -3
- package/layouts/full.vue +21 -0
- package/locales/ru.json +558 -16
- package/nuxt.config.ts +11 -15
- package/package.json +36 -39
- package/pages/Token.vue +0 -13
- package/plugins/head.ts +26 -0
- package/plugins/vuetifyPlugin.ts +1 -5
- package/store/data.store.ts +1610 -321
- package/store/extractStore.ts +17 -0
- package/store/form.store.ts +13 -1
- package/store/member.store.ts +1 -1
- package/store/rules.ts +97 -3
- package/store/toast.ts +1 -1
- package/types/enum.ts +81 -0
- package/types/env.d.ts +2 -0
- package/types/form.ts +94 -0
- package/types/index.ts +419 -24
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section v-show="showForm" class="flex flex-col gap-4 px-[10px]">
|
|
3
|
-
<v-form v-if="member" ref="vForm" @submit="submitForm" class="max-h-[
|
|
3
|
+
<v-form v-if="member" ref="vForm" @submit="submitForm" class="max-h-[75svh] overflow-y-scroll">
|
|
4
4
|
<base-form-section :title="$dataStore.t('form.personalData')" class="mt-[14px]">
|
|
5
5
|
<base-form-input
|
|
6
6
|
v-model="member.phoneNumber"
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
<base-panel-input
|
|
113
113
|
v-model="member.registrationCity"
|
|
114
114
|
:value="member.registrationCity?.nameRu"
|
|
115
|
-
:label="$dataStore.t('form.City')"
|
|
115
|
+
:label="member.registrationRegionType.nameRu === 'поселок' ? $dataStore.t('form.village') : $dataStore.t('form.City')"
|
|
116
116
|
:readonly="disabled"
|
|
117
117
|
:clearable="!disabled"
|
|
118
118
|
:rules="$rules.objectRequired"
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
</base-form-section>
|
|
262
262
|
</v-form>
|
|
263
263
|
<base-btn v-if="showSaveButton && !disabled" :loading="isButtonLoading" :text="$dataStore.t('buttons.save')" @click="submitForm" />
|
|
264
|
-
<Teleport v-if="isPanelOpen" to="#panel-actions">
|
|
264
|
+
<Teleport v-if="isPanelOpen" to="#right-panel-actions">
|
|
265
265
|
<div :class="[$styles.scrollPage]" class="relative flex flex-col items-center">
|
|
266
266
|
<i
|
|
267
267
|
v-if="type === 'panel'"
|
|
@@ -274,7 +274,7 @@
|
|
|
274
274
|
<base-panel-select-item
|
|
275
275
|
v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery ?? '', 'i')))"
|
|
276
276
|
:key="index"
|
|
277
|
-
:text="(item.nameRu
|
|
277
|
+
:text="String(item.nameRu)"
|
|
278
278
|
:selected="item.nameRu === panelValue.nameRu"
|
|
279
279
|
@click="pickPanelValue(item)"
|
|
280
280
|
/>
|
|
@@ -344,8 +344,8 @@ export default defineComponent({
|
|
|
344
344
|
isPanelOpen.value = true;
|
|
345
345
|
dataStore.panelAction = null;
|
|
346
346
|
if (props.type === 'default') {
|
|
347
|
-
dataStore.
|
|
348
|
-
dataStore.
|
|
347
|
+
dataStore.rightPanel.open = true;
|
|
348
|
+
dataStore.rightPanel.title = title;
|
|
349
349
|
}
|
|
350
350
|
|
|
351
351
|
let newList = list;
|
|
@@ -363,7 +363,7 @@ export default defineComponent({
|
|
|
363
363
|
|
|
364
364
|
const pickPanelValue = (item: Value) => {
|
|
365
365
|
if (props.type === 'default') {
|
|
366
|
-
dataStore.
|
|
366
|
+
dataStore.rightPanel.open = false;
|
|
367
367
|
}
|
|
368
368
|
showForm.value = true;
|
|
369
369
|
isPanelOpen.value = false;
|
|
@@ -463,9 +463,9 @@ export default defineComponent({
|
|
|
463
463
|
);
|
|
464
464
|
|
|
465
465
|
watch(
|
|
466
|
-
() => dataStore.
|
|
466
|
+
() => dataStore.rightPanel.open,
|
|
467
467
|
() => {
|
|
468
|
-
if (dataStore.
|
|
468
|
+
if (dataStore.rightPanel.open === false) {
|
|
469
469
|
isPanelOpen.value = false;
|
|
470
470
|
dataStore.panelAction = null;
|
|
471
471
|
}
|
|
@@ -1,32 +1,128 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<section
|
|
3
|
-
<base-
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
<section :class="[$styles.scrollPage]">
|
|
3
|
+
<base-form-section v-if="isUnderwriterDocuments" title="Загрузить документы для Андеррайтинга" class="mx-[10px] mt-[14px]">
|
|
4
|
+
<base-file-input :readonly="isDisabled || documentLoading" @input.prevent="onUnderFiles($event)" @onClear="onClearUnderFiles()" />
|
|
5
|
+
<base-animation>
|
|
6
|
+
<base-btn v-if="underDocumentsList && underDocumentsList.length" :loading="documentLoading" text="Загрузить" size="sm" class="mt-3" @click="uploadUnderFiles" />
|
|
7
|
+
</base-animation>
|
|
8
|
+
</base-form-section>
|
|
9
|
+
<section class="w-full px-[10px] pt-[14px] flex flex-col gap-2" v-if="formStore.signedDocumentList && formStore.signedDocumentList.length">
|
|
10
|
+
<base-content-block
|
|
11
|
+
v-if="$dataStore.isInitiator() && !$dataStore.isPension && $dataStore.controls.hasChooseSign && formStore.applicationData.statusCode === 'ContractSignedFrom'"
|
|
12
|
+
:class="[$styles.textSimple]"
|
|
13
|
+
>
|
|
14
|
+
<h5 class="text-center font-medium mb-4">{{ $dataStore.t('Contract') }}</h5>
|
|
15
|
+
<base-form-input v-model="formStore.documentName" :label="$dataStore.t('form.document')" :readonly="true" />
|
|
16
|
+
<base-form-input v-model="formStore.policyNumber" :label="$dataStore.t('form.documentNumber')" :readonly="true" />
|
|
17
|
+
<base-form-input v-model="formStore.contractDate" :label="$dataStore.t('form.date')" :readonly="true" append-inner-icon="mdi mdi-calendar-blank-outline" />
|
|
18
|
+
<base-file-input :readonly="isDisabled" @input.prevent="onFileChange($event)" />
|
|
19
|
+
</base-content-block>
|
|
20
|
+
<base-content-block v-for="document of formStore.signedDocumentList" :key="document.id" :class="[$styles.textSimple]">
|
|
21
|
+
<h5 class="text-center font-medium mb-4">
|
|
22
|
+
{{ document.fileTypeName }}
|
|
23
|
+
</h5>
|
|
24
|
+
<div :class="[$styles.whiteBg, $styles.rounded]" class="p-2 h-12 flex items-center relative">
|
|
25
|
+
<span class="ml-2">{{ document.fileName }}</span>
|
|
26
|
+
<i
|
|
27
|
+
class="transition-all cursor-pointer mdi mdi-dots-vertical pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
|
|
28
|
+
:class="[$styles.greenTextHover]"
|
|
29
|
+
@click="openPanel(document)"
|
|
30
|
+
></i>
|
|
31
|
+
</div>
|
|
32
|
+
</base-content-block>
|
|
33
|
+
</section>
|
|
34
|
+
<div v-if="noDocuments" class="h-[calc(90vh-70px)] flex flex-col items-center justify-center gap-6">
|
|
35
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="125" height="131" viewBox="0 0 125 131" fill="none" class="cursor-help">
|
|
36
|
+
<path
|
|
37
|
+
fill-rule="evenodd"
|
|
38
|
+
clip-rule="evenodd"
|
|
39
|
+
d="M71.0404 15.5H34.8737C29.8801 15.5 25.832 19.6638 25.832 24.8V99.2C25.832 104.336 29.8801 108.5 34.8737 108.5H89.1237C94.1173 108.5 98.1654 104.336 98.1654 99.2V43.4L71.0404 15.5Z"
|
|
40
|
+
stroke="#009C73"
|
|
41
|
+
stroke-width="6"
|
|
42
|
+
stroke-linecap="round"
|
|
43
|
+
stroke-linejoin="round"
|
|
44
|
+
/>
|
|
45
|
+
<path d="M72.332 20.6641V41.3307H92.9987" stroke="#009C73" stroke-width="6" stroke-linecap="round" stroke-linejoin="round" />
|
|
46
|
+
<path opacity="0.497024" d="M82.6654 67.1641H41.332" stroke="#009C73" stroke-width="6" stroke-linecap="round" stroke-linejoin="round" />
|
|
47
|
+
<path opacity="0.497024" d="M82.6654 87.8359H41.332" stroke="#009C73" stroke-width="6" stroke-linecap="round" stroke-linejoin="round" />
|
|
48
|
+
<path opacity="0.497024" d="M51.6654 46.5H46.4987H41.332" stroke="#009C73" stroke-width="6" stroke-linecap="round" stroke-linejoin="round" />
|
|
49
|
+
<circle cx="102" cy="108" r="22.5" fill="#FCB016" stroke="#F1F2F6" />
|
|
50
|
+
<path d="M103.375 95.625V109.375H92.375" stroke="white" stroke-linecap="round" stroke-linejoin="round" />
|
|
51
|
+
</svg>
|
|
52
|
+
<p class="text-xl" :class="[$styles.mutedText]">{{ $dataStore.t('labels.noDocuments') }}</p>
|
|
53
|
+
</div>
|
|
54
|
+
<section v-if="$dataStore.isPension && showContract" class="w-full px-[10px] pt-[14px] flex flex-col gap-2">
|
|
55
|
+
<base-content-block :class="[$styles.textSimple]">
|
|
56
|
+
<h5 class="text-center font-medium mb-4">{{ $dataStore.t('labels.statements') }}</h5>
|
|
57
|
+
<div :class="[$styles.whiteBg, $styles.rounded]" class="p-2 h-12 flex items-center relative">
|
|
58
|
+
<span class="ml-2">Заявления на {{ processCode == 19 ? 'страхование' : 'возврат' }}</span>
|
|
59
|
+
<i
|
|
60
|
+
class="transition-all cursor-pointer mdi mdi-paperclip pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
|
|
61
|
+
:class="[$styles.greenTextHover]"
|
|
62
|
+
@click="$dataStore.generatePDFDocument(processCode == 19 ? 'PA_Statement' : 'PA_RefundStatement', '37')"
|
|
63
|
+
></i>
|
|
64
|
+
</div>
|
|
65
|
+
</base-content-block>
|
|
66
|
+
<base-content-block :class="[$styles.textSimple]">
|
|
67
|
+
<h5 class="text-center font-medium mb-4">{{ $dataStore.t('labels.contract') }}</h5>
|
|
68
|
+
<div :class="[$styles.whiteBg, $styles.rounded]" class="p-2 h-12 flex items-center relative">
|
|
69
|
+
<span class="ml-2">Договор {{ processCode == 19 ? 'страхования' : 'возврата' }}</span>
|
|
70
|
+
<i
|
|
71
|
+
class="transition-all cursor-pointer mdi mdi-paperclip pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
|
|
72
|
+
:class="[$styles.greenTextHover]"
|
|
73
|
+
@click="$dataStore.generatePDFDocument(processCode == 19 ? 'PA_Contract' : 'PA_RefundAgreement', '38')"
|
|
74
|
+
></i>
|
|
75
|
+
</div>
|
|
76
|
+
</base-content-block>
|
|
77
|
+
<base-content-block :class="[$styles.textSimple]" v-if="formStore.applicationData.statusCode !== 'StartForm' && processCode == 19">
|
|
78
|
+
<h5 class="text-center font-medium mb-4">{{ $dataStore.t('pension.complianceFinMonitoring') }}</h5>
|
|
79
|
+
<div :class="[$styles.whiteBg, $styles.rounded]" class="p-2 h-12 flex items-center relative">
|
|
80
|
+
<span class="ml-2">{{ $dataStore.t('pension.complianceFinMonitoring') }}</span>
|
|
81
|
+
<i
|
|
82
|
+
class="transition-all cursor-pointer mdi mdi-paperclip pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
|
|
83
|
+
:class="[$styles.greenTextHover]"
|
|
84
|
+
@click="$dataStore.generatePDFDocument('Compliance_FinMonitoring', '39')"
|
|
85
|
+
></i>
|
|
86
|
+
</div>
|
|
87
|
+
</base-content-block>
|
|
88
|
+
<base-content-block :class="[$styles.textSimple]" v-if="formStore.applicationData.statusCode === 'PreparationDossierForm' && processCode == 19">
|
|
89
|
+
<h5 class="text-center font-medium mb-4">{{ $dataStore.t('pension.dossierPA') }}</h5>
|
|
90
|
+
<div :class="[$styles.whiteBg, $styles.rounded]" class="p-2 h-12 flex items-center relative">
|
|
91
|
+
<span class="ml-2">{{ $dataStore.t('pension.dossierPA') }}</span>
|
|
92
|
+
<i
|
|
93
|
+
class="transition-all cursor-pointer mdi mdi-paperclip pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
|
|
94
|
+
:class="[$styles.greenTextHover]"
|
|
95
|
+
@click="$dataStore.generatePDFDocument('PA_Dossier', '40', 'doc')"
|
|
96
|
+
></i>
|
|
97
|
+
</div>
|
|
98
|
+
</base-content-block>
|
|
99
|
+
</section>
|
|
100
|
+
<Teleport v-if="$dataStore.panelAction === null" to="#right-panel-actions">
|
|
101
|
+
<base-fade-transition>
|
|
102
|
+
<div :class="[$styles.flexColNav]">
|
|
103
|
+
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Открыть" @click="getFile('view')" />
|
|
104
|
+
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="getFile('download')" />
|
|
105
|
+
<base-animation>
|
|
106
|
+
<base-btn v-if="canDeleteFiles" :disabled="documentLoading" :loading="documentLoading" text="Удалить" @click="deletionDialog = true" />
|
|
107
|
+
</base-animation>
|
|
108
|
+
</div>
|
|
109
|
+
</base-fade-transition>
|
|
110
|
+
</Teleport>
|
|
111
|
+
<base-dialog
|
|
112
|
+
v-model="deletionDialog"
|
|
113
|
+
:title="$dataStore.t('dialog.confirmDelete')"
|
|
114
|
+
:subtitle="$dataStore.t('dialog.deleteFile')"
|
|
115
|
+
:confirm="$dataStore.t('confirm.delete')"
|
|
116
|
+
:icon="{ mdi: 'delete-outline', color: '#FD2D39' }"
|
|
117
|
+
@yes="deleteFile"
|
|
118
|
+
@no="deletionDialog = false"
|
|
119
|
+
/>
|
|
16
120
|
</section>
|
|
17
|
-
<base-list-empty v-else />
|
|
18
|
-
<Teleport v-if="$dataStore.panelAction === null" to="#panel-actions">
|
|
19
|
-
<base-fade-transition>
|
|
20
|
-
<div :class="[$styles.flexColNav]">
|
|
21
|
-
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Открыть" @click="getFile('view')" />
|
|
22
|
-
<base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="getFile('download')" />
|
|
23
|
-
</div>
|
|
24
|
-
</base-fade-transition>
|
|
25
|
-
</Teleport>
|
|
26
121
|
</template>
|
|
27
122
|
|
|
28
123
|
<script lang="ts">
|
|
29
124
|
import { DocumentItem } from '../../composables/classes';
|
|
125
|
+
import { uuid } from 'vue-uuid';
|
|
30
126
|
|
|
31
127
|
export default defineComponent({
|
|
32
128
|
setup() {
|
|
@@ -34,11 +130,37 @@ export default defineComponent({
|
|
|
34
130
|
const formStore = useFormStore();
|
|
35
131
|
const currentDocument = ref<DocumentItem>(new DocumentItem());
|
|
36
132
|
const documentLoading = ref<boolean>(false);
|
|
37
|
-
|
|
133
|
+
const deletionDialog = ref<boolean>(false);
|
|
134
|
+
const isDisabled = computed(() => !dataStore.isTask());
|
|
135
|
+
const contractDict = computed(() => dataStore.dicFileTypeList.find(i => i.nameRu === 'Договор страхования' || i.nameRu === 'Договор'));
|
|
136
|
+
const processCode = formStore.applicationData.processCode;
|
|
137
|
+
const signedContract = reactive<{
|
|
138
|
+
processInstanceId: string | number;
|
|
139
|
+
fileTypeId: string | number | null;
|
|
140
|
+
fileTypeCode: string | number | null;
|
|
141
|
+
fileName?: string | number | null;
|
|
142
|
+
}>({
|
|
143
|
+
processInstanceId: formStore.applicationData.processInstanceId,
|
|
144
|
+
fileTypeId: contractDict.value ? contractDict.value.id : '',
|
|
145
|
+
fileTypeCode: contractDict.value ? contractDict.value.code : '',
|
|
146
|
+
});
|
|
147
|
+
const signedContractFormData = ref(new FormData());
|
|
38
148
|
const currentState = reactive<{ action: string; text: string }>({
|
|
39
149
|
action: '',
|
|
40
150
|
text: '',
|
|
41
151
|
});
|
|
152
|
+
const underDocumentsList = ref<
|
|
153
|
+
{
|
|
154
|
+
file: File;
|
|
155
|
+
fileName: string;
|
|
156
|
+
identifier: string;
|
|
157
|
+
fileTypeId: string;
|
|
158
|
+
fileTypeCode: string;
|
|
159
|
+
fileTypeName: string;
|
|
160
|
+
processInstanceId: string;
|
|
161
|
+
}[]
|
|
162
|
+
>([]);
|
|
163
|
+
|
|
42
164
|
const object_list = computed(() => Object.values(formStore.signedDocumentList));
|
|
43
165
|
const unSignedList = computed(() => document_list.value.filter((doc: DocumentItem) => doc.signed === false || doc.signed === null));
|
|
44
166
|
const document_list = computed(() =>
|
|
@@ -48,12 +170,97 @@ export default defineComponent({
|
|
|
48
170
|
}
|
|
49
171
|
}),
|
|
50
172
|
);
|
|
173
|
+
const showContract = computed(
|
|
174
|
+
() =>
|
|
175
|
+
formStore.applicationData &&
|
|
176
|
+
(formStore.applicationData.statusCode === 'Completed' || formStore.applicationData.statusCode === 'PreparationDossierForm' || dataStore.isActuary()),
|
|
177
|
+
);
|
|
178
|
+
const noDocuments = computed(() => {
|
|
179
|
+
if (dataStore.isPension) return !showContract.value;
|
|
180
|
+
return !formStore.signedDocumentList || !formStore.signedDocumentList.length;
|
|
181
|
+
});
|
|
182
|
+
const isUnderwriterDocuments = computed(
|
|
183
|
+
() =>
|
|
184
|
+
(dataStore.isBaiterek || dataStore.isBolashak || dataStore.isLiferenta || dataStore.isKazyna || dataStore.isAmulet || dataStore.isGons) &&
|
|
185
|
+
dataStore.isInitiator() &&
|
|
186
|
+
formStore.applicationData &&
|
|
187
|
+
(formStore.applicationData.statusCode === 'StartForm' || formStore.applicationData.statusCode === 'EditForm'),
|
|
188
|
+
);
|
|
189
|
+
const canDeleteFiles = computed(() => {
|
|
190
|
+
const baseCondition = dataStore.isTask() && dataStore.isInitiator() && dataStore.isProcessEditable(formStore.applicationData.statusCode);
|
|
191
|
+
if (dataStore.isBaiterek || dataStore.isBolashak || dataStore.isLiferenta || dataStore.isKazyna || dataStore.isAmulet || dataStore.isGons) {
|
|
192
|
+
return baseCondition && (currentDocument.value ? currentDocument.value.fileTypeCode === '46' : false);
|
|
193
|
+
}
|
|
194
|
+
if (dataStore.isPension) return baseCondition;
|
|
195
|
+
return false;
|
|
196
|
+
});
|
|
51
197
|
|
|
52
198
|
const openPanel = async (document: DocumentItem) => {
|
|
53
|
-
dataStore.
|
|
54
|
-
dataStore.panel.title = document.fileTypeName!;
|
|
199
|
+
dataStore.rightPanel.title = document.fileTypeName!;
|
|
55
200
|
currentDocument.value = document;
|
|
56
|
-
dataStore.
|
|
201
|
+
dataStore.rightPanel.open = true;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
const onFileChange = async (event: InputEvent) => {
|
|
205
|
+
if (event.target) {
|
|
206
|
+
const files = (event.target as HTMLInputElement).files;
|
|
207
|
+
if (files && files.length && files[0].name !== signedContract.fileName) {
|
|
208
|
+
if (files[0].size >= 20_000_000) {
|
|
209
|
+
return dataStore.showToaster('error', dataStore.t('toaster.fileOnlyBelow20mb'), 6000);
|
|
210
|
+
}
|
|
211
|
+
if (files[0].type !== 'application/pdf') {
|
|
212
|
+
return dataStore.showToaster('error', dataStore.t('toaster.onlyPDF'), 6000);
|
|
213
|
+
}
|
|
214
|
+
signedContract.fileName = files[0].name;
|
|
215
|
+
formStore.documentName = signedContract.fileName;
|
|
216
|
+
signedContractFormData.value.append('file', files[0]);
|
|
217
|
+
signedContractFormData.value.append('fileData', JSON.stringify([signedContract]));
|
|
218
|
+
formStore.signedContractFormData = signedContractFormData.value;
|
|
219
|
+
formStore.isUploadedSignedContract = true;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
const onUnderFiles = async (event: InputEvent) => {
|
|
225
|
+
if (event.target || event.dataTransfer) {
|
|
226
|
+
const files = event.target ? (event.target as HTMLInputElement).files : (event.dataTransfer as DataTransfer).files;
|
|
227
|
+
if (files !== null) {
|
|
228
|
+
const underDocumentType = dataStore.dicFileTypeList.find(i => i.code === '46');
|
|
229
|
+
Object.values(files).map(file => {
|
|
230
|
+
const uuidV4 = uuid.v4();
|
|
231
|
+
underDocumentsList.value.push({
|
|
232
|
+
file: file,
|
|
233
|
+
identifier: `${uuidV4}${file.name.substring(file.name.lastIndexOf('.'))}`,
|
|
234
|
+
processInstanceId: String(formStore.applicationData.processInstanceId),
|
|
235
|
+
fileTypeId: underDocumentType ? String(underDocumentType.id) : '',
|
|
236
|
+
fileTypeCode: underDocumentType ? String(underDocumentType.code) : '',
|
|
237
|
+
fileTypeName: underDocumentType ? String(underDocumentType.nameRu) : '',
|
|
238
|
+
fileName: file.name ? file.name : underDocumentType ? String(underDocumentType.nameRu) : '',
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
const onClearUnderFiles = () => {
|
|
246
|
+
underDocumentsList.value = [];
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
const uploadUnderFiles = async () => {
|
|
250
|
+
if (underDocumentsList.value) {
|
|
251
|
+
documentLoading.value = true;
|
|
252
|
+
await Promise.allSettled(
|
|
253
|
+
Object.values(underDocumentsList.value).map(async value => {
|
|
254
|
+
const formData = new FormData();
|
|
255
|
+
formData.append('file', value.file);
|
|
256
|
+
formData.append('fileData', JSON.stringify([{ ...value, file: undefined }]));
|
|
257
|
+
await dataStore.uploadFiles(formData, false);
|
|
258
|
+
}),
|
|
259
|
+
);
|
|
260
|
+
onClearUnderFiles();
|
|
261
|
+
await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
|
|
262
|
+
documentLoading.value = false;
|
|
263
|
+
}
|
|
57
264
|
};
|
|
58
265
|
|
|
59
266
|
watch(
|
|
@@ -81,6 +288,20 @@ export default defineComponent({
|
|
|
81
288
|
}
|
|
82
289
|
};
|
|
83
290
|
|
|
291
|
+
const deleteFile = async () => {
|
|
292
|
+
if (currentDocument.value) {
|
|
293
|
+
const data = {
|
|
294
|
+
id: currentDocument.value.id,
|
|
295
|
+
processInstanceId: currentDocument.value.processInstanceId,
|
|
296
|
+
};
|
|
297
|
+
await dataStore.deleteFile(data);
|
|
298
|
+
deletionDialog.value = false;
|
|
299
|
+
dataStore.rightPanel.open = false;
|
|
300
|
+
dataStore.panelAction = null;
|
|
301
|
+
await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
|
|
84
305
|
const onInit = async () => {
|
|
85
306
|
await dataStore.getDicFileTypeList();
|
|
86
307
|
await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
|
|
@@ -89,8 +310,7 @@ export default defineComponent({
|
|
|
89
310
|
onInit();
|
|
90
311
|
|
|
91
312
|
onUnmounted(() => {
|
|
92
|
-
dataStore.
|
|
93
|
-
dataStore.panelAction = null;
|
|
313
|
+
dataStore.rightPanel.open = false;
|
|
94
314
|
});
|
|
95
315
|
|
|
96
316
|
return {
|
|
@@ -98,10 +318,26 @@ export default defineComponent({
|
|
|
98
318
|
formStore,
|
|
99
319
|
documentLoading,
|
|
100
320
|
DocumentItem,
|
|
321
|
+
signedContract,
|
|
322
|
+
deletionDialog,
|
|
323
|
+
processCode,
|
|
324
|
+
underDocumentsList,
|
|
325
|
+
|
|
326
|
+
// Computed
|
|
327
|
+
isDisabled,
|
|
328
|
+
showContract,
|
|
329
|
+
noDocuments,
|
|
330
|
+
canDeleteFiles,
|
|
331
|
+
isUnderwriterDocuments,
|
|
101
332
|
|
|
102
333
|
// Functions
|
|
103
|
-
openPanel,
|
|
104
334
|
getFile,
|
|
335
|
+
openPanel,
|
|
336
|
+
deleteFile,
|
|
337
|
+
onFileChange,
|
|
338
|
+
onUnderFiles,
|
|
339
|
+
uploadUnderFiles,
|
|
340
|
+
onClearUnderFiles,
|
|
105
341
|
};
|
|
106
342
|
},
|
|
107
343
|
});
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
</lazy-base-form-section>
|
|
9
9
|
<lazy-base-form-section v-if="invoiceData.paymentLink && invoiceData.status !== 1" :title="$dataStore.t('labels.epayPage')" class="flex items-center">
|
|
10
10
|
<div class="w-full lg:w-[70%] bg-white">
|
|
11
|
-
<iframe :src="invoiceData.paymentLink" frameborder="0" class="w-full h-[
|
|
11
|
+
<iframe :src="invoiceData.paymentLink" frameborder="0" class="w-full h-[70svh]"></iframe>
|
|
12
12
|
</div>
|
|
13
13
|
</lazy-base-form-section>
|
|
14
14
|
</section>
|