hl-core 0.0.9-beta.21 → 0.0.9-beta.22

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 CHANGED
@@ -394,6 +394,13 @@ export class ApiClass {
394
394
  });
395
395
  }
396
396
 
397
+ async getGovernmentPremiums(id: string) {
398
+ return await this.axiosCall<GovPremiums>({
399
+ method: Methods.POST,
400
+ url: `/${this.productUrl}/api/Application/getGovernmentPremiums?processInstanceId=${id} `,
401
+ });
402
+ }
403
+
397
404
  async getCalculation(id: string) {
398
405
  return await this.axiosCall<number>({
399
406
  method: Methods.POST,
@@ -495,6 +502,15 @@ export class ApiClass {
495
502
  });
496
503
  }
497
504
 
505
+ async generateDocument(data: SignDataType) {
506
+ return await this.axiosCall<void>({
507
+ method: Methods.POST,
508
+ url: '/File/api/Document/Generate',
509
+ responseType: 'arraybuffer',
510
+ data: data,
511
+ });
512
+ }
513
+
498
514
  async getSignedDocList(data: { processInstanceId: string | number }) {
499
515
  return await this.axiosCall<IDocument[]>({
500
516
  method: Methods.POST,
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <base-fade-transition>
3
- <section v-if="firstQuestionList && firstQuestionList.length && !firstPanel && !secondPanel" class="flex flex-col">
3
+ <section v-if="firstQuestionList && firstQuestionList.length && !firstPanel && !secondPanel" class="flex flex-col shrink grow max-h-[90vh]">
4
4
  <section :class="[$styles.blueBgLight, $styles.rounded]" class="mx-[10px] my-[14px] p-4 flex flex-col gap-4">
5
5
  <base-form-toggle
6
6
  v-model="answerToAll"
@@ -10,7 +10,7 @@
10
10
  @clicked="handleToggler"
11
11
  />
12
12
  </section>
13
- <v-form ref="vForm" class="max-h-[65svh] overflow-y-scroll" @submit="submitForm">
13
+ <v-form ref="vForm" class="grow shrink overflow-y-scroll" @submit="submitForm">
14
14
  <section
15
15
  v-if="firstQuestionList.filter(i => i.first.definedAnswers === 'N').length"
16
16
  :class="[$styles.blueBgLight, $styles.rounded]"
@@ -69,18 +69,20 @@
69
69
  </base-form-text-section>
70
70
  </section>
71
71
  </v-form>
72
- <base-btn
73
- class="my-[14px] self-center"
74
- :loading="isButtonLoading"
75
- :disabled="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
76
- @click="submitForm"
77
- :text="$dataStore.t('buttons.save')"
78
- />
72
+ <div class="px-[14px]">
73
+ <base-btn
74
+ class="my-[14px] self-center"
75
+ :loading="isButtonLoading"
76
+ :disabled="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
77
+ @click="submitForm"
78
+ :text="$dataStore.t('buttons.save')"
79
+ />
80
+ </div>
79
81
  </section>
80
- <v-btn
82
+ <base-btn
81
83
  v-if="currentQuestion && currentQuestion.second && currentQuestion.second.length && firstPanel"
82
- icon="mdi mdi-close"
83
- class="ml-3 !absolute z-10"
84
+ class="!absolute z-10 my-[14px] self-center w-[96%] bottom-0"
85
+ :text="$dataStore.t('buttons.save')"
84
86
  @click="submitSecondaryForm"
85
87
  />
86
88
  <section ref="firstPanelSection" v-if="currentQuestion && currentQuestion.second && firstPanel" class="flex flex-col px-[10px] pb-[14px]" :class="[$styles.scrollPage]">
@@ -1,5 +1,15 @@
1
1
  <template>
2
2
  <section class="w-full px-[10px] pt-[14px] flex flex-col gap-2" :class="[$styles.scrollPage]" v-if="formStore.signedDocumentList && formStore.signedDocumentList.length">
3
+ <base-content-block
4
+ v-if="$dataStore.isInitiator() && $dataStore.controls.hasChooseSign && formStore.applicationData.statusCode === 'ContractSignedFrom'"
5
+ :class="[$styles.textSimple]"
6
+ >
7
+ <h5 class="text-center font-medium mb-4">{{ $dataStore.t('Contract') }}</h5>
8
+ <base-form-input v-model="formStore.documentName" :label="$dataStore.t('form.document')" :readonly="true" />
9
+ <base-form-input v-model="formStore.policyNumber" :label="$dataStore.t('form.documentNumber')" :readonly="true" />
10
+ <base-form-input v-model="formStore.contractDate" :label="$dataStore.t('form.date')" :readonly="true" append-inner-icon="mdi mdi-calendar-blank-outline" />
11
+ <base-file-input :readonly="isDisabled" @input.prevent="onFileChange($event)" />
12
+ </base-content-block>
3
13
  <base-content-block v-for="document of formStore.signedDocumentList" :key="document.id" :class="[$styles.textSimple]">
4
14
  <h5 class="text-center font-medium mb-4">
5
15
  {{ document.fileTypeName }}
@@ -35,6 +45,19 @@ export default defineComponent({
35
45
  const currentDocument = ref<DocumentItem>(new DocumentItem());
36
46
  const documentLoading = ref<boolean>(false);
37
47
 
48
+ const isDisabled = computed(() => !dataStore.isTask());
49
+ const contractDict = computed(() => dataStore.dicFileTypeList.find(i => i.nameRu === 'Договор страхования'));
50
+ const signedContract = reactive<{
51
+ processInstanceId: string | number;
52
+ fileTypeId: string | number | null;
53
+ fileTypeCode: string | number | null;
54
+ fileName?: string | number | null;
55
+ }>({
56
+ processInstanceId: formStore.applicationData.processInstanceId,
57
+ fileTypeId: contractDict.value ? contractDict.value.id : '',
58
+ fileTypeCode: contractDict.value ? contractDict.value.code : '',
59
+ });
60
+ const signedContractFormData = ref(new FormData());
38
61
  const currentState = reactive<{ action: string; text: string }>({
39
62
  action: '',
40
63
  text: '',
@@ -56,6 +79,26 @@ export default defineComponent({
56
79
  dataStore.panel.open = true;
57
80
  };
58
81
 
82
+ const onFileChange = async (event: InputEvent) => {
83
+ if (event.target) {
84
+ const files = (event.target as HTMLInputElement).files;
85
+ if (files && files.length && files[0].name !== signedContract.fileName) {
86
+ if (files[0].size >= 5_000_000) {
87
+ return dataStore.showToaster('error', dataStore.t('toaster.fileOnlyBelow5mb'), 6000);
88
+ }
89
+ if (files[0].type !== 'application/pdf') {
90
+ return dataStore.showToaster('error', dataStore.t('toaster.onlyPDF'), 6000);
91
+ }
92
+ signedContract.fileName = files[0].name;
93
+ formStore.documentName = signedContract.fileName;
94
+ signedContractFormData.value.append('file', files[0]);
95
+ signedContractFormData.value.append('fileData', JSON.stringify([signedContract]));
96
+ formStore.signedContractFormData = signedContractFormData.value;
97
+ formStore.isUploadedSignedContract = true;
98
+ }
99
+ }
100
+ };
101
+
59
102
  watch(
60
103
  () => document_list.value,
61
104
  () => {
@@ -98,10 +141,15 @@ export default defineComponent({
98
141
  formStore,
99
142
  documentLoading,
100
143
  DocumentItem,
144
+ signedContract,
145
+
146
+ // Computed
147
+ isDisabled,
101
148
 
102
149
  // Functions
103
150
  openPanel,
104
151
  getFile,
152
+ onFileChange,
105
153
  };
106
154
  },
107
155
  });
@@ -228,28 +228,28 @@
228
228
  :suffix="$constants.currencySymbols.kzt"
229
229
  />
230
230
  <base-form-input
231
- v-if="whichProduct === 'gons' && isCalculator"
231
+ v-if="whichProduct === 'gons'"
232
232
  v-model="productConditionsForm.totalAmount5"
233
233
  :readonly="true"
234
234
  :label="$dataStore.t('productConditionsForm.totalAmount5')"
235
235
  :suffix="$constants.currencySymbols.kzt"
236
236
  />
237
237
  <base-form-input
238
- v-if="whichProduct === 'gons' && isCalculator"
238
+ v-if="whichProduct === 'gons'"
239
239
  v-model="productConditionsForm.statePremium5"
240
240
  :readonly="true"
241
241
  :label="$dataStore.t('productConditionsForm.statePremium5')"
242
242
  :suffix="$constants.currencySymbols.kzt"
243
243
  />
244
244
  <base-form-input
245
- v-if="whichProduct === 'gons' && isCalculator"
245
+ v-if="whichProduct === 'gons'"
246
246
  v-model="productConditionsForm.totalAmount7"
247
247
  :readonly="true"
248
248
  :label="$dataStore.t('productConditionsForm.totalAmount7')"
249
249
  :suffix="$constants.currencySymbols.kzt"
250
250
  />
251
251
  <base-form-input
252
- v-if="whichProduct === 'gons' && isCalculator"
252
+ v-if="whichProduct === 'gons'"
253
253
  v-model="productConditionsForm.statePremium7"
254
254
  :readonly="true"
255
255
  :label="$dataStore.t('productConditionsForm.statePremium7')"
@@ -26,47 +26,51 @@
26
26
  <base-btn :btn="$styles.blueLightBtn" :text="$dataStore.t('confirm.no')" @click="closePanel" />
27
27
  </div>
28
28
  </section>
29
+ <section v-if="chooseSignActions">
30
+ <div v-if="!isElectronicContract && !isPaperContract" :class="[$styles.flexColNav]">
31
+ <base-btn :text="$dataStore.t('buttons.sendOnPaper')" @click="handleSignAction('paper')" />
32
+ <base-btn :text="$dataStore.t('buttons.sendElectronically')" :disabled="true" @click="handleSignAction('electronic')" />
33
+ </div>
34
+ <div v-if="isPaperContract" :class="[$styles.flexColNav]">
35
+ <base-btn :text="$dataStore.t('buttons.downloadContract')" :loading="$dataStore.isButtonsLoading" @click="generateDocument" />
36
+ </div>
37
+ </section>
29
38
  <section v-if="signingActions" class="relative">
30
- <div>
31
- <base-fade-transition>
32
- <div v-if="!isSendNumberOpen" :class="[$styles.flexColNav]">
33
- <div :class="[$styles.blueBgLight]" class="rounded-lg p-4">
34
- <v-expansion-panels v-if="formStore.signUrls && formStore.signUrls.length" variant="accordion" multiple>
35
- <v-expansion-panel v-for="signUrl of formStore.signUrls" :key="signUrl.iin!" class="border-[1px]" elevation="0" bg-color="#FFF">
36
- <v-expansion-panel-title class="h-[80px]" :class="$styles.textTitle">
37
- {{ `${signUrl.longName} - ${signUrl.iin}` }}
38
- </v-expansion-panel-title>
39
- <v-expansion-panel-text class="border-t-[1px]">
40
- <section class="flex flex-col gap-4 py-3" :class="$styles.textSimple">
41
- <base-btn :loading="loading" :text="$dataStore.t('sign.copyCloud')" @click="$dataStore.copyToClipboard(signUrl.uri)" />
42
- <base-btn :loading="loading" :btn="$styles.blueLightBtn" :text="$dataStore.t('sign.recipientNumber')" @click="openSmsPanel(signUrl)" />
43
- </section>
44
- </v-expansion-panel-text>
45
- </v-expansion-panel>
46
- </v-expansion-panels>
47
- <base-list-empty v-else />
48
- </div>
39
+ <base-fade-transition>
40
+ <div v-if="!isSendNumberOpen" :class="[$styles.flexColNav]">
41
+ <div :class="[$styles.blueBgLight]" class="rounded-lg p-4">
42
+ <v-expansion-panels v-if="formStore.signUrls && formStore.signUrls.length" variant="accordion" multiple>
43
+ <v-expansion-panel v-for="signUrl of formStore.signUrls" :key="signUrl.iin!" class="border-[1px]" elevation="0" bg-color="#FFF">
44
+ <v-expansion-panel-title class="h-[80px]" :class="$styles.textTitle">
45
+ {{ `${signUrl.longName} - ${signUrl.iin}` }}
46
+ </v-expansion-panel-title>
47
+ <v-expansion-panel-text class="border-t-[1px]">
48
+ <section class="flex flex-col gap-4 py-3" :class="$styles.textSimple">
49
+ <base-btn :loading="loading" :text="$dataStore.t('sign.copyCloud')" @click="$dataStore.copyToClipboard(signUrl.uri)" />
50
+ <base-btn :loading="loading" :btn="$styles.blueLightBtn" :text="$dataStore.t('sign.recipientNumber')" @click="openSmsPanel(signUrl)" />
51
+ </section>
52
+ </v-expansion-panel-text>
53
+ </v-expansion-panel>
54
+ </v-expansion-panels>
55
+ <base-list-empty v-else />
49
56
  </div>
50
- <div v-if="isSendNumberOpen" :class="[$styles.flexColNav]">
51
- <i
52
- class="mdi mdi-arrow-left cursor-pointer absolute text-xl left-0 top-0 rounded-br-full bg-white border-[1px] pb-3 pt-1 pl-1 pr-3"
53
- @click="isSendNumberOpen = false"
54
- ></i>
55
- <base-form-section :title="selectedClient && selectedClient.longName ? selectedClient.longName : ''">
56
- <v-form ref="vForm">
57
- <base-rounded-input
58
- v-model="phoneNumber"
59
- :maska="$maska.phone"
60
- :rules="$rules.required.concat($rules.phoneFormat)"
61
- :label="$dataStore.t('form.phoneNumber')"
62
- placeholder="+7 7"
63
- />
64
- </v-form>
65
- <base-btn :text="$dataStore.t('buttons.sendSMS')" :loading="loading" @click="submitForm" />
66
- </base-form-section>
67
- </div>
68
- </base-fade-transition>
69
- </div>
57
+ </div>
58
+ <div v-if="isSendNumberOpen" :class="[$styles.flexColNav]">
59
+ <i class="mdi mdi-arrow-left cursor-pointer absolute text-xl left-0 top-0 rounded-br-full bg-white border-[1px] pb-3 pt-1 pl-1 pr-3" @click="isSendNumberOpen = false"></i>
60
+ <base-form-section :title="selectedClient && selectedClient.longName ? selectedClient.longName : ''">
61
+ <v-form ref="vForm">
62
+ <base-rounded-input
63
+ v-model="phoneNumber"
64
+ :maska="$maska.phone"
65
+ :rules="$rules.required.concat($rules.phoneFormat)"
66
+ :label="$dataStore.t('form.phoneNumber')"
67
+ placeholder="+7 7"
68
+ />
69
+ </v-form>
70
+ <base-btn :text="$dataStore.t('buttons.sendSMS')" :loading="loading" @click="submitForm" />
71
+ </base-form-section>
72
+ </div>
73
+ </base-fade-transition>
70
74
  </section>
71
75
  <section v-if="payingActions" class="relative">
72
76
  <div>
@@ -145,6 +149,9 @@ export default defineComponent({
145
149
  const formStore = useFormStore();
146
150
  const actionCause = ref<string>('');
147
151
  const loading = ref<boolean>(false);
152
+ const isPaperContract = ref<boolean>(false);
153
+ const isElectronicContract = ref<boolean>(true);
154
+
148
155
  const vForm = ref<any>();
149
156
  const isSendNumberOpen = ref<boolean>(false);
150
157
  const phoneNumber = ref<string | null>(formStore.policyholderForm.phoneNumber ?? '');
@@ -190,7 +197,6 @@ export default defineComponent({
190
197
  }
191
198
  }
192
199
  };
193
-
194
200
  const submitForm = async () => {
195
201
  await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
196
202
  if (v.valid) {
@@ -237,6 +243,18 @@ export default defineComponent({
237
243
  loading.value = false;
238
244
  };
239
245
 
246
+ const onInit = async () => {
247
+ if (dataStore.controls.hasChooseSign) {
248
+ if (dataStore.isGons) {
249
+ isElectronicContract.value = false;
250
+ }
251
+ }
252
+ };
253
+
254
+ onMounted(async () => {
255
+ await onInit();
256
+ });
257
+
240
258
  const buttonText = computed(() => {
241
259
  switch (dataStore.panelAction) {
242
260
  case constants.actions.reject:
@@ -293,6 +311,8 @@ export default defineComponent({
293
311
  const signingActions = computed(() => dataStore.panelAction === constants.actions.sign);
294
312
  const payingActions = computed(() => dataStore.panelAction === constants.actions.pay);
295
313
  const affiliateActions = computed(() => dataStore.panelAction === constants.actions.affiliate);
314
+ const chooseSignActions = computed(() => dataStore.controls.hasChooseSign && dataStore.panelAction === constants.actions.chooseSign);
315
+
296
316
  const paymentPeriod = computed(() => formStore.productConditionsForm.paymentPeriod.nameRu);
297
317
  const insurancePremiumPerMonth = computed(() => dataStore.getNumberWithSpaces(formStore.productConditionsForm.insurancePremiumPerMonth));
298
318
  const requestedSumInsured = computed(() => dataStore.getNumberWithSpaces(formStore.productConditionsForm.requestedSumInsured));
@@ -307,7 +327,20 @@ export default defineComponent({
307
327
  }
308
328
  return true;
309
329
  });
310
-
330
+ const handleSignAction = async (type: 'paper' | 'electronic') => {
331
+ if (type === 'electronic') {
332
+ await dataStore.signDocument();
333
+ isElectronicContract.value = true;
334
+ }
335
+ if (type === 'paper') {
336
+ isPaperContract.value = true;
337
+ }
338
+ };
339
+ const generateDocument = async () => {
340
+ dataStore.panel.open = false;
341
+ dataStore.panelAction = null;
342
+ await dataStore.generateDocument();
343
+ };
311
344
  return {
312
345
  // State
313
346
  formStore,
@@ -317,6 +350,7 @@ export default defineComponent({
317
350
  isSendNumberOpen,
318
351
  phoneNumber,
319
352
  selectedClient,
353
+ isPaperContract,
320
354
 
321
355
  // Functions
322
356
  closePanel,
@@ -333,6 +367,7 @@ export default defineComponent({
333
367
  payingActions,
334
368
  acceptAction,
335
369
  affiliateActions,
370
+ chooseSignActions,
336
371
  paymentPeriod,
337
372
  insurancePremiumPerMonth,
338
373
  requestedSumInsured,
@@ -341,6 +376,9 @@ export default defineComponent({
341
376
  price,
342
377
  insuredAmount,
343
378
  templateAction,
379
+ isElectronicContract,
380
+ handleSignAction,
381
+ generateDocument,
344
382
  };
345
383
  },
346
384
  });
@@ -906,6 +906,8 @@ export class DataStoreClass {
906
906
  hasAttachment: boolean;
907
907
  // Решение АС
908
908
  hasAffiliation: boolean;
909
+ // Выбор метода подписания
910
+ hasChooseSign: boolean;
909
911
  };
910
912
  members: {
911
913
  clientApp: MemberSettings;
@@ -1056,6 +1058,7 @@ export class DataStoreClass {
1056
1058
  hasCalculator: false,
1057
1059
  hasAttachment: true,
1058
1060
  hasAffiliation: true,
1061
+ hasChooseSign: false,
1059
1062
  };
1060
1063
  this.iframeLoading = false;
1061
1064
  this.hasLayoutMargins = true;
@@ -1192,6 +1195,13 @@ export class DataStoreClass {
1192
1195
  }
1193
1196
 
1194
1197
  export class FormStoreClass {
1198
+ documentName: string | null;
1199
+ regNumber: string | null;
1200
+ policyNumber: string | null;
1201
+ contractDate: string | null;
1202
+ needToScanSignedContract: boolean;
1203
+ isUploadedSignedContract: boolean;
1204
+ signedContractFormData: any;
1195
1205
  lfb: {
1196
1206
  insurers: ClientV2[];
1197
1207
  fixInsAmount: Value[];
@@ -1286,7 +1296,14 @@ export class FormStoreClass {
1286
1296
  questionnaireByCritical: any[];
1287
1297
  canBeClaimed: boolean | null;
1288
1298
  applicationTaskId: string | null;
1289
- constructor(procuctConditionsTitle?: string) {
1299
+ constructor() {
1300
+ this.regNumber = null;
1301
+ this.policyNumber = null;
1302
+ this.contractDate = null;
1303
+ this.documentName = null;
1304
+ this.isUploadedSignedContract = false;
1305
+ this.needToScanSignedContract = false;
1306
+ this.signedContractFormData = null;
1290
1307
  this.lfb = {
1291
1308
  insurers: [],
1292
1309
  fixInsAmount: [],
package/locales/ru.json CHANGED
@@ -113,8 +113,15 @@
113
113
  "needAgent": "Поле агент должно быть заполнено",
114
114
  "tripInsuredAmountCalculated": "Высчитана страховая сумма для выбора",
115
115
  "calcSumForUnder": "Внимание! Требуется пересчет страховой суммы андеррайтером. Заявка будет направлена Андеррайтеру",
116
- "doesHaveActiveContract": "Заключение договора невозможно. У Выгодоприобретателя имеется действующий договор"
116
+ "doesHaveActiveContract": "Заключение договора невозможно. У Выгодоприобретателя имеется действующий договор",
117
+ "needToSignContract": "Документ скачан. После подписи, необходимо вложить договор в разделе “Документы”",
118
+ "successfullyDocSent": "Отправка документа прошла успешно",
119
+ "fileOnlyBelow5mb": "Максимальный размер документа для загрузки - 5 МБ.",
120
+ "onlyPDF": "Загружать документы можно только в формате PDF"
117
121
  },
122
+ "notSignedContract": "Неподписанный Договор",
123
+ "Contract": "Договор страхования",
124
+ "needToScanSignedContract": "Необходимо вложить подписанный и отсканированный договор",
118
125
  "buttons": {
119
126
  "clearOrReset": "Не выбран / Очистить",
120
127
  "dataInput": "Ввод данных",
@@ -177,10 +184,15 @@
177
184
  "toStatement": "Продолжить оформление",
178
185
  "affiliate": "Добавить решение АС",
179
186
  "more": "Подробнее",
180
- "reset": "Восстановить"
187
+ "reset": "Восстановить",
188
+ "sendToSign": "Отправить на подпись",
189
+ "downloadContract": "Скачать договор",
190
+ "sendElectronically": "Отправить в электронном виде",
191
+ "sendOnPaper": "Отправить на бумажном носителе"
181
192
  },
182
193
  "dialog": {
183
194
  "title": "Подтверждение",
195
+ "do": "Вы действительно хотите сделать данное действие?",
184
196
  "exit": "Вы действительно хотите выйти?",
185
197
  "exitApp": "Вы действительно хотите выйти? Данные будут очищены.",
186
198
  "dataWillClear": "Данные будут очищены",
@@ -195,6 +207,7 @@
195
207
  "continue": "Продолжить",
196
208
  "correctSum": "Корректна ли сумма страховой премии?",
197
209
  "sign": "Вы действительно хотите подписать?",
210
+ "signed": "Вы действительно хотите отправить на следующий этап?",
198
211
  "pay": "Вы действительно хотите оплатить?",
199
212
  "familyMember": "Выберите члена семьи",
200
213
  "register": "Вы действительно хотите добавить в реестр данного ребенка?",
@@ -373,9 +386,12 @@
373
386
  "nameEn": "Наименование (англ)",
374
387
  "from": "От",
375
388
  "to": "До",
376
- "reason": "Основание для признания аффилированности",
389
+ "reasonForAffiliation": "Основание для признания аффилированности",
390
+ "reasonForRelation": "Основание для признания связанности",
377
391
  "affiliationDate": "Дата появления аффилированности",
392
+ "relationDate": "Дата появления связанности",
378
393
  "expulsionDate": "Дата исключения",
394
+ "applicationDate": "Дата заявки",
379
395
  "wrongData": "Некорректные данные обнаружены",
380
396
  "legalName": "Название организации",
381
397
  "oked": "Окэд",
@@ -387,7 +403,10 @@
387
403
  "controllerCheck": "Проверенно контроллером",
388
404
  "amountCurrency": "Сумма в валюте",
389
405
  "isAnotherContract ": "Подозрение что у клиента есть договор страхования в другой иностранной компании",
390
- "opf": "Организационно-правовая форма"
406
+ "opf": "Организационно-правовая форма",
407
+ "checkType": "Тип проверки",
408
+ "personType": "Тип клиента",
409
+ "operationtype": "Тип операции"
391
410
  },
392
411
  "agent": {
393
412
  "currency": "Валюта",
@@ -716,6 +735,7 @@
716
735
  "NumberApartment": "№ кв.",
717
736
  "birthData": "Место рождения",
718
737
  "documentData": "Документы",
738
+ "document": "Документ",
719
739
  "documentType": "Тип документа",
720
740
  "documentNumber": "Номер документа",
721
741
  "date": "Дата",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hl-core",
3
- "version": "0.0.9-beta.21",
3
+ "version": "0.0.9-beta.22",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "nuxt.config.ts",
@@ -603,7 +603,7 @@ export const useDataStore = defineStore('data', {
603
603
  }
604
604
  },
605
605
  async saveContragent(user: Member, whichForm: keyof typeof StoreMembers | 'contragent', whichIndex: number | null, onlySaveAction: boolean = true) {
606
- if (this.isGons && user.iin) {
606
+ if (this.isGons && user.iin && whichForm === 'beneficiaryForm') {
607
607
  const doesHaveActiveContract = await this.api.checkBeneficiariesInActualPolicy(user.iin.replace(/-/g, ''));
608
608
  if (doesHaveActiveContract) {
609
609
  this.showToaster('error', this.t('toaster.doesHaveActiveContract'), 6000);
@@ -1739,6 +1739,13 @@ export const useDataStore = defineStore('data', {
1739
1739
  if (this.isLiferenta) {
1740
1740
  this.formStore.productConditionsForm.amountAnnuityPayments = this.getNumberWithSpaces(applicationData.policyAppDto.annuityMonthPay);
1741
1741
  }
1742
+ if (this.isGons) {
1743
+ const govPremiums = await this.api.getGovernmentPremiums(String(id));
1744
+ this.formStore.productConditionsForm.totalAmount5 = this.getNumberWithSpaces(govPremiums.totalAmount5 === null ? null : govPremiums.totalAmount5);
1745
+ this.formStore.productConditionsForm.totalAmount7 = this.getNumberWithSpaces(govPremiums.totalAmount7 === null ? null : govPremiums.totalAmount7);
1746
+ this.formStore.productConditionsForm.statePremium5 = this.getNumberWithSpaces(govPremiums.statePremium5 === null ? null : govPremiums.statePremium5);
1747
+ this.formStore.productConditionsForm.statePremium7 = this.getNumberWithSpaces(govPremiums.statePremium7 === null ? null : govPremiums.statePremium7);
1748
+ }
1742
1749
 
1743
1750
  this.showToaster('success', this.t('toaster.calculated'), 1000);
1744
1751
  } catch (err) {
@@ -1833,6 +1840,7 @@ export const useDataStore = defineStore('data', {
1833
1840
  this.sendToParent(constants.postActions.toHomePage, this.t('toaster.noSuchProduct'));
1834
1841
  return;
1835
1842
  }
1843
+ this.formStore.regNumber = applicationData.regNumber;
1836
1844
  this.formStore.applicationData = applicationData;
1837
1845
  this.formStore.additionalInsuranceTerms = applicationData.addCoverDto;
1838
1846
 
@@ -2023,6 +2031,8 @@ export const useDataStore = defineStore('data', {
2023
2031
  }
2024
2032
  }
2025
2033
  if (setProductConditions) {
2034
+ this.formStore.policyNumber = applicationData.policyAppDto.policyNumber;
2035
+ this.formStore.contractDate = reformatDate(applicationData.policyAppDto.contractDate);
2026
2036
  this.formStore.productConditionsForm.coverPeriod = applicationData.policyAppDto.coverPeriod;
2027
2037
  this.formStore.productConditionsForm.payPeriod = applicationData.policyAppDto.payPeriod;
2028
2038
  // this.formStore.productConditionsForm.annualIncome = applicationData.policyAppDto.annualIncome?.toString();
@@ -2140,6 +2150,7 @@ export const useDataStore = defineStore('data', {
2140
2150
  }
2141
2151
  case constants.actions.reject:
2142
2152
  case constants.actions.return:
2153
+ case constants.actions.signed:
2143
2154
  case constants.actions.rejectclient:
2144
2155
  case constants.actions.accept: {
2145
2156
  try {
@@ -2265,6 +2276,34 @@ export const useDataStore = defineStore('data', {
2265
2276
  ErrorHandler(err);
2266
2277
  }
2267
2278
  },
2279
+ async generateDocument() {
2280
+ try {
2281
+ this.isButtonsLoading = true;
2282
+ if (this.formStore.signUrls.length) {
2283
+ return this.formStore.signUrls;
2284
+ }
2285
+ this.formStore.needToScanSignedContract = true;
2286
+ const data: SignDataType = {
2287
+ processInstanceId: String(this.formStore.applicationData.processInstanceId),
2288
+ name: 'Contract',
2289
+ format: 'pdf',
2290
+ };
2291
+ const response: any = await this.api.generateDocument(data);
2292
+ const blob = new Blob([response], {
2293
+ type: `application/pdf`,
2294
+ });
2295
+ this.showToaster('info', this.t('toaster.needToSignContract'), 100000);
2296
+ const url = window.URL.createObjectURL(blob);
2297
+ const link = document.createElement('a');
2298
+ link.href = url;
2299
+ link.setAttribute('download', this.formStore.regNumber + ' Договор страхования');
2300
+ document.body.appendChild(link);
2301
+ link.click();
2302
+ } catch (err) {
2303
+ ErrorHandler(err);
2304
+ }
2305
+ this.isButtonsLoading = false;
2306
+ },
2268
2307
  async registerNumber() {
2269
2308
  try {
2270
2309
  if (!this.formStore.finCenterData.date) return;
package/types/enum.ts CHANGED
@@ -13,11 +13,13 @@ export enum Actions {
13
13
  return = 'return',
14
14
  claim = 'claim',
15
15
  sign = 'sign',
16
+ signed = 'signed',
16
17
  pay = 'pay',
17
18
  register = 'register',
18
19
  send = 'send',
19
20
  affiliate = 'affiliate',
20
21
  template = 'template',
22
+ chooseSign = 'chooseSign',
21
23
  }
22
24
 
23
25
  export enum PostActions {
package/types/index.ts CHANGED
@@ -618,4 +618,11 @@ declare global {
618
618
  middleName: string;
619
619
  name: string;
620
620
  };
621
+
622
+ type GovPremiums = {
623
+ statePremium5: number | null;
624
+ statePremium7: number | null;
625
+ totalAmount5: number | null;
626
+ totalAmount7: number | null;
627
+ };
621
628
  }