hl-core 0.0.10-beta.7 → 0.0.10-beta.70

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.
Files changed (49) hide show
  1. package/README.md +0 -2
  2. package/api/base.api.ts +425 -134
  3. package/api/interceptors.ts +162 -62
  4. package/components/Dialog/Dialog.vue +5 -1
  5. package/components/Dialog/DigitalDocumentsDialog.vue +129 -0
  6. package/components/Dialog/FamilyDialog.vue +15 -4
  7. package/components/Form/DigitalDocument.vue +52 -0
  8. package/components/Form/FormSource.vue +30 -0
  9. package/components/Form/ManagerAttachment.vue +85 -11
  10. package/components/Form/ProductConditionsBlock.vue +12 -6
  11. package/components/Input/Datepicker.vue +5 -0
  12. package/components/Input/FileInput.vue +1 -1
  13. package/components/Input/FormInput.vue +7 -0
  14. package/components/Input/OtpInput.vue +25 -0
  15. package/components/Input/RoundedInput.vue +2 -0
  16. package/components/Input/RoundedSelect.vue +2 -0
  17. package/components/Input/TextAreaField.vue +71 -0
  18. package/components/Input/TextHint.vue +13 -0
  19. package/components/Layout/SettingsPanel.vue +2 -1
  20. package/components/Menu/MenuNav.vue +2 -1
  21. package/components/Pages/Anketa.vue +207 -176
  22. package/components/Pages/Auth.vue +10 -3
  23. package/components/Pages/ContragentForm.vue +24 -18
  24. package/components/Pages/Documents.vue +488 -66
  25. package/components/Pages/MemberForm.vue +1009 -268
  26. package/components/Pages/ProductConditions.vue +1424 -273
  27. package/components/Panel/PanelHandler.vue +329 -126
  28. package/components/Utilities/Chip.vue +1 -1
  29. package/components/Utilities/JsonViewer.vue +1 -2
  30. package/composables/classes.ts +136 -20
  31. package/composables/constants.ts +168 -1
  32. package/composables/index.ts +467 -9
  33. package/composables/styles.ts +8 -24
  34. package/configs/i18n.ts +2 -0
  35. package/configs/pwa.ts +1 -7
  36. package/layouts/clear.vue +1 -1
  37. package/layouts/default.vue +2 -2
  38. package/layouts/full.vue +1 -1
  39. package/locales/kz.json +1239 -0
  40. package/locales/ru.json +133 -21
  41. package/nuxt.config.ts +8 -6
  42. package/package.json +14 -13
  43. package/plugins/head.ts +7 -1
  44. package/plugins/helperFunctionsPlugins.ts +1 -0
  45. package/store/data.store.ts +1080 -552
  46. package/store/member.store.ts +19 -8
  47. package/store/rules.ts +75 -8
  48. package/types/enum.ts +52 -2
  49. package/types/index.ts +143 -6
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <section class="flex flex-col gap-4 px-[10px]">
3
- <v-form ref="vForm" @submit="submitForm" class="overflow-y-scroll" :class="[!$dataStore.isCalculator && isCalculator && hasCalculated ? 'max-h-[73svh]' : 'max-h-[80svh]']">
2
+ <section v-if="!isLoading" class="flex flex-col gap-4 px-[10px]" :class="[$styles.scrollPage]">
3
+ <v-form ref="vForm" @submit="submitForm">
4
4
  <base-message-block
5
5
  v-if="isCalculator"
6
6
  class="mt-4"
@@ -15,17 +15,17 @@
15
15
  <base-form-input
16
16
  v-model="productConditionsForm.lifeMultiplyClient"
17
17
  :maska="$maska.numbers"
18
- :clearable="isRecalculationDisabled === false"
19
18
  :label="$dataStore.t('percent') + `Life Multiply`"
20
19
  :readonly="isRecalculationDisabled"
20
+ :clearable="!isRecalculationDisabled"
21
21
  :rules="$dataStore.rules.recalculationMultiply"
22
22
  />
23
23
  <base-form-input
24
24
  v-model="productConditionsForm.lifeAdditiveClient"
25
25
  :maska="$maska.numbers"
26
- :clearable="isRecalculationDisabled === false"
27
26
  :label="$dataStore.t('percent') + `Life Additive`"
28
27
  :readonly="isRecalculationDisabled"
28
+ :clearable="!isRecalculationDisabled"
29
29
  :rules="$dataStore.rules.recalculationAdditive"
30
30
  />
31
31
  <base-form-input v-model="formStore.policyholderForm.longName" :label="$dataStore.t('labels.policyholderLongName')" :readonly="true" />
@@ -36,7 +36,15 @@
36
36
  <base-form-input v-model="formStore.policyholderForm.gender.nameRu" class="mb-4" :label="$dataStore.t('form.gender')" :readonly="true" />
37
37
  </base-form-section>
38
38
  <base-form-section
39
- v-if="isUnderwriterRole && $dataStore.members.insuredApp.has === true && whichProduct !== 'lifebusiness' && whichProduct !== 'gns' && whichProduct !== 'pensionannuitynew'"
39
+ v-if="
40
+ isUnderwriterRole &&
41
+ $dataStore.members.insuredApp.has === true &&
42
+ whichProduct !== 'lifebusiness' &&
43
+ whichProduct !== 'gns' &&
44
+ whichProduct !== 'pensionannuitynew' &&
45
+ whichProduct !== 'lifetrip' &&
46
+ whichProduct !== 'halykmycar'
47
+ "
40
48
  :title="$dataStore.t('insuredForm')"
41
49
  >
42
50
  <div v-for="(insured, index) of formStore.insuredForm" :key="index">
@@ -49,57 +57,65 @@
49
57
  </div>
50
58
  </base-form-section>
51
59
  <base-form-section
52
- v-if="isUnderwriterRole && whichProduct !== 'lifebusiness' && whichProduct !== 'gns' && whichProduct !== 'pensionannuitynew'"
60
+ v-if="
61
+ isUnderwriterRole &&
62
+ whichProduct !== 'pensionannuitynew' &&
63
+ whichProduct !== 'balam' &&
64
+ whichProduct !== 'borrower' &&
65
+ whichProduct !== 'tumar' &&
66
+ whichProduct !== 'halykmycar'
67
+ "
53
68
  :title="$dataStore.t('recalculationInfo')"
54
69
  >
55
70
  <base-form-input
56
71
  v-model="productConditionsForm.lifeMultiply"
57
72
  :maska="$maska.numbers"
58
- :clearable="isRecalculationDisabled === false"
59
- :label="$dataStore.t('percent') + `Life Multiply`"
73
+ :label="lifeMultiplyLabel"
60
74
  :readonly="isRecalculationDisabled"
75
+ :clearable="!isRecalculationDisabled"
61
76
  :rules="whichProduct === 'gons' ? $dataStore.rules.recalculationMultiplyBetween : $dataStore.rules.recalculationMultiply"
62
77
  />
63
78
  <base-form-input
64
79
  v-model="productConditionsForm.lifeAdditive"
65
80
  :maska="$maska.numbers"
66
- :clearable="isRecalculationDisabled === false"
67
- :label="$dataStore.t('percent') + `Life Additive`"
81
+ :label="lifeAdditiveLabel"
68
82
  :readonly="readonlyLifeAdditive"
83
+ :clearable="!isRecalculationDisabled"
69
84
  :rules="$dataStore.rules.recalculationAdditive"
70
85
  />
71
86
  <base-form-input
72
87
  v-if="hasAdbMultiply"
73
88
  v-model="productConditionsForm.adbMultiply"
74
89
  :maska="$maska.numbers"
75
- :clearable="isRecalculationDisabled === false"
76
- :label="$dataStore.t('percent') + `Adb Multiply`"
90
+ :label="adbMultiplyLabel"
77
91
  :readonly="isRecalculationDisabled"
92
+ :clearable="!isRecalculationDisabled"
78
93
  :rules="$dataStore.rules.recalculationMultiply"
79
94
  />
80
95
  <base-form-input
81
96
  v-if="hasAdbAdditive"
82
97
  v-model="productConditionsForm.adbAdditive"
83
98
  :maska="$maska.numbers"
84
- :clearable="isRecalculationDisabled === false"
85
- :label="$dataStore.t('percent') + `Adb Additive`"
99
+ :label="adbAdditiveLabel"
86
100
  :readonly="isRecalculationDisabled"
101
+ :clearable="!isRecalculationDisabled"
87
102
  :rules="$dataStore.rules.recalculationAdditive"
88
103
  />
89
104
  <base-form-input
90
105
  v-model="productConditionsForm.disabilityMultiply"
91
106
  :maska="$maska.numbers"
92
- :clearable="isRecalculationDisabled === false"
93
- :label="$dataStore.t('percent') + `Disability Multiply`"
107
+ :label="disabilityMultiplyLabel"
94
108
  :readonly="readonlyDisabilityMultiply"
109
+ :clearable="!isRecalculationDisabled"
95
110
  :rules="whichProduct === 'gons' ? [] : $dataStore.rules.recalculationMultiply"
96
111
  />
97
112
  <base-form-input
113
+ v-if="hasDisabilityAdditive"
98
114
  v-model="productConditionsForm.disabilityAdditive"
99
115
  :maska="$maska.numbers"
100
- :clearable="isRecalculationDisabled === false"
101
116
  :label="$dataStore.t('percent') + `Disability Additive`"
102
117
  :readonly="readonlyDisabilityAdditive"
118
+ :clearable="!isRecalculationDisabled"
103
119
  :rules="$dataStore.rules.recalculationAdditive"
104
120
  />
105
121
  <base-panel-input
@@ -107,22 +123,32 @@
107
123
  v-model="productConditionsForm.riskGroup"
108
124
  :value="productConditionsForm.riskGroup?.nameRu"
109
125
  :label="$dataStore.t('productConditionsForm.riskGroup')"
110
- :clearable="isRecalculationDisabled === false"
111
126
  :readonly="isRecalculationDisabled"
127
+ :clearable="!isRecalculationDisabled"
112
128
  append-inner-icon="mdi mdi-chevron-right"
113
129
  @append="openPanel($dataStore.t('productConditionsForm.riskGroup'), $dataStore.riskGroup, 'riskGroup')"
114
130
  />
115
131
  </base-form-section>
132
+ <base-form-section v-if="hasEduCapitalConsent">
133
+ <base-form-toggle
134
+ v-model="productConditionsForm.accureStartEducationCapital"
135
+ :disabled="isDisabled"
136
+ :has-border="false"
137
+ :title="$dataStore.t('form.educationFundConsent')"
138
+ />
139
+ </base-form-section>
116
140
  <base-form-section v-if="hasDefault" :title="defaultText">
117
141
  <div v-if="isCalculator && ($route.params.taskId === '0' || $dataStore.isCalculator || fromIndexPage)">
118
142
  <base-form-input
119
143
  v-model="productConditionsForm.signDate"
120
144
  :maska="$maska.date"
121
- :clearable="false"
122
145
  :readonly="true"
146
+ :clearable="false"
123
147
  :label="$dataStore.t('form.signDate')"
124
148
  append-inner-icon="mdi mdi-calendar-blank-outline"
125
149
  />
150
+ <!-- $dataStore.t('hint.needToFillPolicyholder') -->
151
+ <base-text-hint v-if="whichProduct === 'gons'" text="Необходимо заполнить данные страхователя" />
126
152
  <base-form-input
127
153
  v-if="hasBirthDate"
128
154
  v-model="productConditionsForm.birthDate"
@@ -136,7 +162,7 @@
136
162
  <base-panel-input
137
163
  v-if="hasGender"
138
164
  v-model="productConditionsForm.gender"
139
- :value="productConditionsForm.gender?.nameRu"
165
+ :value="locale === 'ru' ? productConditionsForm.gender?.nameRu : productConditionsForm.gender?.nameKz"
140
166
  :readonly="isDisabled"
141
167
  :clearable="!isDisabled"
142
168
  :label="$dataStore.t('form.gender')"
@@ -145,14 +171,26 @@
145
171
  @append="openPanel($dataStore.t('form.gender'), $dataStore.gender, 'gender')"
146
172
  />
147
173
  </div>
174
+ <base-panel-input
175
+ v-if="hasCurrency"
176
+ v-model="productConditionsForm.currency"
177
+ :value="locale === 'ru' ? productConditionsForm.currency.nameRu : productConditionsForm.currency.nameKz"
178
+ :readonly="isDisabled"
179
+ :clearable="!isDisabled"
180
+ :label="$dataStore.t('agent.currency')"
181
+ :rules="$rules.objectRequired"
182
+ append-inner-icon="mdi mdi-chevron-right"
183
+ @append="openPanel($dataStore.t('agent.currency'), currencyListFiltered, 'currency')"
184
+ />
148
185
  <base-form-input
149
186
  v-if="hasInsStartDate"
150
187
  v-model="productConditionsForm.calcDate"
151
188
  :maska="$maska.date"
152
- :readonly="isDisabled"
153
- :clearable="!isDisabled"
189
+ :readonly="isDisabledInsStartDate"
190
+ :clearable="!isDisabledInsStartDate"
154
191
  :label="$dataStore.t('labels.insuranceStartDate')"
155
- :rules="$rules.required"
192
+ :rules="[...$rules.required, formStore.lfb.add ? [] : $rules.checkDateIsAfterOrSame(productConditionsForm.calcDate, closeDate)]"
193
+ :min-date="closeDate ?? undefined"
156
194
  append-inner-icon="mdi mdi-calendar-blank-outline"
157
195
  />
158
196
  <base-form-input
@@ -170,16 +208,16 @@
170
208
  v-model="productConditionsForm.coverPeriod"
171
209
  :maska="$maska.numbers"
172
210
  :readonly="isDisabledCoverPeriod"
173
- :clearable="!isDisabled"
211
+ :clearable="!isDisabledCoverPeriod"
174
212
  :rules="coverPeriodRule"
175
213
  :label="coverPeriodLabel"
176
214
  />
177
215
  <base-panel-input
178
216
  v-if="hasPaymentPeriod"
179
217
  v-model="productConditionsForm.paymentPeriod"
180
- :value="productConditionsForm.paymentPeriod?.nameRu"
181
- :readonly="isDisabled"
182
- :clearable="!isDisabled"
218
+ :value="locale === 'ru' ? productConditionsForm.paymentPeriod?.nameRu : productConditionsForm.paymentPeriod?.nameKz"
219
+ :readonly="isDisabledPaymentPeriod"
220
+ :clearable="!isDisabledPaymentPeriod"
183
221
  :rules="$rules.objectRequired"
184
222
  :label="$dataStore.t('productConditionsForm.processPaymentPeriod')"
185
223
  append-inner-icon="mdi mdi-chevron-right"
@@ -196,17 +234,18 @@
196
234
  append-inner-icon="mdi mdi-chevron-right"
197
235
  @append="openPanel($dataStore.t('productConditionsForm.processIndexRate'), $dataStore.processIndexRate, 'processIndexRate', $dataStore.getProcessIndexRate)"
198
236
  />
237
+ <!-- <base-form-input-->
238
+ <!-- v-if="hasFixInsSum"-->
239
+ <!-- v-model="productConditionsForm.fixInsSum"-->
240
+ <!-- :readonly="isDisabledFixInsSum"-->
241
+ <!-- :clearable="!isDisabledFixInsSum"-->
242
+ <!-- :rules="fixInsSumRule"-->
243
+ <!-- :label="$dataStore.t('productConditionsForm.fixInsSum')"-->
244
+ <!-- :suffix="$constants.currencySymbols.kzt"-->
245
+ <!-- @input="onInputFixInsSum"-->
246
+ <!-- />-->
199
247
  <base-form-input
200
- v-if="hasFixInsSum"
201
- v-model="productConditionsForm.fixInsSum"
202
- :readonly="isDisabledFixInsSum"
203
- :clearable="!isDisabled"
204
- :rules="fixInsSumRule"
205
- :label="$dataStore.t('productConditionsForm.fixInsSum')"
206
- :suffix="$constants.currencySymbols.kzt"
207
- @input="onInputFixInsSum"
208
- />
209
- <base-form-input
248
+ v-if="hasRequestedSumInsured"
210
249
  v-model="productConditionsForm.requestedSumInsured"
211
250
  :readonly="isDisabledSum"
212
251
  :clearable="!isDisabledSum"
@@ -228,6 +267,7 @@
228
267
  @onClear="onClearSumDollar"
229
268
  />
230
269
  <base-form-input
270
+ v-if="hasInsurancePremiumPerMonth"
231
271
  v-model="productConditionsForm.insurancePremiumPerMonth"
232
272
  :readonly="insurancePremiumPerMonthDisabled"
233
273
  :clearable="!insurancePremiumPerMonthDisabled"
@@ -237,6 +277,22 @@
237
277
  @input="onInputInsurancePremiumPerMonth"
238
278
  @onClear="onClearPremium"
239
279
  />
280
+ <base-form-input
281
+ v-if="hasPaidOrRefund"
282
+ v-model="productConditionsForm.amountRefunded"
283
+ :readonly="isDisabledSum"
284
+ :clearable="!isDisabledSum"
285
+ :label="$dataStore.t('productConditionsForm.amountRefunded')"
286
+ :suffix="$constants.currencySymbols.kzt"
287
+ />
288
+ <base-form-input
289
+ v-if="hasPaidOrRefund"
290
+ v-model="productConditionsForm.amountPaid"
291
+ :readonly="insurancePremiumPerMonthDisabled"
292
+ :clearable="!insurancePremiumPerMonthDisabled"
293
+ :label="$dataStore.t('productConditionsForm.amountPaid')"
294
+ :suffix="$constants.currencySymbols.kzt"
295
+ />
240
296
  <base-form-input
241
297
  v-if="hasInsurancePremiumPerMonthInDollar"
242
298
  v-model="productConditionsForm.insurancePremiumPerMonthInDollar"
@@ -249,10 +305,10 @@
249
305
  @onClear="onClearPremiumDollar"
250
306
  />
251
307
  <base-form-input
252
- v-if="hasCurrency && $dataStore.currencies.usd"
308
+ v-if="hasCurrencySymbols && $dataStore.currencies.usd"
253
309
  v-model="$dataStore.currencies.usd"
254
310
  :readonly="true"
255
- :label="$dataStore.t('productConditionsForm.dollarExchangeRateNBRK')"
311
+ :label="currencySymbolsLabel"
256
312
  :suffix="$constants.currencySymbols.kzt"
257
313
  />
258
314
  <base-form-input
@@ -289,102 +345,245 @@
289
345
  :label="$dataStore.t('productConditionsForm.agencyPart')"
290
346
  :readonly="isDisabledAgentCommission"
291
347
  :clearable="!isDisabledAgentCommission"
292
- :rules="$rules.required.concat($rules.numbers, $rules.agentCommission)"
348
+ :rules="agencyPartRule"
349
+ />
350
+ <base-form-input
351
+ v-if="hasTariffName"
352
+ v-model="productConditionsForm.tariffName"
353
+ :readonly="true"
354
+ :clearable="false"
355
+ label="Тариф"
293
356
  />
294
357
  </base-form-section>
295
358
  <section v-if="whichProduct === 'pensionannuitynew'">
296
- <base-btn v-if="formStore.applicationData.processCode === 19 && !isDisabled" :text="$dataStore.t('buttons.copyToClient')" class="mt-4" @click="copyRedirect" />
297
- <base-form-section :title="$dataStore.t('pension.compulsoryAmount&Prof')">
359
+ <base-animation>
360
+ <div
361
+ v-if="(formStore.applicationData.processCode === 19 || formStore.applicationData.processCode === 25) && !isDisabled"
362
+ :class="[$styles.blueBgLight]"
363
+ class="h-[52px] rounded-lg flex items-center justify-end px-2 gap-2 mt-4"
364
+ >
365
+ <base-btn class="max-w-[300px]" :text="$dataStore.t('buttons.copyToClient')" size="sm" @click="copyRedirect" />
366
+ </div>
367
+ </base-animation>
368
+ <base-form-section v-if="formStore.applicationData.statusCode === 'ActuaryForm' && isTask">
369
+ <base-content-block :class="[$styles.textSimple]">
370
+ <h5 class="text-center font-medium mb-4">{{ $dataStore.t('labels.contract') }}</h5>
371
+ <div :class="[$styles.whiteBg, $styles.rounded]" class="p-2 h-12 flex items-center relative">
372
+ <span class="ml-2">Договор {{ formStore.applicationData.processCode === 19 || formStore.applicationData.processCode === 25 ? 'страхования' : 'возврата' }}</span>
373
+ <i
374
+ class="transition-all cursor-pointer mdi mdi-tray-arrow-down pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
375
+ :class="[$styles.greenTextHover]"
376
+ @click="
377
+ $dataStore.generatePDFDocument(
378
+ formStore.applicationData.processCode === 19 ? 'PA_Contract' : formStore.applicationData.processCode === 25 ? 'PAJ_Contract' : 'PA_RefundAgreement',
379
+ '38',
380
+ )
381
+ "
382
+ ></i>
383
+ </div>
384
+ </base-content-block>
385
+ </base-form-section>
386
+ <div v-if="formStore.applicationData.processCode === 25" class="flex items-center mt-[14px] h-[48px]">
387
+ <div :class="[$styles.blueBgLight]" class="flex flex-wrap items-center gap-2 p-1 rounded-t-[8px] h-full">
388
+ <div
389
+ class="h-full px-4 py-1 rounded-[8px] cursor-pointer flex items-center"
390
+ :class="[$styles.textSimple, !isSlavePensionForm ? `${$styles.blueBg} ${$styles.whiteText}` : '']"
391
+ @click="$router.replace({ query: { ...$route.query, which: undefined, upd: 'true' } })"
392
+ >
393
+ {{ !!formStore.applicationData.clientApp?.longName ? formStore.applicationData.clientApp?.longName : 'Страхователь' }}
394
+ </div>
395
+ <div
396
+ class="h-full px-4 py-1 rounded-[8px] cursor-pointer flex items-center"
397
+ :class="[$styles.textSimple, isSlavePensionForm ? `${$styles.blueBg} ${$styles.whiteText}` : '']"
398
+ @click="$router.replace({ query: { ...$route.query, which: 'slave', upd: 'true' } })"
399
+ >
400
+ {{ !!formStore.applicationData.slave.clientApp?.longName ? formStore.applicationData.slave.clientApp?.longName : 'Страхователь 2' }}
401
+ </div>
402
+ </div>
403
+ </div>
404
+ <base-form-section v-if="hasContragentData && contragentData">
405
+ <base-panel-input v-model="contragentData.gender" :readonly="true" :clearable="false" :label="$dataStore.t('form.gender')" />
406
+ <base-form-input v-model="contragentData.birthDate" :readonly="true" :clearable="false" :label="$dataStore.t('form.birthDate')" />
407
+ <base-panel-input
408
+ v-if="disabilityGroup"
409
+ v-model="disabilityGroup"
410
+ :value="disabilityGroup?.nameRu"
411
+ :readonly="true"
412
+ :clearable="false"
413
+ :label="$dataStore.t('pension.disabilityGroup')"
414
+ />
415
+ </base-form-section>
416
+ <base-form-section
417
+ v-if="formStore.applicationData.processCode !== 24"
418
+ :title="$dataStore.t('pension.compulsoryAmount&Prof')"
419
+ :class="[formStore.applicationData.processCode === 25 ? 'mt-0 rounded-tl-none' : '']"
420
+ >
298
421
  <base-form-input
299
- v-model="pensionCalculationParams.compulsoryContractAmount"
300
- :maska="$maska.numbers"
422
+ v-model="pensionForm.compulsoryContractAmount"
301
423
  :readonly="isDisabled || isEnpfSum"
302
424
  :clearable="!isDisabled && !isEnpfSum"
303
425
  :label="$dataStore.t('pension.compulsoryContractAmount')"
426
+ :rules="$dataStore.rules.sums"
427
+ :suffix="$constants.currencySymbols.kzt"
428
+ @input="onInputPension($event, 'compulsoryContractAmount')"
429
+ @onClear="onClearPension('compulsoryContractAmount')"
304
430
  />
305
431
  <base-form-input
306
- v-model="pensionCalculationParams.compulsoryProfContractAmount"
307
- :maska="$maska.numbers"
432
+ v-model="pensionForm.compulsoryProfContractAmount"
308
433
  :readonly="isDisabled || isEnpfSum"
309
434
  :clearable="!isDisabled && !isEnpfSum"
310
435
  :label="$dataStore.t('pension.compulsoryProfContractAmount')"
436
+ :rules="$dataStore.rules.sums"
437
+ :suffix="$constants.currencySymbols.kzt"
438
+ @input="onInputPension($event, 'compulsoryProfContractAmount')"
439
+ @onClear="onClearPension('compulsoryProfContractAmount')"
311
440
  />
312
- <base-animation>
313
- <base-form-input
314
- v-if="pensionCalculationParams.compulsoryProfContractAmount && pensionCalculationParams.compulsoryProfContractAmount != 0"
315
- v-model="pensionForm.compulsoryProfMonthCount"
316
- :maska="$maska.numbers"
317
- :readonly="isDisabled || isEnpfSum"
318
- :clearable="!isDisabled && !isEnpfSum"
319
- :label="$dataStore.t('pension.compulsoryProfMonthCount')"
320
- />
321
- </base-animation>
322
441
  <base-form-input
323
- v-model="pensionCalculationParams.voluntaryContractAmount"
324
- :maska="$maska.numbers"
325
- :readonly="isDisabled"
326
- :clearable="!isDisabled"
442
+ v-model="pensionForm.compulsoryProfMonthCount"
443
+ :readonly="true"
444
+ :clearable="false"
445
+ :rules="isCompulsoryProfContractAmount ? $dataStore.rules.required : []"
446
+ :label="$dataStore.t('pension.compulsoryProfMonthCount')"
447
+ />
448
+ <base-form-input
449
+ v-model="pensionForm.voluntaryContractAmount"
450
+ :readonly="isDisabled || isEnpfSum"
451
+ :clearable="!isDisabled && !isEnpfSum"
327
452
  :label="$dataStore.t('pension.voluntaryContractAmount')"
453
+ :rules="$dataStore.rules.sums"
454
+ :suffix="$constants.currencySymbols.kzt"
455
+ @input="onInputPension($event, 'voluntaryContractAmount')"
456
+ @onClear="onClearPension('voluntaryContractAmount')"
328
457
  />
329
458
  <base-form-input
330
- v-model="pensionCalculationParams.ownFundsRaisAmount"
331
- :maska="$maska.numbers"
459
+ v-model="pensionForm.ownFundsRaisAmount"
332
460
  :readonly="isDisabled"
333
461
  :clearable="!isDisabled"
334
462
  :label="$dataStore.t('pension.ownFundsRaisAmount')"
463
+ :rules="$dataStore.rules.sums"
464
+ :suffix="$constants.currencySymbols.kzt"
465
+ @input="onInputPension($event, 'ownFundsRaisAmount')"
466
+ @onClear="onClearPension('ownFundsRaisAmount')"
335
467
  />
468
+ <base-animation type="fade">
469
+ <base-form-toggle
470
+ v-if="formatSpacedNumber(pensionForm.ownFundsRaisAmount) > 0"
471
+ v-model="pensionForm.isOwnAmountFromDividend"
472
+ :disabled="isDisabled"
473
+ :has-border="false"
474
+ :title="$dataStore.t('pension.isOwnAmountFromDividend')"
475
+ />
476
+ </base-animation>
336
477
  </base-form-section>
337
- <base-form-section :title="$dataStore.t('pension.companyName')">
338
- <base-panel-input
339
- v-model="pensionForm.transferContractCompany"
340
- :value="pensionForm.transferContractCompany?.nameRu"
341
- :label="$dataStore.t('pension.transferContractCompany')"
342
- :readonly="isDisabled"
343
- :clearable="!isDisabled"
344
- append-inner-icon="mdi mdi-chevron-right"
345
- @append="openPanel($dataStore.t('pension.transferContractCompany'), $dataStore.transferContractCompanies, 'transferContractCompany', $dataStore.getInsuranceCompanies)"
346
- />
347
- <base-form-input
348
- v-model="transferContractDate"
349
- :maska="$maska.date"
350
- :label="$dataStore.t('pension.contractDate')"
351
- :readonly="isDisabled"
352
- :clearable="!isDisabled"
353
- append-inner-icon="mdi mdi-calendar-blank-outline"
354
- :rules="pensionForm.transferContractCompany?.ids ? $rules.required.concat($rules.date) : []"
355
- />
356
- <base-form-input
357
- v-model="pensionForm.transferContractNumber"
358
- :label="$dataStore.t('pension.globalId')"
359
- :readonly="isDisabled"
360
- :clearable="!isDisabled"
361
- :rules="pensionForm.transferContractCompany?.ids ? $rules.required : []"
362
- />
363
- <base-form-input
364
- v-model="transferContractFirstPaymentDate"
365
- :maska="$maska.date"
366
- :label="$dataStore.t('pension.transferContractFirstPaymentDate')"
367
- append-inner-icon="mdi mdi-calendar-blank-outline"
368
- :readonly="isDisabled"
369
- :clearable="!isDisabled"
370
- :rules="pensionForm.transferContractCompany?.ids ? $rules.required.concat($rules.date) : []"
371
- />
372
- <base-form-input
373
- v-model="pensionCalculationParams.transferContractAmount"
374
- :maska="$maska.numbers"
375
- :label="$dataStore.t('pension.transferContractAmount')"
376
- :rules="pensionForm.transferContractCompany?.ids ? $rules.required : []"
377
- />
378
- <base-form-toggle v-model="pensionForm.transferContractIsOppv" :disabled="isDisabled" :has-border="false" :title="$dataStore.t('pension.isOPPVTransfer')" />
478
+ <base-form-section v-if="formStore.applicationData.processCode !== 24" :title="$dataStore.t('pension.ENPFnote')" class="mt-[14px]">
479
+ <base-file-input :loading="$dataStore.isLoading" @input.prevent="onFileChange($event)" v-if="!enpfNoteFile" />
480
+ <base-content-block class="!p-0" v-if="!!enpfNoteFile">
481
+ <div :class="[$styles.whiteBg]" class="p-2 h-12 flex items-center relative rounded-[4px]">
482
+ <span class="ml-2">{{ enpfNoteFile.fileName }}</span>
483
+ <i
484
+ class="transition-all cursor-pointer mdi mdi-dots-vertical pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
485
+ :class="[$styles.greenTextHover]"
486
+ @click="openFileActionsPanel(enpfNoteFile)"
487
+ ></i>
488
+ </div>
489
+ </base-content-block>
490
+ </base-form-section>
491
+ <base-form-section v-if="formStore.applicationData.processCode !== 24" :title="$dataStore.t('pension.companyName')">
492
+ <base-btn v-if="!isDisabled" :text="$dataStore.t('buttons.add')" :disabled="isDisabled" size="sm" :btn="$styles.blueBtn" @click="addTransferContract" />
493
+ <section v-for="(contract, index) in transferContracts" class="py-2">
494
+ <base-panel-input
495
+ v-model="contract.transferContractCompany"
496
+ :value="contract.transferContractCompany?.nameRu"
497
+ :label="$dataStore.t('pension.transferContractCompany')"
498
+ :readonly="isDisabled"
499
+ :clearable="!isDisabled"
500
+ append-inner-icon="mdi mdi-chevron-right"
501
+ @append="
502
+ openPanel($dataStore.t('pension.transferContractCompany'), $dataStore.transferContractCompanies, 'transferContractCompany', $dataStore.getInsuranceCompanies)
503
+ "
504
+ @click="contractIndex = index"
505
+ />
506
+ <div class="flex flex-col">
507
+ <base-form-input
508
+ v-model="contract.transferContractDate"
509
+ :maska="$maska.date"
510
+ :label="$dataStore.t('pension.contractDate')"
511
+ :readonly="isDisabled"
512
+ :clearable="!isDisabled"
513
+ :max-date="formatDate(transferMaxDate) ?? undefined"
514
+ :rules="$dataStore.rules.required.concat(checkTransferContractDate)"
515
+ append-inner-icon="mdi mdi-calendar-blank-outline"
516
+ />
517
+ <span v-if="transferMaxDate && !isDisabled" class="px-3 font-light text-sm bg-white py-0 mt-[-5px]" style="color: #a0b3d8 !important"
518
+ >до {{ transferMaxDate }} включительно</span
519
+ >
520
+ </div>
521
+ <base-form-input
522
+ v-model="contract.transferContractNumber"
523
+ :label="$dataStore.t('pension.globalId')"
524
+ :readonly="isDisabled"
525
+ :clearable="!isDisabled"
526
+ />
527
+ <base-form-input
528
+ v-model="contract.transferContractRegNumber"
529
+ :label="$dataStore.t('pension.transferRegNumber')"
530
+ :rules="$rules.required"
531
+ :readonly="isDisabled"
532
+ :clearable="!isDisabled"
533
+ />
534
+ <base-form-input
535
+ v-model="contract.transferContractFirstPaymentDate"
536
+ :maska="$maska.date"
537
+ :label="$dataStore.t('pension.transferContractFirstPaymentDate')"
538
+ :rules="[...$rules.required, $rules.validateAfterContractDate(contract.transferContractFirstPaymentDate, contract.transferContractDate)]"
539
+ append-inner-icon="mdi mdi-calendar-blank-outline"
540
+ :min-date="formatDate(contract.transferContractDate) ?? undefined"
541
+ :readonly="isDisabled"
542
+ :clearable="!isDisabled"
543
+ />
544
+ <base-form-input
545
+ v-model="contract.transferContractAmount"
546
+ :label="$dataStore.t('pension.transferContractAmount')"
547
+ :suffix="$constants.currencySymbols.kzt"
548
+ :readonly="isDisabled"
549
+ :clearable="!isDisabled"
550
+ @input="onInputPension($event, 'transferContractAmount', index)"
551
+ @onClear="onClearPension('transferContractAmount', index)"
552
+ />
553
+ <base-form-toggle v-model="contract.transferContractIsOppv" :disabled="isDisabled" :has-border="false" :title="$dataStore.t('pension.isOPPVTransfer')" />
554
+ <div class="flex items-center gap-[8px] mt-2">
555
+ <v-icon class="text-[#99A3B3] text-[20px]">mdi-information-outline</v-icon>
556
+ <p class="font-normal text-[14px] leading-[20px] tracking-[0.25px] text-[#99A3B3]">
557
+ Если выкупная сумма содержит ОППВ, необходимо приложить развернутую выписку из ЕНПФ.
558
+ </p>
559
+ </div>
560
+ <!-- <base-form-input-->
561
+ <!-- v-if="contract.transferContractIsOppv"-->
562
+ <!-- v-model="contract.transferContractMonthCount"-->
563
+ <!-- :disabled="$dataStore.isLoading"-->
564
+ <!-- :rules="$rules.required.concat($rules.notZero, $rules.numbers)"-->
565
+ <!-- :label="$dataStore.t('pension.compulsoryProfMonthCount')"-->
566
+ <!-- />-->
567
+ <base-btn
568
+ v-if="!isDisabled"
569
+ class="mt-3"
570
+ :text="$dataStore.t('buttons.delete')"
571
+ :disabled="isDisabled"
572
+ size="sm"
573
+ :btn="$styles.redBtn"
574
+ @click="removeTransferContract(index)"
575
+ />
576
+ </section>
379
577
  </base-form-section>
380
578
  <base-form-section :title="$dataStore.t('pension.paymentTerms')">
381
579
  <base-form-input
382
580
  v-model="contractDate"
383
581
  :maska="$maska.date"
384
- :rules="!isDisabled ? $rules.required.concat($rules.date) : []"
385
- :readonly="isDisabled"
582
+ :rules="!isDisabled ? $rules.required.concat($rules.date, [validateContractDate]) : []"
583
+ :readonly="isDisabled || formStore.applicationData.processCode === 24 || isSlavePensionForm"
386
584
  :clearable="!isDisabled"
387
585
  :min-date="new Date()"
586
+ :max-date="formatDate(maxDate ?? '') ?? undefined"
388
587
  :label="$dataStore.t('pension.contractDate')"
389
588
  append-inner-icon="mdi mdi-calendar-blank-outline"
390
589
  />
@@ -392,7 +591,7 @@
392
591
  <base-form-input v-model="dateOfBegin" :maska="$maska.date" readonly :label="$dataStore.t('pension.paymentsDate')" append-inner-icon="mdi mdi-calendar-blank-outline" />
393
592
  <base-rounded-select
394
593
  v-model="pensionForm.guaranteedPeriod"
395
- class="pension-guaranteed-period"
594
+ class="pension-round-toggle"
396
595
  :readonly="isDisabled"
397
596
  :clearable="!isDisabled"
398
597
  :rules="$rules.notZero"
@@ -400,11 +599,39 @@
400
599
  :items="guaranteedPeriodList"
401
600
  :hide-details="true"
402
601
  />
602
+ <base-rounded-select
603
+ v-if="dividendPeriods"
604
+ v-model="pensionForm.dividendId"
605
+ class="pension-round-toggle"
606
+ :readonly="isDisabled"
607
+ :rules="$rules.notZero"
608
+ :label="$dataStore.t('pension.dividendPeriod')"
609
+ item-title="nameRu"
610
+ item-value="id"
611
+ :items="dividendPeriods"
612
+ :hide-details="true"
613
+ />
403
614
  <base-form-input v-model="pensionForm.frequencyPayments" disabled :label="$dataStore.t('pension.frequencyPayments')" />
404
615
  <base-form-input v-model="pensionForm.periodPayments" disabled :label="$dataStore.t('pension.paymentPeriod')" />
405
616
  <base-form-input v-model="pensionForm.insuranceProgramType" disabled :label="$dataStore.t('pension.insuranceProgramType')" />
406
- <base-form-input v-model="pensionAmount" readonly :maska="$maska.numbers" :label="$dataStore.t('pension.pensionAmount')" />
407
- <base-form-input v-model="pensionForm.payment" readonly :maska="$maska.numbers" :label="$dataStore.t('pension.pensionPayment')" />
617
+ <base-form-input
618
+ v-if="formStore.applicationData.processCode === 25 && formStore.pensionApp?.slave?.amount"
619
+ :value="totalInsPremium"
620
+ :active="true"
621
+ :label="$dataStore.t('productConditionsForm.totalInsurancePremiumAmount')"
622
+ :disabled="$dataStore.isLoading"
623
+ readonly
624
+ />
625
+ <base-form-input
626
+ v-model="pensionForm.amount"
627
+ :value="$dataStore.getNumberWithSpaces(pensionForm.amount)"
628
+ @input="onInputPension($event, 'pensionAmount')"
629
+ @onClear="onClearPension('pensionAmount')"
630
+ @change="customPension = true"
631
+ :readonly="isDisabled || formStore.applicationData.processCode !== 25"
632
+ :label="$dataStore.t('pension.pensionAmount')"
633
+ />
634
+ <base-form-input :value="$dataStore.getNumberWithSpaces(pensionForm.payment)" :active="true" readonly :label="$dataStore.t('pension.pensionPayment')" />
408
635
  </base-form-section>
409
636
  </section>
410
637
  <base-form-section v-if="hasAnnuityPayments" :title="$dataStore.t('calculationAnnuityPayments')">
@@ -558,6 +785,7 @@
558
785
  v-if="calculatorForm.type.code === 'Single'"
559
786
  v-model="calculatorForm.days"
560
787
  :readonly="isDisabled || !isCalculator"
788
+ :clearable="!isDisabled && isCalculator"
561
789
  :label="$dataStore.t('calculatorForm.days')"
562
790
  :rules="$rules.required"
563
791
  />
@@ -566,7 +794,7 @@
566
794
  v-model="calculatorForm.age"
567
795
  :rules="$rules.required"
568
796
  :readonly="isDisabledSum"
569
- :clearable="!isDisabled"
797
+ :clearable="!isDisabledSum"
570
798
  :label="$dataStore.t('calculatorForm.age')"
571
799
  />
572
800
  <base-form-input
@@ -602,9 +830,9 @@
602
830
  <base-panel-input
603
831
  v-if="filterTermConditions(term)"
604
832
  v-model="additionalTerms[index]"
605
- :value="term.coverSumName"
833
+ :value="locale === 'ru' ? term.coverSumName : term.coverSumNameKz"
606
834
  :readonly="isTermsDisabled"
607
- :clearable="false"
835
+ :clearable="!isTermsDisabled"
608
836
  :label="coverTypeName(term)"
609
837
  append-inner-icon="mdi mdi-chevron-right"
610
838
  :suffix="
@@ -617,20 +845,115 @@
617
845
  @append="openTermPanel(coverTypeName(term), $dataStore.getAdditionalInsuranceTermsAnswers, term.coverTypeId, index)"
618
846
  />
619
847
  </div>
848
+ <template v-if="whichProduct === 'halykkazyna'">
849
+ <base-form-toggle
850
+ v-model="productConditionsForm.managerHelped"
851
+ :has-border="false"
852
+ :title="$dataStore.t('Вам помогал менеджер?')"
853
+ height="min-h-[56px]"
854
+ />
855
+ <base-panel-input
856
+ v-if="isDisabled"
857
+ v-model="productConditionsForm.hasEnhancedGift"
858
+ :value="productConditionsForm.hasEnhancedGift ? 'включено' : 'не включено'"
859
+ :readonly="true"
860
+ :clearable="false"
861
+ label="Подарочный сертификат"
862
+ append-inner-icon="mdi mdi-chevron-right"
863
+ />
864
+ <base-form-toggle
865
+ v-else
866
+ v-model="productConditionsForm.hasEnhancedGift"
867
+ :disabled="enhancedGiftDisabled"
868
+ :showValue="false"
869
+ :has-border="false"
870
+ :title="$dataStore.t('Получить «Подарочный сертификат»')"
871
+ height="min-h-[56px]"
872
+ />
873
+ <div class="flex items-center gap-[8px] mt-2">
874
+ <v-icon class="text-[#99A3B3] text-[20px]">mdi-information-outline</v-icon>
875
+ <p class="font-normal text-[14px] leading-[20px] tracking-[0.25px] text-[#99A3B3]">
876
+ Доступно, если размер страховой премии больше {{ $dataStore.getNumberWithSpaces(minEnhancedGiftSum) }} тенге или {{ $dataStore.getNumberWithSpaces(minEnhancedGiftSumInUsd) }} долларов.
877
+ </p>
878
+ </div>
879
+ </template>
620
880
  </base-form-section>
621
881
  </v-form>
622
- <base-btn v-if="!$dataStore.isCalculator && isCalculator && hasCalculated" :btn="$styles.greenLightBtn" :text="$dataStore.t('buttons.toStatement')" @click="toStatement" />
623
- <base-btn v-if="!isDisabled && $dataStore.isPension && isTask" :text="$dataStore.t('buttons.save')" :loading="$dataStore.isLoading" type="submit" @click="submitForm" />
624
- <base-btn
625
- v-if="$dataStore.isCalculator ? true : !isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter()) && !$dataStore.isPension"
626
- :loading="isCalculating"
627
- :text="$dataStore.t('buttons.calculate')"
628
- @click="submitForm"
629
- />
882
+ <base-animation>
883
+ <base-btn
884
+ v-if="!$dataStore.isCalculator && isCalculator && hasCalculated"
885
+ :btn="$styles.greenLightBtn"
886
+ :text="$dataStore.t('buttons.toStatement')"
887
+ class="min-h-[60px]"
888
+ @click="toStatement"
889
+ />
890
+ </base-animation>
891
+ <base-animation>
892
+ <base-btn
893
+ v-if="!isDisabled && $dataStore.isPension && isTask"
894
+ :text="$dataStore.t('buttons.calculate')"
895
+ :loading="$dataStore.isLoading"
896
+ class="min-h-[60px]"
897
+ type="submit"
898
+ @click="submitForm"
899
+ />
900
+ </base-animation>
901
+ <base-animation>
902
+ <base-btn
903
+ v-if="$dataStore.isCalculator ? true : !isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter()) && !$dataStore.isPension"
904
+ :loading="isCalculating"
905
+ class="min-h-[60px]"
906
+ :text="$dataStore.t('buttons.calculate')"
907
+ @click="submitForm"
908
+ />
909
+ </base-animation>
630
910
  <div v-if="$dataStore.isTask() && $dataStore.isUnderwriter() && !isRecalculationDisabled" class="flex gap-3">
631
- <base-btn :text="$dataStore.t('buttons.calcSum')" v-if="hasCalcSum" type="submit" @click.prevent="underwriterCalculate('sum')" :loading="isCalculating" />
632
- <base-btn :text="$dataStore.t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
911
+ <base-animation>
912
+ <base-btn
913
+ v-if="hasCalcSum"
914
+ class="min-h-[60px]"
915
+ :text="$dataStore.t('buttons.calcSum')"
916
+ type="submit"
917
+ @click.prevent="underwriterCalculate('sum')"
918
+ :loading="isCalculating"
919
+ />
920
+ </base-animation>
921
+ <base-btn class="min-h-[60px]" :text="$dataStore.t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
633
922
  </div>
923
+ <base-fade-transition>
924
+ <base-form-section :title="$dataStore.t('pension.dividendsGraph')" v-if="dividendSchedules.scheduleDividend" class="grid-table">
925
+ <div class="flex justify-between rounded-t-[8px] border-b-[1px]" :class="[$styles.blueBg, $styles.whiteText]">
926
+ <span class="h-full">#</span>
927
+ <span class="h-full">{{ $dataStore.t('pension.dividendDate') }}</span>
928
+ <span class="h-full grow">{{ $dataStore.t('pension.dividendAmount') }}</span>
929
+ </div>
930
+ <v-virtual-scroll :items="dividendSchedules.scheduleDividend" height="300">
931
+ <template v-slot:default="{ item, index }">
932
+ <div class="flex justify-between border-b-[1px]" :class="[$styles.whiteBg, $styles.textSimple, $styles.rounded]">
933
+ <span class="h-full">{{ index + 1 }}</span>
934
+ <span class="h-full">{{ reformatDate(item.date) }}</span>
935
+ <span class="h-full grow">{{ $dataStore.getNumberWithSpaces(item.amount) }}</span>
936
+ </div>
937
+ </template>
938
+ </v-virtual-scroll>
939
+ </base-form-section>
940
+ <base-form-section :title="$dataStore.t('pension.dividendsGraph') + ' 2'" v-if="dividendSchedules.scheduleDividend2" class="grid-table">
941
+ <div class="flex justify-between rounded-t-[8px] border-b-[1px]" :class="[$styles.blueBg, $styles.whiteText]">
942
+ <span class="h-full">#</span>
943
+ <span class="h-full">{{ $dataStore.t('pension.dividendDate') }}</span>
944
+ <span class="h-full grow">{{ $dataStore.t('pension.dividendAmount') }}</span>
945
+ </div>
946
+ <v-virtual-scroll :items="dividendSchedules.scheduleDividend2" height="300">
947
+ <template v-slot:default="{ item, index }">
948
+ <div class="flex justify-between border-b-[1px]" :class="[$styles.whiteBg, $styles.textSimple, $styles.rounded]">
949
+ <span class="h-full">{{ index + 1 }}</span>
950
+ <span class="h-full">{{ reformatDate(item.date) }}</span>
951
+ <span class="h-full grow">{{ $dataStore.getNumberWithSpaces(item.amount) }}</span>
952
+ </div>
953
+ </template>
954
+ </v-virtual-scroll>
955
+ </base-form-section>
956
+ </base-fade-transition>
634
957
  <Teleport v-if="isPanelOpen" to="#right-panel-actions">
635
958
  <div :class="[$styles.scrollPage]" class="flex flex-col items-center">
636
959
  <base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
@@ -639,7 +962,7 @@
639
962
  <base-panel-select-item
640
963
  v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
641
964
  :key="index"
642
- :text="String(item.nameRu)"
965
+ :text="locale === 'ru' ? String(item.nameRu) : String(item.nameKz)"
643
966
  :selected="item.nameRu === panelValue.nameRu"
644
967
  @click="pickPanelValue(item)"
645
968
  />
@@ -685,18 +1008,65 @@
685
1008
  </v-expansion-panel-text>
686
1009
  </v-expansion-panel>
687
1010
  </v-expansion-panels>
688
- <base-panel-select-item v-else :key="index" :text="String(item.nameRu)" :selected="item.nameRu === termValue?.coverSumName" @click="pickTermValue(item)" />
1011
+ <base-panel-select-item
1012
+ v-else
1013
+ :key="index"
1014
+ :text="locale === 'ru' ? String(item.nameRu) : String(item.nameKz)"
1015
+ :selected="item.nameRu === termValue?.coverSumName"
1016
+ @click="pickTermValue(item)"
1017
+ />
689
1018
  </div>
690
1019
  </div>
691
1020
  <base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
692
1021
  </div>
693
1022
  </Teleport>
1023
+ <Teleport v-if="isFileActionsPanelOpen" to="#right-panel-actions">
1024
+ <base-fade-transition>
1025
+ <div :class="[$styles.flexColNav]">
1026
+ <base-animation>
1027
+ <base-btn
1028
+ v-if="enpfNoteFile?.fileName && enpfNoteFile?.fileName.includes('.') ? enpfNoteFile?.fileName.endsWith('.pdf') : true"
1029
+ :disabled="documentLoading"
1030
+ :loading="documentLoading"
1031
+ text="Открыть"
1032
+ @click="getDoc('view')"
1033
+ />
1034
+ </base-animation>
1035
+ <base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="getDoc('download')" />
1036
+ <base-animation>
1037
+ <base-btn :disabled="documentLoading" :loading="documentLoading" text="Удалить" @click="deletionDialog = true" />
1038
+ </base-animation>
1039
+ </div>
1040
+ </base-fade-transition>
1041
+ </Teleport>
1042
+ <base-dialog
1043
+ v-model="deletionDialog"
1044
+ :title="$dataStore.t('dialog.confirmDelete')"
1045
+ :subtitle="$dataStore.t('dialog.deleteFile')"
1046
+ :confirm="$dataStore.t('confirm.delete')"
1047
+ :icon="{ mdi: 'delete-outline', color: '#FD2D39' }"
1048
+ @yes="deleteFile"
1049
+ @no="deletionDialog = false"
1050
+ />
694
1051
  </section>
1052
+ <div v-if="isLoading" class="w-full h-[80dvh] flex items-center justify-center"><base-loader :size="50" /></div>
695
1053
  </template>
696
1054
 
697
1055
  <script lang="ts">
698
- import { Member, Value, CountryValue, CalculatorForm } from '../../composables/classes';
699
- import type { Projects, AddCover, AddCoverAnswer } from '../../types';
1056
+ import { Member, Value, CountryValue, CalculatorForm, TransferContract, DocumentItem } from '../../composables/classes';
1057
+ import type { Projects, AddCover, AddCoverAnswer, FileActions } from '../../types';
1058
+ import { useI18n } from 'vue-i18n';
1059
+ import { getNumber, parseAmount } from '../../composables';
1060
+ import { uuid } from 'vue-uuid';
1061
+
1062
+ type PensionCalculation = {
1063
+ compulsoryContractAmount: number | string | null;
1064
+ voluntaryContractAmount: number | string | null;
1065
+ ownFundsRaisAmount: number | string | null;
1066
+ compulsoryProfContractAmount: number | string | null;
1067
+ transferContractAmount: number | string | null;
1068
+ transferContractCompany: number | string | null;
1069
+ };
700
1070
 
701
1071
  export default defineComponent({
702
1072
  props: {
@@ -716,12 +1086,16 @@ export default defineComponent({
716
1086
  const formStore = useFormStore();
717
1087
  const dataStore = useDataStore();
718
1088
  const memberStore = useMemberStore();
1089
+ const { locale } = useI18n();
719
1090
 
720
1091
  const whichProduct = ref<Projects | null>(dataStore.isCalculator ? props.product : dataStore.product!);
721
1092
  const isCalculating = ref<boolean>(false);
722
1093
  const isPanelLoading = ref<boolean>(false);
723
1094
  const isPanelOpen = ref<boolean>(false);
724
1095
  const isTermsPanelOpen = ref<boolean>(false);
1096
+ const isFileActionsPanelOpen = ref<boolean>(false);
1097
+ const isLoading = ref<boolean>(false);
1098
+ const documentLoading = ref<boolean>(false);
725
1099
  const panelValue = ref<Value>(new Value());
726
1100
  const termValue = ref<AddCover>();
727
1101
  const subTermValue = ref<string>('');
@@ -734,23 +1108,108 @@ export default defineComponent({
734
1108
  const whichSum = ref<'insurancePremiumPerMonth' | 'requestedSumInsured' | ''>('');
735
1109
  const panelCodeList = ['processcovertypesum', 'fixedinssum'];
736
1110
  const enabled = 'включено';
1111
+ const amountRefunded = ref<string | number | null>(null);
1112
+ const amountPaid = ref<string | number | null>(null);
1113
+ const deletionDialog = ref<boolean>(false);
1114
+ const hasEduCapitalConsent = ref<boolean>(false);
737
1115
 
738
1116
  const additionalTerms = ref<AddCover[]>([]);
739
1117
 
740
- const maxDate = ref();
1118
+ const maxDate = ref<string | null>();
741
1119
  const dateOfBegin = ref();
742
- const contractDate = ref();
743
- const transferContractDate = ref();
744
- const transferContractFirstPaymentDate = ref();
745
- const guaranteedPeriodList = Array.from(Array(35), (e, i) => i + 1);
746
- const pensionForm = formStore.applicationData?.pensionApp ?? undefined;
747
- const isEnpfSum = (formStore.applicationData?.isEnpfSum ?? false) && useEnv().isProduction;
1120
+ const contractDate = ref<string | null>();
1121
+ const transferContractDate = ref<string | null>();
1122
+ const transferContractFirstPaymentDate = ref<string | null>();
1123
+ const guaranteedPeriodList = Array.from(Array(35), (_, i) => i + 1);
1124
+ const dividendPeriods = ref<Value[] | null>(null);
1125
+
1126
+ const dividendSchedules = ref(<
1127
+ {
1128
+ scheduleDividend: any[] | null;
1129
+ scheduleDividend2: any[] | null;
1130
+ }
1131
+ >{
1132
+ scheduleDividend: null,
1133
+ scheduleDividend2: null,
1134
+ });
1135
+ const transferMaxDate = computed({
1136
+ get() {
1137
+ if (contractDate.value) {
1138
+ var maxDate = structuredClone(formatDate(contractDate.value))!;
1139
+ maxDate.setFullYear(maxDate.getFullYear() - 2);
1140
+ maxDate.setDate(maxDate.getDate() + 1);
1141
+ return reformatDate(String(maxDate))!;
1142
+ } else {
1143
+ return '';
1144
+ }
1145
+ },
1146
+ set(newValue) {
1147
+ return newValue;
1148
+ },
1149
+ });
1150
+ const isSlavePensionForm = computed(() => route.query.which === 'slave');
1151
+ const pensionForm = computedWithControl(
1152
+ () => formStore.pensionApp,
1153
+ () => (route.query.which === 'slave' ? formStore.pensionApp?.slave : formStore.pensionApp ?? undefined),
1154
+ );
1155
+
1156
+ const insuredForm = isSlavePensionForm.value
1157
+ ? formStore.applicationData?.slave?.insuredApp && formStore.applicationData?.slave?.insuredApp[0]
1158
+ : (formStore.applicationData?.insuredApp && Array.isArray(formStore.applicationData?.insuredApp) && formStore.applicationData?.insuredApp[0]) ?? undefined;
1159
+ const disabilityGroup = computed(() => {
1160
+ if (!!insuredForm.disabilityGroupId) {
1161
+ const disabilityGroup = dataStore.disabilityGroups.find(i => i.id === insuredForm.disabilityGroupId);
1162
+ return disabilityGroup;
1163
+ }
1164
+ });
1165
+ const enpfNoteFile = computed(() => {
1166
+ if(useEnv().isProduction) {
1167
+ return formStore.signedDocumentList.find(i => i.fileTypeCode === '8' && i.iin === contragentData.value?.iin)
1168
+ } else {
1169
+ return formStore.signedDocumentList.find(i => i.fileTypeCode === '8')
1170
+ }
1171
+ });
1172
+ const isEnpfSum = pensionForm.value?.isEnpfSum ?? false;
748
1173
 
1174
+ const transferContracts = ref<TransferContract[]>([]);
1175
+ const contractsValue = ref<Value[]>([]);
1176
+ const contractIndex = ref<number>(0);
749
1177
  const isMultiplePanelOpen = ref<boolean>(false);
750
1178
  const multiplePanelValue = ref<CountryValue>(new CountryValue());
751
1179
  const multiplePanelList = ref<CountryValue[]>([]);
752
1180
  const calculatorForm = productConditionsForm.calculatorForm;
753
1181
  const minInsSum = computed(() => formStore.lfb.clients && formStore.lfb.clients.reduce((min, item) => Math.min(min, item.insSum), Infinity));
1182
+ const contragentData = ref<any>();
1183
+ const customPension = ref<boolean>(false);
1184
+ const transferSum = ref<number>(0);
1185
+ const firstAmount = ref<boolean>(true);
1186
+ const isHalykBank = formStore.lfb.policyholder.clientData.iin.replace(/-/g, '') === '940140000385';
1187
+ const closeDate = ref<any>('');
1188
+ const minEnhancedGiftSum = 10_000_000
1189
+
1190
+ const checkTransferContractDate = (val: any) => {
1191
+ if (val) {
1192
+ if (new Date(formatDate(transferMaxDate.value)!.valueOf() - formatDate(val)!.valueOf()).getUTCFullYear() - 1970 < 0) {
1193
+ return dataStore.t('rules.invalidtransferContractDate');
1194
+ } else {
1195
+ return true;
1196
+ }
1197
+ } else {
1198
+ return true;
1199
+ }
1200
+ };
1201
+
1202
+ const minEnhancedGiftSumInUsd = computed(() => {
1203
+ if(typeof dataStore.currencies.usd === 'number') {
1204
+ return Math.round(minEnhancedGiftSum / dataStore.currencies.usd)
1205
+ }
1206
+ })
1207
+ const enhancedGiftDisabled = computed(() => {
1208
+ const insurancePremium = parseAmount(productConditionsForm.insurancePremiumPerMonth)
1209
+
1210
+ return (!insurancePremium || insurancePremium < minEnhancedGiftSum) ||
1211
+ (!productConditionsForm.coverPeriod || productConditionsForm.coverPeriod < 1 || productConditionsForm.coverPeriod > 5)
1212
+ })
754
1213
  const isShownAdditionalTerms = computed(() => {
755
1214
  if (whichProduct.value === 'gons') {
756
1215
  return false;
@@ -769,6 +1228,9 @@ export default defineComponent({
769
1228
  if (whichProduct.value === 'gons') {
770
1229
  return true;
771
1230
  }
1231
+ if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
1232
+ return true;
1233
+ }
772
1234
  if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && dataStore.isUnderwriter()) {
773
1235
  return false;
774
1236
  }
@@ -778,7 +1240,13 @@ export default defineComponent({
778
1240
  const isTask = computed(() => (route.params.taskId === '0' && props.isCalculator === true) || dataStore.isTask() || fromIndexPage.value);
779
1241
  const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm || formStore.canBeClaimed === true);
780
1242
  const isUnderwriterRole = computed(() => dataStore.isUnderwriter() || dataStore.isAdmin() || dataStore.isSupport());
781
- const insurancePremiumPerMonthRule = computed(() => (!!productConditionsForm.insurancePremiumPerMonth ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
1243
+ const insurancePremiumPerMonthRule = computed(() =>
1244
+ !!productConditionsForm.insurancePremiumPerMonth
1245
+ ? whichProduct.value === 'gons' || whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns'
1246
+ ? dataStore.rules.required
1247
+ : dataStore.rules.required.concat(dataStore.rules.sums)
1248
+ : [],
1249
+ );
782
1250
  const insurancePremiumPerMonthDisabled = computed(() => {
783
1251
  if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
784
1252
  return true;
@@ -788,34 +1256,40 @@ export default defineComponent({
788
1256
  }
789
1257
  return isDisabled.value;
790
1258
  });
791
- const requestedSumInsuredRule = computed(() => (!!productConditionsForm.requestedSumInsured ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
1259
+ const requestedSumInsuredRule = computed(() =>
1260
+ !!productConditionsForm.requestedSumInsured ? (whichProduct.value === 'gons' ? dataStore.rules.required : dataStore.rules.required.concat(dataStore.rules.sums)) : [],
1261
+ );
792
1262
  const fixInsSumRule = computed(() =>
793
1263
  !!productConditionsForm.fixInsSum
794
1264
  ? dataStore.rules.required.concat(dataStore.rules.sums, dataStore.rules.fixInsSumLimit(getNumber(productConditionsForm.fixInsSum as string), minInsSum.value))
795
1265
  : [],
796
1266
  );
1267
+ const agencyPartRule = computed(() => {
1268
+ if (formStore.lfb.add || isHalykBank) {
1269
+ return productConditionsForm.agentCommission === 0 ? [] : dataStore.rules.required;
1270
+ } else {
1271
+ return dataStore.rules.required.concat(dataStore.rules.numbers, dataStore.rules.agentCommission);
1272
+ }
1273
+ });
797
1274
  const amountAnnuityPayments = computed(() => (!!productConditionsForm.amountAnnuityPayments ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
798
1275
  const hasCalculated = computed(() => {
799
1276
  if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && productConditionsForm.requestedSumInsured === null) {
800
1277
  return !!productConditionsForm.insurancePremiumPerMonth;
801
1278
  }
1279
+ if (whichProduct.value === 'gons') {
1280
+ return false
1281
+ }
802
1282
  return !!productConditionsForm.requestedSumInsured && !!productConditionsForm.insurancePremiumPerMonth;
803
1283
  });
804
1284
  const hasProcessIndexRate = computed(() => {
805
- if (
806
- whichProduct.value === 'gons' ||
807
- whichProduct.value === 'halykkazyna' ||
808
- whichProduct.value === 'liferenta' ||
809
- whichProduct.value === 'lifebusiness' ||
810
- whichProduct.value === 'amuletlife' ||
811
- whichProduct.value === 'gns'
812
- ) {
813
- return false;
814
- }
815
- return true;
1285
+ if (whichProduct.value === 'baiterek' || whichProduct.value === 'bolashak') return true;
1286
+ return false;
816
1287
  });
817
1288
  const hasPaymentPeriod = computed(() => {
818
- if (whichProduct.value === 'halykkazyna') {
1289
+ if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'halykmycar') {
1290
+ return false;
1291
+ }
1292
+ if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
819
1293
  return false;
820
1294
  }
821
1295
  return true;
@@ -826,22 +1300,50 @@ export default defineComponent({
826
1300
  }
827
1301
  return true;
828
1302
  });
1303
+
1304
+ const hasRequestedSumInsured = computed(() => {
1305
+ if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
1306
+ return false;
1307
+ }
1308
+ return true;
1309
+ });
829
1310
  const hasRequestedSumInsuredInDollar = computed(() => {
830
1311
  if (whichProduct.value === 'halykkazyna') {
831
1312
  return true;
832
1313
  }
1314
+ if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
1315
+ return true;
1316
+ }
833
1317
  return false;
834
1318
  });
1319
+ const hasInsurancePremiumPerMonth = computed(() => {
1320
+ if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
1321
+ return false;
1322
+ }
1323
+ return true;
1324
+ });
835
1325
  const hasInsurancePremiumPerMonthInDollar = computed(() => {
836
1326
  if (whichProduct.value === 'halykkazyna') {
837
1327
  return true;
838
1328
  }
1329
+ if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
1330
+ return true;
1331
+ }
839
1332
  return false;
840
1333
  });
841
- const hasCurrency = computed(() => {
1334
+ const hasTariffName = computed(() => {
1335
+ if (whichProduct.value === 'halykmycar') {
1336
+ return true;
1337
+ }
1338
+ return false;
1339
+ });
1340
+ const hasCurrencySymbols = computed(() => {
842
1341
  if (whichProduct.value === 'halykkazyna') {
843
1342
  return true;
844
1343
  }
1344
+ if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
1345
+ return true;
1346
+ }
845
1347
  return false;
846
1348
  });
847
1349
  const hasAdbMultiply = computed(() => {
@@ -878,6 +1380,15 @@ export default defineComponent({
878
1380
  if (whichProduct.value === 'gons') {
879
1381
  return false;
880
1382
  }
1383
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1384
+ return false;
1385
+ }
1386
+ return true;
1387
+ });
1388
+ const hasDisabilityAdditive = computed(() => {
1389
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1390
+ return false;
1391
+ }
881
1392
  return true;
882
1393
  });
883
1394
  const hasAnnuityPayments = computed(() => {
@@ -910,7 +1421,7 @@ export default defineComponent({
910
1421
  return baseCondition.concat(dataStore.rules.coverPeriodFrom3to20);
911
1422
  }
912
1423
  if (whichProduct.value === 'halykkazyna') {
913
- return baseCondition.concat(dataStore.rules.coverPeriodFrom2to20);
1424
+ return baseCondition.concat(dataStore.rules.coverPeriodFrom1to20);
914
1425
  }
915
1426
  if (whichProduct.value === 'amuletlife') {
916
1427
  return baseCondition.concat(dataStore.rules.coverPeriodFrom1or5to15);
@@ -944,6 +1455,42 @@ export default defineComponent({
944
1455
  }
945
1456
  return dataStore.t('productConditionsForm.insurancePremiumAmount');
946
1457
  });
1458
+ const currencySymbolsLabel = computed(() => {
1459
+ if (whichProduct.value === 'gons') {
1460
+ return dataStore.t('productConditionsForm.exchangeRateSettlementDate');
1461
+ }
1462
+ return dataStore.t('productConditionsForm.dollarExchangeRateNBRK');
1463
+ });
1464
+ const lifeMultiplyLabel = computed(() => {
1465
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1466
+ return dataStore.t('percent') + `Life (смерть по любой причине) multiply`;
1467
+ }
1468
+ return dataStore.t('percent') + `Life Multiply`;
1469
+ });
1470
+ const lifeAdditiveLabel = computed(() => {
1471
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1472
+ return dataStore.t('percent') + `Life (смерть по любой причине) надбавка`;
1473
+ }
1474
+ return dataStore.t('percent') + `Life Additive`;
1475
+ });
1476
+ const disabilityMultiplyLabel = computed(() => {
1477
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1478
+ return dataStore.t('percent') + `Disability (инвалидность, временная утрата тр-ти, стойкая утрата тр-ти)`;
1479
+ }
1480
+ return dataStore.t('percent') + `Disability Multiply`;
1481
+ });
1482
+ const adbMultiplyLabel = computed(() => {
1483
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1484
+ return dataStore.t('percent') + `Accidental life multiply`;
1485
+ }
1486
+ return dataStore.t('percent') + `Adb Multiply`;
1487
+ });
1488
+ const adbAdditiveLabel = computed(() => {
1489
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1490
+ return dataStore.t('percent') + `Accidental life additional надбавка`;
1491
+ }
1492
+ return dataStore.t('percent') + `Adb Additive`;
1493
+ });
947
1494
  const isDisabledFixInsSum = computed(() => {
948
1495
  if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
949
1496
  return false;
@@ -991,11 +1538,23 @@ export default defineComponent({
991
1538
  return true;
992
1539
  });
993
1540
  const isDisabledAgentCommission = computed(() => {
1541
+ if (isHalykBank) {
1542
+ return true;
1543
+ }
1544
+ if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
1545
+ return true;
1546
+ }
994
1547
  if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns' || dataStore.isUnderwriter()) {
995
1548
  return false;
996
1549
  }
997
1550
  return isDisabled.value;
998
1551
  });
1552
+ const isDisabledInsStartDate = computed(() => {
1553
+ if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
1554
+ return true;
1555
+ }
1556
+ return isDisabled.value;
1557
+ });
999
1558
  const hasCalcSum = computed(() => {
1000
1559
  if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1001
1560
  return false;
@@ -1003,7 +1562,13 @@ export default defineComponent({
1003
1562
  return true;
1004
1563
  });
1005
1564
  const hasFixInsSum = computed(() => {
1006
- if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1565
+ if (!formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
1566
+ return true;
1567
+ }
1568
+ return false;
1569
+ });
1570
+ const hasPaidOrRefund = computed(() => {
1571
+ if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
1007
1572
  return true;
1008
1573
  }
1009
1574
  return false;
@@ -1027,37 +1592,70 @@ export default defineComponent({
1027
1592
  return dataStore.t('generalConditions');
1028
1593
  });
1029
1594
  const hasInsStartDate = computed(() => {
1030
- if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1595
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns' || whichProduct.value === 'halykmycar') {
1031
1596
  return true;
1032
1597
  }
1033
1598
  return false;
1034
1599
  });
1035
1600
  const hasInsEndDate = computed(() => {
1036
- if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1601
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns' || whichProduct.value === 'halykmycar') {
1037
1602
  return true;
1038
1603
  }
1039
1604
  return false;
1040
1605
  });
1041
-
1042
- const pensionCalculationParams = ref({
1043
- compulsoryContractAmount: pensionForm && pensionForm.compulsoryContractAmount && pensionForm.compulsoryContractAmount != 0 ? pensionForm.compulsoryContractAmount : null,
1044
- voluntaryContractAmount: pensionForm && pensionForm.voluntaryContractAmount && pensionForm.voluntaryContractAmount != 0 ? pensionForm.voluntaryContractAmount : null,
1045
- ownFundsRaisAmount: pensionForm && pensionForm.ownFundsRaisAmount && pensionForm.ownFundsRaisAmount != 0 ? pensionForm.ownFundsRaisAmount : null,
1046
- compulsoryProfContractAmount:
1047
- pensionForm && pensionForm.compulsoryProfContractAmount && pensionForm.compulsoryProfContractAmount != 0 ? pensionForm.compulsoryProfContractAmount : null,
1048
- transferContractAmount: pensionForm && pensionForm.transferContractAmount && pensionForm.transferContractAmount != 0 ? pensionForm.transferContractAmount : null,
1606
+ const hasCurrency = computed(() => {
1607
+ if (whichProduct.value === 'gons') {
1608
+ return true;
1609
+ }
1610
+ return false;
1611
+ });
1612
+ const hasContragentData = computed(() => {
1613
+ if (whichProduct.value === 'pensionannuitynew') {
1614
+ return true;
1615
+ }
1616
+ return false;
1617
+ });
1618
+ const isDisabledPaymentPeriod = computed(() => {
1619
+ if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
1620
+ return true;
1621
+ }
1622
+ return isDisabled.value;
1623
+ });
1624
+ const currencyListFiltered = computed(() => {
1625
+ return constants.currencyList;
1049
1626
  });
1050
1627
 
1051
- const pensionAmount = computed(() =>
1052
- pensionCalculationParams.value
1053
- ? (Number(pensionCalculationParams.value.compulsoryContractAmount) ?? 0) +
1054
- (Number(pensionCalculationParams.value.voluntaryContractAmount) ?? 0) +
1055
- (Number(pensionCalculationParams.value.ownFundsRaisAmount) ?? 0) +
1056
- (Number(pensionCalculationParams.value.compulsoryProfContractAmount) ?? 0) +
1057
- (Number(pensionCalculationParams.value.transferContractAmount) ?? 0)
1058
- : 0,
1628
+ const totalInsPremium = computed(() =>
1629
+ dataStore.getNumberWithSpaces(formatSpacedNumber(formStore.pensionApp?.amount) + formatSpacedNumber(formStore.pensionApp.slave?.amount)),
1059
1630
  );
1060
1631
 
1632
+ const isCompulsoryProfContractAmount = computed(() => {
1633
+ return Number(cleanWhiteSpace(pensionForm.value.compulsoryProfContractAmount)) > 0
1634
+ })
1635
+
1636
+ const transferContractsHasOppv = computed(() => {
1637
+ return transferContracts.value.length && transferContracts.value.some(item => item.transferContractIsOppv)
1638
+ })
1639
+
1640
+ const getContragent = async () => {
1641
+ const data = await dataStore.api.getContragentById(
1642
+ Number(route.query.which !== 'slave' ? formStore.applicationData.clientApp.insisId : formStore.applicationData.slave.clientApp.insisId),
1643
+ );
1644
+ if (data && data.items.length != 0) {
1645
+ contragentData.value = data.items[0];
1646
+ contragentData.value.gender = contragentData.value.gender === 1 ? dataStore.t('pension.male') : dataStore.t('pension.female');
1647
+ contragentData.value.birthDate = reformatDate(contragentData.value.birthDate);
1648
+ }
1649
+ };
1650
+
1651
+ const sumContractsAmount = (transferContracts: TransferContract[]) => {
1652
+ if (!transferContracts || !transferContracts.length) return 0;
1653
+ return transferContracts.reduce((accumulator, currentValue) => {
1654
+ const transferAmount = structuredClone(toRaw(currentValue));
1655
+ return accumulator + Number(String(transferAmount.transferContractAmount).replace(/\s/g, ''));
1656
+ }, 0);
1657
+ };
1658
+
1061
1659
  const formatTermValue = (term: number) => {
1062
1660
  if (term !== null) {
1063
1661
  const termNumber = Number(term);
@@ -1069,7 +1667,7 @@ export default defineComponent({
1069
1667
  const toStatement = async () => {
1070
1668
  const statementItem = dataStore.menuItems.find(i => i.id === 'statement');
1071
1669
  if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1072
- await router.push({ name: 'taskId-NewApp', params: route.params, query: { tab: 'statement' } });
1670
+ await router.push({ name: 'taskId-NewApp', params: route.params, query: { tab: 'statement', add: 'false' } });
1073
1671
  return;
1074
1672
  }
1075
1673
  if (whichProduct.value === 'gons') {
@@ -1088,7 +1686,7 @@ export default defineComponent({
1088
1686
  }
1089
1687
  };
1090
1688
 
1091
- const pickPanelValue = (item: Value) => {
1689
+ const pickPanelValue = async (item: Value) => {
1092
1690
  dataStore.rightPanel.open = false;
1093
1691
  isPanelOpen.value = false;
1094
1692
  isMultiplePanelOpen.value = false;
@@ -1100,14 +1698,31 @@ export default defineComponent({
1100
1698
  // @ts-ignore
1101
1699
  calculatorForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
1102
1700
  } else if (whichProduct.value === 'pensionannuitynew') {
1103
- // @ts-ignore
1104
- pensionForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
1701
+ if (currentPanel.value === 'transferContractCompany') {
1702
+ transferContracts.value[contractIndex.value].transferContractCompany = item;
1703
+ } else {
1704
+ // @ts-ignore
1705
+ pensionForm.value[currentPanel.value] = item.nameRu === null ? new Value() : item;
1706
+ }
1105
1707
  } else {
1106
1708
  // @ts-ignore
1107
1709
  productConditionsForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
1108
- if (currentPanel.value === 'paymentPeriod' && hasProcessIndexRate.value && item.code === 'single') {
1109
- const defaultIndexRate = dataStore.processIndexRate.find((i: any) => i.isDefault === true);
1110
- if (defaultIndexRate) productConditionsForm.processIndexRate = defaultIndexRate;
1710
+ if (currentPanel.value === 'paymentPeriod' && item.code === 'single') {
1711
+ if (hasProcessIndexRate.value) {
1712
+ const defaultIndexRate = dataStore.processIndexRate.find((i: any) => i.isDefault === true);
1713
+ if (defaultIndexRate) productConditionsForm.processIndexRate = defaultIndexRate;
1714
+ }
1715
+ if (whichProduct.value === 'bolashak') {
1716
+ const termCover = additionalTerms.value?.findIndex(i => i.coverTypeCode === 10);
1717
+ if (termCover !== -1) {
1718
+ const termList = await dataStore.getAdditionalInsuranceTermsAnswers(additionalTerms.value[termCover].coverTypeId);
1719
+ const defaultTermValue = termList?.find(i => i.isDefault === true);
1720
+ if (defaultTermValue) {
1721
+ additionalTerms.value[termCover].coverSumId = String(defaultTermValue.id);
1722
+ additionalTerms.value[termCover].coverSumName = String(defaultTermValue.nameRu);
1723
+ }
1724
+ }
1725
+ }
1111
1726
  }
1112
1727
  }
1113
1728
  };
@@ -1153,11 +1768,14 @@ export default defineComponent({
1153
1768
 
1154
1769
  additionalTerms.value[currentIndex.value].coverSumId = item.id as string;
1155
1770
  additionalTerms.value[currentIndex.value].coverSumName = item.nameRu as string;
1771
+ additionalTerms.value[currentIndex.value].coverSumNameKz = item.nameKz as string;
1156
1772
 
1157
1773
  if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1158
1774
  if (termValue.value && item.code === 'fixedinssum') {
1159
- if (termValue.value.coverTypeCode === 11) {
1775
+ if (termValue.value.coverTypeCode === 11 || termValue.value.coverTypeCode === 4) {
1160
1776
  subPanelList.value = constants.fixInsAmount.slice(0, 5);
1777
+ } else if (termValue.value.coverTypeCode !== 19) {
1778
+ subPanelList.value = constants.fixInsAmount.slice(0, 10);
1161
1779
  } else {
1162
1780
  subPanelList.value = constants.fixInsAmount;
1163
1781
  }
@@ -1331,7 +1949,7 @@ export default defineComponent({
1331
1949
  const calculatedPremiumDollar = getNumber(event.target.value as string);
1332
1950
  if (calculatedPremiumDollar) {
1333
1951
  productConditionsForm.insurancePremiumPerMonth = dataStore.getNumberWithSpaces(productConditionsForm.insurancePremiumPerMonth);
1334
- if (whichProduct.value === 'halykkazyna') {
1952
+ if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
1335
1953
  if (typeof dataStore.currencies.usd === 'number') {
1336
1954
  productConditionsForm.insurancePremiumPerMonthInDollar = dataStore.getNumberWithSpaces(calculatedPremiumDollar / dataStore.currencies.usd);
1337
1955
  } else {
@@ -1359,7 +1977,7 @@ export default defineComponent({
1359
1977
  const calculatedSumDollar = getNumber(event.target.value as string);
1360
1978
  if (calculatedSumDollar) {
1361
1979
  productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(productConditionsForm.requestedSumInsured);
1362
- if (whichProduct.value === 'halykkazyna') {
1980
+ if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
1363
1981
  if (typeof dataStore.currencies.usd === 'number') {
1364
1982
  productConditionsForm.requestedSumInsuredInDollar = dataStore.getNumberWithSpaces(calculatedSumDollar / dataStore.currencies.usd);
1365
1983
  } else {
@@ -1370,6 +1988,42 @@ export default defineComponent({
1370
1988
  }
1371
1989
  };
1372
1990
 
1991
+ const onInputPension = (event: Event, key: keyof PensionCalculation | 'pensionAmount', index?: number) => {
1992
+ if (event.target && 'value' in event.target && event.target.value) {
1993
+ const calcCheck = getNumber(event.target.value as string);
1994
+ if (calcCheck) {
1995
+ if (index !== undefined) {
1996
+ transferContracts.value[index].transferContractAmount = dataStore.getNumberWithSpaces(event.target.value) as string;
1997
+ transferSum.value = transferContracts.value.reduce((accumulator, { transferContractAmount }) => (accumulator += formatSpacedNumber(transferContractAmount)), 0);
1998
+ } else if (key === 'pensionAmount') {
1999
+ pensionForm.value.amount = dataStore.getNumberWithSpaces(event.target.value) ?? '0';
2000
+ } else {
2001
+ pensionForm.value[key] = dataStore.getNumberWithSpaces(event.target.value);
2002
+ }
2003
+ }
2004
+ } else {
2005
+ if (index !== undefined) {
2006
+ transferContracts.value[index].transferContractAmount = 0;
2007
+ transferSum.value = transferContracts.value.reduce((accumulator, { transferContractAmount }) => (accumulator += formatSpacedNumber(transferContractAmount)), 0);
2008
+ }
2009
+ }
2010
+ if (key !== 'pensionAmount' && !customPension.value) {
2011
+ if (firstAmount.value) {
2012
+ firstAmount.value = false;
2013
+ return;
2014
+ }
2015
+ pensionForm.value.amount =
2016
+ dataStore.getNumberWithSpaces(
2017
+ formatSpacedNumber(pensionForm.value.compulsoryContractAmount) +
2018
+ formatSpacedNumber(pensionForm.value.compulsoryProfContractAmount) +
2019
+ formatSpacedNumber(pensionForm.value.ownFundsRaisAmount) +
2020
+ formatSpacedNumber(pensionForm.value.transferContractAmount) +
2021
+ formatSpacedNumber(pensionForm.value.voluntaryContractAmount) +
2022
+ sumContractsAmount(transferContracts.value),
2023
+ ) ?? '';
2024
+ }
2025
+ };
2026
+
1373
2027
  const onInputFixInsSum = (event: Event) => {
1374
2028
  if (event.target && 'value' in event.target && event.target.value) {
1375
2029
  const calculatedFixInsSum = getNumber(event.target.value as string);
@@ -1394,6 +2048,21 @@ export default defineComponent({
1394
2048
  productConditionsForm.requestedSumInsuredInDollar = null;
1395
2049
  };
1396
2050
 
2051
+ const onClearPension = (key: keyof PensionCalculation | 'pensionAmount', index?: number) => {
2052
+ if (index) {
2053
+ transferContracts.value[index].transferContractAmount = 0;
2054
+ } else if (key === 'pensionAmount') {
2055
+ pensionForm.value.amount = '0';
2056
+ } else {
2057
+ pensionForm.value[key] = null;
2058
+
2059
+ // Clear isOwnAmountFromDividend when ownFundsRaisAmount is cleared
2060
+ if (key === 'ownFundsRaisAmount') {
2061
+ pensionForm.value.isOwnAmountFromDividend = null;
2062
+ }
2063
+ }
2064
+ };
2065
+
1397
2066
  const onClearSumDollar = () => {
1398
2067
  productConditionsForm.requestedSumInsured = null;
1399
2068
  };
@@ -1425,8 +2094,10 @@ export default defineComponent({
1425
2094
  };
1426
2095
 
1427
2096
  const filterTermConditions = (term: AddCover) => {
1428
- if (term.coverTypeCode === 10) {
1429
- return !!formStore.insuredForm.find((member: Member) => member.iin === formStore.policyholderForm.iin) === false;
2097
+ if (term.coverTypeCode === 10 && !props.isCalculator) {
2098
+ const isSinglePeriod = whichProduct.value === 'bolashak' ? productConditionsForm.paymentPeriod?.code === 'single' : false;
2099
+ const isDifferentClients = !!formStore.insuredForm.find((member: Member) => member.iin === formStore.policyholderForm.iin) === false;
2100
+ return isDifferentClients && !isSinglePeriod;
1430
2101
  }
1431
2102
  return true;
1432
2103
  };
@@ -1435,19 +2106,97 @@ export default defineComponent({
1435
2106
  if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1436
2107
  return String(term.coverTypeNameRu);
1437
2108
  }
1438
- return term.coverTypeName;
2109
+ return locale.value === 'ru' ? term.coverTypeName ?? '' : term.coverTypeNameKz ?? '';
2110
+ };
2111
+
2112
+ const addTransferContract = () => {
2113
+ transferContracts.value.push(new TransferContract());
2114
+ transferContracts.value[transferContracts.value.length - 1].transferContractDate = transferMaxDate.value;
2115
+ };
2116
+
2117
+ const removeTransferContract = (index: number) => {
2118
+ transferContracts.value.splice(index, 1);
2119
+ transferSum.value = transferContracts.value.reduce((accumulator, { transferContractAmount }) => (accumulator += formatSpacedNumber(transferContractAmount)), 0);
2120
+ };
2121
+
2122
+ const prepareTransferContracts = (transferContracts: Array<TransferContract>) => {
2123
+ const formatedContracts: Array<TransferContract> = [];
2124
+ if (transferContracts && transferContracts.length) {
2125
+ transferContracts.forEach(i => {
2126
+ formatedContracts.push({
2127
+ ...i,
2128
+ transferContractDate: constants.regex.isoDate.test(i.transferContractDate) ? i.transferContractDate : formatDate(i.transferContractDate)?.toISOString() ?? '',
2129
+ transferContractFirstPaymentDate: constants.regex.isoDate.test(i.transferContractFirstPaymentDate)
2130
+ ? i.transferContractFirstPaymentDate
2131
+ : formatDate(i.transferContractFirstPaymentDate)?.toISOString() ?? '',
2132
+ // @ts-ignore
2133
+ transferContractCompany:
2134
+ typeof i.transferContractCompany !== 'string' && 'nameRu' in i.transferContractCompany ? i.transferContractCompany.nameRu : i.transferContractCompany,
2135
+ transferContractCompanyId:
2136
+ // @ts-ignore
2137
+ typeof i.transferContractCompany !== 'string' && 'ids' in i.transferContractCompany ? i.transferContractCompany.ids : i.transferContractCompanyId,
2138
+ id: i.id ?? null,
2139
+ transferContractAmount: String(i.transferContractAmount).replace(/\s/g, ''),
2140
+ });
2141
+ });
2142
+ }
2143
+ return formatedContracts;
2144
+ };
2145
+
2146
+ const validateContractDate = (v: any) => {
2147
+ if (v && maxDate.value && formatDate(v) && formatDate(maxDate.value)) {
2148
+ const invalidDate = (formatDate(v) ?? new Date()) > (formatDate(maxDate.value) ?? new Date());
2149
+ if (invalidDate) return 'Дата заключения договора некорректна';
2150
+ }
2151
+ return true;
1439
2152
  };
1440
2153
 
2154
+ const isTruthyNumber = (value: any): boolean => {
2155
+ const num = Number(value?.toString().replace(/\s/g, ''));
2156
+ return !!num;
2157
+ }
2158
+
2159
+ const doesNeedEnpfNoteFile = (): boolean => {
2160
+ let needFile = false
2161
+
2162
+ if(
2163
+ dataStore.isProcessEditable(formStore.applicationData.statusCode) &&
2164
+ (isTruthyNumber(pensionForm.value.compulsoryProfContractAmount) ||
2165
+ isTruthyNumber(pensionForm.value.compulsoryContractAmount) ||
2166
+ transferContractsHasOppv.value
2167
+ )
2168
+ ) {
2169
+ needFile = true
2170
+ }
2171
+
2172
+ return needFile;
2173
+ }
2174
+
1441
2175
  const submitForm = async () => {
2176
+ if (whichProduct.value === 'pensionannuitynew') {
2177
+ const needsEnpfNoteFile = doesNeedEnpfNoteFile()
2178
+ if(needsEnpfNoteFile && !enpfNoteFile.value) {
2179
+ dataStore.showToaster('error', 'Необходимо вложить Выписка ЕНПФ');
2180
+ return;
2181
+ }
2182
+ const isValid = !!(formatSpacedNumber(pensionForm.value.compulsoryContractAmount) || formatSpacedNumber(pensionForm.value.compulsoryProfContractAmount) || transferContracts.value?.length)
2183
+ if(formStore.applicationData.processCode !== 24 && !isValid) {
2184
+ dataStore.showToaster('error', 'Отказ')
2185
+ return
2186
+ }
2187
+ }
1442
2188
  vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
1443
2189
  if (v.valid) {
1444
2190
  if (whichProduct.value === 'lifetrip') {
1445
2191
  if (calculatorForm.type.code === 'Single' && calculatorForm.startDate && calculatorForm.endDate) {
1446
2192
  const formattedStartDate = formatDate(calculatorForm.startDate);
1447
2193
  const formattedEndDate = formatDate(calculatorForm.endDate);
1448
- if (formattedStartDate && formattedEndDate && formattedStartDate.getTime() > formattedEndDate.getTime()) {
2194
+ if (formattedStartDate && formattedEndDate && formattedStartDate.getTime() >= formattedEndDate.getTime()) {
1449
2195
  return dataStore.showToaster('error', dataStore.t('toaster.startMoreEnd'));
1450
2196
  }
2197
+ if (calculatorForm.days !== productConditionsForm.getSingleTripDays()) {
2198
+ return dataStore.showToaster('error', dataStore.t('toaster.daysPickAgain'));
2199
+ }
1451
2200
  }
1452
2201
  if (dataStore.isTask()) {
1453
2202
  await dataStore.calculatePrice(route.params.taskId as string);
@@ -1455,41 +2204,116 @@ export default defineComponent({
1455
2204
  await dataStore.calculatePrice();
1456
2205
  }
1457
2206
  } else if (whichProduct.value === 'pensionannuitynew') {
1458
- if (
1459
- pensionCalculationParams.value &&
1460
- pensionCalculationParams.value.compulsoryProfContractAmount &&
1461
- pensionForm &&
1462
- pensionForm.compulsoryProfContractAmount != 0 &&
1463
- pensionForm.compulsoryProfMonthCount < 60
1464
- ) {
1465
- dataStore.showToaster('error', 'Минимальное число дней уплаты ОППВ должно быть больше 60');
1466
- return;
2207
+ if (contractDate.value && maxDate.value && formatDate(contractDate.value) && formatDate(maxDate.value)) {
2208
+ const invalidDate = (formatDate(contractDate.value) ?? new Date()) > (formatDate(maxDate.value) ?? new Date());
2209
+ if (invalidDate) {
2210
+ dataStore.showToaster('error', 'Дата заключения договора некорректна');
2211
+ return;
2212
+ }
1467
2213
  }
1468
- const data = {
1469
- ...pensionForm,
1470
- ...(pensionCalculationParams.value = {
1471
- ...pensionCalculationParams.value,
1472
- compulsoryContractAmount: Number(pensionCalculationParams.value.compulsoryContractAmount),
1473
- voluntaryContractAmount: Number(pensionCalculationParams.value.voluntaryContractAmount),
1474
- ownFundsRaisAmount: Number(pensionCalculationParams.value.ownFundsRaisAmount),
1475
- compulsoryProfContractAmount: Number(pensionCalculationParams.value.compulsoryProfContractAmount),
1476
- transferContractAmount: Number(pensionCalculationParams.value.transferContractAmount),
1477
- }),
1478
- transferContractCompany: pensionForm.transferContractCompany?.nameRu ?? null,
1479
- transferContractDate: transferContractDate.value ? formatDate(transferContractDate.value) : null,
1480
- transferContractFirstPaymentDate: transferContractFirstPaymentDate.value ? formatDate(transferContractFirstPaymentDate.value) : null,
2214
+ if (transferContracts.value && transferContracts.value.length) {
2215
+ transferContracts.value.forEach(i => {
2216
+ if (formatDate(i.transferContractDate) != null && formatDate(transferMaxDate.value)) {
2217
+ const invalidDate = (formatDate(i.transferContractDate) ?? new Date()) > (formatDate(transferMaxDate.value) ?? new Date());
2218
+ if (invalidDate) {
2219
+ dataStore.showToaster('error', 'Дата заключения договора КСЖ некорректна');
2220
+ return;
2221
+ }
2222
+ }
2223
+ });
2224
+ }
2225
+ if (!pensionForm.value.compulsoryProfContractAmount) pensionForm.value.compulsoryProfMonthCount = 0;
2226
+ const pensionData = {
2227
+ ...pensionForm.value,
2228
+ ...{
2229
+ compulsoryContractAmount: formatSpacedNumber(pensionForm.value.compulsoryContractAmount),
2230
+ voluntaryContractAmount: formatSpacedNumber(pensionForm.value.voluntaryContractAmount),
2231
+ ownFundsRaisAmount: formatSpacedNumber(pensionForm.value.ownFundsRaisAmount),
2232
+ compulsoryProfContractAmount: formatSpacedNumber(pensionForm.value.compulsoryProfContractAmount),
2233
+ transferContractAmount: formatSpacedNumber(pensionForm.value.transferContractAmount),
2234
+ transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
2235
+ },
2236
+ amount: formatSpacedNumber(pensionForm.value.amount),
2237
+ contractDate: formatDate(contractDate.value ?? ''),
1481
2238
  };
1482
- await dataStore.setApplication(data, true);
2239
+ const data = isSlavePensionForm.value
2240
+ ? {
2241
+ ...formStore.pensionApp,
2242
+ transferContracts: prepareTransferContracts(formStore.pensionApp.transferContracts),
2243
+ slave: pensionData,
2244
+ amount: formatSpacedNumber(formStore.pensionApp?.amount),
2245
+ compulsoryContractAmount: formatSpacedNumber(formStore.pensionApp?.compulsoryContractAmount),
2246
+ voluntaryContractAmount: formatSpacedNumber(formStore.pensionApp?.voluntaryContractAmount),
2247
+ ownFundsRaisAmount: formatSpacedNumber(formStore.pensionApp?.ownFundsRaisAmount),
2248
+ compulsoryProfContractAmount: formatSpacedNumber(formStore.pensionApp?.compulsoryProfContractAmount),
2249
+ transferContractAmount: formatSpacedNumber(formStore.pensionApp?.transferContractAmount),
2250
+ transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
2251
+ }
2252
+ : {
2253
+ ...pensionData,
2254
+ transferContracts: prepareTransferContracts(transferContracts.value),
2255
+ slave: !!formStore.pensionApp?.slave
2256
+ ? {
2257
+ ...formStore.pensionApp?.slave,
2258
+ contractDate: pensionData.contractDate,
2259
+ amount: formatSpacedNumber(formStore.pensionApp?.slave?.amount),
2260
+ compulsoryContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.compulsoryContractAmount),
2261
+ voluntaryContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.voluntaryContractAmount),
2262
+ ownFundsRaisAmount: formatSpacedNumber(formStore.pensionApp?.slave?.ownFundsRaisAmount),
2263
+ compulsoryProfContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.compulsoryProfContractAmount),
2264
+ transferContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.transferContractAmount),
2265
+ transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
2266
+ }
2267
+ : null,
2268
+ };
2269
+ if (!!data.slave) {
2270
+ data.slave.transferContracts = prepareTransferContracts(isSlavePensionForm.value ? transferContracts.value : data.slave.transferContracts);
2271
+ const difference = Math.abs(
2272
+ formatSpacedNumber(formStore.pensionApp?.amount) + formatSpacedNumber(formStore.pensionApp?.slave?.amount) - formatSpacedNumber(pensionForm.value.amount),
2273
+ );
2274
+ if (customPension.value) {
2275
+ isSlavePensionForm.value ? (data.slave.amount = formatSpacedNumber(pensionForm.value.amount)) : (data.amount = formatSpacedNumber(pensionForm.value.amount));
2276
+ const customSum = sumPensionData(data) + sumPensionData(data.slave);
2277
+ if (formatSpacedNumber(totalInsPremium.value) !== customSum) {
2278
+ return dataStore.showToaster('error', 'Cтраховая премия не соответсвует общей страховой премии');
2279
+ }
2280
+ if (!isSlavePensionForm.value) {
2281
+ data.slave.amount = difference;
2282
+ } else {
2283
+ data.amount = difference;
2284
+ }
2285
+ } else {
2286
+ const amount = isSlavePensionForm.value ? data.slave.amount : data.amount;
2287
+ if (formatSpacedNumber(pensionForm.value.amount) != amount) {
2288
+ data.slave.amount = sumPensionData(data.slave);
2289
+ data.amount = sumPensionData(data);
2290
+ }
2291
+ }
2292
+ const isParentValid = validatePensionForm(data, 'Заполните условия первого страхователя');
2293
+ const isSlaveValid = validatePensionForm(data.slave, 'Заполните условия второго страхователя');
2294
+ if (!isParentValid || !isSlaveValid) {
2295
+ return;
2296
+ }
2297
+ const isApplicationSaved = await dataStore.setApplication(data, true);
2298
+ if (isApplicationSaved === false) return;
2299
+ customPension.value = false;
2300
+ } else {
2301
+ const isApplicationSaved = await dataStore.setApplication(data, true);
2302
+ if (isApplicationSaved === false) return;
2303
+ }
2304
+ await dataStore.getApplicationData(String(route.params.taskId), false, false, false, true);
2305
+ dateOfBegin.value = reformatDate(formStore.applicationData.pensionApp.dateOfBegin);
2306
+ dividendSchedules.value = await dataStore.getDividendSchedule();
1483
2307
  } else {
1484
2308
  if (whichSum.value === 'requestedSumInsured') {
1485
2309
  productConditionsForm.insurancePremiumPerMonth = null;
1486
- if (whichProduct.value === 'halykkazyna') {
2310
+ if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
1487
2311
  productConditionsForm.insurancePremiumPerMonthInDollar = null;
1488
2312
  }
1489
2313
  }
1490
2314
  if (whichSum.value === 'insurancePremiumPerMonth') {
1491
2315
  productConditionsForm.requestedSumInsured = null;
1492
- if (whichProduct.value === 'halykkazyna') {
2316
+ if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
1493
2317
  productConditionsForm.requestedSumInsuredInDollar = null;
1494
2318
  }
1495
2319
  }
@@ -1555,7 +2379,9 @@ export default defineComponent({
1555
2379
  recalculationData.riskGroup = productConditionsForm.riskGroup?.id ? productConditionsForm.riskGroup.id : 1;
1556
2380
  isCalculating.value = true;
1557
2381
  if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1558
- await dataStore.calculate(route.params.taskId as string);
2382
+ const setApplicationData = dataStore.getConditionsData();
2383
+ const hasSetApplication = await dataStore.setApplication(setApplicationData);
2384
+ if (hasSetApplication && !isHalykBank) await dataStore.calculate(route.params.taskId as string);
1559
2385
  additionalTerms.value = formStore.additionalInsuranceTerms;
1560
2386
  } else {
1561
2387
  await dataStore.reCalculate(formStore.applicationData.processInstanceId, recalculationData, route.params.taskId as string, whichSum.value);
@@ -1569,12 +2395,11 @@ export default defineComponent({
1569
2395
  additionalTerms.value = formStore.additionalInsuranceTermsWithout;
1570
2396
  } else {
1571
2397
  if (dataStore.isProcessEditable(formStore.applicationData.statusCode)) {
1572
- await dataStore.calculate(route.params.taskId as string);
2398
+ await dataStore.calculate(route.params.taskId as string, isHalykBank);
1573
2399
  additionalTerms.value = formStore.additionalInsuranceTerms;
1574
2400
  }
1575
2401
  }
1576
2402
  }
1577
-
1578
2403
  isCalculating.value = false;
1579
2404
  } else {
1580
2405
  const errors = document.querySelector('.v-input--error');
@@ -1598,75 +2423,250 @@ export default defineComponent({
1598
2423
  });
1599
2424
  };
1600
2425
 
1601
- onMounted(async () => {
1602
- if (props.isCalculator === true) {
1603
- if (dataStore.isCalculator) {
1604
- clearFields();
1605
- }
1606
- if (whichProduct.value !== 'lifetrip' && whichProduct.value !== 'pensionannuitynew') {
1607
- if (
1608
- (dataStore.isCalculator || route.params.taskId === '0' || fromIndexPage.value) &&
1609
- productConditionsForm.requestedSumInsured === null &&
1610
- productConditionsForm.insurancePremiumPerMonth === null
1611
- ) {
1612
- // @ts-ignore
1613
- const defaultData = await dataStore.getDefaultCalculationData(true, whichProduct.value);
1614
- if (!defaultData) {
1615
- dataStore.showToaster('error', 'Отсутствуют базовые данные');
1616
- return;
1617
- }
1618
- formStore.additionalInsuranceTermsWithout = defaultData.addCovers;
1619
- productConditionsForm.requestedSumInsured = defaultData.amount;
1620
- productConditionsForm.insurancePremiumPerMonth = defaultData.premium;
1621
- const indexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
1622
- if (indexRate) productConditionsForm.processIndexRate = indexRate;
1623
- const paymendPeriod = dataStore.processPaymentPeriod.find(i => i.id === defaultData.paymentPeriodId);
1624
- if (paymendPeriod) productConditionsForm.paymentPeriod = paymendPeriod;
1625
- if (defaultData.signDate) {
1626
- productConditionsForm.signDate = reformatDate(defaultData.signDate);
1627
- }
1628
- if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1629
- productConditionsForm.coverPeriod = defaultData.insTermInMonth ?? null;
1630
- productConditionsForm.insurancePremiumPerMonth = null;
2426
+ const validatePensionForm = (data: any, text: string) => {
2427
+ if (!data.amount || !data.guaranteedPeriod) {
2428
+ dataStore.showToaster('error', text);
2429
+ return false;
2430
+ }
2431
+ return true;
2432
+ };
2433
+
2434
+ const sumPensionData = (data: any) => {
2435
+ return (
2436
+ formatSpacedNumber(data.ownFundsRaisAmount) +
2437
+ formatSpacedNumber(data.voluntaryContractAmount) +
2438
+ formatSpacedNumber(data.compulsoryContractAmount) +
2439
+ formatSpacedNumber(data.compulsoryProfContractAmount) +
2440
+ sumContractsAmount(data.transferContracts)
2441
+ );
2442
+ };
2443
+
2444
+ const onFileChange = async (event: InputEvent) => {
2445
+ if (event && event.target) {
2446
+ const file = (event.target as HTMLInputElement).files?.[0];
2447
+ if (file) {
2448
+ if (file.type !== constants.fileTypes.pdf) {
2449
+ return dataStore.showToaster('error', dataStore.t('toaster.onlyPDF'), 6000);
2450
+ }
2451
+ dataStore.isLoading = true;
2452
+ try {
2453
+ if(isCompulsoryProfContractAmount.value || transferContractsHasOppv.value) {
2454
+ await setOppvCount(file)
2455
+ } else {
2456
+ await uploadFile(file)
1631
2457
  }
2458
+ await dataStore.getSignedDocList(formStore.applicationData.processInstanceId, formStore.applicationData.slave?.processInstanceId);
2459
+ dataStore.showToaster('success', dataStore.t('toaster.successOperation'));
2460
+ } finally {
2461
+ dataStore.isLoading = false;
1632
2462
  }
1633
2463
  }
1634
2464
  }
1635
- additionalTerms.value = props.isCalculator ? formStore.additionalInsuranceTermsWithout : formStore.additionalInsuranceTerms;
1636
- if (!!productConditionsForm.insurancePremiumPerMonth) {
1637
- whichSum.value = 'insurancePremiumPerMonth';
1638
- }
1639
- if (!!productConditionsForm.requestedSumInsured) {
1640
- whichSum.value = 'requestedSumInsured';
1641
- }
1642
- if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && !productConditionsForm.requestedSumInsured) {
1643
- whichSum.value = 'requestedSumInsured';
2465
+ };
2466
+ const setOppvCount = async (file: File) => {
2467
+ const result = await dataStore.setOppvCount(
2468
+ { file },
2469
+ isSlavePensionForm.value ? formStore.applicationData.slave.processInstanceId : formStore.applicationData.processInstanceId,
2470
+ );
2471
+ if (typeof result === 'number') {
2472
+ pensionForm.value.compulsoryProfMonthCount = result;
1644
2473
  }
1645
- if (dataStore.isCalculator) {
1646
- dataStore.processCode = constants.products[whichProduct.value as keyof typeof constants.products];
1647
- await dataStore.getProcessPaymentPeriod();
2474
+ }
2475
+ const uploadFile = async (file: File) => {
2476
+ const formData = new FormData();
2477
+ const information: any = [];
2478
+ const uuidV4 = uuid.v4();
2479
+ formData.append('file', file);
2480
+ const ext = file.name.substring(file.name.lastIndexOf('.'));
2481
+ const selectedDocument = dataStore.dicFileTypeList.find((i: Value) => i.code === '8');
2482
+ information.push({
2483
+ identifier: `${uuidV4}${ext}`,
2484
+ iin: contragentData.value?.iin ? contragentData.value?.iin.replaceAll('-', '') : null,
2485
+ processInstanceId: formStore.applicationData.processInstanceId,
2486
+ fileTypeCode: selectedDocument ? selectedDocument.code : null,
2487
+ fileTypeId: selectedDocument ? selectedDocument.id : null,
2488
+ fileName: file.name,
2489
+ });
2490
+ formData.append('fileData', JSON.stringify(information));
2491
+ await dataStore.uploadFiles(formData, false);
2492
+ }
2493
+ const openFileActionsPanel = async (document: DocumentItem) => {
2494
+ dataStore.rightPanel.title = document.fileTypeName!;
2495
+ dataStore.rightPanel.open = true;
2496
+ isFileActionsPanelOpen.value = true;
2497
+ dataStore.panelAction = null;
2498
+ };
2499
+ const getDoc = async (type: FileActions) => {
2500
+ if (enpfNoteFile.value) {
2501
+ documentLoading.value = true;
2502
+ const fileExtension = enpfNoteFile.value.fileName!.match(/\.([0-9a-z]+)(?:[\?#]|$)/i)![1];
2503
+ await dataStore.getDoc(enpfNoteFile.value, type, fileExtension);
2504
+ documentLoading.value = false;
1648
2505
  }
1649
- if (whichProduct.value === 'halykkazyna') {
1650
- const kazynaPaymentPeriod = dataStore.processPaymentPeriod.find(i => i.code === 'single');
1651
- if (kazynaPaymentPeriod) productConditionsForm.paymentPeriod = kazynaPaymentPeriod;
1652
- await dataStore.getCurrencies();
2506
+ };
2507
+ const deleteFile = async () => {
2508
+ if (enpfNoteFile.value) {
2509
+ const data = {
2510
+ id: enpfNoteFile.value.id,
2511
+ processInstanceId: enpfNoteFile.value.processInstanceId,
2512
+ iin: enpfNoteFile.value.iin ?? '',
2513
+ };
2514
+ await dataStore.deleteFile(data);
2515
+ formStore.signedDocumentList = formStore.signedDocumentList.filter(doc => doc.id !== data.id)
2516
+ deletionDialog.value = false;
2517
+ isFileActionsPanelOpen.value = false;
2518
+ dataStore.rightPanel.open = false;
2519
+ dataStore.panelAction = null;
2520
+ await dataStore.api.pensionannuityNew.resetApplicationData(formStore.applicationData.processInstanceId);
2521
+ await dataStore.getApplicationData(String(route.params.taskId), false, false, false, true);
2522
+ await dataStore.getSignedDocList(formStore.applicationData.processInstanceId, formStore.applicationData.slave?.processInstanceId);
1653
2523
  }
1654
- if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1655
- productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(
1656
- formStore.lfb.clients.reduce((sum: number, i: any) => {
1657
- return sum + Number(i.insSum);
1658
- }, 0),
1659
- );
2524
+ };
2525
+
2526
+ onMounted(async () => {
2527
+ try {
2528
+ if (hasContragentData.value) await getContragent();
2529
+ if (props.isCalculator === true) {
2530
+ isLoading.value = true;
2531
+ if (dataStore.isCalculator) {
2532
+ clearFields();
2533
+ }
2534
+ if (whichProduct.value === 'gons') {
2535
+ formStore.isDisabled.productConditionsForm = false;
2536
+ dataStore.setFormsDisabled(false);
2537
+ }
2538
+ if (whichProduct.value !== 'lifetrip' && whichProduct.value !== 'pensionannuitynew') {
2539
+ if (
2540
+ (dataStore.isCalculator || route.params.taskId === '0' || fromIndexPage.value) &&
2541
+ productConditionsForm.requestedSumInsured === null &&
2542
+ productConditionsForm.insurancePremiumPerMonth === null
2543
+ ) {
2544
+ // @ts-ignore
2545
+ const defaultData = await dataStore.getDefaultCalculationData(true, whichProduct.value);
2546
+ if (!defaultData) {
2547
+ dataStore.showToaster('error', 'Отсутствуют базовые данные');
2548
+ return;
2549
+ }
2550
+ formStore.additionalInsuranceTermsWithout = defaultData.addCovers;
2551
+ productConditionsForm.requestedSumInsured = defaultData.amount;
2552
+ productConditionsForm.insurancePremiumPerMonth = defaultData.premium;
2553
+ const indexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
2554
+ if (indexRate) productConditionsForm.processIndexRate = indexRate;
2555
+ const paymendPeriod = dataStore.processPaymentPeriod.find(i => i.id === defaultData.paymentPeriodId);
2556
+ if (paymendPeriod) productConditionsForm.paymentPeriod = paymendPeriod;
2557
+ if (defaultData.signDate) {
2558
+ productConditionsForm.signDate = reformatDate(defaultData.signDate);
2559
+ }
2560
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
2561
+ productConditionsForm.coverPeriod = defaultData.insTermInMonth ?? null;
2562
+ productConditionsForm.insurancePremiumPerMonth = null;
2563
+ }
2564
+ }
2565
+ }
2566
+ }
2567
+ additionalTerms.value = props.isCalculator ? formStore.additionalInsuranceTermsWithout : formStore.additionalInsuranceTerms;
2568
+ if (!!productConditionsForm.requestedSumInsured) {
2569
+ whichSum.value = 'requestedSumInsured';
2570
+ }
2571
+ if (!!productConditionsForm.insurancePremiumPerMonth) {
2572
+ whichSum.value = 'insurancePremiumPerMonth';
2573
+ }
2574
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
2575
+ if (!productConditionsForm.requestedSumInsured) {
2576
+ whichSum.value = 'requestedSumInsured';
2577
+ }
2578
+ if (!formStore.lfb.add) {
2579
+ const apiDate = await dataStore.api.getCloseDate();
2580
+ const minDate = new Date(apiDate);
2581
+ closeDate.value = minDate.setDate(minDate.getDate() + 1);
2582
+ }
2583
+ }
2584
+ if (dataStore.isCalculator) {
2585
+ dataStore.processCode = constants.products[whichProduct.value as keyof typeof constants.products];
2586
+ await dataStore.getProcessPaymentPeriod();
2587
+ }
2588
+ if (
2589
+ formStore.productConditionsForm.requestedSumInsured === null &&
2590
+ formStore.productConditionsForm.insurancePremiumPerMonth === null &&
2591
+ (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons')
2592
+ ) {
2593
+ await dataStore.getCurrencies();
2594
+ }
2595
+ if (whichProduct.value === 'halykkazyna') {
2596
+ const kazynaPaymentPeriod = dataStore.processPaymentPeriod.find(i => i.code === 'single');
2597
+ if (kazynaPaymentPeriod) productConditionsForm.paymentPeriod = kazynaPaymentPeriod;
2598
+ }
2599
+ if (!formStore.lfb.add && !isHalykBank && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
2600
+ productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(
2601
+ formStore.lfb.clients.reduce((sum: number, i: any) => {
2602
+ return sum + Number(i.insSum);
2603
+ }, 0),
2604
+ );
2605
+ }
2606
+ if (whichProduct.value === 'gons') {
2607
+ const response = await dataStore.api.availableToAccureStartEducationalCapital(formStore.applicationData.processInstanceId);
2608
+ hasEduCapitalConsent.value = response.isAllowed;
2609
+ }
2610
+ if (whichProduct.value === 'pensionannuitynew') {
2611
+ contractDate.value = reformatDate(pensionForm.value.contractDate ?? '');
2612
+ dateOfBegin.value = reformatDate(pensionForm.value.dateOfBegin);
2613
+ transferContractDate.value = reformatDate(pensionForm.value.transferContractDate);
2614
+ transferContractFirstPaymentDate.value = reformatDate(pensionForm.value.transferContractFirstPaymentDate ?? '');
2615
+ maxDate.value = await dataStore.getVariableData(formStore.applicationData.processCode ?? 19);
2616
+ dividendPeriods.value = await dataStore.getProcessDividendPeriods();
2617
+ if (pensionForm.value.dividendId) {
2618
+ dividendSchedules.value = await dataStore.getDividendSchedule();
2619
+ }
2620
+ if (!transferContracts.value.length && pensionForm.value.transferContracts && pensionForm.value.transferContracts.length) {
2621
+ pensionForm.value.transferContracts.forEach((contract: TransferContract) => {
2622
+ transferContracts.value.push({
2623
+ ...contract,
2624
+ transferContractDate: constants.regex.isoDate.test(contract.transferContractDate) ? reformatDate(contract.transferContractDate)! : contract.transferContractDate,
2625
+ transferContractFirstPaymentDate: constants.regex.isoDate.test(contract.transferContractFirstPaymentDate)
2626
+ ? reformatDate(contract.transferContractFirstPaymentDate)!
2627
+ : contract.transferContractFirstPaymentDate,
2628
+ transferContractCompany:
2629
+ typeof contract.transferContractCompany === 'string' ? ({ nameRu: contract.transferContractCompany } as any) : contract.transferContractCompany,
2630
+ transferContractAmount: dataStore.getNumberWithSpaces(contract.transferContractAmount) ?? '',
2631
+ });
2632
+ });
2633
+ }
2634
+ await dataStore.getSignedDocList(formStore.applicationData.processInstanceId, formStore.applicationData.slave?.processInstanceId);
2635
+ }
2636
+ } catch (err) {
2637
+ console.log(err);
2638
+ } finally {
2639
+ isLoading.value = false;
1660
2640
  }
1661
- if (whichProduct.value === 'pensionannuitynew') {
1662
- contractDate.value = reformatDate(formStore.applicationData.pensionApp.contractDate);
1663
- dateOfBegin.value = reformatDate(formStore.applicationData.pensionApp.dateOfBegin);
1664
- transferContractDate.value = reformatDate(formStore.applicationData.pensionApp.transferContractDate);
1665
- transferContractFirstPaymentDate.value = reformatDate(formStore.applicationData.pensionApp.transferContractFirstPaymentDate);
1666
- maxDate.value = await dataStore.getVariableData(formStore.applicationData.processCode ?? 19);
2641
+ });
2642
+ watch(isSlavePensionForm, newVal => {
2643
+ if (newVal) {
2644
+ transferContracts.value = formStore.pensionApp.slave.transferContracts;
2645
+ } else {
2646
+ transferContracts.value = formStore.pensionApp.transferContracts;
1667
2647
  }
1668
2648
  });
1669
2649
 
2650
+ watch(
2651
+ transferContracts,
2652
+ newVal => {
2653
+ if (!isDisabled.value) {
2654
+ if (isSlavePensionForm.value) {
2655
+ formStore.pensionApp.slave.transferContracts = newVal;
2656
+ } else {
2657
+ formStore.pensionApp.transferContracts = newVal;
2658
+ }
2659
+ }
2660
+ },
2661
+ { deep: true },
2662
+ );
2663
+
2664
+ watch(
2665
+ () => pensionForm.value?.amount,
2666
+ val => {
2667
+ if (val) pensionForm.value.amount = dataStore.getNumberWithSpaces(val);
2668
+ },
2669
+ );
1670
2670
  watch(
1671
2671
  () => productConditionsForm.amountOfInsurancePremium,
1672
2672
  val => {
@@ -1697,6 +2697,23 @@ export default defineComponent({
1697
2697
  { immediate: true },
1698
2698
  );
1699
2699
 
2700
+ if (hasCurrency.value) {
2701
+ watch(
2702
+ () => productConditionsForm.currency,
2703
+ async val => {
2704
+ if (val.code === 'USD') {
2705
+ if (!dataStore.processPaymentPeriod.length) {
2706
+ await dataStore.getProcessPaymentPeriod();
2707
+ }
2708
+ const paymentPeriod = dataStore.processPaymentPeriod.find(item => item.nameRu === 'единовременно');
2709
+ if (paymentPeriod) {
2710
+ productConditionsForm.paymentPeriod = paymentPeriod;
2711
+ }
2712
+ }
2713
+ },
2714
+ );
2715
+ }
2716
+
1700
2717
  if (hasInsStartDate.value) {
1701
2718
  watch(
1702
2719
  () => productConditionsForm.calcDate,
@@ -1706,6 +2723,9 @@ export default defineComponent({
1706
2723
  formattedStartDate?.setFullYear(formattedStartDate?.getFullYear() + 1);
1707
2724
  formattedStartDate?.setDate(formattedStartDate?.getDate() - 1);
1708
2725
  productConditionsForm.contractEndDate = reformatDate(String(formattedStartDate));
2726
+ if (formStore.applicationData.policyAppDto?.mainPremiumWithCommission !== 0) {
2727
+ dataStore.showToaster('error', dataStore.t('toaster.needToRecalculate'), 2000);
2728
+ }
1709
2729
  }
1710
2730
  },
1711
2731
  );
@@ -1730,6 +2750,8 @@ export default defineComponent({
1730
2750
  async val => {
1731
2751
  if (val?.length && val.every(option => option.id != 0) && calculatorForm.type?.nameRu != null) {
1732
2752
  await dataStore.getTripInsuredAmount();
2753
+ } else {
2754
+ calculatorForm.amount = new Value();
1733
2755
  }
1734
2756
  },
1735
2757
  { deep: true },
@@ -1763,8 +2785,67 @@ export default defineComponent({
1763
2785
  );
1764
2786
  }
1765
2787
 
2788
+ if (whichProduct.value === 'pensionannuitynew') {
2789
+ watch(
2790
+ () => pensionForm.value.guaranteedPeriod,
2791
+ async () => {
2792
+ if (formStore.applicationData.processCode === 24) {
2793
+ await dataStore.reCalculateRefund(
2794
+ Number(pensionForm.value.parentContractAmount),
2795
+ Number(pensionForm.value.parentContractMainAmount),
2796
+ pensionForm.value.guaranteedPeriod,
2797
+ pensionForm.value.transferContractIsOppv,
2798
+ pensionForm.value.compulsoryProfMonthCount ?? 0,
2799
+ );
2800
+ }
2801
+ },
2802
+ );
2803
+ watch(
2804
+ () => contractDate.value,
2805
+ (val, oldVal) => {
2806
+ if (val !== null && val !== undefined && val.length === 10 && oldVal != undefined && !isSlavePensionForm.value) {
2807
+ const formattedContractDate = formatDate(val);
2808
+ if (formattedContractDate) {
2809
+ formattedContractDate.setDate(formattedContractDate.getDate() + 20);
2810
+ dateOfBegin.value = reformatDate(String(formattedContractDate));
2811
+ }
2812
+ }
2813
+ },
2814
+ { immediate: true },
2815
+ );
2816
+ watch(
2817
+ () => pensionForm.value.ownFundsRaisAmount,
2818
+ val => {
2819
+ if (val && val.replace(/\s/g, '') > 0) {
2820
+ pensionForm.value.isOwnAmountFromDividend = true;
2821
+ } else {
2822
+ pensionForm.value.isOwnAmountFromDividend = false;
2823
+ }
2824
+ },
2825
+ );
2826
+ }
2827
+
2828
+ if(whichProduct.value === 'halykkazyna') {
2829
+ watch(
2830
+ () => productConditionsForm.coverPeriod,
2831
+ (val) => {
2832
+ if(!val || val > 5) {
2833
+ productConditionsForm.hasEnhancedGift = false
2834
+ }
2835
+ }
2836
+ );
2837
+ watch(
2838
+ () => productConditionsForm.insurancePremiumPerMonth,
2839
+ (val) => {
2840
+ if(!val || Number(val) < minEnhancedGiftSum) {
2841
+ productConditionsForm.hasEnhancedGift = false
2842
+ }
2843
+ }
2844
+ )
2845
+ }
2846
+
1766
2847
  const copyRedirect = async () => {
1767
- const url = await dataStore.api.getEnpfRedirectUrl(String(formStore.applicationData.processInstanceId));
2848
+ const url = await dataStore.api.pensionannuityNew.getEnpfRedirectUrl(String(pensionForm.value.processInstanceId));
1768
2849
  dataStore.copyToClipboard(url.redirectUrl);
1769
2850
  };
1770
2851
 
@@ -1772,11 +2853,16 @@ export default defineComponent({
1772
2853
  // State
1773
2854
  formStore,
1774
2855
  vForm,
2856
+ locale,
2857
+ closeDate,
2858
+ isLoading,
1775
2859
  whichProduct,
1776
2860
  productConditionsForm,
1777
2861
  additionalTerms,
1778
2862
  isCalculating,
1779
2863
  isPanelLoading,
2864
+ documentLoading,
2865
+ deletionDialog,
1780
2866
  isPanelOpen,
1781
2867
  isMultiplePanelOpen,
1782
2868
  isTermsPanelOpen,
@@ -1793,20 +2879,39 @@ export default defineComponent({
1793
2879
  subTermValue,
1794
2880
  panelCodeList,
1795
2881
  pensionForm,
2882
+ insuredForm,
1796
2883
  dateOfBegin,
1797
2884
  contractDate,
1798
2885
  transferContractDate,
1799
2886
  transferContractFirstPaymentDate,
1800
2887
  enabled,
1801
2888
  maxDate,
2889
+ amountPaid,
2890
+ amountRefunded,
2891
+ transferMaxDate,
2892
+ hasEduCapitalConsent,
1802
2893
  guaranteedPeriodList,
2894
+ isFileActionsPanelOpen,
1803
2895
  isEnpfSum,
2896
+ transferContracts,
2897
+ contractsValue,
2898
+ contractIndex,
2899
+ contragentData,
2900
+ customPension,
2901
+ minEnhancedGiftSum,
1804
2902
 
1805
2903
  // Computed
1806
2904
  isTask,
1807
2905
  isDisabled,
2906
+ enpfNoteFile,
2907
+ disabilityGroup,
2908
+ totalInsPremium,
1808
2909
  isTermsDisabled,
1809
2910
  isUnderwriterForm,
2911
+ hasCurrencySymbols,
2912
+ currencyListFiltered,
2913
+ currencySymbolsLabel,
2914
+ isDisabledPaymentPeriod,
1810
2915
  insurancePremiumPerMonthRule,
1811
2916
  insurancePremiumPerMonthDisabled,
1812
2917
  requestedSumInsuredRule,
@@ -1814,9 +2919,14 @@ export default defineComponent({
1814
2919
  isUnderwriterRole,
1815
2920
  hasProcessIndexRate,
1816
2921
  hasPaymentPeriod,
2922
+ hasRequestedSumInsured,
2923
+ hasInsurancePremiumPerMonth,
2924
+ hasTariffName,
1817
2925
  hasRequestedSumInsuredInDollar,
1818
2926
  hasInsurancePremiumPerMonthInDollar,
1819
2927
  hasCurrency,
2928
+ hasPaidOrRefund,
2929
+ hasContragentData,
1820
2930
  hasAdbMultiply,
1821
2931
  readonlyLifeAdditive,
1822
2932
  readonlyDisabilityMultiply,
@@ -1826,6 +2936,7 @@ export default defineComponent({
1826
2936
  hasCalculated,
1827
2937
  hasAnnuityPayments,
1828
2938
  hasAgencyPart,
2939
+ hasDisabilityAdditive,
1829
2940
  currencySymbolsAddTerm,
1830
2941
  amountAnnuityPayments,
1831
2942
  requestedSumInsuredLabel,
@@ -1835,30 +2946,44 @@ export default defineComponent({
1835
2946
  hasBirthDate,
1836
2947
  hasGender,
1837
2948
  coverPeriodLabel,
2949
+ lifeMultiplyLabel,
2950
+ lifeAdditiveLabel,
2951
+ disabilityMultiplyLabel,
2952
+ adbMultiplyLabel,
2953
+ adbAdditiveLabel,
1838
2954
  insurancePremiumPerMonthLabel,
1839
2955
  isDisabledCoverPeriod,
1840
2956
  hasDefault,
1841
2957
  isShownAdditionalTerms,
1842
2958
  hasCalcSum,
2959
+ isDisabledInsStartDate,
1843
2960
  isDisabledAgentCommission,
1844
2961
  hasFixInsSum,
1845
2962
  isDisabledFixInsSum,
1846
2963
  defaultText,
1847
2964
  hasDeathInsFromNS,
1848
- pensionAmount,
1849
- pensionCalculationParams,
1850
2965
  hasDeathInsAnyReason,
1851
2966
  fromIndexPage,
1852
2967
  hasCoverPeriod,
1853
2968
  hasInsStartDate,
1854
2969
  hasInsEndDate,
2970
+ isSlavePensionForm,
2971
+ dividendPeriods,
2972
+ dividendSchedules,
2973
+ enhancedGiftDisabled,
2974
+ minEnhancedGiftSumInUsd,
2975
+ isCompulsoryProfContractAmount,
1855
2976
 
1856
2977
  // Rules
1857
- coverPeriodRule,
1858
2978
  fixInsSumRule,
2979
+ agencyPartRule,
2980
+ coverPeriodRule,
1859
2981
 
1860
2982
  // Functions
2983
+ getDoc,
1861
2984
  submitForm,
2985
+ deleteFile,
2986
+ onFileChange,
1862
2987
  pickPanelValue,
1863
2988
  pickTermValue,
1864
2989
  openPanel,
@@ -1868,10 +2993,13 @@ export default defineComponent({
1868
2993
  underwriterCalculate,
1869
2994
  onInputInsurancePremiumPerMonth,
1870
2995
  onInputInsurancePremiumPerMonthInDollar,
2996
+ validateContractDate,
1871
2997
  onInputSum,
2998
+ onInputPension,
1872
2999
  onInputSumDollar,
1873
3000
  toStatement,
1874
3001
  onClearSum,
3002
+ onClearPension,
1875
3003
  onClearSumDollar,
1876
3004
  onClearPremium,
1877
3005
  onClearPremiumDollar,
@@ -1883,13 +3011,36 @@ export default defineComponent({
1883
3011
  pickSubTermValue,
1884
3012
  onInputFixInsSum,
1885
3013
  copyRedirect,
3014
+ getContragent,
3015
+ addTransferContract,
3016
+ openFileActionsPanel,
3017
+ removeTransferContract,
3018
+ checkTransferContractDate,
1886
3019
  };
1887
3020
  },
1888
3021
  });
1889
3022
  </script>
1890
3023
 
1891
3024
  <style>
1892
- .pension-guaranteed-period .v-field {
3025
+ .pension-round-toggle .v-field {
1893
3026
  border: none !important;
1894
3027
  }
3028
+ .grid-table > div > span {
3029
+ padding-left: 24px;
3030
+ border-right: 1px solid #fff;
3031
+ display: flex;
3032
+ align-items: center;
3033
+ padding-top: 12px;
3034
+ padding-bottom: 12px;
3035
+ min-width: 15%;
3036
+ }
3037
+ .v-virtual-scroll__item > div > span {
3038
+ padding-left: 24px;
3039
+ border-right: 1px solid #fff;
3040
+ display: flex;
3041
+ align-items: center;
3042
+ padding-top: 12px;
3043
+ padding-bottom: 12px;
3044
+ min-width: 15%;
3045
+ }
1895
3046
  </style>