hl-core 0.0.10-beta.30 → 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 CHANGED
@@ -38,5 +38,3 @@ Locally preview production build:
38
38
  ```bash
39
39
  npm run preview
40
40
  ```
41
-
42
- Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
package/api/base.api.ts CHANGED
@@ -502,6 +502,7 @@ export class ApiClass {
502
502
  return await this.axiosCall<Types.EpayShortResponse>({
503
503
  method: Methods.POST,
504
504
  url: `/Arm/api/Invoice/SendToEpay/${processInstanceId}`,
505
+ data: {},
505
506
  });
506
507
  }
507
508
 
@@ -1034,6 +1035,22 @@ export class ApiClass {
1034
1035
  url: `${this.pensionannuityNew.base}/SetEnpfSharedId/${sharedId}/${infoId}`,
1035
1036
  });
1036
1037
  },
1038
+ calcParentContractSums: async (data: any) => {
1039
+ return await this.axiosCall<void>({
1040
+ method: Methods.POST,
1041
+ baseURL: getStrValuePerEnv('efoBaseApi'),
1042
+ url: `${this.pensionannuityNew.base}/CalcParentContractSums`,
1043
+ data: data,
1044
+ });
1045
+ },
1046
+ reCalculateRefund: async (data: any) => {
1047
+ return await this.axiosCall<void>({
1048
+ method: Methods.POST,
1049
+ baseURL: getStrValuePerEnv('efoBaseApi'),
1050
+ url: `${this.pensionannuityNew.base}/ReCalculateRefund`,
1051
+ data: data,
1052
+ });
1053
+ },
1037
1054
  };
1038
1055
 
1039
1056
  externalServices = {
@@ -1052,6 +1069,13 @@ export class ApiClass {
1052
1069
  data: data,
1053
1070
  });
1054
1071
  },
1072
+ updateDigitalDocumentsProfile: async (data: { iinBin: string }) => {
1073
+ return await this.axiosCall<void>({
1074
+ method: Methods.POST,
1075
+ url: `${this.externalServices.base}/api/ExternalServices/UpdateDigitalDocumentsProfile`,
1076
+ data: data,
1077
+ });
1078
+ },
1055
1079
  };
1056
1080
 
1057
1081
  file = {
@@ -1128,6 +1152,16 @@ export class ApiClass {
1128
1152
  },
1129
1153
  });
1130
1154
  },
1155
+ getFileNew: async (id: string) => {
1156
+ return await this.axiosCall({
1157
+ method: Methods.GET,
1158
+ url: `${this.file.base}/api/GeneralSign/DownloadFile/${id}`,
1159
+ responseType: 'arraybuffer',
1160
+ headers: {
1161
+ 'Content-Type': 'application/pdf',
1162
+ },
1163
+ });
1164
+ },
1131
1165
  deleteFile: async (data: any) => {
1132
1166
  return await this.axiosCall<void>({
1133
1167
  method: Methods.POST,
@@ -1174,5 +1208,12 @@ export class ApiClass {
1174
1208
  data: data,
1175
1209
  });
1176
1210
  },
1211
+ setActualEnpf: async (data: { processId: string; isOnlineEnpfAgreement: boolean }) => {
1212
+ return await this.axiosCall<void>({
1213
+ method: Methods.POST,
1214
+ url: `${this.file.base}/api/GeneralSign/SetActualEnpfAgreement`,
1215
+ data: data,
1216
+ });
1217
+ },
1177
1218
  };
1178
1219
  }
@@ -159,7 +159,7 @@ export default defineComponent({
159
159
  const isAgentReadonly = computed(() => {
160
160
  if (!isReadonly.value) {
161
161
  if (dataStore.isGons) return !dataStore.isServiceManager();
162
- if (dataStore.isPension) return !dataStore.isManager();
162
+ if (dataStore.isPension) return true;
163
163
  }
164
164
  return isReadonly.value;
165
165
  });
@@ -176,7 +176,6 @@ export default defineComponent({
176
176
  });
177
177
  const isAgentShown = computed(() => {
178
178
  if (dataStore.isGons) return !dataStore.isAgent();
179
- if (dataStore.isPension) return dataStore.isServiceManager();
180
179
  return true;
181
180
  });
182
181
  const openPanel = async (currentDict: ManagerAttachmentFiels, title: string) => {
@@ -13,6 +13,7 @@
13
13
  :enable-time-picker="false"
14
14
  :six-weeks="true"
15
15
  :min-date="minDate"
16
+ :max-date="maxDate"
16
17
  cancel-text="Отменить"
17
18
  select-text="Выбрать"
18
19
  >
@@ -43,6 +44,10 @@ export default defineComponent({
43
44
  type: Date,
44
45
  required: false,
45
46
  },
47
+ maxDate: {
48
+ type: Date,
49
+ required: false,
50
+ },
46
51
  },
47
52
  });
48
53
  </script>
@@ -39,6 +39,7 @@
39
39
  v-if="appendInnerIcon.includes('mdi-calendar-blank-outline') && !props.readonly"
40
40
  :model-value="modelValue"
41
41
  :min-date="minDate"
42
+ :max-date="maxDate"
42
43
  @update:modelValue="$emit('update:modelValue', $event)"
43
44
  />
44
45
  </template>
@@ -120,6 +121,10 @@ export default defineComponent({
120
121
  type: Date,
121
122
  default: undefined,
122
123
  },
124
+ maxDate: {
125
+ type: Date,
126
+ default: undefined,
127
+ },
123
128
  prependIcon: {
124
129
  type: String,
125
130
  },
@@ -138,6 +138,8 @@ export default defineComponent({
138
138
  border: 1px solid #dadada;
139
139
  box-shadow: none;
140
140
  font-size: 14px;
141
+ padding-top: 6px;
142
+ padding-bottom: 4px;
141
143
  }
142
144
  .rounded-input .v-field--error {
143
145
  border-color: #ff5449;
@@ -6,6 +6,55 @@
6
6
  <base-btn v-if="underDocumentsList && underDocumentsList.length" :loading="documentLoading" text="Загрузить" size="sm" class="mt-3" @click="uploadUnderFiles" />
7
7
  </base-animation>
8
8
  </base-form-section>
9
+ <section
10
+ v-if="$dataStore.isPension && (showContract || formStore.applicationData.statusCode === 'PreparationDossierForm')"
11
+ class="w-full px-[10px] pt-[14px] flex flex-col gap-2"
12
+ >
13
+ <base-content-block v-if="showContract" :class="[$styles.textSimple]">
14
+ <h5 class="text-center font-medium mb-4">{{ $dataStore.t('labels.statements') }}</h5>
15
+ <div :class="[$styles.whiteBg, $styles.rounded]" class="p-2 h-12 flex items-center relative">
16
+ <span class="ml-2">Заявления на {{ processCode === 19 || processCode === 25 ? 'страхование' : 'возврат' }}</span>
17
+ <i
18
+ class="transition-all cursor-pointer mdi mdi-tray-arrow-down pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
19
+ :class="[$styles.greenTextHover]"
20
+ @click="$dataStore.generatePDFDocument(processCode === 19 ? 'PA_Statement' : processCode === 25 ? 'PAJ_Statement' : 'PA_RefundStatement', '37')"
21
+ ></i>
22
+ </div>
23
+ </base-content-block>
24
+ <base-content-block v-if="showContract" :class="[$styles.textSimple]">
25
+ <h5 class="text-center font-medium mb-4">{{ $dataStore.t('labels.contract') }}</h5>
26
+ <div :class="[$styles.whiteBg, $styles.rounded]" class="p-2 h-12 flex items-center relative">
27
+ <span class="ml-2">Договор {{ processCode === 19 || processCode === 25 ? 'страхования' : 'возврата' }}</span>
28
+ <i
29
+ class="transition-all cursor-pointer mdi mdi-tray-arrow-down pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
30
+ :class="[$styles.greenTextHover]"
31
+ @click="$dataStore.generatePDFDocument(processCode === 19 ? 'PA_Contract' : processCode === 25 ? 'PAJ_Contract' : 'PA_RefundAgreement', '38')"
32
+ ></i>
33
+ </div>
34
+ </base-content-block>
35
+ <base-content-block :class="[$styles.textSimple]" v-if="formStore.applicationData.statusCode !== 'StartForm' && showContract">
36
+ <h5 class="text-center font-medium mb-4">{{ $dataStore.t('pension.complianceFinMonitoring') }}</h5>
37
+ <div :class="[$styles.whiteBg, $styles.rounded]" class="p-2 h-12 flex items-center relative">
38
+ <span class="ml-2">{{ $dataStore.t('pension.complianceFinMonitoring') }}</span>
39
+ <i
40
+ class="transition-all cursor-pointer mdi mdi-tray-arrow-down pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
41
+ :class="[$styles.greenTextHover]"
42
+ @click="$dataStore.generatePDFDocument('Compliance_FinMonitoring', '39')"
43
+ ></i>
44
+ </div>
45
+ </base-content-block>
46
+ <base-content-block :class="[$styles.textSimple]" v-if="formStore.applicationData.statusCode === 'PreparationDossierForm'">
47
+ <h5 class="text-center font-medium mb-4">{{ $dataStore.t('pension.dossierPA') }}</h5>
48
+ <div :class="[$styles.whiteBg, $styles.rounded]" class="p-2 h-12 flex items-center relative">
49
+ <span class="ml-2">{{ $dataStore.t('pension.dossierPA') }}</span>
50
+ <i
51
+ class="transition-all cursor-pointer mdi mdi-tray-arrow-down pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
52
+ :class="[$styles.greenTextHover]"
53
+ @click="$dataStore.generatePDFDocument('PA_Dossier', '40', 'doc')"
54
+ ></i>
55
+ </div>
56
+ </base-content-block>
57
+ </section>
9
58
  <section class="w-full px-[10px] pt-[14px] flex flex-col gap-2" v-if="formStore.signedDocumentList && formStore.signedDocumentList.length">
10
59
  <base-content-block
11
60
  v-if="$dataStore.isInitiator() && !$dataStore.isPension && $dataStore.controls.hasChooseSign && formStore.applicationData.statusCode === 'ContractSignedFrom'"
@@ -31,6 +80,54 @@
31
80
  </div>
32
81
  </base-content-block>
33
82
  </section>
83
+ <section v-if="requiredSign">
84
+ <div v-for="(member, index) in jointMembers.filter(i => memberHasDocumentsToSign(i.iin))" :key="index">
85
+ <base-form-section :title="`${member.firstName} ${member.lastName}`" class="mx-[10px] mt-[14px] d-flex">
86
+ <base-file-input
87
+ v-if="
88
+ !formStore.signedDocumentList.find(i => i.fileTypeCode === '10' && i.iin === String(member.iin).replaceAll('-', '')) &&
89
+ formStore.requiredDocuments.some(i => i.code === '10' && i.iin === String(member.iin).replaceAll('-', ''))
90
+ "
91
+ :label="$dataStore.t('form.bankStatement')"
92
+ :loading="$dataStore.isLoading"
93
+ @input="uploadAdditionalFile($event, '10', member.iin)"
94
+ />
95
+ <base-file-input
96
+ v-if="!formStore.signedDocumentList.find(i => i.fileTypeCode === '9' && i.iin === String(member.iin).replaceAll('-', '')) && member.isDisability"
97
+ label="Справка об инвалидности"
98
+ :loading="$dataStore.isLoading"
99
+ @input="uploadAdditionalFile($event, '9', member.iin)"
100
+ />
101
+ <base-file-input
102
+ v-if="
103
+ !formStore.signedDocumentList.find(i => i.fileTypeCode === '8' && i.iin === String(member.iin).replaceAll('-', '')) &&
104
+ formStore.requiredDocuments.some(i => i.code === '8' && i.iin === String(member.iin).replaceAll('-', ''))
105
+ "
106
+ :label="$dataStore.t('pension.ENPFnote')"
107
+ :loading="$dataStore.isLoading"
108
+ @input="uploadAdditionalFile($event, '8', member.iin)"
109
+ />
110
+ <base-file-input
111
+ v-if="
112
+ !formStore.signedDocumentList.find(i => i.fileTypeCode === '40' && i.iin === String(member.iin).replaceAll('-', '')) &&
113
+ formStore.requiredDocuments.some(i => i.code === '40' && i.iin === String(member.iin).replaceAll('-', ''))
114
+ "
115
+ :label="$dataStore.t('pension.dossierPA')"
116
+ :loading="$dataStore.isLoading"
117
+ @input="uploadAdditionalFile($event, '40', member.iin)"
118
+ />
119
+ <base-file-input
120
+ v-if="
121
+ !formStore.signedDocumentList.find(i => i.fileTypeCode === '50' && i.iin === String(member.iin).replaceAll('-', '')) &&
122
+ formStore.requiredDocuments.some(i => i.code === '50' && i.iin === String(member.iin).replaceAll('-', ''))
123
+ "
124
+ :label="$dataStore.t('pension.oppvPaymentCertificate')"
125
+ :loading="$dataStore.isLoading"
126
+ @input="uploadAdditionalFile($event, '50', member.iin)"
127
+ />
128
+ </base-form-section>
129
+ </div>
130
+ </section>
34
131
  <section v-if="hasDigitalDocuments">
35
132
  <base-digital-document
36
133
  v-if="$route.params.taskId !== '0'"
@@ -40,6 +137,14 @@
40
137
  @openDigitalDocPanel="openDigitalDocPanel($event, 'Страхователя')"
41
138
  @openPanel="openPanel"
42
139
  />
140
+ <base-digital-document
141
+ v-if="$route.params.taskId !== '0' && slaveInsuredForm"
142
+ :member="slaveInsuredForm"
143
+ :title="$dataStore.t('policyholderForm') + ' 2'"
144
+ :disabled="isDigitalDocDisabled"
145
+ @openDigitalDocPanel="openDigitalDocPanel($event, 'Страхователя 2')"
146
+ @openPanel="openPanel"
147
+ />
43
148
  <div v-if="insuredFiltered.length !== 0">
44
149
  <base-digital-document
45
150
  v-for="(member, index) in insuredFiltered"
@@ -85,56 +190,18 @@
85
190
  </svg>
86
191
  <p class="text-xl" :class="[$styles.mutedText]">{{ $dataStore.t('labels.noDocuments') }}</p>
87
192
  </div>
88
- <section v-if="$dataStore.isPension && showContract" class="w-full px-[10px] pt-[14px] flex flex-col gap-2">
89
- <base-content-block :class="[$styles.textSimple]">
90
- <h5 class="text-center font-medium mb-4">{{ $dataStore.t('labels.statements') }}</h5>
91
- <div :class="[$styles.whiteBg, $styles.rounded]" class="p-2 h-12 flex items-center relative">
92
- <span class="ml-2">Заявления на {{ processCode == 19 ? 'страхование' : 'возврат' }}</span>
93
- <i
94
- class="transition-all cursor-pointer mdi mdi-paperclip pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
95
- :class="[$styles.greenTextHover]"
96
- @click="$dataStore.generatePDFDocument(processCode == 19 ? 'PA_Statement' : 'PA_RefundStatement', '37')"
97
- ></i>
98
- </div>
99
- </base-content-block>
100
- <base-content-block :class="[$styles.textSimple]">
101
- <h5 class="text-center font-medium mb-4">{{ $dataStore.t('labels.contract') }}</h5>
102
- <div :class="[$styles.whiteBg, $styles.rounded]" class="p-2 h-12 flex items-center relative">
103
- <span class="ml-2">Договор {{ processCode == 19 ? 'страхования' : 'возврата' }}</span>
104
- <i
105
- class="transition-all cursor-pointer mdi mdi-paperclip pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
106
- :class="[$styles.greenTextHover]"
107
- @click="$dataStore.generatePDFDocument(processCode == 19 ? 'PA_Contract' : 'PA_RefundAgreement', '38')"
108
- ></i>
109
- </div>
110
- </base-content-block>
111
- <base-content-block :class="[$styles.textSimple]" v-if="formStore.applicationData.statusCode !== 'StartForm' && processCode == 19">
112
- <h5 class="text-center font-medium mb-4">{{ $dataStore.t('pension.complianceFinMonitoring') }}</h5>
113
- <div :class="[$styles.whiteBg, $styles.rounded]" class="p-2 h-12 flex items-center relative">
114
- <span class="ml-2">{{ $dataStore.t('pension.complianceFinMonitoring') }}</span>
115
- <i
116
- class="transition-all cursor-pointer mdi mdi-paperclip pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
117
- :class="[$styles.greenTextHover]"
118
- @click="$dataStore.generatePDFDocument('Compliance_FinMonitoring', '39')"
119
- ></i>
120
- </div>
121
- </base-content-block>
122
- <base-content-block :class="[$styles.textSimple]" v-if="formStore.applicationData.statusCode === 'PreparationDossierForm' && processCode == 19">
123
- <h5 class="text-center font-medium mb-4">{{ $dataStore.t('pension.dossierPA') }}</h5>
124
- <div :class="[$styles.whiteBg, $styles.rounded]" class="p-2 h-12 flex items-center relative">
125
- <span class="ml-2">{{ $dataStore.t('pension.dossierPA') }}</span>
126
- <i
127
- class="transition-all cursor-pointer mdi mdi-paperclip pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
128
- :class="[$styles.greenTextHover]"
129
- @click="$dataStore.generatePDFDocument('PA_Dossier', '40', 'doc')"
130
- ></i>
131
- </div>
132
- </base-content-block>
133
- </section>
134
193
  <Teleport v-if="isPanelOpen" to="#right-panel-actions">
135
194
  <base-fade-transition>
136
195
  <div :class="[$styles.flexColNav]">
137
- <base-btn :disabled="documentLoading" :loading="documentLoading" text="Открыть" @click="getFile('view')" />
196
+ <base-animation>
197
+ <base-btn
198
+ v-if="currentDocument.fileName && currentDocument.fileName.includes('.') ? currentDocument.fileName.endsWith('.pdf') : true"
199
+ :disabled="documentLoading"
200
+ :loading="documentLoading"
201
+ text="Открыть"
202
+ @click="getFile('view')"
203
+ />
204
+ </base-animation>
138
205
  <base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="getFile('download')" />
139
206
  <base-animation>
140
207
  <base-btn v-if="canDeleteFiles" :disabled="documentLoading" :loading="documentLoading" text="Удалить" @click="deletionDialog = true" />
@@ -158,7 +225,8 @@
158
225
  3. Через SMS: <br />
159
226
  • Нажмите "Отправить код". <br />
160
227
  • Введите полученный SMS-код. <br />
161
- • Нажмите "Получить документ".<br />
228
+ • Нажмите "Получить документ".<br /><br />
229
+ 4. При ошибке нажмите <a href="javascript:void(0);" class="text-blue-600" @click="$dataStore.updateDigitalDocumentsProfile(currentIin)">обновить профиль</a><br />
162
230
  </v-expansion-panel-text>
163
231
  </v-expansion-panel>
164
232
  </v-expansion-panels>
@@ -195,8 +263,8 @@
195
263
  </template>
196
264
 
197
265
  <script lang="ts">
198
- import { DocumentItem } from '../../composables/classes';
199
- import type { IDocument } from '../../composables/classes';
266
+ import { DocumentItem, Value } from '../../composables/classes';
267
+ import type { IDocument, Member } from '../../composables/classes';
200
268
  import { uuid } from 'vue-uuid';
201
269
  import type { Base, FileActions } from '../../types';
202
270
 
@@ -216,7 +284,15 @@ export default defineComponent({
216
284
  const isDisabled = computed(() => !dataStore.isTask());
217
285
  const contractDict = computed(() => dataStore.dicFileTypeList.find(i => i.nameRu === 'Договор страхования' || i.nameRu === 'Договор'));
218
286
  const processCode = formStore.applicationData.processCode;
219
-
287
+ const requiredSign = computed(
288
+ () =>
289
+ !isDisabled.value &&
290
+ dataStore.isPension &&
291
+ formStore.applicationData &&
292
+ (formStore.applicationData.statusCode === 'StartForm' ||
293
+ formStore.applicationData.statusCode === 'EditForm' ||
294
+ formStore.applicationData.statusCode === 'PreparationDossierForm'),
295
+ );
220
296
  const hasDigitalDocuments = computed(() => dataStore.isEfoParent && !dataStore.isGns && !dataStore.isLifeBusiness && !!formStore.applicationData);
221
297
  const isDigitalDocDisabled = computed(
222
298
  () => !dataStore.isTask() || route.params.taskId === '0' || !dataStore.isInitiator() || !dataStore.isProcessEditable(formStore.applicationData.statusCode),
@@ -267,9 +343,7 @@ export default defineComponent({
267
343
  }),
268
344
  );
269
345
  const showContract = computed(
270
- () =>
271
- formStore.applicationData &&
272
- (formStore.applicationData.statusCode === 'Completed' || formStore.applicationData.statusCode === 'PreparationDossierForm' || dataStore.isActuary()),
346
+ () => formStore.applicationData && (dataStore.isAdmin() || dataStore.isSupport() || (dataStore.isActuary() && formStore.applicationData.statusCode === 'ActuaryForm')),
273
347
  );
274
348
  const noDocuments = computed(() => {
275
349
  if (dataStore.isPension && (!formStore.signedDocumentList || !formStore.signedDocumentList.length)) return !showContract.value;
@@ -287,14 +361,21 @@ export default defineComponent({
287
361
  if (dataStore.isBaiterek || dataStore.isBolashak || dataStore.isLiferenta || dataStore.isKazyna || dataStore.isAmulet || dataStore.isGons) {
288
362
  return baseCondition && (currentDocument.value ? deleteFilesId.includes(String(currentDocument.value.fileTypeCode)) : false);
289
363
  }
290
- if (dataStore.isPension) return baseCondition;
364
+ if (dataStore.isPension) {
365
+ const canDeleteInPension = dataStore.isTask() && dataStore.isInitiator() && currentDocument.value.signed === true && currentDocument.value.signedType === 2;
366
+ if (formStore.applicationData.statusCode === 'AttachAppContractForm')
367
+ return canDeleteInPension && (currentDocument.value.fileTypeCode === '5' || currentDocument.value.fileTypeCode === '19');
368
+ if (formStore.applicationData.statusCode === 'ContractSignedFrom') return canDeleteInPension && currentDocument.value.fileTypeCode === '6';
369
+ }
291
370
  return false;
292
371
  });
293
372
 
294
373
  const policyholderForm = computed(() => formStore.policyholderForm as Base.Document.Digital);
295
374
  const insuredFiltered = computed(() => formStore.insuredForm.filter(i => i.iin !== formStore.policyholderForm.iin) as Base.Document.Digital[]);
296
375
  const beneficiaryFiltered = computed(() => formStore.beneficiaryForm.filter(i => i.iin !== formStore.policyholderForm.iin) as Base.Document.Digital[]);
376
+ const slaveInsuredForm = computed(() => formStore.slaveInsuredForm as Base.Document.Digital);
297
377
  const documentListFiltered = computed(() => formStore.signedDocumentList.filter(i => !['1', '2', '4'].includes(String(i.fileTypeCode))));
378
+ const jointMembers = ref<Member[]>([formStore.insuredForm[0]]);
298
379
 
299
380
  const openPanel = async (document: DocumentItem) => {
300
381
  dataStore.rightPanel.title = document.fileTypeName!;
@@ -312,7 +393,7 @@ export default defineComponent({
312
393
  if (files[0].size >= 20_000_000) {
313
394
  return dataStore.showToaster('error', dataStore.t('toaster.fileOnlyBelow20mb'), 6000);
314
395
  }
315
- if (files[0].type !== 'application/pdf') {
396
+ if (files[0].type !== constants.fileTypes.pdf) {
316
397
  return dataStore.showToaster('error', dataStore.t('toaster.onlyPDF'), 6000);
317
398
  }
318
399
  signedContract.fileName = files[0].name;
@@ -497,10 +578,54 @@ export default defineComponent({
497
578
  }
498
579
  };
499
580
 
581
+ const memberHasDocumentsToSign = (iin: string | null) => {
582
+ if (!iin) return false;
583
+ // TODO reformat logic
584
+ return (
585
+ formStore.signedDocumentList.filter(i => formStore.requiredDocuments.find(j => j.code === i.fileTypeCode) && i.iin === iin.replaceAll('-', '')).length !==
586
+ formStore.requiredDocuments.filter(i => i.iin === iin.replaceAll('-', '')).length
587
+ );
588
+ };
589
+
590
+ const uploadAdditionalFile = async (event: InputEvent, code: string, iin?: string | null) => {
591
+ if (event.target) {
592
+ const files = (event.target as HTMLInputElement).files;
593
+ if (files && files.length && files[0]) {
594
+ if (files[0].type !== constants.fileTypes.pdf && files[0].type !== constants.fileTypes.docx && files[0].type !== constants.fileTypes.doc) {
595
+ return dataStore.showToaster('error', dataStore.t('toaster.onlyWithFormat', { format: 'PDF, Word' }), 6000);
596
+ }
597
+ if (files[0].size >= 10_000_000) {
598
+ return dataStore.showToaster('error', dataStore.t('toaster.fileOnlyBelow10mb'), 6000);
599
+ }
600
+ const file = Object.assign(files[0]);
601
+ const formData = new FormData();
602
+ const information: any = [];
603
+ const uuidV4 = uuid.v4();
604
+ formData.append('file', file);
605
+ const ext = file.name.substring(file.name.lastIndexOf('.'));
606
+ const selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === code);
607
+ information.push({
608
+ identifier: `${uuidV4}${ext}`,
609
+ iin: iin ? iin.replaceAll('-', '') : null,
610
+ processInstanceId: formStore.applicationData.processInstanceId,
611
+ fileTypeCode: selectedDocument ? selectedDocument.code : null,
612
+ fileTypeId: selectedDocument ? selectedDocument.id : null,
613
+ fileName: file.name,
614
+ });
615
+ formData.append('fileData', JSON.stringify(information));
616
+ dataStore.isLoading = true;
617
+ await dataStore.uploadFiles(formData, false);
618
+ await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
619
+ }
620
+ dataStore.isLoading = false;
621
+ }
622
+ };
623
+
500
624
  const onInit = async () => {
501
625
  await dataStore.getDicFileTypeList();
502
626
  await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
503
627
  if (hasDigitalDocuments.value) getDigitalDocs();
628
+ if (processCode === 25) jointMembers.value.push(slaveInsuredForm.value as Member);
504
629
  };
505
630
 
506
631
  onInit();
@@ -513,24 +638,29 @@ export default defineComponent({
513
638
  // State
514
639
  otpCode,
515
640
  formStore,
641
+ currentIin,
516
642
  processCode,
517
643
  isPanelOpen,
644
+ jointMembers,
518
645
  DocumentItem,
519
646
  documentType,
520
647
  documentItems,
521
648
  signedContract,
522
649
  deletionDialog,
650
+ currentDocument,
523
651
  documentLoading,
524
652
  isDigitalDocOpen,
525
653
  underDocumentsList,
526
654
 
527
655
  // Computed
528
656
  isDisabled,
657
+ requiredSign,
529
658
  showContract,
530
659
  noDocuments,
531
660
  canDeleteFiles,
532
661
  insuredFiltered,
533
662
  policyholderForm,
663
+ slaveInsuredForm,
534
664
  beneficiaryFiltered,
535
665
  hasDigitalDocuments,
536
666
  documentListFiltered,
@@ -548,6 +678,8 @@ export default defineComponent({
548
678
  openDigitalDocPanel,
549
679
  uploadUnderFiles,
550
680
  onClearUnderFiles,
681
+ uploadAdditionalFile,
682
+ memberHasDocumentsToSign,
551
683
  };
552
684
  },
553
685
  });