hl-core 0.0.10-beta.6 → 0.0.10-beta.61

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 (45) hide show
  1. package/README.md +0 -2
  2. package/api/base.api.ts +361 -137
  3. package/api/interceptors.ts +3 -5
  4. package/components/Dialog/Dialog.vue +5 -1
  5. package/components/Dialog/FamilyDialog.vue +15 -4
  6. package/components/Form/DigitalDocument.vue +52 -0
  7. package/components/Form/FormSource.vue +30 -0
  8. package/components/Form/ManagerAttachment.vue +60 -11
  9. package/components/Form/ProductConditionsBlock.vue +12 -6
  10. package/components/Input/Datepicker.vue +5 -0
  11. package/components/Input/FileInput.vue +1 -1
  12. package/components/Input/FormInput.vue +7 -0
  13. package/components/Input/OtpInput.vue +25 -0
  14. package/components/Input/RoundedInput.vue +2 -0
  15. package/components/Input/RoundedSelect.vue +2 -0
  16. package/components/Input/TextAreaField.vue +71 -0
  17. package/components/Menu/MenuNav.vue +2 -1
  18. package/components/Pages/Anketa.vue +207 -176
  19. package/components/Pages/ContragentForm.vue +1 -1
  20. package/components/Pages/Documents.vue +486 -64
  21. package/components/Pages/MemberForm.vue +424 -182
  22. package/components/Pages/ProductConditions.vue +1180 -257
  23. package/components/Panel/PanelHandler.vue +319 -125
  24. package/components/Utilities/Chip.vue +1 -1
  25. package/components/Utilities/JsonViewer.vue +1 -2
  26. package/composables/classes.ts +125 -21
  27. package/composables/constants.ts +166 -1
  28. package/composables/index.ts +345 -9
  29. package/composables/styles.ts +8 -24
  30. package/configs/i18n.ts +2 -0
  31. package/configs/pwa.ts +1 -7
  32. package/layouts/clear.vue +1 -1
  33. package/layouts/default.vue +1 -1
  34. package/layouts/full.vue +1 -1
  35. package/locales/kz.json +1236 -0
  36. package/locales/ru.json +109 -20
  37. package/nuxt.config.ts +8 -6
  38. package/package.json +12 -12
  39. package/plugins/head.ts +7 -1
  40. package/plugins/helperFunctionsPlugins.ts +1 -0
  41. package/store/data.store.ts +948 -527
  42. package/store/member.store.ts +17 -6
  43. package/store/rules.ts +54 -3
  44. package/types/enum.ts +46 -2
  45. package/types/index.ts +126 -5
@@ -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"
@@ -36,7 +36,14 @@
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
+ "
40
47
  :title="$dataStore.t('insuredForm')"
41
48
  >
42
49
  <div v-for="(insured, index) of formStore.insuredForm" :key="index">
@@ -49,14 +56,14 @@
49
56
  </div>
50
57
  </base-form-section>
51
58
  <base-form-section
52
- v-if="isUnderwriterRole && whichProduct !== 'lifebusiness' && whichProduct !== 'gns' && whichProduct !== 'pensionannuitynew'"
59
+ v-if="isUnderwriterRole && whichProduct !== 'pensionannuitynew' && whichProduct !== 'balam' && whichProduct !== 'borrower' && whichProduct !== 'tumar'"
53
60
  :title="$dataStore.t('recalculationInfo')"
54
61
  >
55
62
  <base-form-input
56
63
  v-model="productConditionsForm.lifeMultiply"
57
64
  :maska="$maska.numbers"
58
65
  :clearable="isRecalculationDisabled === false"
59
- :label="$dataStore.t('percent') + `Life Multiply`"
66
+ :label="lifeMultiplyLabel"
60
67
  :readonly="isRecalculationDisabled"
61
68
  :rules="whichProduct === 'gons' ? $dataStore.rules.recalculationMultiplyBetween : $dataStore.rules.recalculationMultiply"
62
69
  />
@@ -64,7 +71,7 @@
64
71
  v-model="productConditionsForm.lifeAdditive"
65
72
  :maska="$maska.numbers"
66
73
  :clearable="isRecalculationDisabled === false"
67
- :label="$dataStore.t('percent') + `Life Additive`"
74
+ :label="lifeAdditiveLabel"
68
75
  :readonly="readonlyLifeAdditive"
69
76
  :rules="$dataStore.rules.recalculationAdditive"
70
77
  />
@@ -73,7 +80,7 @@
73
80
  v-model="productConditionsForm.adbMultiply"
74
81
  :maska="$maska.numbers"
75
82
  :clearable="isRecalculationDisabled === false"
76
- :label="$dataStore.t('percent') + `Adb Multiply`"
83
+ :label="adbMultiplyLabel"
77
84
  :readonly="isRecalculationDisabled"
78
85
  :rules="$dataStore.rules.recalculationMultiply"
79
86
  />
@@ -82,7 +89,7 @@
82
89
  v-model="productConditionsForm.adbAdditive"
83
90
  :maska="$maska.numbers"
84
91
  :clearable="isRecalculationDisabled === false"
85
- :label="$dataStore.t('percent') + `Adb Additive`"
92
+ :label="adbAdditiveLabel"
86
93
  :readonly="isRecalculationDisabled"
87
94
  :rules="$dataStore.rules.recalculationAdditive"
88
95
  />
@@ -90,11 +97,12 @@
90
97
  v-model="productConditionsForm.disabilityMultiply"
91
98
  :maska="$maska.numbers"
92
99
  :clearable="isRecalculationDisabled === false"
93
- :label="$dataStore.t('percent') + `Disability Multiply`"
100
+ :label="disabilityMultiplyLabel"
94
101
  :readonly="readonlyDisabilityMultiply"
95
102
  :rules="whichProduct === 'gons' ? [] : $dataStore.rules.recalculationMultiply"
96
103
  />
97
104
  <base-form-input
105
+ v-if="hasDisabilityAdditive"
98
106
  v-model="productConditionsForm.disabilityAdditive"
99
107
  :maska="$maska.numbers"
100
108
  :clearable="isRecalculationDisabled === false"
@@ -136,7 +144,7 @@
136
144
  <base-panel-input
137
145
  v-if="hasGender"
138
146
  v-model="productConditionsForm.gender"
139
- :value="productConditionsForm.gender?.nameRu"
147
+ :value="locale === 'ru' ? productConditionsForm.gender?.nameRu : productConditionsForm.gender?.nameKz"
140
148
  :readonly="isDisabled"
141
149
  :clearable="!isDisabled"
142
150
  :label="$dataStore.t('form.gender')"
@@ -145,12 +153,23 @@
145
153
  @append="openPanel($dataStore.t('form.gender'), $dataStore.gender, 'gender')"
146
154
  />
147
155
  </div>
156
+ <base-panel-input
157
+ v-if="hasCurrency"
158
+ v-model="productConditionsForm.currency"
159
+ :value="locale === 'ru' ? productConditionsForm.currency.nameRu : productConditionsForm.currency.nameKz"
160
+ :readonly="isDisabled"
161
+ :clearable="!isDisabled"
162
+ :label="$dataStore.t('agent.currency')"
163
+ :rules="$rules.objectRequired"
164
+ append-inner-icon="mdi mdi-chevron-right"
165
+ @append="openPanel($dataStore.t('agent.currency'), currencyListFiltered, 'currency')"
166
+ />
148
167
  <base-form-input
149
168
  v-if="hasInsStartDate"
150
169
  v-model="productConditionsForm.calcDate"
151
170
  :maska="$maska.date"
152
- :readonly="isDisabled"
153
- :clearable="!isDisabled"
171
+ :readonly="isDisabledInsStartDate"
172
+ :clearable="!isDisabledInsStartDate"
154
173
  :label="$dataStore.t('labels.insuranceStartDate')"
155
174
  :rules="$rules.required"
156
175
  append-inner-icon="mdi mdi-calendar-blank-outline"
@@ -177,9 +196,9 @@
177
196
  <base-panel-input
178
197
  v-if="hasPaymentPeriod"
179
198
  v-model="productConditionsForm.paymentPeriod"
180
- :value="productConditionsForm.paymentPeriod?.nameRu"
181
- :readonly="isDisabled"
182
- :clearable="!isDisabled"
199
+ :value="locale === 'ru' ? productConditionsForm.paymentPeriod?.nameRu : productConditionsForm.paymentPeriod?.nameKz"
200
+ :readonly="isDisabledPaymentPeriod"
201
+ :clearable="!isDisabledPaymentPeriod"
183
202
  :rules="$rules.objectRequired"
184
203
  :label="$dataStore.t('productConditionsForm.processPaymentPeriod')"
185
204
  append-inner-icon="mdi mdi-chevron-right"
@@ -196,17 +215,18 @@
196
215
  append-inner-icon="mdi mdi-chevron-right"
197
216
  @append="openPanel($dataStore.t('productConditionsForm.processIndexRate'), $dataStore.processIndexRate, 'processIndexRate', $dataStore.getProcessIndexRate)"
198
217
  />
218
+ <!-- <base-form-input-->
219
+ <!-- v-if="hasFixInsSum"-->
220
+ <!-- v-model="productConditionsForm.fixInsSum"-->
221
+ <!-- :readonly="isDisabledFixInsSum"-->
222
+ <!-- :clearable="!isDisabled"-->
223
+ <!-- :rules="fixInsSumRule"-->
224
+ <!-- :label="$dataStore.t('productConditionsForm.fixInsSum')"-->
225
+ <!-- :suffix="$constants.currencySymbols.kzt"-->
226
+ <!-- @input="onInputFixInsSum"-->
227
+ <!-- />-->
199
228
  <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
229
+ v-if="hasRequestedSumInsured"
210
230
  v-model="productConditionsForm.requestedSumInsured"
211
231
  :readonly="isDisabledSum"
212
232
  :clearable="!isDisabledSum"
@@ -228,6 +248,7 @@
228
248
  @onClear="onClearSumDollar"
229
249
  />
230
250
  <base-form-input
251
+ v-if="hasInsurancePremiumPerMonth"
231
252
  v-model="productConditionsForm.insurancePremiumPerMonth"
232
253
  :readonly="insurancePremiumPerMonthDisabled"
233
254
  :clearable="!insurancePremiumPerMonthDisabled"
@@ -237,6 +258,22 @@
237
258
  @input="onInputInsurancePremiumPerMonth"
238
259
  @onClear="onClearPremium"
239
260
  />
261
+ <base-form-input
262
+ v-if="hasPaidOrRefund"
263
+ v-model="productConditionsForm.amountRefunded"
264
+ :readonly="isDisabledSum"
265
+ :clearable="!isDisabledSum"
266
+ :label="$dataStore.t('productConditionsForm.amountRefunded')"
267
+ :suffix="$constants.currencySymbols.kzt"
268
+ />
269
+ <base-form-input
270
+ v-if="hasPaidOrRefund"
271
+ v-model="productConditionsForm.amountPaid"
272
+ :readonly="insurancePremiumPerMonthDisabled"
273
+ :clearable="!insurancePremiumPerMonthDisabled"
274
+ :label="$dataStore.t('productConditionsForm.amountPaid')"
275
+ :suffix="$constants.currencySymbols.kzt"
276
+ />
240
277
  <base-form-input
241
278
  v-if="hasInsurancePremiumPerMonthInDollar"
242
279
  v-model="productConditionsForm.insurancePremiumPerMonthInDollar"
@@ -249,10 +286,10 @@
249
286
  @onClear="onClearPremiumDollar"
250
287
  />
251
288
  <base-form-input
252
- v-if="hasCurrency && $dataStore.currencies.usd"
289
+ v-if="hasCurrencySymbols && $dataStore.currencies.usd"
253
290
  v-model="$dataStore.currencies.usd"
254
291
  :readonly="true"
255
- :label="$dataStore.t('productConditionsForm.dollarExchangeRateNBRK')"
292
+ :label="currencySymbolsLabel"
256
293
  :suffix="$constants.currencySymbols.kzt"
257
294
  />
258
295
  <base-form-input
@@ -289,102 +326,229 @@
289
326
  :label="$dataStore.t('productConditionsForm.agencyPart')"
290
327
  :readonly="isDisabledAgentCommission"
291
328
  :clearable="!isDisabledAgentCommission"
292
- :rules="$rules.required.concat($rules.numbers, $rules.agentCommission)"
329
+ :rules="agencyPartRule"
293
330
  />
294
331
  </base-form-section>
295
332
  <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')">
333
+ <base-animation>
334
+ <div
335
+ v-if="(formStore.applicationData.processCode === 19 || formStore.applicationData.processCode === 25) && !isDisabled"
336
+ :class="[$styles.blueBgLight]"
337
+ class="h-[52px] rounded-lg flex items-center justify-end px-2 gap-2 mt-4"
338
+ >
339
+ <base-btn class="max-w-[300px]" :text="$dataStore.t('buttons.copyToClient')" size="sm" @click="copyRedirect" />
340
+ </div>
341
+ </base-animation>
342
+ <base-form-section v-if="formStore.applicationData.statusCode === 'ActuaryForm' && isTask">
343
+ <base-content-block :class="[$styles.textSimple]">
344
+ <h5 class="text-center font-medium mb-4">{{ $dataStore.t('labels.contract') }}</h5>
345
+ <div :class="[$styles.whiteBg, $styles.rounded]" class="p-2 h-12 flex items-center relative">
346
+ <span class="ml-2">Договор {{ formStore.applicationData.processCode === 19 || formStore.applicationData.processCode === 25 ? 'страхования' : 'возврата' }}</span>
347
+ <i
348
+ class="transition-all cursor-pointer mdi mdi-tray-arrow-down pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
349
+ :class="[$styles.greenTextHover]"
350
+ @click="
351
+ $dataStore.generatePDFDocument(
352
+ formStore.applicationData.processCode === 19 ? 'PA_Contract' : formStore.applicationData.processCode === 25 ? 'PAJ_Contract' : 'PA_RefundAgreement',
353
+ '38',
354
+ )
355
+ "
356
+ ></i>
357
+ </div>
358
+ </base-content-block>
359
+ </base-form-section>
360
+ <div v-if="formStore.applicationData.processCode === 25" class="flex items-center mt-[14px] h-[48px]">
361
+ <div :class="[$styles.blueBgLight]" class="flex flex-wrap items-center gap-2 p-1 rounded-t-[8px] h-full">
362
+ <div
363
+ class="h-full px-4 py-1 rounded-[8px] cursor-pointer flex items-center"
364
+ :class="[$styles.textSimple, !isSlavePensionForm ? `${$styles.blueBg} ${$styles.whiteText}` : '']"
365
+ @click="$router.replace({ query: { ...$route.query, which: undefined, upd: 'true' } })"
366
+ >
367
+ {{ !!formStore.applicationData.clientApp?.longName ? formStore.applicationData.clientApp?.longName : 'Страхователь' }}
368
+ </div>
369
+ <div
370
+ class="h-full px-4 py-1 rounded-[8px] cursor-pointer flex items-center"
371
+ :class="[$styles.textSimple, isSlavePensionForm ? `${$styles.blueBg} ${$styles.whiteText}` : '']"
372
+ @click="$router.replace({ query: { ...$route.query, which: 'slave', upd: 'true' } })"
373
+ >
374
+ {{ !!formStore.applicationData.slave.clientApp?.longName ? formStore.applicationData.slave.clientApp?.longName : 'Страхователь 2' }}
375
+ </div>
376
+ </div>
377
+ </div>
378
+ <base-form-section v-if="hasContragentData && contragentData">
379
+ <base-panel-input v-model="contragentData.gender" :readonly="true" :clearable="false" :label="$dataStore.t('form.gender')" />
380
+ <base-form-input v-model="contragentData.birthDate" :readonly="true" :clearable="false" :label="$dataStore.t('form.birthDate')" />
381
+ <base-panel-input
382
+ v-if="disabilityGroup"
383
+ v-model="disabilityGroup"
384
+ :value="disabilityGroup?.nameRu"
385
+ :readonly="true"
386
+ :clearable="false"
387
+ :label="$dataStore.t('pension.disabilityGroup')"
388
+ />
389
+ </base-form-section>
390
+ <base-form-section v-if="formStore.applicationData.processCode !== 24" :title="$dataStore.t('pension.ENPFnote')" class="mt-[14px]">
391
+ <base-file-input :loading="$dataStore.isLoading" @input.prevent="onFileChange($event)" v-if="!enpfNoteFile" />
392
+ <base-content-block class="!p-0" v-if="!!enpfNoteFile">
393
+ <div :class="[$styles.whiteBg]" class="p-2 h-12 flex items-center relative rounded-[4px]">
394
+ <span class="ml-2">{{ enpfNoteFile.fileName }}</span>
395
+ <i
396
+ class="transition-all cursor-pointer mdi mdi-dots-vertical pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
397
+ :class="[$styles.greenTextHover]"
398
+ @click="openFileActionsPanel(enpfNoteFile)"
399
+ ></i>
400
+ </div>
401
+ </base-content-block>
402
+ </base-form-section>
403
+ <base-form-section
404
+ v-if="formStore.applicationData.processCode !== 24"
405
+ :title="$dataStore.t('pension.compulsoryAmount&Prof')"
406
+ :class="[formStore.applicationData.processCode === 25 ? 'mt-0 rounded-tl-none' : '']"
407
+ >
298
408
  <base-form-input
299
- v-model="pensionCalculationParams.compulsoryContractAmount"
300
- :maska="$maska.numbers"
409
+ v-model="pensionForm.compulsoryContractAmount"
301
410
  :readonly="isDisabled || isEnpfSum"
302
411
  :clearable="!isDisabled && !isEnpfSum"
303
412
  :label="$dataStore.t('pension.compulsoryContractAmount')"
413
+ :rules="$dataStore.rules.sums"
414
+ :suffix="$constants.currencySymbols.kzt"
415
+ @input="onInputPension($event, 'compulsoryContractAmount')"
416
+ @onClear="onClearPension('compulsoryContractAmount')"
304
417
  />
305
418
  <base-form-input
306
- v-model="pensionCalculationParams.compulsoryProfContractAmount"
307
- :maska="$maska.numbers"
419
+ v-model="pensionForm.compulsoryProfContractAmount"
308
420
  :readonly="isDisabled || isEnpfSum"
309
421
  :clearable="!isDisabled && !isEnpfSum"
310
422
  :label="$dataStore.t('pension.compulsoryProfContractAmount')"
423
+ :rules="$dataStore.rules.sums"
424
+ :suffix="$constants.currencySymbols.kzt"
425
+ @input="onInputPension($event, 'compulsoryProfContractAmount')"
426
+ @onClear="onClearPension('compulsoryProfContractAmount')"
311
427
  />
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
428
  <base-form-input
323
- v-model="pensionCalculationParams.voluntaryContractAmount"
324
- :maska="$maska.numbers"
325
- :readonly="isDisabled"
326
- :clearable="!isDisabled"
429
+ v-model="pensionForm.compulsoryProfMonthCount"
430
+ :readonly="true"
431
+ :clearable="false"
432
+ :rules="$dataStore.rules.notEmpty"
433
+ :label="$dataStore.t('pension.compulsoryProfMonthCount')"
434
+ />
435
+ <base-form-input
436
+ v-model="pensionForm.voluntaryContractAmount"
437
+ :readonly="isDisabled || isEnpfSum"
438
+ :clearable="!isDisabled && !isEnpfSum"
327
439
  :label="$dataStore.t('pension.voluntaryContractAmount')"
440
+ :rules="$dataStore.rules.sums"
441
+ :suffix="$constants.currencySymbols.kzt"
442
+ @input="onInputPension($event, 'voluntaryContractAmount')"
443
+ @onClear="onClearPension('voluntaryContractAmount')"
328
444
  />
329
445
  <base-form-input
330
- v-model="pensionCalculationParams.ownFundsRaisAmount"
331
- :maska="$maska.numbers"
446
+ v-model="pensionForm.ownFundsRaisAmount"
332
447
  :readonly="isDisabled"
333
448
  :clearable="!isDisabled"
334
449
  :label="$dataStore.t('pension.ownFundsRaisAmount')"
450
+ :rules="$dataStore.rules.sums"
451
+ :suffix="$constants.currencySymbols.kzt"
452
+ @input="onInputPension($event, 'ownFundsRaisAmount')"
453
+ @onClear="onClearPension('ownFundsRaisAmount')"
335
454
  />
455
+ <base-animation type="fade">
456
+ <base-form-toggle
457
+ v-if="formatSpacedNumber(pensionForm.ownFundsRaisAmount) > 0"
458
+ v-model="pensionForm.isOwnAmountFromDividend"
459
+ :disabled="isDisabled"
460
+ :has-border="false"
461
+ :title="$dataStore.t('pension.isOwnAmountFromDividend')"
462
+ />
463
+ </base-animation>
336
464
  </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')" />
465
+ <base-form-section v-if="formStore.applicationData.processCode !== 24" :title="$dataStore.t('pension.companyName')">
466
+ <base-btn v-if="!isDisabled" :text="$dataStore.t('buttons.add')" :disabled="isDisabled" size="sm" :btn="$styles.blueBtn" @click="addTransferContract" />
467
+ <section v-for="(contract, index) in transferContracts" class="py-2">
468
+ <base-panel-input
469
+ v-model="contract.transferContractCompany"
470
+ :value="contract.transferContractCompany?.nameRu"
471
+ :label="$dataStore.t('pension.transferContractCompany')"
472
+ :readonly="isDisabled"
473
+ :clearable="!isDisabled"
474
+ append-inner-icon="mdi mdi-chevron-right"
475
+ @append="
476
+ openPanel($dataStore.t('pension.transferContractCompany'), $dataStore.transferContractCompanies, 'transferContractCompany', $dataStore.getInsuranceCompanies)
477
+ "
478
+ @click="contractIndex = index"
479
+ />
480
+ <div class="flex flex-col">
481
+ <base-form-input
482
+ v-model="contract.transferContractDate"
483
+ :maska="$maska.date"
484
+ :label="$dataStore.t('pension.contractDate')"
485
+ :readonly="isDisabled"
486
+ :clearable="!isDisabled"
487
+ :max-date="formatDate(transferMaxDate) ?? undefined"
488
+ :rules="$dataStore.rules.required.concat(checkTransferContractDate)"
489
+ append-inner-icon="mdi mdi-calendar-blank-outline"
490
+ />
491
+ <span v-if="transferMaxDate && !isDisabled" class="px-3 font-light text-sm bg-white py-0 mt-[-5px]" style="color: #a0b3d8 !important"
492
+ >до {{ transferMaxDate }} включительно</span
493
+ >
494
+ </div>
495
+ <!--
496
+ <base-form-input v-model="contract.transferContractNumber" :label="$dataStore.t('pension.globalId')" :readonly="isDisabled" :clearable="!isDisabled"
497
+ <base-form-input
498
+ v-model="contract.transferContractRegNumber"
499
+ :label="$dataStore.t('pension.transferRegNumber')"
500
+ :rules="$rules.required"
501
+ :readonly="isDisabled"
502
+ :clearable="!isDisabled"
503
+ />
504
+ -->
505
+ <base-form-input
506
+ v-model="contract.transferContractFirstPaymentDate"
507
+ :maska="$maska.date"
508
+ :label="$dataStore.t('pension.transferContractFirstPaymentDate')"
509
+ :rules="[...$rules.required, $rules.validateAfterContractDate(contract.transferContractFirstPaymentDate, contract.transferContractDate)]"
510
+ append-inner-icon="mdi mdi-calendar-blank-outline"
511
+ :min-date="formatDate(contract.transferContractDate) ?? undefined"
512
+ :readonly="isDisabled"
513
+ :clearable="!isDisabled"
514
+ />
515
+ <base-form-input
516
+ v-model="contract.transferContractAmount"
517
+ :label="$dataStore.t('pension.transferContractAmount')"
518
+ :suffix="$constants.currencySymbols.kzt"
519
+ :readonly="isDisabled"
520
+ :clearable="!isDisabled"
521
+ @input="onInputPension($event, 'transferContractAmount', index)"
522
+ @onClear="onClearPension('transferContractAmount', index)"
523
+ />
524
+ <!-- <base-form-toggle v-model="contract.transferContractIsOppv" :disabled="isDisabled" :has-border="false" :title="$dataStore.t('pension.isOPPVTransfer')" />-->
525
+ <base-form-input
526
+ v-if="contract.transferContractIsOppv"
527
+ v-model="contract.transferContractMonthCount"
528
+ :disabled="$dataStore.isLoading"
529
+ :rules="$rules.required.concat($rules.notZero, $rules.numbers)"
530
+ :label="$dataStore.t('pension.compulsoryProfMonthCount')"
531
+ />
532
+ <base-btn
533
+ v-if="!isDisabled"
534
+ class="mt-3"
535
+ :text="$dataStore.t('buttons.delete')"
536
+ :disabled="isDisabled"
537
+ size="sm"
538
+ :btn="$styles.redBtn"
539
+ @click="removeTransferContract(index)"
540
+ />
541
+ </section>
379
542
  </base-form-section>
380
543
  <base-form-section :title="$dataStore.t('pension.paymentTerms')">
381
544
  <base-form-input
382
545
  v-model="contractDate"
383
546
  :maska="$maska.date"
384
- :rules="!isDisabled ? $rules.required.concat($rules.date) : []"
385
- :readonly="isDisabled"
547
+ :rules="!isDisabled ? $rules.required.concat($rules.date, [validateContractDate]) : []"
548
+ :readonly="isDisabled || formStore.applicationData.processCode === 24 || isSlavePensionForm"
386
549
  :clearable="!isDisabled"
387
550
  :min-date="new Date()"
551
+ :max-date="formatDate(maxDate ?? '') ?? undefined"
388
552
  :label="$dataStore.t('pension.contractDate')"
389
553
  append-inner-icon="mdi mdi-calendar-blank-outline"
390
554
  />
@@ -392,7 +556,7 @@
392
556
  <base-form-input v-model="dateOfBegin" :maska="$maska.date" readonly :label="$dataStore.t('pension.paymentsDate')" append-inner-icon="mdi mdi-calendar-blank-outline" />
393
557
  <base-rounded-select
394
558
  v-model="pensionForm.guaranteedPeriod"
395
- class="pension-guaranteed-period"
559
+ class="pension-round-toggle"
396
560
  :readonly="isDisabled"
397
561
  :clearable="!isDisabled"
398
562
  :rules="$rules.notZero"
@@ -400,11 +564,39 @@
400
564
  :items="guaranteedPeriodList"
401
565
  :hide-details="true"
402
566
  />
567
+ <base-rounded-select
568
+ v-if="dividendPeriods"
569
+ v-model="pensionForm.dividendId"
570
+ class="pension-round-toggle"
571
+ :readonly="isDisabled"
572
+ :rules="$rules.notZero"
573
+ :label="$dataStore.t('pension.dividendPeriod')"
574
+ item-title="nameRu"
575
+ item-value="id"
576
+ :items="dividendPeriods"
577
+ :hide-details="true"
578
+ />
403
579
  <base-form-input v-model="pensionForm.frequencyPayments" disabled :label="$dataStore.t('pension.frequencyPayments')" />
404
580
  <base-form-input v-model="pensionForm.periodPayments" disabled :label="$dataStore.t('pension.paymentPeriod')" />
405
581
  <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')" />
582
+ <base-form-input
583
+ v-if="formStore.applicationData.processCode === 25 && formStore.pensionApp?.slave?.amount"
584
+ :value="totalInsPremium"
585
+ :active="true"
586
+ :label="$dataStore.t('productConditionsForm.totalInsurancePremiumAmount')"
587
+ :disabled="$dataStore.isLoading"
588
+ readonly
589
+ />
590
+ <base-form-input
591
+ v-model="pensionForm.amount"
592
+ :value="$dataStore.getNumberWithSpaces(pensionForm.amount)"
593
+ @input="onInputPension($event, 'pensionAmount')"
594
+ @onClear="onClearPension('pensionAmount')"
595
+ @change="customPension = true"
596
+ :readonly="isDisabled || formStore.applicationData.processCode !== 25"
597
+ :label="$dataStore.t('pension.pensionAmount')"
598
+ />
599
+ <base-form-input :value="$dataStore.getNumberWithSpaces(pensionForm.payment)" :active="true" readonly :label="$dataStore.t('pension.pensionPayment')" />
408
600
  </base-form-section>
409
601
  </section>
410
602
  <base-form-section v-if="hasAnnuityPayments" :title="$dataStore.t('calculationAnnuityPayments')">
@@ -602,7 +794,7 @@
602
794
  <base-panel-input
603
795
  v-if="filterTermConditions(term)"
604
796
  v-model="additionalTerms[index]"
605
- :value="term.coverSumName"
797
+ :value="locale === 'ru' ? term.coverSumName : term.coverSumNameKz"
606
798
  :readonly="isTermsDisabled"
607
799
  :clearable="false"
608
800
  :label="coverTypeName(term)"
@@ -619,18 +811,81 @@
619
811
  </div>
620
812
  </base-form-section>
621
813
  </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
- />
814
+ <base-animation>
815
+ <base-btn
816
+ v-if="!$dataStore.isCalculator && isCalculator && hasCalculated"
817
+ :btn="$styles.greenLightBtn"
818
+ :text="$dataStore.t('buttons.toStatement')"
819
+ class="min-h-[60px]"
820
+ @click="toStatement"
821
+ />
822
+ </base-animation>
823
+ <base-animation>
824
+ <base-btn
825
+ v-if="!isDisabled && $dataStore.isPension && isTask"
826
+ :text="$dataStore.t('buttons.calculate')"
827
+ :loading="$dataStore.isLoading"
828
+ class="min-h-[60px]"
829
+ type="submit"
830
+ @click="submitForm"
831
+ />
832
+ </base-animation>
833
+ <base-animation>
834
+ <base-btn
835
+ v-if="$dataStore.isCalculator ? true : !isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter()) && !$dataStore.isPension"
836
+ :loading="isCalculating"
837
+ class="min-h-[60px]"
838
+ :text="$dataStore.t('buttons.calculate')"
839
+ @click="submitForm"
840
+ />
841
+ </base-animation>
630
842
  <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" />
843
+ <base-animation>
844
+ <base-btn
845
+ v-if="hasCalcSum"
846
+ class="min-h-[60px]"
847
+ :text="$dataStore.t('buttons.calcSum')"
848
+ type="submit"
849
+ @click.prevent="underwriterCalculate('sum')"
850
+ :loading="isCalculating"
851
+ />
852
+ </base-animation>
853
+ <base-btn class="min-h-[60px]" :text="$dataStore.t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
633
854
  </div>
855
+ <base-fade-transition>
856
+ <base-form-section :title="$dataStore.t('pension.dividendsGraph')" v-if="dividendSchedules.scheduleDividend" class="grid-table">
857
+ <div class="flex justify-between rounded-t-[8px] border-b-[1px]" :class="[$styles.blueBg, $styles.whiteText]">
858
+ <span class="h-full">#</span>
859
+ <span class="h-full">{{ $dataStore.t('pension.dividendDate') }}</span>
860
+ <span class="h-full grow">{{ $dataStore.t('pension.dividendAmount') }}</span>
861
+ </div>
862
+ <v-virtual-scroll :items="dividendSchedules.scheduleDividend" height="300">
863
+ <template v-slot:default="{ item, index }">
864
+ <div class="flex justify-between border-b-[1px]" :class="[$styles.whiteBg, $styles.textSimple, $styles.rounded]">
865
+ <span class="h-full">{{ index + 1 }}</span>
866
+ <span class="h-full">{{ reformatDate(item.date) }}</span>
867
+ <span class="h-full grow">{{ $dataStore.getNumberWithSpaces(item.amount) }}</span>
868
+ </div>
869
+ </template>
870
+ </v-virtual-scroll>
871
+ </base-form-section>
872
+ <base-form-section :title="$dataStore.t('pension.dividendsGraph') + ' 2'" v-if="dividendSchedules.scheduleDividend2" class="grid-table">
873
+ <div class="flex justify-between rounded-t-[8px] border-b-[1px]" :class="[$styles.blueBg, $styles.whiteText]">
874
+ <span class="h-full">#</span>
875
+ <span class="h-full">{{ $dataStore.t('pension.dividendDate') }}</span>
876
+ <span class="h-full grow">{{ $dataStore.t('pension.dividendAmount') }}</span>
877
+ </div>
878
+ <v-virtual-scroll :items="dividendSchedules.scheduleDividend2" height="300">
879
+ <template v-slot:default="{ item, index }">
880
+ <div class="flex justify-between border-b-[1px]" :class="[$styles.whiteBg, $styles.textSimple, $styles.rounded]">
881
+ <span class="h-full">{{ index + 1 }}</span>
882
+ <span class="h-full">{{ reformatDate(item.date) }}</span>
883
+ <span class="h-full grow">{{ $dataStore.getNumberWithSpaces(item.amount) }}</span>
884
+ </div>
885
+ </template>
886
+ </v-virtual-scroll>
887
+ </base-form-section>
888
+ </base-fade-transition>
634
889
  <Teleport v-if="isPanelOpen" to="#right-panel-actions">
635
890
  <div :class="[$styles.scrollPage]" class="flex flex-col items-center">
636
891
  <base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
@@ -639,7 +894,7 @@
639
894
  <base-panel-select-item
640
895
  v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
641
896
  :key="index"
642
- :text="String(item.nameRu)"
897
+ :text="locale === 'ru' ? String(item.nameRu) : String(item.nameKz)"
643
898
  :selected="item.nameRu === panelValue.nameRu"
644
899
  @click="pickPanelValue(item)"
645
900
  />
@@ -685,18 +940,63 @@
685
940
  </v-expansion-panel-text>
686
941
  </v-expansion-panel>
687
942
  </v-expansion-panels>
688
- <base-panel-select-item v-else :key="index" :text="String(item.nameRu)" :selected="item.nameRu === termValue?.coverSumName" @click="pickTermValue(item)" />
943
+ <base-panel-select-item
944
+ v-else
945
+ :key="index"
946
+ :text="locale === 'ru' ? String(item.nameRu) : String(item.nameKz)"
947
+ :selected="item.nameRu === termValue?.coverSumName"
948
+ @click="pickTermValue(item)"
949
+ />
689
950
  </div>
690
951
  </div>
691
952
  <base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
692
953
  </div>
693
954
  </Teleport>
955
+ <Teleport v-if="isFileActionsPanelOpen" to="#right-panel-actions">
956
+ <base-fade-transition>
957
+ <div :class="[$styles.flexColNav]">
958
+ <base-animation>
959
+ <base-btn
960
+ v-if="enpfNoteFile?.fileName && enpfNoteFile?.fileName.includes('.') ? enpfNoteFile?.fileName.endsWith('.pdf') : true"
961
+ :disabled="documentLoading"
962
+ :loading="documentLoading"
963
+ text="Открыть"
964
+ @click="getDoc('view')"
965
+ />
966
+ </base-animation>
967
+ <base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="getDoc('download')" />
968
+ <base-animation>
969
+ <base-btn :disabled="documentLoading" :loading="documentLoading" text="Удалить" @click="deletionDialog = true" />
970
+ </base-animation>
971
+ </div>
972
+ </base-fade-transition>
973
+ </Teleport>
974
+ <base-dialog
975
+ v-model="deletionDialog"
976
+ :title="$dataStore.t('dialog.confirmDelete')"
977
+ :subtitle="$dataStore.t('dialog.deleteFile')"
978
+ :confirm="$dataStore.t('confirm.delete')"
979
+ :icon="{ mdi: 'delete-outline', color: '#FD2D39' }"
980
+ @yes="deleteFile"
981
+ @no="deletionDialog = false"
982
+ />
694
983
  </section>
984
+ <div v-if="isLoading" class="w-full h-[80dvh] flex items-center justify-center"><base-loader :size="50" /></div>
695
985
  </template>
696
986
 
697
987
  <script lang="ts">
698
- import { Member, Value, CountryValue, CalculatorForm } from '../../composables/classes';
699
- import type { Projects, AddCover, AddCoverAnswer } from '../../types';
988
+ import { Member, Value, CountryValue, CalculatorForm, TransferContract, DocumentItem } from '../../composables/classes';
989
+ import type { Projects, AddCover, AddCoverAnswer, FileActions } from '../../types';
990
+ import { useI18n } from 'vue-i18n';
991
+
992
+ type PensionCalculation = {
993
+ compulsoryContractAmount: number | string | null;
994
+ voluntaryContractAmount: number | string | null;
995
+ ownFundsRaisAmount: number | string | null;
996
+ compulsoryProfContractAmount: number | string | null;
997
+ transferContractAmount: number | string | null;
998
+ transferContractCompany: number | string | null;
999
+ };
700
1000
 
701
1001
  export default defineComponent({
702
1002
  props: {
@@ -716,12 +1016,16 @@ export default defineComponent({
716
1016
  const formStore = useFormStore();
717
1017
  const dataStore = useDataStore();
718
1018
  const memberStore = useMemberStore();
1019
+ const { locale } = useI18n();
719
1020
 
720
1021
  const whichProduct = ref<Projects | null>(dataStore.isCalculator ? props.product : dataStore.product!);
721
1022
  const isCalculating = ref<boolean>(false);
722
1023
  const isPanelLoading = ref<boolean>(false);
723
1024
  const isPanelOpen = ref<boolean>(false);
724
1025
  const isTermsPanelOpen = ref<boolean>(false);
1026
+ const isFileActionsPanelOpen = ref<boolean>(false);
1027
+ const isLoading = ref<boolean>(false);
1028
+ const documentLoading = ref<boolean>(false);
725
1029
  const panelValue = ref<Value>(new Value());
726
1030
  const termValue = ref<AddCover>();
727
1031
  const subTermValue = ref<string>('');
@@ -734,23 +1038,88 @@ export default defineComponent({
734
1038
  const whichSum = ref<'insurancePremiumPerMonth' | 'requestedSumInsured' | ''>('');
735
1039
  const panelCodeList = ['processcovertypesum', 'fixedinssum'];
736
1040
  const enabled = 'включено';
1041
+ const amountRefunded = ref<string | number | null>(null);
1042
+ const amountPaid = ref<string | number | null>(null);
1043
+ const deletionDialog = ref<boolean>(false);
737
1044
 
738
1045
  const additionalTerms = ref<AddCover[]>([]);
739
1046
 
740
- const maxDate = ref();
1047
+ const maxDate = ref<string | null>();
741
1048
  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;
1049
+ const contractDate = ref<string | null>();
1050
+ const transferContractDate = ref<string | null>();
1051
+ const transferContractFirstPaymentDate = ref<string | null>();
1052
+ const guaranteedPeriodList = Array.from(Array(35), (_, i) => i + 1);
1053
+ const dividendPeriods = ref<Value[] | null>(null);
748
1054
 
1055
+ const dividendSchedules = ref(<
1056
+ {
1057
+ scheduleDividend: any[] | null;
1058
+ scheduleDividend2: any[] | null;
1059
+ }
1060
+ >{
1061
+ scheduleDividend: null,
1062
+ scheduleDividend2: null,
1063
+ });
1064
+ const transferMaxDate = computed({
1065
+ get() {
1066
+ if (contractDate.value) {
1067
+ var maxDate = structuredClone(formatDate(contractDate.value))!;
1068
+ maxDate.setFullYear(maxDate.getFullYear() - 2);
1069
+ maxDate.setDate(maxDate.getDate() + 1);
1070
+ return reformatDate(String(maxDate))!;
1071
+ } else {
1072
+ return '';
1073
+ }
1074
+ },
1075
+ set(newValue) {
1076
+ return newValue;
1077
+ },
1078
+ });
1079
+ const isSlavePensionForm = computed(() => route.query.which === 'slave');
1080
+ const pensionForm = computedWithControl(
1081
+ () => formStore.pensionApp,
1082
+ () => (route.query.which === 'slave' ? formStore.pensionApp?.slave : formStore.pensionApp ?? undefined),
1083
+ );
1084
+
1085
+ const insuredForm = isSlavePensionForm.value
1086
+ ? formStore.applicationData?.slave?.insuredApp && formStore.applicationData?.slave?.insuredApp[0]
1087
+ : (formStore.applicationData?.insuredApp && Array.isArray(formStore.applicationData?.insuredApp) && formStore.applicationData?.insuredApp[0]) ?? undefined;
1088
+ const disabilityGroup = computed(() => {
1089
+ if (!!insuredForm.disabilityGroupId) {
1090
+ const disabilityGroup = dataStore.disabilityGroups.find(i => i.id === insuredForm.disabilityGroupId);
1091
+ return disabilityGroup;
1092
+ }
1093
+ });
1094
+ const enpfNoteFile = computed(() => formStore.signedDocumentList.find(i => i.fileTypeCode === '8'));
1095
+ const isEnpfSum = pensionForm.value?.isEnpfSum ?? false;
1096
+
1097
+ const transferContracts = ref<TransferContract[]>([]);
1098
+ const contractsValue = ref<Value[]>([]);
1099
+ const contractIndex = ref<number>(0);
749
1100
  const isMultiplePanelOpen = ref<boolean>(false);
750
1101
  const multiplePanelValue = ref<CountryValue>(new CountryValue());
751
1102
  const multiplePanelList = ref<CountryValue[]>([]);
752
1103
  const calculatorForm = productConditionsForm.calculatorForm;
753
1104
  const minInsSum = computed(() => formStore.lfb.clients && formStore.lfb.clients.reduce((min, item) => Math.min(min, item.insSum), Infinity));
1105
+ const contragentData = ref<any>();
1106
+ const customPension = ref<boolean>(false);
1107
+ const transferSum = ref<number>(0);
1108
+ const firstAmount = ref<boolean>(true);
1109
+ const isHalykBank = formStore.lfb.policyholder.clientData.iin.replace(/-/g, '') === '940140000385';
1110
+
1111
+ const checkTransferContractDate = (val: any) => {
1112
+ if (val) {
1113
+ if (new Date(formatDate(transferMaxDate.value)!.valueOf() - formatDate(val)!.valueOf()).getUTCFullYear() - 1970 < 0) {
1114
+ return dataStore.t('rules.invalidtransferContractDate');
1115
+ } else {
1116
+ return true;
1117
+ }
1118
+ } else {
1119
+ return true;
1120
+ }
1121
+ };
1122
+
754
1123
  const isShownAdditionalTerms = computed(() => {
755
1124
  if (whichProduct.value === 'gons') {
756
1125
  return false;
@@ -769,6 +1138,9 @@ export default defineComponent({
769
1138
  if (whichProduct.value === 'gons') {
770
1139
  return true;
771
1140
  }
1141
+ if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
1142
+ return true;
1143
+ }
772
1144
  if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && dataStore.isUnderwriter()) {
773
1145
  return false;
774
1146
  }
@@ -778,7 +1150,13 @@ export default defineComponent({
778
1150
  const isTask = computed(() => (route.params.taskId === '0' && props.isCalculator === true) || dataStore.isTask() || fromIndexPage.value);
779
1151
  const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm || formStore.canBeClaimed === true);
780
1152
  const isUnderwriterRole = computed(() => dataStore.isUnderwriter() || dataStore.isAdmin() || dataStore.isSupport());
781
- const insurancePremiumPerMonthRule = computed(() => (!!productConditionsForm.insurancePremiumPerMonth ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
1153
+ const insurancePremiumPerMonthRule = computed(() =>
1154
+ !!productConditionsForm.insurancePremiumPerMonth
1155
+ ? whichProduct.value === 'gons' || whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns'
1156
+ ? dataStore.rules.required
1157
+ : dataStore.rules.required.concat(dataStore.rules.sums)
1158
+ : [],
1159
+ );
782
1160
  const insurancePremiumPerMonthDisabled = computed(() => {
783
1161
  if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
784
1162
  return true;
@@ -788,12 +1166,21 @@ export default defineComponent({
788
1166
  }
789
1167
  return isDisabled.value;
790
1168
  });
791
- const requestedSumInsuredRule = computed(() => (!!productConditionsForm.requestedSumInsured ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
1169
+ const requestedSumInsuredRule = computed(() =>
1170
+ !!productConditionsForm.requestedSumInsured ? (whichProduct.value === 'gons' ? dataStore.rules.required : dataStore.rules.required.concat(dataStore.rules.sums)) : [],
1171
+ );
792
1172
  const fixInsSumRule = computed(() =>
793
1173
  !!productConditionsForm.fixInsSum
794
1174
  ? dataStore.rules.required.concat(dataStore.rules.sums, dataStore.rules.fixInsSumLimit(getNumber(productConditionsForm.fixInsSum as string), minInsSum.value))
795
1175
  : [],
796
1176
  );
1177
+ const agencyPartRule = computed(() => {
1178
+ if (formStore.lfb.add || isHalykBank) {
1179
+ return productConditionsForm.agentCommission === 0 ? [] : dataStore.rules.required;
1180
+ } else {
1181
+ return dataStore.rules.required.concat(dataStore.rules.numbers, dataStore.rules.agentCommission);
1182
+ }
1183
+ });
797
1184
  const amountAnnuityPayments = computed(() => (!!productConditionsForm.amountAnnuityPayments ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
798
1185
  const hasCalculated = computed(() => {
799
1186
  if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && productConditionsForm.requestedSumInsured === null) {
@@ -802,22 +1189,16 @@ export default defineComponent({
802
1189
  return !!productConditionsForm.requestedSumInsured && !!productConditionsForm.insurancePremiumPerMonth;
803
1190
  });
804
1191
  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;
1192
+ if (whichProduct.value === 'baiterek' || whichProduct.value === 'bolashak') return true;
1193
+ return false;
816
1194
  });
817
1195
  const hasPaymentPeriod = computed(() => {
818
1196
  if (whichProduct.value === 'halykkazyna') {
819
1197
  return false;
820
1198
  }
1199
+ if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
1200
+ return false;
1201
+ }
821
1202
  return true;
822
1203
  });
823
1204
  const hasCoverPeriod = computed(() => {
@@ -826,22 +1207,44 @@ export default defineComponent({
826
1207
  }
827
1208
  return true;
828
1209
  });
1210
+
1211
+ const hasRequestedSumInsured = computed(() => {
1212
+ if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
1213
+ return false;
1214
+ }
1215
+ return true;
1216
+ });
829
1217
  const hasRequestedSumInsuredInDollar = computed(() => {
830
1218
  if (whichProduct.value === 'halykkazyna') {
831
1219
  return true;
832
1220
  }
1221
+ if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
1222
+ return true;
1223
+ }
833
1224
  return false;
834
1225
  });
1226
+ const hasInsurancePremiumPerMonth = computed(() => {
1227
+ if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
1228
+ return false;
1229
+ }
1230
+ return true;
1231
+ });
835
1232
  const hasInsurancePremiumPerMonthInDollar = computed(() => {
836
1233
  if (whichProduct.value === 'halykkazyna') {
837
1234
  return true;
838
1235
  }
1236
+ if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
1237
+ return true;
1238
+ }
839
1239
  return false;
840
1240
  });
841
- const hasCurrency = computed(() => {
1241
+ const hasCurrencySymbols = computed(() => {
842
1242
  if (whichProduct.value === 'halykkazyna') {
843
1243
  return true;
844
1244
  }
1245
+ if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
1246
+ return true;
1247
+ }
845
1248
  return false;
846
1249
  });
847
1250
  const hasAdbMultiply = computed(() => {
@@ -878,6 +1281,15 @@ export default defineComponent({
878
1281
  if (whichProduct.value === 'gons') {
879
1282
  return false;
880
1283
  }
1284
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1285
+ return false;
1286
+ }
1287
+ return true;
1288
+ });
1289
+ const hasDisabilityAdditive = computed(() => {
1290
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1291
+ return false;
1292
+ }
881
1293
  return true;
882
1294
  });
883
1295
  const hasAnnuityPayments = computed(() => {
@@ -944,6 +1356,42 @@ export default defineComponent({
944
1356
  }
945
1357
  return dataStore.t('productConditionsForm.insurancePremiumAmount');
946
1358
  });
1359
+ const currencySymbolsLabel = computed(() => {
1360
+ if (whichProduct.value === 'gons') {
1361
+ return dataStore.t('productConditionsForm.exchangeRateSettlementDate');
1362
+ }
1363
+ return dataStore.t('productConditionsForm.dollarExchangeRateNBRK');
1364
+ });
1365
+ const lifeMultiplyLabel = computed(() => {
1366
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1367
+ return dataStore.t('percent') + `Life (смерть по любой причине) multiply`;
1368
+ }
1369
+ return dataStore.t('percent') + `Life Multiply`;
1370
+ });
1371
+ const lifeAdditiveLabel = computed(() => {
1372
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1373
+ return dataStore.t('percent') + `Life (смерть по любой причине) надбавка`;
1374
+ }
1375
+ return dataStore.t('percent') + `Life Additive`;
1376
+ });
1377
+ const disabilityMultiplyLabel = computed(() => {
1378
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1379
+ return dataStore.t('percent') + `Disability (инвалидность, временная утрата тр-ти, стойкая утрата тр-ти)`;
1380
+ }
1381
+ return dataStore.t('percent') + `Disability Multiply`;
1382
+ });
1383
+ const adbMultiplyLabel = computed(() => {
1384
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1385
+ return dataStore.t('percent') + `Accidental life multiply`;
1386
+ }
1387
+ return dataStore.t('percent') + `Adb Multiply`;
1388
+ });
1389
+ const adbAdditiveLabel = computed(() => {
1390
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1391
+ return dataStore.t('percent') + `Accidental life additional надбавка`;
1392
+ }
1393
+ return dataStore.t('percent') + `Adb Additive`;
1394
+ });
947
1395
  const isDisabledFixInsSum = computed(() => {
948
1396
  if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
949
1397
  return false;
@@ -991,11 +1439,23 @@ export default defineComponent({
991
1439
  return true;
992
1440
  });
993
1441
  const isDisabledAgentCommission = computed(() => {
1442
+ if (isHalykBank) {
1443
+ return true;
1444
+ }
1445
+ if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
1446
+ return true;
1447
+ }
994
1448
  if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns' || dataStore.isUnderwriter()) {
995
1449
  return false;
996
1450
  }
997
1451
  return isDisabled.value;
998
1452
  });
1453
+ const isDisabledInsStartDate = computed(() => {
1454
+ if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
1455
+ return true;
1456
+ }
1457
+ return isDisabled.value;
1458
+ });
999
1459
  const hasCalcSum = computed(() => {
1000
1460
  if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1001
1461
  return false;
@@ -1003,7 +1463,13 @@ export default defineComponent({
1003
1463
  return true;
1004
1464
  });
1005
1465
  const hasFixInsSum = computed(() => {
1006
- if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1466
+ if (!formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
1467
+ return true;
1468
+ }
1469
+ return false;
1470
+ });
1471
+ const hasPaidOrRefund = computed(() => {
1472
+ if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
1007
1473
  return true;
1008
1474
  }
1009
1475
  return false;
@@ -1038,26 +1504,51 @@ export default defineComponent({
1038
1504
  }
1039
1505
  return false;
1040
1506
  });
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,
1507
+ const hasCurrency = computed(() => {
1508
+ if (whichProduct.value === 'gons') {
1509
+ return true;
1510
+ }
1511
+ return false;
1512
+ });
1513
+ const hasContragentData = computed(() => {
1514
+ if (whichProduct.value === 'pensionannuitynew') {
1515
+ return true;
1516
+ }
1517
+ return false;
1518
+ });
1519
+ const isDisabledPaymentPeriod = computed(() => {
1520
+ if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
1521
+ return true;
1522
+ }
1523
+ return isDisabled.value;
1524
+ });
1525
+ const currencyListFiltered = computed(() => {
1526
+ return constants.currencyList;
1049
1527
  });
1050
1528
 
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,
1529
+ const totalInsPremium = computed(() =>
1530
+ dataStore.getNumberWithSpaces(formatSpacedNumber(formStore.pensionApp?.amount) + formatSpacedNumber(formStore.pensionApp.slave?.amount)),
1059
1531
  );
1060
1532
 
1533
+ const getContragent = async () => {
1534
+ const data = await dataStore.api.getContragentById(
1535
+ Number(route.query.which !== 'slave' ? formStore.applicationData.clientApp.insisId : formStore.applicationData.slave.clientApp.insisId),
1536
+ );
1537
+ if (data && data.items.length != 0) {
1538
+ contragentData.value = data.items[0];
1539
+ contragentData.value.gender = contragentData.value.gender === 1 ? dataStore.t('pension.male') : dataStore.t('pension.female');
1540
+ contragentData.value.birthDate = reformatDate(contragentData.value.birthDate);
1541
+ }
1542
+ };
1543
+
1544
+ const sumContractsAmount = (transferContracts: TransferContract[]) => {
1545
+ if (!transferContracts || !transferContracts.length) return 0;
1546
+ return transferContracts.reduce((accumulator, currentValue) => {
1547
+ const transferAmount = structuredClone(toRaw(currentValue));
1548
+ return accumulator + Number(String(transferAmount.transferContractAmount).replace(/\s/g, ''));
1549
+ }, 0);
1550
+ };
1551
+
1061
1552
  const formatTermValue = (term: number) => {
1062
1553
  if (term !== null) {
1063
1554
  const termNumber = Number(term);
@@ -1069,7 +1560,7 @@ export default defineComponent({
1069
1560
  const toStatement = async () => {
1070
1561
  const statementItem = dataStore.menuItems.find(i => i.id === 'statement');
1071
1562
  if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1072
- await router.push({ name: 'taskId-NewApp', params: route.params, query: { tab: 'statement' } });
1563
+ await router.push({ name: 'taskId-NewApp', params: route.params, query: { tab: 'statement', add: 'false' } });
1073
1564
  return;
1074
1565
  }
1075
1566
  if (whichProduct.value === 'gons') {
@@ -1088,7 +1579,7 @@ export default defineComponent({
1088
1579
  }
1089
1580
  };
1090
1581
 
1091
- const pickPanelValue = (item: Value) => {
1582
+ const pickPanelValue = async (item: Value) => {
1092
1583
  dataStore.rightPanel.open = false;
1093
1584
  isPanelOpen.value = false;
1094
1585
  isMultiplePanelOpen.value = false;
@@ -1100,14 +1591,31 @@ export default defineComponent({
1100
1591
  // @ts-ignore
1101
1592
  calculatorForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
1102
1593
  } else if (whichProduct.value === 'pensionannuitynew') {
1103
- // @ts-ignore
1104
- pensionForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
1594
+ if (currentPanel.value === 'transferContractCompany') {
1595
+ transferContracts.value[contractIndex.value].transferContractCompany = item;
1596
+ } else {
1597
+ // @ts-ignore
1598
+ pensionForm.value[currentPanel.value] = item.nameRu === null ? new Value() : item;
1599
+ }
1105
1600
  } else {
1106
1601
  // @ts-ignore
1107
1602
  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;
1603
+ if (currentPanel.value === 'paymentPeriod' && item.code === 'single') {
1604
+ if (hasProcessIndexRate.value) {
1605
+ const defaultIndexRate = dataStore.processIndexRate.find((i: any) => i.isDefault === true);
1606
+ if (defaultIndexRate) productConditionsForm.processIndexRate = defaultIndexRate;
1607
+ }
1608
+ if (whichProduct.value === 'bolashak') {
1609
+ const termCover = additionalTerms.value?.findIndex(i => i.coverTypeCode === 10);
1610
+ if (termCover !== -1) {
1611
+ const termList = await dataStore.getAdditionalInsuranceTermsAnswers(additionalTerms.value[termCover].coverTypeId);
1612
+ const defaultTermValue = termList?.find(i => i.isDefault === true);
1613
+ if (defaultTermValue) {
1614
+ additionalTerms.value[termCover].coverSumId = String(defaultTermValue.id);
1615
+ additionalTerms.value[termCover].coverSumName = String(defaultTermValue.nameRu);
1616
+ }
1617
+ }
1618
+ }
1111
1619
  }
1112
1620
  }
1113
1621
  };
@@ -1153,11 +1661,14 @@ export default defineComponent({
1153
1661
 
1154
1662
  additionalTerms.value[currentIndex.value].coverSumId = item.id as string;
1155
1663
  additionalTerms.value[currentIndex.value].coverSumName = item.nameRu as string;
1664
+ additionalTerms.value[currentIndex.value].coverSumNameKz = item.nameKz as string;
1156
1665
 
1157
1666
  if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1158
1667
  if (termValue.value && item.code === 'fixedinssum') {
1159
1668
  if (termValue.value.coverTypeCode === 11) {
1160
1669
  subPanelList.value = constants.fixInsAmount.slice(0, 5);
1670
+ } else if (termValue.value.coverTypeCode !== 19) {
1671
+ subPanelList.value = constants.fixInsAmount.slice(0, 10);
1161
1672
  } else {
1162
1673
  subPanelList.value = constants.fixInsAmount;
1163
1674
  }
@@ -1331,7 +1842,7 @@ export default defineComponent({
1331
1842
  const calculatedPremiumDollar = getNumber(event.target.value as string);
1332
1843
  if (calculatedPremiumDollar) {
1333
1844
  productConditionsForm.insurancePremiumPerMonth = dataStore.getNumberWithSpaces(productConditionsForm.insurancePremiumPerMonth);
1334
- if (whichProduct.value === 'halykkazyna') {
1845
+ if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
1335
1846
  if (typeof dataStore.currencies.usd === 'number') {
1336
1847
  productConditionsForm.insurancePremiumPerMonthInDollar = dataStore.getNumberWithSpaces(calculatedPremiumDollar / dataStore.currencies.usd);
1337
1848
  } else {
@@ -1359,7 +1870,7 @@ export default defineComponent({
1359
1870
  const calculatedSumDollar = getNumber(event.target.value as string);
1360
1871
  if (calculatedSumDollar) {
1361
1872
  productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(productConditionsForm.requestedSumInsured);
1362
- if (whichProduct.value === 'halykkazyna') {
1873
+ if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
1363
1874
  if (typeof dataStore.currencies.usd === 'number') {
1364
1875
  productConditionsForm.requestedSumInsuredInDollar = dataStore.getNumberWithSpaces(calculatedSumDollar / dataStore.currencies.usd);
1365
1876
  } else {
@@ -1370,6 +1881,42 @@ export default defineComponent({
1370
1881
  }
1371
1882
  };
1372
1883
 
1884
+ const onInputPension = (event: Event, key: keyof PensionCalculation | 'pensionAmount', index?: number) => {
1885
+ if (event.target && 'value' in event.target && event.target.value) {
1886
+ const calcCheck = getNumber(event.target.value as string);
1887
+ if (calcCheck) {
1888
+ if (index !== undefined) {
1889
+ transferContracts.value[index].transferContractAmount = dataStore.getNumberWithSpaces(event.target.value) as string;
1890
+ transferSum.value = transferContracts.value.reduce((accumulator, { transferContractAmount }) => (accumulator += formatSpacedNumber(transferContractAmount)), 0);
1891
+ } else if (key === 'pensionAmount') {
1892
+ pensionForm.value.amount = dataStore.getNumberWithSpaces(event.target.value) ?? '0';
1893
+ } else {
1894
+ pensionForm.value[key] = dataStore.getNumberWithSpaces(event.target.value);
1895
+ }
1896
+ }
1897
+ } else {
1898
+ if (index !== undefined) {
1899
+ transferContracts.value[index].transferContractAmount = 0;
1900
+ transferSum.value = transferContracts.value.reduce((accumulator, { transferContractAmount }) => (accumulator += formatSpacedNumber(transferContractAmount)), 0);
1901
+ }
1902
+ }
1903
+ if (key !== 'pensionAmount' && !customPension.value) {
1904
+ if (firstAmount.value) {
1905
+ firstAmount.value = false;
1906
+ return;
1907
+ }
1908
+ pensionForm.value.amount =
1909
+ dataStore.getNumberWithSpaces(
1910
+ formatSpacedNumber(pensionForm.value.compulsoryContractAmount) +
1911
+ formatSpacedNumber(pensionForm.value.compulsoryProfContractAmount) +
1912
+ formatSpacedNumber(pensionForm.value.ownFundsRaisAmount) +
1913
+ formatSpacedNumber(pensionForm.value.transferContractAmount) +
1914
+ formatSpacedNumber(pensionForm.value.voluntaryContractAmount) +
1915
+ sumContractsAmount(transferContracts.value),
1916
+ ) ?? '';
1917
+ }
1918
+ };
1919
+
1373
1920
  const onInputFixInsSum = (event: Event) => {
1374
1921
  if (event.target && 'value' in event.target && event.target.value) {
1375
1922
  const calculatedFixInsSum = getNumber(event.target.value as string);
@@ -1394,6 +1941,21 @@ export default defineComponent({
1394
1941
  productConditionsForm.requestedSumInsuredInDollar = null;
1395
1942
  };
1396
1943
 
1944
+ const onClearPension = (key: keyof PensionCalculation | 'pensionAmount', index?: number) => {
1945
+ if (index) {
1946
+ transferContracts.value[index].transferContractAmount = 0;
1947
+ } else if (key === 'pensionAmount') {
1948
+ pensionForm.value.amount = '0';
1949
+ } else {
1950
+ pensionForm.value[key] = null;
1951
+
1952
+ // Clear isOwnAmountFromDividend when ownFundsRaisAmount is cleared
1953
+ if (key === 'ownFundsRaisAmount') {
1954
+ pensionForm.value.isOwnAmountFromDividend = null;
1955
+ }
1956
+ }
1957
+ };
1958
+
1397
1959
  const onClearSumDollar = () => {
1398
1960
  productConditionsForm.requestedSumInsured = null;
1399
1961
  };
@@ -1425,8 +1987,10 @@ export default defineComponent({
1425
1987
  };
1426
1988
 
1427
1989
  const filterTermConditions = (term: AddCover) => {
1428
- if (term.coverTypeCode === 10) {
1429
- return !!formStore.insuredForm.find((member: Member) => member.iin === formStore.policyholderForm.iin) === false;
1990
+ if (term.coverTypeCode === 10 && !props.isCalculator) {
1991
+ const isSinglePeriod = whichProduct.value === 'bolashak' ? productConditionsForm.paymentPeriod?.code === 'single' : false;
1992
+ const isDifferentClients = !!formStore.insuredForm.find((member: Member) => member.iin === formStore.policyholderForm.iin) === false;
1993
+ return isDifferentClients && !isSinglePeriod;
1430
1994
  }
1431
1995
  return true;
1432
1996
  };
@@ -1435,19 +1999,75 @@ export default defineComponent({
1435
1999
  if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1436
2000
  return String(term.coverTypeNameRu);
1437
2001
  }
1438
- return term.coverTypeName;
2002
+ return locale.value === 'ru' ? term.coverTypeName ?? '' : term.coverTypeNameKz ?? '';
2003
+ };
2004
+
2005
+ const addTransferContract = () => {
2006
+ transferContracts.value.push(new TransferContract());
2007
+ transferContracts.value[transferContracts.value.length - 1].transferContractDate = transferMaxDate.value;
2008
+ };
2009
+
2010
+ const removeTransferContract = (index: number) => {
2011
+ transferContracts.value.splice(index, 1);
2012
+ transferSum.value = transferContracts.value.reduce((accumulator, { transferContractAmount }) => (accumulator += formatSpacedNumber(transferContractAmount)), 0);
2013
+ };
2014
+
2015
+ const prepareTransferContracts = (transferContracts: Array<TransferContract>) => {
2016
+ const formatedContracts: Array<TransferContract> = [];
2017
+ if (transferContracts && transferContracts.length) {
2018
+ transferContracts.forEach(i => {
2019
+ formatedContracts.push({
2020
+ ...i,
2021
+ transferContractDate: constants.regex.isoDate.test(i.transferContractDate) ? i.transferContractDate : formatDate(i.transferContractDate)?.toISOString() ?? '',
2022
+ transferContractFirstPaymentDate: constants.regex.isoDate.test(i.transferContractFirstPaymentDate)
2023
+ ? i.transferContractFirstPaymentDate
2024
+ : formatDate(i.transferContractFirstPaymentDate)?.toISOString() ?? '',
2025
+ // @ts-ignore
2026
+ transferContractCompany:
2027
+ typeof i.transferContractCompany !== 'string' && 'nameRu' in i.transferContractCompany ? String(i.transferContractCompany.nameRu) : i.transferContractCompany,
2028
+ transferContractCompanyId:
2029
+ // @ts-ignore
2030
+ typeof i.transferContractCompany !== 'string' && 'ids' in i.transferContractCompany ? i.transferContractCompany.ids : i.transferContractCompanyId,
2031
+ id: i.id ?? null,
2032
+ transferContractAmount: String(i.transferContractAmount).replace(/\s/g, ''),
2033
+ });
2034
+ });
2035
+ }
2036
+ return formatedContracts;
2037
+ };
2038
+
2039
+ const validateContractDate = (v: any) => {
2040
+ if (v && maxDate.value && formatDate(v) && formatDate(maxDate.value)) {
2041
+ const invalidDate = (formatDate(v) ?? new Date()) > (formatDate(maxDate.value) ?? new Date());
2042
+ if (invalidDate) return 'Дата заключения договора некорректна';
2043
+ }
2044
+ return true;
1439
2045
  };
1440
2046
 
1441
2047
  const submitForm = async () => {
2048
+ if (
2049
+ whichProduct.value === 'pensionannuitynew' &&
2050
+ (formStore.applicationData.statusCode === 'StartForm' ||
2051
+ formStore.applicationData.statusCode === 'EditForm' ||
2052
+ formStore.applicationData.statusCode === 'EditBeneficiaryForm')
2053
+ ) {
2054
+ if (!enpfNoteFile.value) {
2055
+ dataStore.showToaster('error', 'Необходимо вложить Выписка ЕНПФ');
2056
+ return;
2057
+ }
2058
+ }
1442
2059
  vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
1443
2060
  if (v.valid) {
1444
2061
  if (whichProduct.value === 'lifetrip') {
1445
2062
  if (calculatorForm.type.code === 'Single' && calculatorForm.startDate && calculatorForm.endDate) {
1446
2063
  const formattedStartDate = formatDate(calculatorForm.startDate);
1447
2064
  const formattedEndDate = formatDate(calculatorForm.endDate);
1448
- if (formattedStartDate && formattedEndDate && formattedStartDate.getTime() > formattedEndDate.getTime()) {
2065
+ if (formattedStartDate && formattedEndDate && formattedStartDate.getTime() >= formattedEndDate.getTime()) {
1449
2066
  return dataStore.showToaster('error', dataStore.t('toaster.startMoreEnd'));
1450
2067
  }
2068
+ if (calculatorForm.days !== productConditionsForm.getSingleTripDays()) {
2069
+ return dataStore.showToaster('error', dataStore.t('toaster.daysPickAgain'));
2070
+ }
1451
2071
  }
1452
2072
  if (dataStore.isTask()) {
1453
2073
  await dataStore.calculatePrice(route.params.taskId as string);
@@ -1455,41 +2075,114 @@ export default defineComponent({
1455
2075
  await dataStore.calculatePrice();
1456
2076
  }
1457
2077
  } 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;
2078
+ if (contractDate.value && maxDate.value && formatDate(contractDate.value) && formatDate(maxDate.value)) {
2079
+ const invalidDate = (formatDate(contractDate.value) ?? new Date()) > (formatDate(maxDate.value) ?? new Date());
2080
+ if (invalidDate) {
2081
+ dataStore.showToaster('error', 'Дата заключения договора некорректна');
2082
+ return;
2083
+ }
2084
+ }
2085
+ if (transferContracts.value && transferContracts.value.length) {
2086
+ transferContracts.value.forEach(i => {
2087
+ if (formatDate(i.transferContractDate) != null && formatDate(transferMaxDate.value)) {
2088
+ const invalidDate = (formatDate(i.transferContractDate) ?? new Date()) > (formatDate(transferMaxDate.value) ?? new Date());
2089
+ if (invalidDate) {
2090
+ dataStore.showToaster('error', 'Дата заключения договора КСЖ некорректна');
2091
+ return;
2092
+ }
2093
+ }
2094
+ });
1467
2095
  }
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,
2096
+ if (!pensionForm.value.compulsoryProfContractAmount) pensionForm.value.compulsoryProfMonthCount = null;
2097
+ const pensionData = {
2098
+ ...pensionForm.value,
2099
+ ...{
2100
+ compulsoryContractAmount: formatSpacedNumber(pensionForm.value.compulsoryContractAmount),
2101
+ voluntaryContractAmount: formatSpacedNumber(pensionForm.value.voluntaryContractAmount),
2102
+ ownFundsRaisAmount: formatSpacedNumber(pensionForm.value.ownFundsRaisAmount),
2103
+ compulsoryProfContractAmount: formatSpacedNumber(pensionForm.value.compulsoryProfContractAmount),
2104
+ transferContractAmount: formatSpacedNumber(pensionForm.value.transferContractAmount),
2105
+ transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
2106
+ },
2107
+ amount: formatSpacedNumber(pensionForm.value.amount),
2108
+ contractDate: formatDate(contractDate.value ?? ''),
1481
2109
  };
1482
- await dataStore.setApplication(data, true);
2110
+ const data = isSlavePensionForm.value
2111
+ ? {
2112
+ ...formStore.pensionApp,
2113
+ transferContracts: prepareTransferContracts(formStore.pensionApp.transferContracts),
2114
+ slave: pensionData,
2115
+ amount: formatSpacedNumber(formStore.pensionApp?.amount),
2116
+ compulsoryContractAmount: formatSpacedNumber(formStore.pensionApp?.compulsoryContractAmount),
2117
+ voluntaryContractAmount: formatSpacedNumber(formStore.pensionApp?.voluntaryContractAmount),
2118
+ ownFundsRaisAmount: formatSpacedNumber(formStore.pensionApp?.ownFundsRaisAmount),
2119
+ compulsoryProfContractAmount: formatSpacedNumber(formStore.pensionApp?.compulsoryProfContractAmount),
2120
+ transferContractAmount: formatSpacedNumber(formStore.pensionApp?.transferContractAmount),
2121
+ transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
2122
+ }
2123
+ : {
2124
+ ...pensionData,
2125
+ transferContracts: prepareTransferContracts(transferContracts.value),
2126
+ slave: !!formStore.pensionApp?.slave
2127
+ ? {
2128
+ ...formStore.pensionApp?.slave,
2129
+ contractDate: pensionData.contractDate,
2130
+ amount: formatSpacedNumber(formStore.pensionApp?.slave?.amount),
2131
+ compulsoryContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.compulsoryContractAmount),
2132
+ voluntaryContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.voluntaryContractAmount),
2133
+ ownFundsRaisAmount: formatSpacedNumber(formStore.pensionApp?.slave?.ownFundsRaisAmount),
2134
+ compulsoryProfContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.compulsoryProfContractAmount),
2135
+ transferContractAmount: formatSpacedNumber(formStore.pensionApp?.slave?.transferContractAmount),
2136
+ transferContractCompany: pensionForm.value?.transferContractCompany?.nameRu ?? '',
2137
+ }
2138
+ : null,
2139
+ };
2140
+ if (!!data.slave) {
2141
+ data.slave.transferContracts = prepareTransferContracts(isSlavePensionForm.value ? transferContracts.value : data.slave.transferContracts);
2142
+ const difference = Math.abs(
2143
+ formatSpacedNumber(formStore.pensionApp?.amount) + formatSpacedNumber(formStore.pensionApp?.slave?.amount) - formatSpacedNumber(pensionForm.value.amount),
2144
+ );
2145
+ if (customPension.value) {
2146
+ isSlavePensionForm.value ? (data.slave.amount = formatSpacedNumber(pensionForm.value.amount)) : (data.amount = formatSpacedNumber(pensionForm.value.amount));
2147
+ const customSum = sumPensionData(data) + sumPensionData(data.slave);
2148
+ if (formatSpacedNumber(totalInsPremium.value) !== customSum) {
2149
+ return dataStore.showToaster('error', 'Cтраховая премия не соответсвует общей страховой премии');
2150
+ }
2151
+ if (!isSlavePensionForm.value) {
2152
+ data.slave.amount = difference;
2153
+ } else {
2154
+ data.amount = difference;
2155
+ }
2156
+ } else {
2157
+ const amount = isSlavePensionForm.value ? data.slave.amount : data.amount;
2158
+ if (formatSpacedNumber(pensionForm.value.amount) != amount) {
2159
+ data.slave.amount = sumPensionData(data.slave);
2160
+ data.amount = sumPensionData(data);
2161
+ }
2162
+ }
2163
+ const isParentValid = validatePensionForm(data, 'Заполните условия первого страхователя');
2164
+ const isSlaveValid = validatePensionForm(data.slave, 'Заполните условия второго страхователя');
2165
+ if (!isParentValid || !isSlaveValid) {
2166
+ return;
2167
+ }
2168
+ await dataStore.setApplication(data, true);
2169
+ customPension.value = false;
2170
+ } else {
2171
+ await dataStore.setApplication(data, true);
2172
+ }
2173
+ await dataStore.getApplicationData(String(route.params.taskId), false, false, false, true);
2174
+ dateOfBegin.value = reformatDate(formStore.applicationData.pensionApp.dateOfBegin);
2175
+ dividendSchedules.value = await dataStore.getDividendSchedule();
1483
2176
  } else {
1484
2177
  if (whichSum.value === 'requestedSumInsured') {
1485
2178
  productConditionsForm.insurancePremiumPerMonth = null;
1486
- if (whichProduct.value === 'halykkazyna') {
2179
+ if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
1487
2180
  productConditionsForm.insurancePremiumPerMonthInDollar = null;
1488
2181
  }
1489
2182
  }
1490
2183
  if (whichSum.value === 'insurancePremiumPerMonth') {
1491
2184
  productConditionsForm.requestedSumInsured = null;
1492
- if (whichProduct.value === 'halykkazyna') {
2185
+ if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
1493
2186
  productConditionsForm.requestedSumInsuredInDollar = null;
1494
2187
  }
1495
2188
  }
@@ -1555,7 +2248,9 @@ export default defineComponent({
1555
2248
  recalculationData.riskGroup = productConditionsForm.riskGroup?.id ? productConditionsForm.riskGroup.id : 1;
1556
2249
  isCalculating.value = true;
1557
2250
  if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1558
- await dataStore.calculate(route.params.taskId as string);
2251
+ const setApplicationData = dataStore.getConditionsData();
2252
+ const hasSetApplication = await dataStore.setApplication(setApplicationData);
2253
+ if (hasSetApplication && !isHalykBank) await dataStore.calculate(route.params.taskId as string);
1559
2254
  additionalTerms.value = formStore.additionalInsuranceTerms;
1560
2255
  } else {
1561
2256
  await dataStore.reCalculate(formStore.applicationData.processInstanceId, recalculationData, route.params.taskId as string, whichSum.value);
@@ -1569,12 +2264,11 @@ export default defineComponent({
1569
2264
  additionalTerms.value = formStore.additionalInsuranceTermsWithout;
1570
2265
  } else {
1571
2266
  if (dataStore.isProcessEditable(formStore.applicationData.statusCode)) {
1572
- await dataStore.calculate(route.params.taskId as string);
2267
+ await dataStore.calculate(route.params.taskId as string, isHalykBank);
1573
2268
  additionalTerms.value = formStore.additionalInsuranceTerms;
1574
2269
  }
1575
2270
  }
1576
2271
  }
1577
-
1578
2272
  isCalculating.value = false;
1579
2273
  } else {
1580
2274
  const errors = document.querySelector('.v-input--error');
@@ -1598,75 +2292,182 @@ export default defineComponent({
1598
2292
  });
1599
2293
  };
1600
2294
 
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;
1631
- }
2295
+ const validatePensionForm = (data: any, text: string) => {
2296
+ if (!data.amount || !data.guaranteedPeriod) {
2297
+ dataStore.showToaster('error', text);
2298
+ return false;
2299
+ }
2300
+ return true;
2301
+ };
2302
+
2303
+ const sumPensionData = (data: any) => {
2304
+ return (
2305
+ formatSpacedNumber(data.ownFundsRaisAmount) +
2306
+ formatSpacedNumber(data.voluntaryContractAmount) +
2307
+ formatSpacedNumber(data.compulsoryContractAmount) +
2308
+ formatSpacedNumber(data.compulsoryProfContractAmount) +
2309
+ sumContractsAmount(data.transferContracts)
2310
+ );
2311
+ };
2312
+
2313
+ const onFileChange = async (event: InputEvent) => {
2314
+ if (event && event.target) {
2315
+ const file = (event.target as HTMLInputElement).files?.[0];
2316
+ if (file) {
2317
+ if (file.type !== constants.fileTypes.pdf) {
2318
+ return dataStore.showToaster('error', dataStore.t('toaster.onlyPDF'), 6000);
2319
+ }
2320
+ const result = await dataStore.setOppvCount({ file });
2321
+ if (typeof result === 'number') {
2322
+ pensionForm.value.compulsoryProfMonthCount = result;
2323
+ await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
2324
+ dataStore.showToaster('success', dataStore.t('toaster.successOperation'));
1632
2325
  }
1633
2326
  }
1634
2327
  }
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';
1644
- }
1645
- if (dataStore.isCalculator) {
1646
- dataStore.processCode = constants.products[whichProduct.value as keyof typeof constants.products];
1647
- await dataStore.getProcessPaymentPeriod();
1648
- }
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();
2328
+ };
2329
+ const openFileActionsPanel = async (document: DocumentItem) => {
2330
+ dataStore.rightPanel.title = document.fileTypeName!;
2331
+ dataStore.rightPanel.open = true;
2332
+ isFileActionsPanelOpen.value = true;
2333
+ dataStore.panelAction = null;
2334
+ };
2335
+ const getDoc = async (type: FileActions) => {
2336
+ if (enpfNoteFile.value) {
2337
+ documentLoading.value = true;
2338
+ const fileExtension = enpfNoteFile.value.fileName!.match(/\.([0-9a-z]+)(?:[\?#]|$)/i)![1];
2339
+ await dataStore.getDoc(enpfNoteFile.value, type, fileExtension);
2340
+ documentLoading.value = false;
1653
2341
  }
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
- );
2342
+ };
2343
+ const deleteFile = async () => {
2344
+ if (enpfNoteFile.value) {
2345
+ const data = {
2346
+ id: enpfNoteFile.value.id,
2347
+ processInstanceId: enpfNoteFile.value.processInstanceId,
2348
+ iin: enpfNoteFile.value.iin ?? '',
2349
+ };
2350
+ await dataStore.deleteFile(data);
2351
+ deletionDialog.value = false;
2352
+ isFileActionsPanelOpen.value = false;
2353
+ dataStore.rightPanel.open = false;
2354
+ dataStore.panelAction = null;
2355
+ pensionForm.value.compulsoryProfMonthCount = '';
2356
+ await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
1660
2357
  }
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);
2358
+ };
2359
+
2360
+ onMounted(async () => {
2361
+ try {
2362
+ if (hasContragentData.value) await getContragent();
2363
+ if (props.isCalculator === true) {
2364
+ isLoading.value = true;
2365
+ if (dataStore.isCalculator) {
2366
+ clearFields();
2367
+ }
2368
+ if (whichProduct.value === 'gons') {
2369
+ formStore.isDisabled.productConditionsForm = false;
2370
+ dataStore.setFormsDisabled(false);
2371
+ }
2372
+ if (whichProduct.value !== 'lifetrip' && whichProduct.value !== 'pensionannuitynew') {
2373
+ if (
2374
+ (dataStore.isCalculator || route.params.taskId === '0' || fromIndexPage.value) &&
2375
+ productConditionsForm.requestedSumInsured === null &&
2376
+ productConditionsForm.insurancePremiumPerMonth === null
2377
+ ) {
2378
+ // @ts-ignore
2379
+ const defaultData = await dataStore.getDefaultCalculationData(true, whichProduct.value);
2380
+ if (!defaultData) {
2381
+ dataStore.showToaster('error', 'Отсутствуют базовые данные');
2382
+ return;
2383
+ }
2384
+ formStore.additionalInsuranceTermsWithout = defaultData.addCovers;
2385
+ productConditionsForm.requestedSumInsured = defaultData.amount;
2386
+ productConditionsForm.insurancePremiumPerMonth = defaultData.premium;
2387
+ const indexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
2388
+ if (indexRate) productConditionsForm.processIndexRate = indexRate;
2389
+ const paymendPeriod = dataStore.processPaymentPeriod.find(i => i.id === defaultData.paymentPeriodId);
2390
+ if (paymendPeriod) productConditionsForm.paymentPeriod = paymendPeriod;
2391
+ if (defaultData.signDate) {
2392
+ productConditionsForm.signDate = reformatDate(defaultData.signDate);
2393
+ }
2394
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
2395
+ productConditionsForm.coverPeriod = defaultData.insTermInMonth ?? null;
2396
+ productConditionsForm.insurancePremiumPerMonth = null;
2397
+ }
2398
+ }
2399
+ }
2400
+ }
2401
+ additionalTerms.value = props.isCalculator ? formStore.additionalInsuranceTermsWithout : formStore.additionalInsuranceTerms;
2402
+ if (!!productConditionsForm.insurancePremiumPerMonth) {
2403
+ whichSum.value = 'insurancePremiumPerMonth';
2404
+ }
2405
+ if (!!productConditionsForm.requestedSumInsured) {
2406
+ whichSum.value = 'requestedSumInsured';
2407
+ }
2408
+ if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && !productConditionsForm.requestedSumInsured) {
2409
+ whichSum.value = 'requestedSumInsured';
2410
+ }
2411
+ if (dataStore.isCalculator) {
2412
+ dataStore.processCode = constants.products[whichProduct.value as keyof typeof constants.products];
2413
+ await dataStore.getProcessPaymentPeriod();
2414
+ }
2415
+ if (
2416
+ formStore.productConditionsForm.requestedSumInsured === null &&
2417
+ formStore.productConditionsForm.insurancePremiumPerMonth === null &&
2418
+ (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons')
2419
+ ) {
2420
+ await dataStore.getCurrencies();
2421
+ }
2422
+ if (whichProduct.value === 'halykkazyna') {
2423
+ const kazynaPaymentPeriod = dataStore.processPaymentPeriod.find(i => i.code === 'single');
2424
+ if (kazynaPaymentPeriod) productConditionsForm.paymentPeriod = kazynaPaymentPeriod;
2425
+ }
2426
+ if (!formStore.lfb.add && !isHalykBank && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
2427
+ productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(
2428
+ formStore.lfb.clients.reduce((sum: number, i: any) => {
2429
+ return sum + Number(i.insSum);
2430
+ }, 0),
2431
+ );
2432
+ }
2433
+ if (whichProduct.value === 'pensionannuitynew') {
2434
+ contractDate.value = reformatDate(pensionForm.value.contractDate ?? '');
2435
+ dateOfBegin.value = reformatDate(pensionForm.value.dateOfBegin);
2436
+ transferContractDate.value = reformatDate(pensionForm.value.transferContractDate);
2437
+ transferContractFirstPaymentDate.value = reformatDate(pensionForm.value.transferContractFirstPaymentDate ?? '');
2438
+ maxDate.value = await dataStore.getVariableData(formStore.applicationData.processCode ?? 19);
2439
+ dividendPeriods.value = await dataStore.getProcessDividendPeriods();
2440
+ if (pensionForm.value.dividendId) {
2441
+ dividendSchedules.value = await dataStore.getDividendSchedule();
2442
+ }
2443
+ if (!transferContracts.value.length && pensionForm.value.transferContracts && pensionForm.value.transferContracts.length) {
2444
+ pensionForm.value.transferContracts.forEach((contract: TransferContract) => {
2445
+ transferContracts.value.push({
2446
+ ...contract,
2447
+ transferContractDate: constants.regex.isoDate.test(contract.transferContractDate) ? reformatDate(contract.transferContractDate)! : contract.transferContractDate,
2448
+ transferContractFirstPaymentDate: constants.regex.isoDate.test(contract.transferContractFirstPaymentDate)
2449
+ ? reformatDate(contract.transferContractFirstPaymentDate)!
2450
+ : contract.transferContractFirstPaymentDate,
2451
+ transferContractCompany:
2452
+ typeof contract.transferContractCompany === 'string' ? ({ nameRu: contract.transferContractCompany } as any) : contract.transferContractCompany,
2453
+ transferContractAmount: dataStore.getNumberWithSpaces(contract.transferContractAmount) ?? '',
2454
+ });
2455
+ });
2456
+ }
2457
+ }
2458
+ } catch (err) {
2459
+ console.log(err);
2460
+ } finally {
2461
+ isLoading.value = false;
1667
2462
  }
1668
2463
  });
1669
2464
 
2465
+ watch(
2466
+ () => pensionForm.value?.amount,
2467
+ val => {
2468
+ if (val) pensionForm.value.amount = dataStore.getNumberWithSpaces(val);
2469
+ },
2470
+ );
1670
2471
  watch(
1671
2472
  () => productConditionsForm.amountOfInsurancePremium,
1672
2473
  val => {
@@ -1697,6 +2498,23 @@ export default defineComponent({
1697
2498
  { immediate: true },
1698
2499
  );
1699
2500
 
2501
+ if (hasCurrency.value) {
2502
+ watch(
2503
+ () => productConditionsForm.currency,
2504
+ async val => {
2505
+ if (val.code === 'USD') {
2506
+ if (!dataStore.processPaymentPeriod.length) {
2507
+ await dataStore.getProcessPaymentPeriod();
2508
+ }
2509
+ const paymentPeriod = dataStore.processPaymentPeriod.find(item => item.nameRu === 'единовременно');
2510
+ if (paymentPeriod) {
2511
+ productConditionsForm.paymentPeriod = paymentPeriod;
2512
+ }
2513
+ }
2514
+ },
2515
+ );
2516
+ }
2517
+
1700
2518
  if (hasInsStartDate.value) {
1701
2519
  watch(
1702
2520
  () => productConditionsForm.calcDate,
@@ -1730,6 +2548,8 @@ export default defineComponent({
1730
2548
  async val => {
1731
2549
  if (val?.length && val.every(option => option.id != 0) && calculatorForm.type?.nameRu != null) {
1732
2550
  await dataStore.getTripInsuredAmount();
2551
+ } else {
2552
+ calculatorForm.amount = new Value();
1733
2553
  }
1734
2554
  },
1735
2555
  { deep: true },
@@ -1763,8 +2583,48 @@ export default defineComponent({
1763
2583
  );
1764
2584
  }
1765
2585
 
2586
+ if (whichProduct.value === 'pensionannuitynew') {
2587
+ watch(
2588
+ () => pensionForm.value.guaranteedPeriod,
2589
+ async () => {
2590
+ if (formStore.applicationData.processCode === 24) {
2591
+ await dataStore.reCalculateRefund(
2592
+ Number(pensionForm.value.parentContractAmount),
2593
+ Number(pensionForm.value.parentContractMainAmount),
2594
+ pensionForm.value.guaranteedPeriod,
2595
+ pensionForm.value.transferContractIsOppv,
2596
+ pensionForm.value.compulsoryProfMonthCount ?? 0,
2597
+ );
2598
+ }
2599
+ },
2600
+ );
2601
+ watch(
2602
+ () => contractDate.value,
2603
+ (val, oldVal) => {
2604
+ if (val !== null && val !== undefined && val.length === 10 && oldVal != undefined && !isSlavePensionForm.value) {
2605
+ const formattedContractDate = formatDate(val);
2606
+ if (formattedContractDate) {
2607
+ formattedContractDate.setDate(formattedContractDate.getDate() + 20);
2608
+ dateOfBegin.value = reformatDate(String(formattedContractDate));
2609
+ }
2610
+ }
2611
+ },
2612
+ { immediate: true },
2613
+ );
2614
+ watch(
2615
+ () => pensionForm.value.ownFundsRaisAmount,
2616
+ val => {
2617
+ if (val && val.replace(/\s/g, '') > 0) {
2618
+ pensionForm.value.isOwnAmountFromDividend = true;
2619
+ } else {
2620
+ pensionForm.value.isOwnAmountFromDividend = false;
2621
+ }
2622
+ },
2623
+ );
2624
+ }
2625
+
1766
2626
  const copyRedirect = async () => {
1767
- const url = await dataStore.api.getEnpfRedirectUrl(String(formStore.applicationData.processInstanceId));
2627
+ const url = await dataStore.api.pensionannuityNew.getEnpfRedirectUrl(String(pensionForm.value.processInstanceId));
1768
2628
  dataStore.copyToClipboard(url.redirectUrl);
1769
2629
  };
1770
2630
 
@@ -1772,11 +2632,15 @@ export default defineComponent({
1772
2632
  // State
1773
2633
  formStore,
1774
2634
  vForm,
2635
+ locale,
2636
+ isLoading,
1775
2637
  whichProduct,
1776
2638
  productConditionsForm,
1777
2639
  additionalTerms,
1778
2640
  isCalculating,
1779
2641
  isPanelLoading,
2642
+ documentLoading,
2643
+ deletionDialog,
1780
2644
  isPanelOpen,
1781
2645
  isMultiplePanelOpen,
1782
2646
  isTermsPanelOpen,
@@ -1793,20 +2657,37 @@ export default defineComponent({
1793
2657
  subTermValue,
1794
2658
  panelCodeList,
1795
2659
  pensionForm,
2660
+ insuredForm,
1796
2661
  dateOfBegin,
1797
2662
  contractDate,
1798
2663
  transferContractDate,
1799
2664
  transferContractFirstPaymentDate,
1800
2665
  enabled,
1801
2666
  maxDate,
2667
+ amountPaid,
2668
+ amountRefunded,
2669
+ transferMaxDate,
1802
2670
  guaranteedPeriodList,
2671
+ isFileActionsPanelOpen,
1803
2672
  isEnpfSum,
2673
+ transferContracts,
2674
+ contractsValue,
2675
+ contractIndex,
2676
+ contragentData,
2677
+ customPension,
1804
2678
 
1805
2679
  // Computed
1806
2680
  isTask,
1807
2681
  isDisabled,
2682
+ enpfNoteFile,
2683
+ disabilityGroup,
2684
+ totalInsPremium,
1808
2685
  isTermsDisabled,
1809
2686
  isUnderwriterForm,
2687
+ hasCurrencySymbols,
2688
+ currencyListFiltered,
2689
+ currencySymbolsLabel,
2690
+ isDisabledPaymentPeriod,
1810
2691
  insurancePremiumPerMonthRule,
1811
2692
  insurancePremiumPerMonthDisabled,
1812
2693
  requestedSumInsuredRule,
@@ -1814,9 +2695,13 @@ export default defineComponent({
1814
2695
  isUnderwriterRole,
1815
2696
  hasProcessIndexRate,
1816
2697
  hasPaymentPeriod,
2698
+ hasRequestedSumInsured,
2699
+ hasInsurancePremiumPerMonth,
1817
2700
  hasRequestedSumInsuredInDollar,
1818
2701
  hasInsurancePremiumPerMonthInDollar,
1819
2702
  hasCurrency,
2703
+ hasPaidOrRefund,
2704
+ hasContragentData,
1820
2705
  hasAdbMultiply,
1821
2706
  readonlyLifeAdditive,
1822
2707
  readonlyDisabilityMultiply,
@@ -1826,6 +2711,7 @@ export default defineComponent({
1826
2711
  hasCalculated,
1827
2712
  hasAnnuityPayments,
1828
2713
  hasAgencyPart,
2714
+ hasDisabilityAdditive,
1829
2715
  currencySymbolsAddTerm,
1830
2716
  amountAnnuityPayments,
1831
2717
  requestedSumInsuredLabel,
@@ -1835,30 +2721,41 @@ export default defineComponent({
1835
2721
  hasBirthDate,
1836
2722
  hasGender,
1837
2723
  coverPeriodLabel,
2724
+ lifeMultiplyLabel,
2725
+ lifeAdditiveLabel,
2726
+ disabilityMultiplyLabel,
2727
+ adbMultiplyLabel,
2728
+ adbAdditiveLabel,
1838
2729
  insurancePremiumPerMonthLabel,
1839
2730
  isDisabledCoverPeriod,
1840
2731
  hasDefault,
1841
2732
  isShownAdditionalTerms,
1842
2733
  hasCalcSum,
2734
+ isDisabledInsStartDate,
1843
2735
  isDisabledAgentCommission,
1844
2736
  hasFixInsSum,
1845
2737
  isDisabledFixInsSum,
1846
2738
  defaultText,
1847
2739
  hasDeathInsFromNS,
1848
- pensionAmount,
1849
- pensionCalculationParams,
1850
2740
  hasDeathInsAnyReason,
1851
2741
  fromIndexPage,
1852
2742
  hasCoverPeriod,
1853
2743
  hasInsStartDate,
1854
2744
  hasInsEndDate,
2745
+ isSlavePensionForm,
2746
+ dividendPeriods,
2747
+ dividendSchedules,
1855
2748
 
1856
2749
  // Rules
1857
- coverPeriodRule,
1858
2750
  fixInsSumRule,
2751
+ agencyPartRule,
2752
+ coverPeriodRule,
1859
2753
 
1860
2754
  // Functions
2755
+ getDoc,
1861
2756
  submitForm,
2757
+ deleteFile,
2758
+ onFileChange,
1862
2759
  pickPanelValue,
1863
2760
  pickTermValue,
1864
2761
  openPanel,
@@ -1868,10 +2765,13 @@ export default defineComponent({
1868
2765
  underwriterCalculate,
1869
2766
  onInputInsurancePremiumPerMonth,
1870
2767
  onInputInsurancePremiumPerMonthInDollar,
2768
+ validateContractDate,
1871
2769
  onInputSum,
2770
+ onInputPension,
1872
2771
  onInputSumDollar,
1873
2772
  toStatement,
1874
2773
  onClearSum,
2774
+ onClearPension,
1875
2775
  onClearSumDollar,
1876
2776
  onClearPremium,
1877
2777
  onClearPremiumDollar,
@@ -1883,13 +2783,36 @@ export default defineComponent({
1883
2783
  pickSubTermValue,
1884
2784
  onInputFixInsSum,
1885
2785
  copyRedirect,
2786
+ getContragent,
2787
+ addTransferContract,
2788
+ openFileActionsPanel,
2789
+ removeTransferContract,
2790
+ checkTransferContractDate,
1886
2791
  };
1887
2792
  },
1888
2793
  });
1889
2794
  </script>
1890
2795
 
1891
2796
  <style>
1892
- .pension-guaranteed-period .v-field {
2797
+ .pension-round-toggle .v-field {
1893
2798
  border: none !important;
1894
2799
  }
2800
+ .grid-table > div > span {
2801
+ padding-left: 24px;
2802
+ border-right: 1px solid #fff;
2803
+ display: flex;
2804
+ align-items: center;
2805
+ padding-top: 12px;
2806
+ padding-bottom: 12px;
2807
+ min-width: 15%;
2808
+ }
2809
+ .v-virtual-scroll__item > div > span {
2810
+ padding-left: 24px;
2811
+ border-right: 1px solid #fff;
2812
+ display: flex;
2813
+ align-items: center;
2814
+ padding-top: 12px;
2815
+ padding-bottom: 12px;
2816
+ min-width: 15%;
2817
+ }
1895
2818
  </style>