hl-core 0.0.9-beta.10 → 0.0.9-beta.12

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.
@@ -34,19 +34,19 @@
34
34
  <base-form-text-section v-for="(question, index) in firstQuestionList.filter(i => i.first.definedAnswers === 'Y')" :key="index">
35
35
  <base-fade-transition>
36
36
  <div
37
- v-if="question.first.answerName === 'Да' && secondQuestionList"
37
+ v-if="question.first.answerName === 'Да' && question.second"
38
38
  :class="[$styles.greenBg, $styles.whiteText, $styles.textSimple]"
39
39
  class="rounded-t-lg pl-6 py-1 cursor-pointer"
40
40
  @click="openFirstPanel(question)"
41
41
  >
42
- {{ $dataStore.t('questionnaireType.pleaseAnswer', { text: secondQuestionList.length }) }}
42
+ {{ $dataStore.t('questionnaireType.pleaseAnswer', { text: question.second.length }) }}
43
43
  </div>
44
44
  </base-fade-transition>
45
45
  <span :class="[$styles.textTitle]" class="border-b-[1px] border-b-[#F3F6FC] p-6 flex items-center justify-between">
46
46
  {{ question.first.name }}
47
47
  <base-fade-transition>
48
48
  <i
49
- v-if="question.first.answerName === 'Да' && secondQuestionList && secondQuestionList.length"
49
+ v-if="question.first.answerName === 'Да' && question.second && question.second.length"
50
50
  class="mdi mdi-chevron-right text-2xl cursor-pointer"
51
51
  @click="openFirstPanel(question)"
52
52
  ></i>
@@ -78,30 +78,39 @@
78
78
  />
79
79
  </section>
80
80
  <v-btn
81
- v-if="secondQuestionList && secondQuestionList.length && firstPanel"
81
+ v-if="currentQuestion && currentQuestion.second && currentQuestion.second.length && firstPanel"
82
82
  icon="mdi mdi-close"
83
83
  class="ml-3 !absolute z-10"
84
- @click="
85
- firstPanel = false;
86
- secondPanel = false;
87
- "
84
+ @click="submitSecondaryForm"
88
85
  />
89
- <section ref="firstPanelSection" v-if="secondQuestionList && secondQuestionList.length && firstPanel" class="flex flex-col px-[10px] pb-[14px]" :class="[$styles.scrollPage]">
90
- <section v-if="currentQuestion" :class="[$styles.blueBgLight, $styles.rounded]" class="mx-[10px] mt-[14px] p-4 flex flex-col gap-4">
86
+ <section ref="firstPanelSection" v-if="currentQuestion && currentQuestion.second && firstPanel" class="flex flex-col px-[10px] pb-[14px]" :class="[$styles.scrollPage]">
87
+ <v-form
88
+ v-if="currentQuestion"
89
+ :class="[$styles.blueBgLight, $styles.rounded]"
90
+ class="mx-[10px] mt-[14px] p-4 flex flex-col gap-4"
91
+ ref="vSecondaryForm"
92
+ @submit="submitSecondaryForm"
93
+ >
91
94
  <base-form-text-section v-for="question in currentQuestion.second" :title="question.name" :key="question.name">
92
95
  <base-form-input
93
96
  v-if="question.definedAnswers === 'N'"
94
97
  v-model="question.answerText"
95
98
  class="border-t-[1px] border-t-[#F3F6FC]"
96
- placeholder="Введите текст"
99
+ :placeholder="$dataStore.t('labels.inputText')"
97
100
  :readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
101
+ :rules="isSecondRequired ? $rules.required : []"
98
102
  />
99
- <span v-else class="flex items-center justify-between p-4 cursor-pointer" :class="[$styles.textTitle, $styles.greenText]" @click="openSecondPanel(question)">
100
- {{ question.answerName ? question.answerName : 'Выбрать вариант ответа' }}
101
- <i class="mdi mdi-chevron-right text-[28px]"></i>
102
- </span>
103
+ <base-panel-input
104
+ v-else
105
+ :class="[$styles.textTitle, $styles.greenText]"
106
+ :value="question.answerName ? question.answerName : 'Выбрать вариант ответа'"
107
+ :readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
108
+ :clearable="false"
109
+ :error-messages="isSecondRequired ? (question.answerName ? [] : ['Выбрать вариант ответа']) : []"
110
+ @click="openSecondPanel(question)"
111
+ ></base-panel-input>
103
112
  </base-form-text-section>
104
- </section>
113
+ </v-form>
105
114
  </section>
106
115
  </base-fade-transition>
107
116
  <Teleport v-if="secondPanel" to="#panel-actions">
@@ -132,6 +141,7 @@ export default defineComponent({
132
141
  const formStore = useFormStore();
133
142
  const dataStore = useDataStore();
134
143
  const vForm = ref<any>();
144
+ const vSecondaryForm = ref<any>();
135
145
  const firstPanelSection = ref<any>();
136
146
  const isButtonLoading = ref<boolean>(false);
137
147
  const answerToAll = ref<boolean>(false);
@@ -148,13 +158,13 @@ export default defineComponent({
148
158
  : 'surveyByCriticalBasePolicyholder',
149
159
  );
150
160
  const firstQuestionList = ref<AnketaBody[]>([]);
151
- const secondQuestionList = ref<AnketaSecond[]>([]);
152
161
  const currentQuestion = ref<AnketaBody>();
153
162
  const currentSecond = ref<AnketaSecond>();
154
163
  const isPanelLoading = ref<boolean>(false);
155
164
  const searchQuery = ref<string>('');
156
165
 
157
166
  const whichMember = computed(() => ('member' in route.query && !!route.query.member ? (route.query.member as 'insured' | 'policyholder') : 'insured'));
167
+ const isSecondRequired = computed(() => dataStore.controls.isSecondAnketaRequired);
158
168
  const scrollForm = (direction: 'up' | 'down') => {
159
169
  const scrollObject = { top: direction === 'up' ? 0 : screen.height * 10, behavior: 'smooth' };
160
170
  if (firstPanel.value) {
@@ -168,11 +178,25 @@ export default defineComponent({
168
178
  await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
169
179
  if (v.valid) {
170
180
  isButtonLoading.value = true;
171
- formStore[whichSurvey.value]!.body.forEach((survey: AnketaBody) => {
172
- if (survey.first.answerText === 'Нет') {
173
- survey.second = [];
174
- }
175
- });
181
+ const isValid = dataStore.validateAnketa(whichSurvey.value);
182
+ if (!isValid) {
183
+ isButtonLoading.value = false;
184
+ return false;
185
+ }
186
+ if (formStore[whichSurvey.value] && formStore[whichSurvey.value]?.body) {
187
+ formStore[whichSurvey.value]?.body.forEach(question => {
188
+ if (question.first.definedAnswers === 'Y' && question.first.answerName?.match(new RegExp('Нет', 'i')) && question.second && question.second.length) {
189
+ question.second.forEach(second => {
190
+ if (second.definedAnswers === 'N') {
191
+ second.answerText = null;
192
+ } else {
193
+ second.answerId = null;
194
+ second.answerName = null;
195
+ }
196
+ });
197
+ }
198
+ });
199
+ }
176
200
  formStore[whichSurvey.value]!.type = surveyType.value;
177
201
  const anketaToken = await dataStore.setSurvey(formStore[whichSurvey.value]!);
178
202
  if (typeof anketaToken === 'string') {
@@ -201,13 +225,36 @@ export default defineComponent({
201
225
  });
202
226
  };
203
227
 
204
- const openFirstPanel = async (question: AnketaBody) => {
205
- currentQuestion.value = question;
206
- formStore[whichSurvey.value]!.body.forEach((question_object: AnketaBody) => {
207
- if ((question_object.first.id === question.first.id && question_object.second && !question_object.second.length) || question_object.second == null) {
208
- question_object.second = JSON.parse(JSON.stringify(formStore[surveyType.value === 'health' ? 'surveyByHealthSecond' : 'surveyByCriticalSecond']));
228
+ const submitSecondaryForm = async () => {
229
+ await vSecondaryForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
230
+ if (v.valid) {
231
+ if (isSecondRequired.value && currentQuestion.value && currentQuestion.value.second) {
232
+ const hasError = currentQuestion.value.second.find(second => (second.definedAnswers === 'N' ? !second.answerText : !second.answerName));
233
+ if (hasError) {
234
+ dataStore.showToaster('error', dataStore.t('toaster.emptySecondAnketa', { text: hasError.name }), 5000);
235
+ return false;
236
+ }
237
+ }
238
+ firstPanel.value = false;
239
+ secondPanel.value = false;
240
+ } else {
241
+ const errors = document.querySelector('.v-input--error');
242
+ if (errors) {
243
+ const errorText = errors.parentElement?.children[0].innerHTML;
244
+ if (errorText) {
245
+ dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorText?.replace(/[-<>!//.]/g, '') }));
246
+ }
247
+ errors.scrollIntoView({
248
+ behavior: 'smooth',
249
+ block: 'center',
250
+ inline: 'nearest',
251
+ });
252
+ }
209
253
  }
210
254
  });
255
+ };
256
+ const openFirstPanel = async (question: AnketaBody) => {
257
+ currentQuestion.value = question;
211
258
  firstPanel.value = true;
212
259
  secondPanel.value = false;
213
260
  };
@@ -236,7 +283,6 @@ export default defineComponent({
236
283
  };
237
284
 
238
285
  const getDefinedAnswerId = async (id: string, value: any, index: number) => {
239
- // @ts-ignore
240
286
  await dataStore.definedAnswers(id, whichSurvey.value, value, index);
241
287
  };
242
288
 
@@ -272,11 +318,9 @@ export default defineComponent({
272
318
  formStore.applicationData.processInstanceId,
273
319
  whichMember.value === 'insured' ? formStore.applicationData.insuredApp[0].id : formStore.applicationData.clientApp.id,
274
320
  whichSurvey.value,
275
- surveyType.value === 'health' ? 'surveyByHealthSecond' : 'surveyByCriticalSecond',
276
321
  whichMember.value,
277
322
  );
278
323
  firstQuestionList.value = formStore[whichSurvey.value]!.body;
279
- secondQuestionList.value = formStore[surveyType.value === 'health' ? 'surveyByHealthSecond' : 'surveyByCriticalSecond']!;
280
324
  formStore[whichSurvey.value]!.type = surveyType.value;
281
325
  const negativeAnswer = firstQuestionList.value.every(i => i.first.answerName === 'Нет');
282
326
  if (negativeAnswer) {
@@ -320,10 +364,10 @@ export default defineComponent({
320
364
  return {
321
365
  // State
322
366
  vForm,
367
+ vSecondaryForm,
323
368
  formStore,
324
369
  answerToAll,
325
370
  firstQuestionList,
326
- secondQuestionList,
327
371
  whichSurvey,
328
372
  isButtonLoading,
329
373
  firstPanel,
@@ -333,9 +377,11 @@ export default defineComponent({
333
377
  isPanelLoading,
334
378
  searchQuery,
335
379
  firstPanelSection,
380
+ isSecondRequired,
336
381
 
337
382
  // Functions
338
383
  submitForm,
384
+ submitSecondaryForm,
339
385
  getDefinedAnswerId,
340
386
  scrollForm,
341
387
  handleToggler,
@@ -84,7 +84,7 @@
84
84
  v-model="member.gender"
85
85
  :value="member.gender?.nameRu"
86
86
  :readonly="isDisabled || isFromGBD"
87
- :clearable="!isDisabled"
87
+ :clearable="!isDisabled && !isFromGBD"
88
88
  :label="$dataStore.t('form.gender')"
89
89
  :rules="$rules.objectRequired"
90
90
  append-inner-icon="mdi mdi-chevron-right"
@@ -1,6 +1,13 @@
1
1
  <template>
2
2
  <section class="flex flex-col gap-4 px-[10px]">
3
3
  <v-form ref="vForm" @submit="submitForm" class="max-h-[82svh] overflow-y-scroll">
4
+ <base-message-block
5
+ v-if="isCalculator"
6
+ class="mt-4"
7
+ :color="$styles.blueBgLight"
8
+ :text="$dataStore.t('preliminaryCalculation')"
9
+ icon="mdi-alert text-[#FCB016]"
10
+ ></base-message-block>
4
11
  <base-form-section v-if="whichProduct === 'gons'" :title="$dataStore.t('productConditionsForm.requestedProductConditions')" :class="[$styles.textSimple]">
5
12
  <base-form-text-section
6
13
  class="mb-4"
@@ -54,14 +61,14 @@
54
61
  :clearable="isRecalculationDisabled === false"
55
62
  :label="$dataStore.t('percent') + `Life Multiply`"
56
63
  :readonly="isRecalculationDisabled"
57
- :rules="$dataStore.rules.recalculationMultiply"
64
+ :rules="whichProduct === 'gons' ? $dataStore.rules.recalculationMultiplyBetween : $dataStore.rules.recalculationMultiply"
58
65
  />
59
66
  <base-form-input
60
67
  v-model="productConditionsForm.lifeAdditive"
61
68
  :maska="$maska.numbers"
62
69
  :clearable="isRecalculationDisabled === false"
63
70
  :label="$dataStore.t('percent') + `Life Additive`"
64
- :readonly="isRecalculationDisabled"
71
+ :readonly="readonlyLifeAdditive"
65
72
  :rules="$dataStore.rules.recalculationAdditive"
66
73
  />
67
74
  <base-form-input
@@ -87,15 +94,15 @@
87
94
  :maska="$maska.numbers"
88
95
  :clearable="isRecalculationDisabled === false"
89
96
  :label="$dataStore.t('percent') + `Disability Multiply`"
90
- :readonly="isRecalculationDisabled"
91
- :rules="$dataStore.rules.recalculationMultiply"
97
+ :readonly="readonlyDisabilityMultiply"
98
+ :rules="whichProduct === 'gons' ? [] : $dataStore.rules.recalculationMultiply"
92
99
  />
93
100
  <base-form-input
94
101
  v-model="productConditionsForm.disabilityAdditive"
95
102
  :maska="$maska.numbers"
96
103
  :clearable="isRecalculationDisabled === false"
97
104
  :label="$dataStore.t('percent') + `Disability Additive`"
98
- :readonly="isRecalculationDisabled"
105
+ :readonly="readonlyDisabilityAdditive"
99
106
  :rules="$dataStore.rules.recalculationAdditive"
100
107
  />
101
108
  <base-panel-input
@@ -110,7 +117,7 @@
110
117
  />
111
118
  </base-form-section>
112
119
  <base-form-section :title="$dataStore.t('generalConditions')">
113
- <div v-if="isRecalculation && ($route.params.taskId === '0' || $dataStore.isCalculator)">
120
+ <div v-if="isCalculator && ($route.params.taskId === '0' || $dataStore.isCalculator)">
114
121
  <base-form-input
115
122
  v-model="productConditionsForm.signDate"
116
123
  :maska="$maska.date"
@@ -120,6 +127,7 @@
120
127
  append-inner-icon="mdi mdi-calendar-blank-outline"
121
128
  />
122
129
  <base-form-input
130
+ v-if="hasBirthDate"
123
131
  v-model="productConditionsForm.birthDate"
124
132
  :maska="$maska.date"
125
133
  :readonly="isDisabled"
@@ -129,6 +137,7 @@
129
137
  append-inner-icon="mdi mdi-calendar-blank-outline"
130
138
  />
131
139
  <base-panel-input
140
+ v-if="hasGender"
132
141
  v-model="productConditionsForm.gender"
133
142
  :value="productConditionsForm.gender?.nameRu"
134
143
  :readonly="isDisabled"
@@ -142,10 +151,10 @@
142
151
  <base-form-input
143
152
  v-model="productConditionsForm.coverPeriod"
144
153
  :maska="$maska.numbers"
145
- :readonly="isDisabled"
154
+ :readonly="isDisabledCoverPeriod"
146
155
  :clearable="!isDisabled"
147
156
  :rules="coverPeriodRule"
148
- :label="$dataStore.t(whichProduct === 'gons' ? 'productConditionsForm.coverPeriodFrom3to20' : 'productConditionsForm.coverPeriod')"
157
+ :label="coverPeriodLabel"
149
158
  />
150
159
  <base-panel-input
151
160
  v-if="hasPaymentPeriod"
@@ -195,11 +204,39 @@
195
204
  :readonly="isDisabled"
196
205
  :clearable="!isDisabled"
197
206
  :rules="insurancePremiumPerMonth"
198
- :label="$dataStore.t('productConditionsForm.insurancePremiumAmount')"
207
+ :label="insurancePremiumPerMonthLabel"
199
208
  :suffix="$constants.currencySymbols.kzt"
200
209
  @input="onInputInsurancePremiumPerMonth"
201
210
  @onClear="onClearPremium"
202
211
  />
212
+ <base-form-input
213
+ v-if="whichProduct === 'gons' && isCalculator"
214
+ v-model="productConditionsForm.totalAmount5"
215
+ :readonly="true"
216
+ :label="$dataStore.t('productConditionsForm.totalAmount5')"
217
+ :suffix="$constants.currencySymbols.kzt"
218
+ />
219
+ <base-form-input
220
+ v-if="whichProduct === 'gons' && isCalculator"
221
+ v-model="productConditionsForm.statePremium5"
222
+ :readonly="true"
223
+ :label="$dataStore.t('productConditionsForm.statePremium5')"
224
+ :suffix="$constants.currencySymbols.kzt"
225
+ />
226
+ <base-form-input
227
+ v-if="whichProduct === 'gons' && isCalculator"
228
+ v-model="productConditionsForm.totalAmount7"
229
+ :readonly="true"
230
+ :label="$dataStore.t('productConditionsForm.totalAmount7')"
231
+ :suffix="$constants.currencySymbols.kzt"
232
+ />
233
+ <base-form-input
234
+ v-if="whichProduct === 'gons' && isCalculator"
235
+ v-model="productConditionsForm.statePremium7"
236
+ :readonly="true"
237
+ :label="$dataStore.t('productConditionsForm.statePremium7')"
238
+ :suffix="$constants.currencySymbols.kzt"
239
+ />
203
240
  <base-form-input
204
241
  v-if="hasInsurancePremiumPerMonthInDollar"
205
242
  v-model="productConditionsForm.insurancePremiumPerMonthInDollar"
@@ -297,7 +334,7 @@
297
334
  </div>
298
335
  </base-form-section>
299
336
  </v-form>
300
- <base-btn v-if="!$dataStore.isCalculator && isRecalculation && hasCalculated" :btn="$styles.greenLightBtn" :text="$dataStore.t('buttons.toStatement')" @click="toStatement" />
337
+ <base-btn v-if="!$dataStore.isCalculator && isCalculator && hasCalculated" :btn="$styles.greenLightBtn" :text="$dataStore.t('buttons.toStatement')" @click="toStatement" />
301
338
  <base-btn
302
339
  v-if="$dataStore.isCalculator ? true : !isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter())"
303
340
  :loading="isCalculating"
@@ -347,7 +384,7 @@ import { Member, Value } from '../../composables/classes';
347
384
 
348
385
  export default defineComponent({
349
386
  props: {
350
- isRecalculation: {
387
+ isCalculator: {
351
388
  type: Boolean,
352
389
  default: false,
353
390
  },
@@ -380,7 +417,7 @@ export default defineComponent({
380
417
 
381
418
  const additionalTerms = ref<AddCover[]>([]);
382
419
  const isUnderwriterForm = computed(() => {
383
- if (route.params.taskId === '0 ' || props.isRecalculation === true) {
420
+ if (route.params.taskId === '0 ' || props.isCalculator === true) {
384
421
  return false;
385
422
  } else {
386
423
  return formStore.applicationData.statusCode === 'UnderwriterForm';
@@ -388,12 +425,12 @@ export default defineComponent({
388
425
  });
389
426
  const isDisabled = computed(() => (dataStore.isCalculator ? false : !memberStore.isStatementEditible('productConditionsForm')));
390
427
  const isTermsDisabled = computed(() => {
391
- if (dataStore.isGons) {
428
+ if (dataStore.isGons || whichProduct.value === 'gons') {
392
429
  return true;
393
430
  }
394
431
  return isDisabled.value;
395
432
  });
396
- const isTask = computed(() => (route.params.taskId === '0' && props.isRecalculation === true) || dataStore.isTask());
433
+ const isTask = computed(() => (route.params.taskId === '0' && props.isCalculator === true) || dataStore.isTask());
397
434
  const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm);
398
435
  const isUnderwriterRole = computed(() => dataStore.isUnderwriter() || dataStore.isAdmin() || dataStore.isSupport());
399
436
  const insurancePremiumPerMonth = computed(() => (!!productConditionsForm.insurancePremiumPerMonth ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
@@ -401,7 +438,7 @@ export default defineComponent({
401
438
  const hasCalculated = computed(() => !!productConditionsForm.requestedSumInsured && !!productConditionsForm.insurancePremiumPerMonth);
402
439
  const amountAnnuityPayments = computed(() => (!!productConditionsForm.amountAnnuityPayments ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
403
440
  const hasProcessIndexRate = computed(() => {
404
- if (whichProduct.value === 'gons' || whichProduct.value === 'halykkazyna' || whichProduct.value === 'liferenta') {
441
+ if (whichProduct.value === 'gons' || whichProduct.value === 'halykkazyna' || whichProduct.value === 'liferenta' || whichProduct.value === 'lifebusiness') {
405
442
  return false;
406
443
  }
407
444
  return true;
@@ -436,6 +473,24 @@ export default defineComponent({
436
473
  }
437
474
  return true;
438
475
  });
476
+ const readonlyLifeAdditive = computed(() => {
477
+ if (whichProduct.value === 'gons') {
478
+ return true;
479
+ }
480
+ return isRecalculationDisabled.value;
481
+ });
482
+ const readonlyDisabilityMultiply = computed(() => {
483
+ if (whichProduct.value === 'gons') {
484
+ return true;
485
+ }
486
+ return isRecalculationDisabled.value;
487
+ });
488
+ const readonlyDisabilityAdditive = computed(() => {
489
+ if (whichProduct.value === 'gons') {
490
+ return true;
491
+ }
492
+ return isRecalculationDisabled.value;
493
+ });
439
494
  const hasAdbAdditive = computed(() => {
440
495
  if (whichProduct.value === 'gons') {
441
496
  return false;
@@ -454,6 +509,18 @@ export default defineComponent({
454
509
  }
455
510
  return false;
456
511
  });
512
+ const hasBirthDate = computed(() => {
513
+ if (whichProduct.value === 'lifebusiness') {
514
+ return false;
515
+ }
516
+ return true;
517
+ });
518
+ const hasGender = computed(() => {
519
+ if (whichProduct.value === 'lifebusiness') {
520
+ return false;
521
+ }
522
+ return true;
523
+ });
457
524
  const coverPeriodRule = computed(() => {
458
525
  const baseCondition = dataStore.rules.required.concat(dataStore.rules.numbers);
459
526
  if (whichProduct.value === 'gons') {
@@ -474,8 +541,26 @@ export default defineComponent({
474
541
  if (whichProduct.value === 'halykkazyna') {
475
542
  return dataStore.t('productConditionsForm.requestedSumInsuredInTenge');
476
543
  }
544
+ if (whichProduct.value === 'lifebusiness') {
545
+ return dataStore.t('productConditionsForm.totalRequestedSumInsured');
546
+ }
477
547
  return dataStore.t('productConditionsForm.requestedSumInsured');
478
548
  });
549
+ const coverPeriodLabel = computed(() => {
550
+ if (whichProduct.value === 'gons') {
551
+ return dataStore.t('productConditionsForm.coverPeriodFrom3to20');
552
+ }
553
+ if (whichProduct.value === 'lifebusiness') {
554
+ return dataStore.t('productConditionsForm.coverPeriodMonth');
555
+ }
556
+ return dataStore.t('productConditionsForm.coverPeriod');
557
+ });
558
+ const insurancePremiumPerMonthLabel = computed(() => {
559
+ if (whichProduct.value === 'lifebusiness') {
560
+ return dataStore.t('productConditionsForm.totalInsurancePremiumAmount');
561
+ }
562
+ return dataStore.t('productConditionsForm.insurancePremiumAmount');
563
+ });
479
564
  const isDisabledSum = computed(() => {
480
565
  if (whichProduct.value === 'halykkazyna') {
481
566
  return true;
@@ -488,6 +573,12 @@ export default defineComponent({
488
573
  }
489
574
  return isDisabled.value;
490
575
  });
576
+ const isDisabledCoverPeriod = computed(() => {
577
+ if (whichProduct.value === 'lifebusiness') {
578
+ return true;
579
+ }
580
+ return isDisabled.value;
581
+ });
491
582
 
492
583
  const formatTermValue = (term: number) => {
493
584
  if (term !== null) {
@@ -708,11 +799,11 @@ export default defineComponent({
708
799
  }
709
800
  if (productConditionsForm.requestedSumInsured !== '' && productConditionsForm.requestedSumInsured != null) {
710
801
  productConditionsForm.insurancePremiumPerMonth = null;
711
- if (props.isRecalculation) whichSum.value = 'requestedSumInsured';
802
+ if (props.isCalculator) whichSum.value = 'requestedSumInsured';
712
803
  }
713
804
  if (productConditionsForm.insurancePremiumPerMonth !== '' && productConditionsForm.insurancePremiumPerMonth != null) {
714
805
  productConditionsForm.requestedSumInsured = null;
715
- if (props.isRecalculation) whichSum.value = 'insurancePremiumPerMonth';
806
+ if (props.isCalculator) whichSum.value = 'insurancePremiumPerMonth';
716
807
  }
717
808
 
718
809
  if (!whichSum.value && isUnderwriterForm.value === false) {
@@ -720,6 +811,13 @@ export default defineComponent({
720
811
  return;
721
812
  }
722
813
 
814
+ if (
815
+ whichProduct.value === 'gons' &&
816
+ (formStore.applicationData.statusCode === 'EditForm' || formStore.applicationData.statusCode === 'StartForm') &&
817
+ getNumber(productConditionsForm.requestedSumInsured as string)! >= 10_000_000
818
+ ) {
819
+ dataStore.showToaster('info', dataStore.t('toaster.calcSumForUnder'), 6000);
820
+ }
723
821
  if (isUnderwriterForm.value) {
724
822
  type recalculationInfo = {
725
823
  lifeMultiply: string | null | number;
@@ -763,7 +861,7 @@ export default defineComponent({
763
861
  await dataStore.reCalculate(formStore.applicationData.processInstanceId, recalculationData, route.params.taskId as string, whichSum.value);
764
862
  }
765
863
  isCalculating.value = true;
766
- if (props.isRecalculation) {
864
+ if (props.isCalculator) {
767
865
  //@ts-ignore
768
866
  await dataStore.calculateWithoutApplication(true, whichProduct.value);
769
867
  additionalTerms.value = formStore.additionalInsuranceTermsWithout;
@@ -797,7 +895,7 @@ export default defineComponent({
797
895
  };
798
896
 
799
897
  onMounted(async () => {
800
- if (props.isRecalculation === true) {
898
+ if (props.isCalculator === true) {
801
899
  if (dataStore.isCalculator) {
802
900
  clearFields();
803
901
  }
@@ -822,7 +920,7 @@ export default defineComponent({
822
920
  productConditionsForm.signDate = reformatDate(defaultData.signDate);
823
921
  }
824
922
  }
825
- additionalTerms.value = props.isRecalculation ? formStore.additionalInsuranceTermsWithout : formStore.additionalInsuranceTerms;
923
+ additionalTerms.value = props.isCalculator ? formStore.additionalInsuranceTermsWithout : formStore.additionalInsuranceTerms;
826
924
  if (!!productConditionsForm.insurancePremiumPerMonth) {
827
925
  whichSum.value = 'insurancePremiumPerMonth';
828
926
  }
@@ -903,6 +1001,9 @@ export default defineComponent({
903
1001
  hasInsurancePremiumPerMonthInDollar,
904
1002
  hasCurrency,
905
1003
  hasAdbMultiply,
1004
+ readonlyLifeAdditive,
1005
+ readonlyDisabilityMultiply,
1006
+ readonlyDisabilityAdditive,
906
1007
  hasAdbAdditive,
907
1008
  hasRiskGroup,
908
1009
  hasCalculated,
@@ -912,6 +1013,11 @@ export default defineComponent({
912
1013
  requestedSumInsuredLabel,
913
1014
  isDisabledSum,
914
1015
  isDisabledSumDollar,
1016
+ hasBirthDate,
1017
+ hasGender,
1018
+ coverPeriodLabel,
1019
+ insurancePremiumPerMonthLabel,
1020
+ isDisabledCoverPeriod,
915
1021
 
916
1022
  // Rules
917
1023
  coverPeriodRule,