hl-core 0.0.8-beta.1 → 0.0.8-beta.11

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.
@@ -13,6 +13,66 @@
13
13
  subtitle="Если несовершеннолетний не достиг возраста 14 лет - законному представителю в соответствии с законодательством Республики Казахстан"
14
14
  ></base-form-text-section>
15
15
  </base-form-section>
16
+ <base-form-section v-if="isUnderwriterRole" :title="$t('recalculationInfo')">
17
+ <base-form-input
18
+ v-model="productConditionsForm.lifeMultiply"
19
+ :maska="$maska.numbers"
20
+ :clearable="isRecalculationDisabled === false"
21
+ :label="$t('percent') + `Life Multiply`"
22
+ :readonly="isRecalculationDisabled"
23
+ :rules="$dataStore.rules.recalculationMultiply"
24
+ ></base-form-input>
25
+ <base-form-input
26
+ v-model="productConditionsForm.lifeAdditive"
27
+ :maska="$maska.numbers"
28
+ :clearable="isRecalculationDisabled === false"
29
+ :label="$t('percent') + `Life Additive`"
30
+ :readonly="isRecalculationDisabled"
31
+ :rules="$dataStore.rules.recalculationAdditive"
32
+ ></base-form-input>
33
+ <base-form-input
34
+ v-model="productConditionsForm.adbMultiply"
35
+ :maska="$maska.numbers"
36
+ :clearable="isRecalculationDisabled === false"
37
+ :label="$t('percent') + `Adb Multiply`"
38
+ :readonly="isRecalculationDisabled"
39
+ :rules="$dataStore.rules.recalculationMultiply"
40
+ ></base-form-input>
41
+ <base-form-input
42
+ v-model="productConditionsForm.adbAdditive"
43
+ :maska="$maska.numbers"
44
+ :clearable="isRecalculationDisabled === false"
45
+ :label="$t('percent') + `Adb Additive`"
46
+ :readonly="isRecalculationDisabled"
47
+ :rules="$dataStore.rules.recalculationAdditive"
48
+ ></base-form-input>
49
+ <base-form-input
50
+ v-model="productConditionsForm.disabilityMultiply"
51
+ :maska="$maska.numbers"
52
+ :clearable="isRecalculationDisabled === false"
53
+ :label="$t('percent') + `Disability Multiply`"
54
+ :readonly="isRecalculationDisabled"
55
+ :rules="$dataStore.rules.recalculationMultiply"
56
+ ></base-form-input>
57
+ <base-form-input
58
+ v-model="productConditionsForm.disabilityAdditive"
59
+ :maska="$maska.numbers"
60
+ :clearable="isRecalculationDisabled === false"
61
+ :label="$t('percent') + `Disability Additive`"
62
+ :readonly="isRecalculationDisabled"
63
+ :rules="$dataStore.rules.recalculationAdditive"
64
+ >
65
+ </base-form-input>
66
+ <base-panel-input
67
+ v-model="productConditionsForm.riskGroup"
68
+ :value="productConditionsForm.riskGroup.nameRu"
69
+ :label="$t('productConditionsForm.riskGroup')"
70
+ :clearable="isRecalculationDisabled === false"
71
+ :readonly="isRecalculationDisabled"
72
+ append-inner-icon="mdi mdi-chevron-right"
73
+ @append="openPanel($t('productConditionsForm.riskGroup'), $dataStore.riskGroup, 'riskGroup')"
74
+ ></base-panel-input>
75
+ </base-form-section>
16
76
  <base-form-section :title="$t('generalConditions')">
17
77
  <div v-if="isRecalculation && $route.params.taskId === '0'">
18
78
  <base-form-input
@@ -48,10 +108,11 @@
48
108
  :maska="$maska.numbers"
49
109
  :readonly="isDisabled"
50
110
  :clearable="!isDisabled"
51
- :rules="$rules.required.concat($rules.numbers, $rules.coverPeriodFrom3to20)"
52
- :label="$t('productConditionsForm.coverPeriodFrom3to20')"
111
+ :rules="coverPeriodRule"
112
+ :label="$t($dataStore.isGons ? 'productConditionsForm.coverPeriodFrom3to20' : 'productConditionsForm.coverPeriod')"
53
113
  ></base-form-input>
54
114
  <base-panel-input
115
+ v-if="hasPaymentPeriod"
55
116
  v-model="productConditionsForm.paymentPeriod"
56
117
  :value="productConditionsForm.paymentPeriod.nameRu"
57
118
  :readonly="isDisabled"
@@ -61,12 +122,34 @@
61
122
  append-inner-icon="mdi mdi-chevron-right"
62
123
  @append="openPanel($t('productConditionsForm.processPaymentPeriod'), $dataStore.processPaymentPeriod, 'paymentPeriod', $dataStore.getProcessPaymentPeriod)"
63
124
  ></base-panel-input>
125
+ <base-panel-input
126
+ v-if="hasProcessIndexRate"
127
+ v-model="productConditionsForm.processIndexRate"
128
+ :value="productConditionsForm.processIndexRate.nameRu"
129
+ :readonly="isDisabled"
130
+ :clearable="!isDisabled"
131
+ :rules="$rules.objectRequired"
132
+ :label="$t('productConditionsForm.processIndexRate')"
133
+ append-inner-icon="mdi mdi-chevron-right"
134
+ @append="openPanel($t('productConditionsForm.processIndexRate'), $dataStore.processIndexRate, 'processIndexRate', $dataStore.getProcessIndexRate)"
135
+ ></base-panel-input>
64
136
  <base-form-input
65
137
  v-model="productConditionsForm.requestedSumInsured"
66
138
  :readonly="isDisabled"
67
139
  :clearable="!isDisabled"
68
140
  :rules="requestedSumInsured"
69
141
  :label="$t('productConditionsForm.requestedSumInsured')"
142
+ @input="onInputSum"
143
+ ></base-form-input>
144
+ <base-form-input
145
+ v-if="hasRequestedSumInsuredInDollar"
146
+ v-model="productConditionsForm.requestedSumInsuredInDollar"
147
+ :readonly="isDisabled"
148
+ :clearable="!isDisabled"
149
+ :rules="requestedSumInsured"
150
+ :label="$t('productConditionsForm.requestedSumInsuredInDollar')"
151
+ :suffix="$constants.currencySymbols.usd"
152
+ @input="onInputSumDollar"
70
153
  ></base-form-input>
71
154
  <base-form-input
72
155
  v-model="productConditionsForm.insurancePremiumPerMonth"
@@ -74,15 +157,52 @@
74
157
  :clearable="!isDisabled"
75
158
  :rules="insurancePremiumPerMonth"
76
159
  :label="$t('productConditionsForm.insurancePremiumAmount')"
160
+ :suffix="$constants.currencySymbols.kzt"
161
+ @input="onInputInsurancePremiumPerMonth"
162
+ ></base-form-input>
163
+ <base-form-input
164
+ v-if="hasInsurancePremiumPerMonthInDollar"
165
+ v-model="productConditionsForm.insurancePremiumPerMonthInDollar"
166
+ :readonly="isDisabled"
167
+ :clearable="!isDisabled"
168
+ :rules="insurancePremiumPerMonth"
169
+ :label="$t('productConditionsForm.insurancePremiumAmountInDollar')"
170
+ :suffix="constants.currencySymbols.usd"
171
+ @input="onInputInsurancePremiumPerMonthInDollar"
172
+ ></base-form-input>
173
+ <base-form-input
174
+ v-if="hasCurrency && $dataStore.currencies.usd"
175
+ v-model="$dataStore.currencies.usd"
176
+ :readonly="true"
177
+ :label="$t('productConditionsForm.dollarExchangeRateNBRK')"
178
+ :suffix="$constants.currencySymbols.kzt"
77
179
  ></base-form-input>
78
180
  </base-form-section>
181
+ <base-form-section v-if="additionalTerms && additionalTerms.length" :title="$t('productConditionsForm.additional')">
182
+ <div v-for="(term, index) of additionalTerms" :key="index">
183
+ <base-panel-input
184
+ v-model="additionalTerms[index]"
185
+ :value="term.coverSumName"
186
+ :readonly="isDisabled"
187
+ :clearable="!isDisabled"
188
+ :label="term.coverTypeName"
189
+ append-inner-icon="mdi mdi-chevron-right"
190
+ @append="openTermPanel(term.coverTypeName, $dataStore.getAdditionalInsuranceTermsAnswers, term.coverTypeId, index)"
191
+ ></base-panel-input>
192
+ </div>
193
+ </base-form-section>
79
194
  </v-form>
195
+ <base-btn v-if="isRecalculation && hasCalculated" :btn="$libStyles.greenLightBtn" :text="$t('buttons.toStatement')" @click="toStatement"></base-btn>
80
196
  <base-btn
81
197
  v-if="!isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter())"
82
198
  :loading="isCalculating"
83
199
  :text="$t('buttons.calculate')"
84
200
  @click="submitForm"
85
201
  ></base-btn>
202
+ <div v-if="$dataStore.isTask() && $dataStore.isUnderwriter() && !isRecalculationDisabled" class="flex gap-3">
203
+ <base-btn :text="$t('buttons.calcSum')" type="submit" @click.prevent="underwriterCalculate('sum')" :loading="isCalculating" />
204
+ <base-btn :text="$t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
205
+ </div>
86
206
  <Teleport v-if="isPanelOpen" to="#panel-actions">
87
207
  <div :class="[$libStyles.scrollPage]" class="flex flex-col items-center">
88
208
  <base-rounded-input v-model="searchQuery" :label="$t('labels.search')" class="w-full p-2" :hide-details="true"></base-rounded-input>
@@ -91,7 +211,7 @@
91
211
  <base-panel-select-item
92
212
  v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
93
213
  :key="index"
94
- :text="item.nameRu as string"
214
+ :text="(item.nameRu as string)"
95
215
  :selected="item.nameRu === panelValue.nameRu"
96
216
  @click="pickPanelValue(item)"
97
217
  ></base-panel-select-item>
@@ -99,6 +219,21 @@
99
219
  <base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50"></base-loader>
100
220
  </div>
101
221
  </Teleport>
222
+ <Teleport v-if="isTermsPanelOpen" to="#panel-actions">
223
+ <div :class="[$libStyles.scrollPage]" class="flex flex-col items-center">
224
+ <base-rounded-input v-model="searchQuery" :label="$t('labels.search')" class="w-full p-2" :hide-details="true"></base-rounded-input>
225
+ <div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
226
+ <base-panel-select-item
227
+ v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
228
+ :key="index"
229
+ :text="(item.nameRu as string)"
230
+ :selected="item.nameRu === termValue?.coverSumName"
231
+ @click="pickTermValue(item)"
232
+ ></base-panel-select-item>
233
+ </div>
234
+ <base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50"></base-loader>
235
+ </div>
236
+ </Teleport>
102
237
  </section>
103
238
  </template>
104
239
 
@@ -123,13 +258,17 @@ export default defineComponent({
123
258
  const isCalculating = ref<boolean>(false);
124
259
  const isPanelLoading = ref<boolean>(false);
125
260
  const isPanelOpen = ref<boolean>(false);
261
+ const isTermsPanelOpen = ref<boolean>(false);
126
262
  const panelValue = ref<Value>(new Value());
263
+ const termValue = ref<AddCover>();
127
264
  const panelList = ref<Value[]>([]);
128
265
  const productConditionsForm = formStore.productConditionsForm;
129
266
  const currentPanel = ref<keyof typeof productConditionsForm>();
267
+ const currentIndex = ref<number>();
130
268
  const searchQuery = ref<string>('');
131
269
  const whichSum = ref<'insurancePremiumPerMonth' | 'requestedSumInsured' | ''>('');
132
270
 
271
+ const additionalTerms = ref<AddCover[]>([]);
133
272
  const isUnderwriterForm = computed(() => {
134
273
  if (route.params.taskId === '0 ' || props.isRecalculation === true) {
135
274
  return false;
@@ -139,25 +278,88 @@ export default defineComponent({
139
278
  });
140
279
  const isDisabled = computed(() => !memberStore.isStatementEditible(formStore.productConditionsFormKey));
141
280
  const isTask = computed(() => (route.params.taskId === '0' && props.isRecalculation === true) || dataStore.isTask());
281
+ const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm);
282
+ const isUnderwriterRole = computed(() => dataStore.isUnderwriter() || dataStore.isAdmin() || dataStore.isSupport());
142
283
  const insurancePremiumPerMonth = computed(() => (!!productConditionsForm.insurancePremiumPerMonth ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
143
284
  const requestedSumInsured = computed(() => (!!productConditionsForm.requestedSumInsured ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
285
+ const hasCalculated = computed(() => !!productConditionsForm.requestedSumInsured && !!productConditionsForm.insurancePremiumPerMonth);
286
+ const hasProcessIndexRate = computed(() => {
287
+ if (dataStore.isGons || dataStore.isKazyna) {
288
+ return false;
289
+ }
290
+ return true;
291
+ });
292
+ const hasPaymentPeriod = computed(() => {
293
+ if (dataStore.isKazyna) {
294
+ return false;
295
+ }
296
+ return true;
297
+ });
298
+ const hasRequestedSumInsuredInDollar = computed(() => {
299
+ if (dataStore.isKazyna) {
300
+ return true;
301
+ }
302
+ return false;
303
+ });
304
+ const hasInsurancePremiumPerMonthInDollar = computed(() => {
305
+ if (dataStore.isKazyna) {
306
+ return true;
307
+ }
308
+ return false;
309
+ });
310
+ const hasCurrency = computed(() => {
311
+ if (dataStore.isKazyna) {
312
+ return true;
313
+ }
314
+ return false;
315
+ });
316
+ const coverPeriodRule = computed(() => {
317
+ const baseCondition = dataStore.rules.required.concat(dataStore.rules.numbers);
318
+ if (dataStore.isGons) {
319
+ return baseCondition.concat(dataStore.rules.coverPeriodFrom3to20);
320
+ }
321
+ if (dataStore.isKazyna) {
322
+ return baseCondition.concat(dataStore.rules.coverPeriodFrom2to20);
323
+ }
324
+ return baseCondition;
325
+ });
144
326
 
145
- const pickPanelValue = (item: Value) => {
146
- if (!isDisabled.value) {
147
- dataStore.panel.open = false;
148
- isPanelOpen.value = false;
149
- // @ts-ignore
150
- productConditionsForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
151
- } else {
152
- dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
327
+ const toStatement = async () => {
328
+ const statementItem = dataStore.menuItems.find(i => i.id === 'statement');
329
+ if (statementItem) {
330
+ dataStore.menu.selectedItem = statementItem;
331
+ await router.replace({
332
+ name: 'taskId',
333
+ query: {
334
+ ...route.query,
335
+ tab: 'statement',
336
+ },
337
+ });
153
338
  }
154
339
  };
155
340
 
341
+ const pickPanelValue = (item: Value) => {
342
+ dataStore.panel.open = false;
343
+ isPanelOpen.value = false;
344
+ if (!currentPanel.value) return;
345
+ // @ts-ignore
346
+ productConditionsForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
347
+ };
348
+
349
+ const pickTermValue = (item: Value) => {
350
+ dataStore.panel.open = false;
351
+ isTermsPanelOpen.value = false;
352
+ if (typeof currentIndex.value !== 'number') return;
353
+ additionalTerms.value[currentIndex.value].coverSumId = item.id as string;
354
+ additionalTerms.value[currentIndex.value].coverSumName = item.nameRu as string;
355
+ };
356
+
156
357
  const openPanel = async (title: string, list: Value[], key: string, asyncFunction?: Function, filterKey?: string) => {
157
- if (!isDisabled.value) {
358
+ if (!isDisabled.value || (key === 'riskGroup' && !isRecalculationDisabled.value)) {
158
359
  searchQuery.value = '';
159
360
  currentPanel.value = key as keyof typeof productConditionsForm;
160
361
  isPanelOpen.value = true;
362
+ isTermsPanelOpen.value = false;
161
363
  dataStore.panelAction = null;
162
364
  dataStore.panel.open = true;
163
365
  dataStore.panel.title = title;
@@ -167,7 +369,7 @@ export default defineComponent({
167
369
  isPanelLoading.value = true;
168
370
  newList = await asyncFunction(filterKey, formStore.productConditionsFormKey);
169
371
  }
170
- panelList.value = newList;
372
+ panelList.value = filterList(newList, key);
171
373
  // @ts-ignore
172
374
  panelValue.value = productConditionsForm[currentPanel.value];
173
375
  isPanelLoading.value = false;
@@ -176,12 +378,96 @@ export default defineComponent({
176
378
  }
177
379
  };
178
380
 
381
+ const filterList = (list: Value[], key: string) => {
382
+ if (dataStore.isBaiterek) {
383
+ if (dataStore.isManagerHalykBank()) {
384
+ if (key === 'paymentPeriod') return list.filter(i => i.code !== 'single');
385
+ }
386
+ }
387
+ return list;
388
+ };
389
+
390
+ const openTermPanel = async (title: string, asyncFunction: Function, questionId: string, index: number) => {
391
+ if (!isDisabled.value) {
392
+ searchQuery.value = '';
393
+ currentIndex.value = index;
394
+ isPanelOpen.value = false;
395
+ isTermsPanelOpen.value = true;
396
+ dataStore.panelAction = null;
397
+ dataStore.panel.open = true;
398
+ dataStore.panel.title = title;
399
+
400
+ let newList;
401
+ if (asyncFunction) {
402
+ isPanelLoading.value = true;
403
+ newList = await asyncFunction(questionId);
404
+ }
405
+ panelList.value = newList;
406
+ // @ts-ignore
407
+ termValue.value = additionalTerms.value[index];
408
+ isPanelLoading.value = false;
409
+ } else {
410
+ dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
411
+ }
412
+ };
413
+
414
+ const underwriterCalculate = async (type: 'sum' | 'premium') => {
415
+ if (!type) return;
416
+ if (type === 'sum') {
417
+ whichSum.value = 'insurancePremiumPerMonth';
418
+ }
419
+ if (type === 'premium') {
420
+ whichSum.value = 'requestedSumInsured';
421
+ }
422
+ await submitForm();
423
+ };
424
+
179
425
  const pickCalculation = async (type: 'insurancePremiumPerMonth' | 'requestedSumInsured') => {
180
426
  if (!type) return false;
181
427
  whichSum.value = type;
182
428
  await submitForm();
183
429
  };
184
430
 
431
+ const onInputInsurancePremiumPerMonth = (event: Event) => {
432
+ if (event.target && 'value' in event.target && event.target.value && dataStore.currencies.usd) {
433
+ const calculatedPremiumDollar = getNumber(event.target.value as string);
434
+ if (calculatedPremiumDollar) {
435
+ productConditionsForm.insurancePremiumPerMonth = dataStore.getNumberWithSpaces(productConditionsForm.insurancePremiumPerMonth);
436
+ productConditionsForm.insurancePremiumPerMonthInDollar = dataStore.getNumberWithSpaces(calculatedPremiumDollar / dataStore.currencies.usd);
437
+ }
438
+ }
439
+ };
440
+
441
+ const onInputInsurancePremiumPerMonthInDollar = (event: Event) => {
442
+ if (event.target && 'value' in event.target && event.target.value && dataStore.currencies.usd) {
443
+ const calculatedPremium = getNumber(event.target.value as string);
444
+ if (calculatedPremium) {
445
+ productConditionsForm.insurancePremiumPerMonthInDollar = dataStore.getNumberWithSpaces(productConditionsForm.insurancePremiumPerMonthInDollar);
446
+ productConditionsForm.insurancePremiumPerMonth = dataStore.getNumberWithSpaces(calculatedPremium * dataStore.currencies.usd);
447
+ }
448
+ }
449
+ };
450
+
451
+ const onInputSum = (event: Event) => {
452
+ if (event.target && 'value' in event.target && event.target.value && dataStore.currencies.usd) {
453
+ const calculatedSumDollar = getNumber(event.target.value as string);
454
+ if (calculatedSumDollar) {
455
+ productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(productConditionsForm.requestedSumInsured);
456
+ productConditionsForm.requestedSumInsuredInDollar = dataStore.getNumberWithSpaces(calculatedSumDollar / dataStore.currencies.usd);
457
+ }
458
+ }
459
+ };
460
+
461
+ const onInputSumDollar = (event: Event) => {
462
+ if (event.target && 'value' in event.target && event.target.value && dataStore.currencies.usd) {
463
+ const calculatedSum = getNumber(event.target.value as string);
464
+ if (calculatedSum) {
465
+ productConditionsForm.requestedSumInsuredInDollar = dataStore.getNumberWithSpaces(productConditionsForm.requestedSumInsuredInDollar);
466
+ productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(calculatedSum * dataStore.currencies.usd);
467
+ }
468
+ }
469
+ };
470
+
185
471
  const submitForm = async () => {
186
472
  vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
187
473
  if (v.valid) {
@@ -249,11 +535,11 @@ export default defineComponent({
249
535
  if (errors) {
250
536
  const errorText = errors.querySelector('.v-label.v-field-label');
251
537
  if (errorText) {
252
- dataStore.showToaster('error', dataStore.t('toaster.errorFormField').replace('{text}', errorText.innerHTML?.replace(/[-<>!//.]/g, '')));
538
+ dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorText.innerHTML?.replace(/[-<>!//.]/g, '') }));
253
539
  } else {
254
540
  const errorFieldText = errors.querySelector('.v-input__control');
255
541
  if (errorFieldText) {
256
- dataStore.showToaster('error', dataStore.t('toaster.errorFormField').replace('{text}', errorFieldText.innerHTML?.replace(/[-<>!//.]/g, '')));
542
+ dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorFieldText.innerHTML?.replace(/[-<>!//.]/g, '') }));
257
543
  }
258
544
  }
259
545
  errors.scrollIntoView({
@@ -277,17 +563,25 @@ export default defineComponent({
277
563
  formStore.additionalInsuranceTermsWithout = defaultData.addCovers;
278
564
  productConditionsForm.requestedSumInsured = defaultData.amount;
279
565
  productConditionsForm.insurancePremiumPerMonth = defaultData.premium;
280
- productConditionsForm.processIndexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
281
- productConditionsForm.paymentPeriod = dataStore.processPaymentPeriod.find(i => i.id == defaultData.paymentPeriodId);
566
+ const indexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
567
+ if (indexRate) productConditionsForm.processIndexRate = indexRate;
568
+ const paymendPeriod = dataStore.processPaymentPeriod.find(i => i.id == defaultData.paymentPeriodId);
569
+ if (paymendPeriod) productConditionsForm.paymentPeriod = paymendPeriod;
282
570
  productConditionsForm.signDate = reformatDate(defaultData.signDate);
283
571
  }
284
572
  }
573
+ additionalTerms.value = props.isRecalculation ? formStore.additionalInsuranceTermsWithout : formStore.additionalInsuranceTerms;
285
574
  if (!!productConditionsForm.insurancePremiumPerMonth) {
286
575
  whichSum.value = 'insurancePremiumPerMonth';
287
576
  }
288
577
  if (!!productConditionsForm.requestedSumInsured) {
289
578
  whichSum.value = 'requestedSumInsured';
290
579
  }
580
+ if (dataStore.isKazyna) {
581
+ const kazynaPaymentPeriod = dataStore.processPaymentPeriod.find(i => i.code === 'single');
582
+ if (kazynaPaymentPeriod) productConditionsForm.paymentPeriod = kazynaPaymentPeriod;
583
+ await dataStore.getCurrencies();
584
+ }
291
585
  });
292
586
 
293
587
  watch(
@@ -322,6 +616,7 @@ export default defineComponent({
322
616
  () => {
323
617
  if (dataStore.panel.open === false) {
324
618
  isPanelOpen.value = false;
619
+ isTermsPanelOpen.value = false;
325
620
  dataStore.panelAction = null;
326
621
  }
327
622
  },
@@ -333,10 +628,13 @@ export default defineComponent({
333
628
  formStore,
334
629
  vForm,
335
630
  productConditionsForm,
631
+ additionalTerms,
336
632
  isCalculating,
337
633
  isPanelLoading,
338
634
  isPanelOpen,
635
+ isTermsPanelOpen,
339
636
  panelValue,
637
+ termValue,
340
638
  panelList,
341
639
  searchQuery,
342
640
  whichSum,
@@ -348,12 +646,31 @@ export default defineComponent({
348
646
  isUnderwriterForm,
349
647
  insurancePremiumPerMonth,
350
648
  requestedSumInsured,
649
+ isRecalculationDisabled,
650
+ isUnderwriterRole,
651
+ hasProcessIndexRate,
652
+ hasPaymentPeriod,
653
+ hasRequestedSumInsuredInDollar,
654
+ hasInsurancePremiumPerMonthInDollar,
655
+ hasCurrency,
656
+ hasCalculated,
657
+
658
+ // Rules
659
+ coverPeriodRule,
351
660
 
352
661
  // Functions
353
662
  submitForm,
354
663
  pickPanelValue,
664
+ pickTermValue,
355
665
  openPanel,
666
+ openTermPanel,
356
667
  pickCalculation,
668
+ underwriterCalculate,
669
+ onInputInsurancePremiumPerMonth,
670
+ onInputInsurancePremiumPerMonthInDollar,
671
+ onInputSum,
672
+ onInputSumDollar,
673
+ toStatement,
357
674
  };
358
675
  },
359
676
  });
@@ -77,7 +77,7 @@
77
77
  <v-form ref="vForm">
78
78
  <base-rounded-input
79
79
  v-model="phoneNumber"
80
- v-maska="'+7 (7##) ### ## ##'"
80
+ :maska="$maska.phone"
81
81
  :rules="$rules.required.concat($rules.phoneFormat)"
82
82
  :label="$t('form.phoneNumber')"
83
83
  placeholder="+7 7"
@@ -89,6 +89,14 @@
89
89
  </base-fade-transition>
90
90
  </div>
91
91
  </section>
92
+ <section v-if="registerActions">
93
+ <div :class="[$libStyles.flexColNav]">
94
+ <v-form ref="vForm">
95
+ <base-rounded-input v-model="actionCause" placeholder="№ ХХХХХХХХХ" :rules="$rules.required"></base-rounded-input>
96
+ </v-form>
97
+ <base-btn :text="$t('buttons.send')" :loading="loading" @click="submitForm"></base-btn>
98
+ </div>
99
+ </section>
92
100
  </template>
93
101
 
94
102
  <script lang="ts">
@@ -104,16 +112,6 @@ export default defineComponent({
104
112
  const phoneNumber = ref<string | null>(formStore.policyholderForm.phoneNumber ?? '');
105
113
  const selectedClient = ref<SignUrlType>();
106
114
 
107
- watch(
108
- () => dataStore.panelAction,
109
- val => {
110
- if (!!val) {
111
- dataStore.panel.title = buttonText.value!;
112
- dataStore.panel.open = true;
113
- }
114
- },
115
- );
116
-
117
115
  const openSmsPanel = (signInfo: SignUrlType) => {
118
116
  if (signInfo) {
119
117
  isSendNumberOpen.value = true;
@@ -138,8 +136,10 @@ export default defineComponent({
138
136
  switch (dataStore.panelAction) {
139
137
  case constants.actions.pay:
140
138
  await dataStore.sendSMS('PayUrl', phoneNumber.value, formStore.epayLink);
139
+ break;
141
140
  case constants.actions.sign:
142
141
  await dataStore.sendSMS('SignUrl', phoneNumber.value, selectedClient.value?.uri);
142
+ break;
143
143
  default:
144
144
  await handleTask();
145
145
  }
@@ -167,15 +167,28 @@ export default defineComponent({
167
167
  return dataStore.t('buttons.sign');
168
168
  case constants.actions.pay:
169
169
  return dataStore.t('buttons.pay');
170
+ case constants.actions.register:
171
+ return dataStore.t('buttons.register');
170
172
  }
171
173
  });
172
174
 
175
+ watch(
176
+ () => dataStore.panelAction,
177
+ val => {
178
+ if (!!val) {
179
+ dataStore.panel.title = buttonText.value!;
180
+ dataStore.panel.open = true;
181
+ }
182
+ },
183
+ { immediate: true },
184
+ );
173
185
  const sendingActions = computed(
174
186
  () => dataStore.panelAction === constants.actions.reject || dataStore.panelAction === constants.actions.return || dataStore.panelAction === constants.actions.rejectclient,
175
187
  );
176
188
  const acceptAction = computed(() => dataStore.panelAction === constants.actions.accept);
177
189
  const signingActions = computed(() => dataStore.panelAction === constants.actions.sign);
178
190
  const payingActions = computed(() => dataStore.panelAction === constants.actions.pay);
191
+ const registerActions = computed(() => dataStore.panelAction === constants.actions.register);
179
192
  const paymentPeriod = computed(() => formStore.productConditionsForm.paymentPeriod.nameRu);
180
193
  const insurancePremiumPerMonth = computed(() => dataStore.getNumberWithSpaces(formStore.productConditionsForm.insurancePremiumPerMonth));
181
194
  const requestedSumInsured = computed(() => dataStore.getNumberWithSpaces(formStore.productConditionsForm.requestedSumInsured));
@@ -203,6 +216,7 @@ export default defineComponent({
203
216
  signingActions,
204
217
  payingActions,
205
218
  acceptAction,
219
+ registerActions,
206
220
  paymentPeriod,
207
221
  insurancePremiumPerMonth,
208
222
  requestedSumInsured,