hl-core 0.0.9-beta.5 → 0.0.9-beta.51

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 (63) hide show
  1. package/api/base.api.ts +1042 -0
  2. package/api/index.ts +2 -620
  3. package/api/interceptors.ts +53 -14
  4. package/components/Button/Btn.vue +2 -2
  5. package/components/Complex/MessageBlock.vue +2 -2
  6. package/components/Complex/Page.vue +1 -1
  7. package/components/Dialog/Dialog.vue +60 -15
  8. package/components/Form/DynamicForm.vue +100 -0
  9. package/components/Form/FormBlock.vue +12 -3
  10. package/components/Form/FormData.vue +110 -0
  11. package/components/Form/FormSection.vue +3 -3
  12. package/components/Form/FormToggle.vue +25 -5
  13. package/components/Form/ManagerAttachment.vue +150 -86
  14. package/components/Form/ProductConditionsBlock.vue +59 -6
  15. package/components/Input/Datepicker.vue +43 -7
  16. package/components/Input/DynamicInput.vue +23 -0
  17. package/components/Input/FileInput.vue +25 -5
  18. package/components/Input/FormInput.vue +7 -4
  19. package/components/Input/Monthpicker.vue +34 -0
  20. package/components/Input/PanelInput.vue +5 -1
  21. package/components/Input/RoundedEmptyField.vue +5 -0
  22. package/components/Input/RoundedSelect.vue +18 -0
  23. package/components/Input/SwitchInput.vue +64 -0
  24. package/components/Input/TextInput.vue +160 -0
  25. package/components/Layout/Drawer.vue +17 -4
  26. package/components/Layout/Header.vue +23 -2
  27. package/components/Layout/Loader.vue +1 -1
  28. package/components/Layout/SettingsPanel.vue +13 -7
  29. package/components/Menu/InfoMenu.vue +35 -0
  30. package/components/Menu/MenuNav.vue +17 -2
  31. package/components/Pages/Anketa.vue +140 -52
  32. package/components/Pages/Auth.vue +50 -9
  33. package/components/Pages/ContragentForm.vue +124 -50
  34. package/components/Pages/Documents.vue +179 -29
  35. package/components/Pages/InvoiceInfo.vue +1 -1
  36. package/components/Pages/MemberForm.vue +605 -116
  37. package/components/Pages/ProductAgreement.vue +1 -8
  38. package/components/Pages/ProductConditions.vue +1055 -183
  39. package/components/Panel/PanelHandler.vue +583 -46
  40. package/components/Panel/PanelSelectItem.vue +17 -2
  41. package/components/Panel/RightPanelCloser.vue +7 -0
  42. package/components/Transitions/Animation.vue +28 -0
  43. package/components/Utilities/Qr.vue +44 -0
  44. package/composables/axios.ts +1 -0
  45. package/composables/classes.ts +456 -8
  46. package/composables/constants.ts +114 -2
  47. package/composables/fields.ts +328 -0
  48. package/composables/index.ts +270 -19
  49. package/composables/styles.ts +29 -16
  50. package/layouts/default.vue +48 -3
  51. package/locales/ru.json +547 -14
  52. package/package.json +28 -24
  53. package/pages/Token.vue +1 -12
  54. package/plugins/vuetifyPlugin.ts +2 -0
  55. package/store/data.store.ts +1463 -275
  56. package/store/extractStore.ts +17 -0
  57. package/store/form.store.ts +13 -1
  58. package/store/member.store.ts +1 -1
  59. package/store/rules.ts +83 -5
  60. package/types/enum.ts +61 -0
  61. package/types/env.d.ts +1 -0
  62. package/types/form.ts +94 -0
  63. package/types/index.ts +259 -23
@@ -1,19 +1,17 @@
1
1
  <template>
2
2
  <section class="flex flex-col gap-4 px-[10px]">
3
- <v-form ref="vForm" @submit="submitForm" class="max-h-[82svh] overflow-y-scroll">
4
- <base-form-section v-if="whichProduct === 'gons'" :title="$dataStore.t('productConditionsForm.requestedProductConditions')" :class="[$styles.textSimple]">
5
- <base-form-text-section
6
- class="mb-4"
7
- title="Инвалидность I или II группы по причине несчастного случая, начиная с третьего года по любой причине, с освобождением от уплаты страховых взносов"
8
- subtitle="Равна страховой сумме по основному покрытию"
9
- />
10
- <base-form-text-section
11
- title="Если лицо, назначенное Выгодоприобретателем, на дату осуществления Страховщиком страховой выплаты не достигло совершеннолетия (восемнадцатилетнего возраста), страховая
12
- выплата подлежит осуществлению:"
13
- subtitle="Если несовершеннолетний не достиг возраста 14 лет - законному представителю в соответствии с законодательством Республики Казахстан"
14
- />
15
- </base-form-section>
16
- <base-form-section v-if="isUnderwriterRole && $dataStore.hasClientAnketa && $dataStore.isClientAnketaCondition" :title="$dataStore.t('policyholderForm')">
3
+ <v-form ref="vForm" @submit="submitForm" class="overflow-y-scroll" :class="[!$dataStore.isCalculator && isCalculator && hasCalculated ? 'max-h-[73svh]' : 'max-h-[80svh]']">
4
+ <base-message-block
5
+ v-if="isCalculator"
6
+ class="mt-4"
7
+ :color="$styles.blueBgLight"
8
+ :text="$dataStore.t('preliminaryCalculation')"
9
+ icon="mdi-alert text-[#FCB016]"
10
+ ></base-message-block>
11
+ <base-form-section
12
+ v-if="isUnderwriterRole && $dataStore.hasClientAnketa && $dataStore.isClientAnketaCondition && whichProduct !== 'pensionannuity'"
13
+ :title="$dataStore.t('policyholderForm')"
14
+ >
17
15
  <base-form-input
18
16
  v-model="productConditionsForm.lifeMultiplyClient"
19
17
  :maska="$maska.numbers"
@@ -37,7 +35,10 @@
37
35
  <base-form-input v-model="formStore.policyholderForm.age" :label="$dataStore.t('form.age')" :readonly="true" />
38
36
  <base-form-input v-model="formStore.policyholderForm.gender.nameRu" class="mb-4" :label="$dataStore.t('form.gender')" :readonly="true" />
39
37
  </base-form-section>
40
- <base-form-section v-if="isUnderwriterRole && $dataStore.members.insuredApp.has === true" :title="$dataStore.t('insuredForm')">
38
+ <base-form-section
39
+ v-if="isUnderwriterRole && $dataStore.members.insuredApp.has === true && whichProduct !== 'lifebusiness' && whichProduct !== 'gns' && whichProduct !== 'pensionannuity'"
40
+ :title="$dataStore.t('insuredForm')"
41
+ >
41
42
  <div v-for="(insured, index) of formStore.insuredForm" :key="index">
42
43
  <base-form-input v-model="insured.longName" :label="$dataStore.t('labels.insurerLongName')" :readonly="true" />
43
44
  <base-form-input v-model="insured.job" :label="$dataStore.t('form.job')" :readonly="true" />
@@ -47,21 +48,24 @@
47
48
  <base-form-input v-model="insured.gender.nameRu" class="mb-4" :label="$dataStore.t('form.gender')" :readonly="true" />
48
49
  </div>
49
50
  </base-form-section>
50
- <base-form-section v-if="isUnderwriterRole" :title="$dataStore.t('recalculationInfo')">
51
+ <base-form-section
52
+ v-if="isUnderwriterRole && whichProduct !== 'lifebusiness' && whichProduct !== 'gns' && whichProduct !== 'pensionannuity'"
53
+ :title="$dataStore.t('recalculationInfo')"
54
+ >
51
55
  <base-form-input
52
56
  v-model="productConditionsForm.lifeMultiply"
53
57
  :maska="$maska.numbers"
54
58
  :clearable="isRecalculationDisabled === false"
55
59
  :label="$dataStore.t('percent') + `Life Multiply`"
56
60
  :readonly="isRecalculationDisabled"
57
- :rules="$dataStore.rules.recalculationMultiply"
61
+ :rules="whichProduct === 'gons' ? $dataStore.rules.recalculationMultiplyBetween : $dataStore.rules.recalculationMultiply"
58
62
  />
59
63
  <base-form-input
60
64
  v-model="productConditionsForm.lifeAdditive"
61
65
  :maska="$maska.numbers"
62
66
  :clearable="isRecalculationDisabled === false"
63
67
  :label="$dataStore.t('percent') + `Life Additive`"
64
- :readonly="isRecalculationDisabled"
68
+ :readonly="readonlyLifeAdditive"
65
69
  :rules="$dataStore.rules.recalculationAdditive"
66
70
  />
67
71
  <base-form-input
@@ -87,21 +91,21 @@
87
91
  :maska="$maska.numbers"
88
92
  :clearable="isRecalculationDisabled === false"
89
93
  :label="$dataStore.t('percent') + `Disability Multiply`"
90
- :readonly="isRecalculationDisabled"
91
- :rules="$dataStore.rules.recalculationMultiply"
94
+ :readonly="readonlyDisabilityMultiply"
95
+ :rules="whichProduct === 'gons' ? [] : $dataStore.rules.recalculationMultiply"
92
96
  />
93
97
  <base-form-input
94
98
  v-model="productConditionsForm.disabilityAdditive"
95
99
  :maska="$maska.numbers"
96
100
  :clearable="isRecalculationDisabled === false"
97
101
  :label="$dataStore.t('percent') + `Disability Additive`"
98
- :readonly="isRecalculationDisabled"
102
+ :readonly="readonlyDisabilityAdditive"
99
103
  :rules="$dataStore.rules.recalculationAdditive"
100
104
  />
101
105
  <base-panel-input
102
106
  v-if="hasRiskGroup"
103
107
  v-model="productConditionsForm.riskGroup"
104
- :value="productConditionsForm.riskGroup.nameRu"
108
+ :value="productConditionsForm.riskGroup?.nameRu"
105
109
  :label="$dataStore.t('productConditionsForm.riskGroup')"
106
110
  :clearable="isRecalculationDisabled === false"
107
111
  :readonly="isRecalculationDisabled"
@@ -109,8 +113,8 @@
109
113
  @append="openPanel($dataStore.t('productConditionsForm.riskGroup'), $dataStore.riskGroup, 'riskGroup')"
110
114
  />
111
115
  </base-form-section>
112
- <base-form-section :title="$dataStore.t('generalConditions')">
113
- <div v-if="isRecalculation && ($route.params.taskId === '0' || $dataStore.isCalculator)">
116
+ <base-form-section v-if="hasDefault" :title="defaultText">
117
+ <div v-if="isCalculator && ($route.params.taskId === '0' || $dataStore.isCalculator)">
114
118
  <base-form-input
115
119
  v-model="productConditionsForm.signDate"
116
120
  :maska="$maska.date"
@@ -120,6 +124,7 @@
120
124
  append-inner-icon="mdi mdi-calendar-blank-outline"
121
125
  />
122
126
  <base-form-input
127
+ v-if="hasBirthDate"
123
128
  v-model="productConditionsForm.birthDate"
124
129
  :maska="$maska.date"
125
130
  :readonly="isDisabled"
@@ -129,8 +134,9 @@
129
134
  append-inner-icon="mdi mdi-calendar-blank-outline"
130
135
  />
131
136
  <base-panel-input
137
+ v-if="hasGender"
132
138
  v-model="productConditionsForm.gender"
133
- :value="productConditionsForm.gender.nameRu"
139
+ :value="productConditionsForm.gender?.nameRu"
134
140
  :readonly="isDisabled"
135
141
  :clearable="!isDisabled"
136
142
  :label="$dataStore.t('form.gender')"
@@ -142,15 +148,15 @@
142
148
  <base-form-input
143
149
  v-model="productConditionsForm.coverPeriod"
144
150
  :maska="$maska.numbers"
145
- :readonly="isDisabled"
151
+ :readonly="isDisabledCoverPeriod"
146
152
  :clearable="!isDisabled"
147
153
  :rules="coverPeriodRule"
148
- :label="$dataStore.t(whichProduct === 'gons' ? 'productConditionsForm.coverPeriodFrom3to20' : 'productConditionsForm.coverPeriod')"
154
+ :label="coverPeriodLabel"
149
155
  />
150
156
  <base-panel-input
151
157
  v-if="hasPaymentPeriod"
152
158
  v-model="productConditionsForm.paymentPeriod"
153
- :value="productConditionsForm.paymentPeriod.nameRu"
159
+ :value="productConditionsForm.paymentPeriod?.nameRu"
154
160
  :readonly="isDisabled"
155
161
  :clearable="!isDisabled"
156
162
  :rules="$rules.objectRequired"
@@ -161,7 +167,7 @@
161
167
  <base-panel-input
162
168
  v-if="hasProcessIndexRate"
163
169
  v-model="productConditionsForm.processIndexRate"
164
- :value="productConditionsForm.processIndexRate.nameRu"
170
+ :value="productConditionsForm.processIndexRate?.nameRu"
165
171
  :readonly="isDisabled"
166
172
  :clearable="!isDisabled"
167
173
  :rules="$rules.objectRequired"
@@ -169,11 +175,21 @@
169
175
  append-inner-icon="mdi mdi-chevron-right"
170
176
  @append="openPanel($dataStore.t('productConditionsForm.processIndexRate'), $dataStore.processIndexRate, 'processIndexRate', $dataStore.getProcessIndexRate)"
171
177
  />
178
+ <base-form-input
179
+ v-if="hasFixInsSum"
180
+ v-model="productConditionsForm.fixInsSum"
181
+ :readonly="isDisabledFixInsSum"
182
+ :clearable="!isDisabled"
183
+ :rules="fixInsSumRule"
184
+ :label="$dataStore.t('productConditionsForm.fixInsSum')"
185
+ :suffix="$constants.currencySymbols.kzt"
186
+ @input="onInputFixInsSum"
187
+ />
172
188
  <base-form-input
173
189
  v-model="productConditionsForm.requestedSumInsured"
174
190
  :readonly="isDisabledSum"
175
- :clearable="!isDisabled"
176
- :rules="requestedSumInsured"
191
+ :clearable="!isDisabledSum"
192
+ :rules="requestedSumInsuredRule"
177
193
  :label="requestedSumInsuredLabel"
178
194
  :suffix="$constants.currencySymbols.kzt"
179
195
  @input="onInputSum"
@@ -183,8 +199,8 @@
183
199
  v-if="hasRequestedSumInsuredInDollar"
184
200
  v-model="productConditionsForm.requestedSumInsuredInDollar"
185
201
  :readonly="isDisabledSumDollar"
186
- :clearable="!isDisabled"
187
- :rules="requestedSumInsured"
202
+ :clearable="!isDisabledSumDollar"
203
+ :rules="requestedSumInsuredRule"
188
204
  :label="$dataStore.t('productConditionsForm.requestedSumInsuredInDollar')"
189
205
  :suffix="$constants.currencySymbols.usd"
190
206
  @input="onInputSumDollar"
@@ -192,10 +208,10 @@
192
208
  />
193
209
  <base-form-input
194
210
  v-model="productConditionsForm.insurancePremiumPerMonth"
195
- :readonly="isDisabled"
196
- :clearable="!isDisabled"
197
- :rules="insurancePremiumPerMonth"
198
- :label="$dataStore.t('productConditionsForm.insurancePremiumAmount')"
211
+ :readonly="insurancePremiumPerMonthDisabled"
212
+ :clearable="!insurancePremiumPerMonthDisabled"
213
+ :rules="insurancePremiumPerMonthRule"
214
+ :label="insurancePremiumPerMonthLabel"
199
215
  :suffix="$constants.currencySymbols.kzt"
200
216
  @input="onInputInsurancePremiumPerMonth"
201
217
  @onClear="onClearPremium"
@@ -203,9 +219,9 @@
203
219
  <base-form-input
204
220
  v-if="hasInsurancePremiumPerMonthInDollar"
205
221
  v-model="productConditionsForm.insurancePremiumPerMonthInDollar"
206
- :readonly="isDisabled"
207
- :clearable="!isDisabled"
208
- :rules="insurancePremiumPerMonth"
222
+ :readonly="insurancePremiumPerMonthDisabled"
223
+ :clearable="!insurancePremiumPerMonthDisabled"
224
+ :rules="insurancePremiumPerMonthRule"
209
225
  :label="$dataStore.t('productConditionsForm.insurancePremiumAmountInDollar')"
210
226
  :suffix="$constants.currencySymbols.usd"
211
227
  @input="onInputInsurancePremiumPerMonthInDollar"
@@ -218,8 +234,148 @@
218
234
  :label="$dataStore.t('productConditionsForm.dollarExchangeRateNBRK')"
219
235
  :suffix="$constants.currencySymbols.kzt"
220
236
  />
237
+ <base-form-input
238
+ v-if="whichProduct === 'gons'"
239
+ v-model="productConditionsForm.totalAmount5"
240
+ :readonly="true"
241
+ :label="$dataStore.t('productConditionsForm.totalAmount5')"
242
+ :suffix="$constants.currencySymbols.kzt"
243
+ />
244
+ <base-form-input
245
+ v-if="whichProduct === 'gons'"
246
+ v-model="productConditionsForm.statePremium5"
247
+ :readonly="true"
248
+ :label="$dataStore.t('productConditionsForm.statePremium5')"
249
+ :suffix="$constants.currencySymbols.kzt"
250
+ />
251
+ <base-form-input
252
+ v-if="whichProduct === 'gons'"
253
+ v-model="productConditionsForm.totalAmount7"
254
+ :readonly="true"
255
+ :label="$dataStore.t('productConditionsForm.totalAmount7')"
256
+ :suffix="$constants.currencySymbols.kzt"
257
+ />
258
+ <base-form-input
259
+ v-if="whichProduct === 'gons'"
260
+ v-model="productConditionsForm.statePremium7"
261
+ :readonly="true"
262
+ :label="$dataStore.t('productConditionsForm.statePremium7')"
263
+ :suffix="$constants.currencySymbols.kzt"
264
+ />
265
+ <base-form-input
266
+ v-if="hasAgencyPart"
267
+ v-model="productConditionsForm.agentCommission"
268
+ :label="$dataStore.t('productConditionsForm.agencyPart')"
269
+ :readonly="isDisabledAgentCommission"
270
+ :clearable="!isDisabledAgentCommission"
271
+ :rules="$rules.required.concat($rules.numbers, $rules.agentCommission)"
272
+ />
273
+ <base-panel-input
274
+ v-if="hasProcessGfot"
275
+ v-model="productConditionsForm.processGfot"
276
+ :value="productConditionsForm.processGfot?.nameRu"
277
+ :readonly="isDisabledProcessGfot"
278
+ :clearable="!isDisabledProcessGfot"
279
+ :label="$dataStore.t('productConditionsForm.processGfot')"
280
+ append-inner-icon="mdi mdi-chevron-right"
281
+ @append="openPanel($dataStore.t('productConditionsForm.processGfot'), $dataStore.processGfot, 'processGfot', $dataStore.getProcessGfot)"
282
+ />
221
283
  </base-form-section>
222
- <base-form-section :title="$dataStore.t('calculationAnnuityPayments')" v-if="hasAnnuityPayments">
284
+ <section v-if="whichProduct === 'pensionannuity'">
285
+ <base-form-section :title="$dataStore.t('pension.compulsoryAmount&Prof')">
286
+ <base-form-input
287
+ v-model="pensionCalculationParams.compulsoryContractAmount"
288
+ :maska="$maska.numbers"
289
+ :rules="$rules.required"
290
+ :readonly="isDisabled"
291
+ :clearable="!isDisabled"
292
+ :label="$dataStore.t('pension.compulsoryContractAmount')"
293
+ />
294
+ <base-form-input
295
+ v-model="pensionCalculationParams.compulsoryProfContractAmount"
296
+ :maska="$maska.numbers"
297
+ :readonly="isDisabled"
298
+ :clearable="!isDisabled"
299
+ :label="$dataStore.t('pension.compulsoryProfContractAmount')"
300
+ />
301
+ <base-animation>
302
+ <base-form-input
303
+ v-if="pensionCalculationParams.compulsoryProfContractAmount && pensionCalculationParams.compulsoryProfContractAmount != 0"
304
+ v-model="pensionForm.compulsoryProfMonthCount"
305
+ :maska="$maska.numbers"
306
+ :readonly="isDisabled"
307
+ :clearable="!isDisabled"
308
+ :label="$dataStore.t('pension.compulsoryProfMonthCount')"
309
+ />
310
+ </base-animation>
311
+ <base-form-input
312
+ v-model="pensionCalculationParams.voluntaryContractAmount"
313
+ :maska="$maska.numbers"
314
+ :readonly="isDisabled"
315
+ :clearable="!isDisabled"
316
+ :label="$dataStore.t('pension.voluntaryContractAmount')"
317
+ />
318
+ <base-form-input
319
+ v-model="pensionCalculationParams.ownFundsRaisAmount"
320
+ :maska="$maska.numbers"
321
+ :readonly="isDisabled"
322
+ :clearable="!isDisabled"
323
+ :label="$dataStore.t('pension.ownFundsRaisAmount')"
324
+ />
325
+ </base-form-section>
326
+ <base-form-section :title="$dataStore.t('pension.companyName')">
327
+ <base-panel-input
328
+ v-model="pensionForm.transferContractCompany"
329
+ :value="pensionForm.transferContractCompany?.nameRu"
330
+ :label="$dataStore.t('pension.transferContractCompany')"
331
+ clearable
332
+ append-inner-icon="mdi mdi-chevron-right"
333
+ @append="openPanel($dataStore.t('pension.transferContractCompany'), $dataStore.insuranceCompanies, 'insuranceCompanies', $dataStore.getInsuranceCompanies)"
334
+ />
335
+ <base-form-input
336
+ v-model="pensionForm.transferContractDate"
337
+ :maska="$maska.date"
338
+ :label="$dataStore.t('pension.contractDate')"
339
+ append-inner-icon="mdi mdi-calendar-blank-outline"
340
+ />
341
+ <base-form-input
342
+ v-model="pensionForm.transferContractFirstPaymentDate"
343
+ :maska="$maska.date"
344
+ :label="$dataStore.t('pension.transferContractFirstPaymentDate')"
345
+ append-inner-icon="mdi mdi-calendar-blank-outline"
346
+ />
347
+ <base-form-input v-model="pensionForm.transferContractAmount" :maska="$maska.numbers" :label="$dataStore.t('pension.transferContractAmount')" />
348
+ </base-form-section>
349
+ <base-form-section :title="$dataStore.t('pension.paymentTerms')">
350
+ <base-form-input
351
+ v-model="contractDate"
352
+ :maska="$maska.date"
353
+ :rules="!isDisabled ? $rules.required.concat($rules.date) : []"
354
+ :readonly="isDisabled"
355
+ :clearable="!isDisabled"
356
+ :min-date="new Date()"
357
+ :label="$dataStore.t('pension.contractDate')"
358
+ append-inner-icon="mdi mdi-calendar-blank-outline"
359
+ />
360
+ <span v-if="maxDate && !isDisabled" class="px-3 font-light text-sm bg-white py-0 mt-[-5px]" style="color: #a0b3d8 !important">до {{ maxDate }}</span>
361
+ <base-form-input v-model="dateOfBegin" :maska="$maska.date" readonly :label="$dataStore.t('pension.paymentsDate')" append-inner-icon="mdi mdi-calendar-blank-outline" />
362
+ <base-rounded-select
363
+ v-model="pensionForm.guaranteedPeriod"
364
+ class="pension-guaranteed-period"
365
+ :readonly="isDisabled"
366
+ :clearable="!isDisabled"
367
+ :label="$dataStore.t('pension.guaranteedPeriod')"
368
+ :items="guaranteedPeriodList"
369
+ :hide-details="true"
370
+ />
371
+ <base-form-input v-model="pensionForm.frequencyPayments" disabled :label="$dataStore.t('pension.frequencyPayments')" />
372
+ <base-form-input v-model="pensionForm.periodPayments" disabled :label="$dataStore.t('pension.paymentPeriod')" />
373
+ <base-form-input v-model="pensionForm.insuranceProgramType" disabled :label="$dataStore.t('pension.insuranceProgramType')" />
374
+ <base-form-input v-model="pensionAmount" readonly :maska="$maska.numbers" :label="$dataStore.t('pension.pensionAmount')" />
375
+ <base-form-input v-model="pensionForm.payment" readonly :maska="$maska.numbers" :label="$dataStore.t('pension.pensionPayment')" />
376
+ </base-form-section>
377
+ </section>
378
+ <base-form-section v-if="hasAnnuityPayments" :title="$dataStore.t('calculationAnnuityPayments')">
223
379
  <base-form-toggle
224
380
  v-model="productConditionsForm.additionalConditionAnnuityPayments"
225
381
  :title="$dataStore.t('productConditionsForm.guaranteedTermAnnuityPayments')"
@@ -240,7 +396,7 @@
240
396
  />
241
397
  <base-panel-input
242
398
  v-model="productConditionsForm.typeAnnuityInsurance"
243
- :value="productConditionsForm.typeAnnuityInsurance.nameRu"
399
+ :value="productConditionsForm.typeAnnuityInsurance?.nameRu"
244
400
  :readonly="isDisabled"
245
401
  :clearable="!isDisabled"
246
402
  :rules="$rules.objectRequired"
@@ -258,7 +414,7 @@
258
414
  />
259
415
  <base-panel-input
260
416
  v-model="productConditionsForm.periodAnnuityPayment"
261
- :value="productConditionsForm.periodAnnuityPayment.nameRu"
417
+ :value="productConditionsForm.periodAnnuityPayment?.nameRu"
262
418
  :readonly="isDisabled"
263
419
  :clearable="!isDisabled"
264
420
  :rules="$rules.objectRequired"
@@ -281,7 +437,135 @@
281
437
  :label="$dataStore.t('productConditionsForm.amountAnnuityPayments')"
282
438
  />
283
439
  </base-form-section>
284
- <base-form-section v-if="additionalTerms && additionalTerms.length" :title="$dataStore.t('productConditionsForm.additional')">
440
+ <base-form-section v-if="whichProduct === 'lifetrip'" :title="$dataStore.t('generalConditions')">
441
+ <base-panel-input
442
+ v-model="calculatorForm.type"
443
+ :value="calculatorForm.type.nameRu ?? $dataStore.t('form.notChosen')"
444
+ :readonly="isDisabled"
445
+ :clearable="!isDisabled"
446
+ :rules="$rules.objectRequired"
447
+ :label="$dataStore.t('calculatorForm.type')"
448
+ append-inner-icon="mdi mdi-chevron-right"
449
+ @append="openPanel($dataStore.t('calculatorForm.type'), [], 'type', $dataStore.getDicTripType)"
450
+ />
451
+ <base-panel-input
452
+ v-model="calculatorForm.countries"
453
+ :value="calculatorForm?.countries![0]?.nameRu && calculatorForm.countries.length ? countriesComputed : $dataStore.t('form.notChosen')"
454
+ :readonly="isDisabled"
455
+ :clearable="!isDisabled"
456
+ :clear-value="[]"
457
+ :label="$dataStore.t('calculatorForm.countries')"
458
+ append-inner-icon="mdi mdi-chevron-right"
459
+ @append="openMultiplePanel($dataStore.t('calculatorForm.countries'), $dataStore.dicAllCountries, 'countries', $dataStore.getDicCountries)"
460
+ />
461
+ <base-panel-input
462
+ v-model="calculatorForm.amount"
463
+ :value="calculatorForm.amount.nameRu ? calculatorForm.amount.nameRu + $dataStore.currency : $dataStore.t('form.notChosen')"
464
+ :readonly="isDisabled"
465
+ :clearable="!isDisabled"
466
+ :rules="$rules.objectRequired"
467
+ :label="$dataStore.t('calculatorForm.amount')"
468
+ append-inner-icon="mdi mdi-chevron-right"
469
+ @append="openPanel($dataStore.t('calculatorForm.amount'), $dataStore.amountArray, 'amount')"
470
+ />
471
+ <base-panel-input
472
+ v-model="calculatorForm.purpose"
473
+ :value="calculatorForm.purpose.nameRu ?? $dataStore.t('form.notChosen')"
474
+ :readonly="isDisabled"
475
+ :clearable="!isDisabled"
476
+ :rules="$rules.objectRequired"
477
+ :label="$dataStore.t('calculatorForm.purpose')"
478
+ append-inner-icon="mdi mdi-chevron-right"
479
+ @append="openPanel($dataStore.t('calculatorForm.purpose'), [], 'purpose', $dataStore.getDicTripPurpose)"
480
+ />
481
+ <base-panel-input
482
+ v-if="calculatorForm.purpose.code === 'WorkStudy'"
483
+ v-model="calculatorForm.workType"
484
+ :value="calculatorForm.workType.nameRu ?? $dataStore.t('form.notChosen')"
485
+ :readonly="isDisabled"
486
+ :clearable="!isDisabled"
487
+ :rules="$rules.objectRequired"
488
+ :label="$dataStore.t('calculatorForm.workType')"
489
+ append-inner-icon="mdi mdi-chevron-right"
490
+ @append="openPanel($dataStore.t('calculatorForm.workType'), [], 'workType', $dataStore.getDicTripWorkType)"
491
+ />
492
+ <base-panel-input
493
+ v-if="calculatorForm.purpose.code === 'Sport'"
494
+ v-model="calculatorForm.sportsType"
495
+ :value="calculatorForm.sportsType.nameRu ?? $dataStore.t('form.notChosen')"
496
+ :readonly="isDisabled"
497
+ :clearable="!isDisabled"
498
+ :rules="$rules.objectRequired"
499
+ :label="$dataStore.t('calculatorForm.sportsType')"
500
+ append-inner-icon="mdi mdi-chevron-right"
501
+ @append="openPanel($dataStore.t('calculatorForm.sportsType'), [], 'sportsType', $dataStore.getDicSportsType)"
502
+ />
503
+ <base-panel-input
504
+ v-if="calculatorForm.type.code === 'Multiple'"
505
+ v-model="calculatorForm.period"
506
+ :value="calculatorForm.period && calculatorForm.period.nameRu ? calculatorForm.period.nameRu : $dataStore.t('form.notChosen')"
507
+ :readonly="isDisabled"
508
+ :clearable="!isDisabled"
509
+ :rules="$rules.objectRequired"
510
+ :label="$dataStore.t('calculatorForm.period')"
511
+ append-inner-icon="mdi mdi-chevron-right"
512
+ @append="openPanel($dataStore.t('calculatorForm.period'), $dataStore.periodArray, 'period')"
513
+ />
514
+ <base-panel-input
515
+ v-if="calculatorForm.type.code === 'Multiple'"
516
+ v-model="calculatorForm.maxDays"
517
+ :value="calculatorForm.period && calculatorForm.maxDays.nameRu ? calculatorForm.maxDays.nameRu : $dataStore.t('form.notChosen')"
518
+ :readonly="isDisabled"
519
+ :clearable="!isDisabled"
520
+ :rules="$rules.objectRequired"
521
+ :label="$dataStore.t('calculatorForm.maxDays')"
522
+ append-inner-icon="mdi mdi-chevron-right"
523
+ @append="openPanel($dataStore.t('calculatorForm.maxDays'), $dataStore.maxDaysFiltered, 'maxDays')"
524
+ />
525
+ <base-form-input
526
+ v-if="calculatorForm.type.code === 'Single'"
527
+ v-model="calculatorForm.days"
528
+ :readonly="isDisabled || !isCalculator"
529
+ :label="$dataStore.t('calculatorForm.days')"
530
+ :rules="$rules.required"
531
+ />
532
+ <base-form-input
533
+ v-if="isCalculator && whichProduct === 'lifetrip'"
534
+ v-model="calculatorForm.age"
535
+ :rules="$rules.required"
536
+ :readonly="isDisabledSum"
537
+ :clearable="!isDisabled"
538
+ :label="$dataStore.t('calculatorForm.age')"
539
+ />
540
+ <base-form-input
541
+ v-if="!isCalculator && whichProduct === 'lifetrip'"
542
+ v-model="calculatorForm.startDate"
543
+ :readonly="isDisabled"
544
+ :clearable="!isDisabled"
545
+ :label="$dataStore.t('calculatorForm.startDate')"
546
+ :rules="$dataStore.rules.required.concat($dataStore.rules.planDate)"
547
+ :maska="$maska.date"
548
+ append-inner-icon="mdi mdi-calendar-blank-outline"
549
+ />
550
+ <base-form-input
551
+ v-if="!isCalculator && calculatorForm.type.code != 'Multiple'"
552
+ v-model="calculatorForm.endDate"
553
+ :readonly="isDisabled"
554
+ :clearable="!isDisabled"
555
+ :label="$dataStore.t('calculatorForm.endDate')"
556
+ :rules="$dataStore.rules.required"
557
+ :maska="$maska.date"
558
+ append-inner-icon="mdi mdi-calendar-blank-outline"
559
+ />
560
+ <base-form-input v-model="calculatorForm.price" :readonly="true" :label="isCalculator ? $dataStore.t('calculatorForm.premium') : $dataStore.t('calculatorForm.price')" />
561
+ </base-form-section>
562
+ <base-form-section v-if="hasDeathInsFromNS" :title="$dataStore.t('generalConditions')">
563
+ <base-form-input v-model="enabled" :readonly="true" :clearable="false" :label="$dataStore.t('form.deathInsFromNS')" />
564
+ </base-form-section>
565
+ <base-form-section v-if="hasDeathInsAnyReason" :title="$dataStore.t('generalConditions')">
566
+ <base-form-input v-model="enabled" :readonly="true" :clearable="false" :label="$dataStore.t('form.deathInsAnyReason')" />
567
+ </base-form-section>
568
+ <base-form-section v-if="isShownAdditionalTerms && additionalTerms && additionalTerms.length" :title="$dataStore.t('productConditionsForm.additional')">
285
569
  <div v-for="(term, index) of additionalTerms" :key="index">
286
570
  <base-panel-input
287
571
  v-if="filterTermConditions(term)"
@@ -289,26 +573,33 @@
289
573
  :value="term.coverSumName"
290
574
  :readonly="isTermsDisabled"
291
575
  :clearable="false"
292
- :label="term.coverTypeName"
576
+ :label="coverTypeName(term)"
293
577
  append-inner-icon="mdi mdi-chevron-right"
294
- :suffix="!!term.amount ? `${formatTermValue(term.amount)} ${currencySymbolsAddTerm}` : ''"
295
- @append="openTermPanel(term.coverTypeName, $dataStore.getAdditionalInsuranceTermsAnswers, term.coverTypeId, index)"
578
+ :suffix="
579
+ (whichProduct === 'lifebusiness' || whichProduct === 'gns') && term.coverTypeCode === 6
580
+ ? String(term.coverPeriodName ?? '')
581
+ : !!term.amount
582
+ ? `${formatTermValue(term.amount)} ${currencySymbolsAddTerm}`
583
+ : ''
584
+ "
585
+ @append="openTermPanel(coverTypeName(term), $dataStore.getAdditionalInsuranceTermsAnswers, term.coverTypeId, index)"
296
586
  />
297
587
  </div>
298
588
  </base-form-section>
299
589
  </v-form>
300
- <base-btn v-if="!$dataStore.isCalculator && isRecalculation && hasCalculated" :btn="$styles.greenLightBtn" :text="$dataStore.t('buttons.toStatement')" @click="toStatement" />
590
+ <base-btn v-if="!$dataStore.isCalculator && isCalculator && hasCalculated" :btn="$styles.greenLightBtn" :text="$dataStore.t('buttons.toStatement')" @click="toStatement" />
591
+ <base-btn v-if="!isDisabled && $dataStore.isPension && isTask" :text="$dataStore.t('buttons.save')" :loading="$dataStore.isLoading" type="submit" @click="submitForm" />
301
592
  <base-btn
302
- v-if="$dataStore.isCalculator ? true : !isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter())"
593
+ v-if="$dataStore.isCalculator ? true : !isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter()) && !$dataStore.isPension"
303
594
  :loading="isCalculating"
304
595
  :text="$dataStore.t('buttons.calculate')"
305
596
  @click="submitForm"
306
597
  />
307
598
  <div v-if="$dataStore.isTask() && $dataStore.isUnderwriter() && !isRecalculationDisabled" class="flex gap-3">
308
- <base-btn :text="$dataStore.t('buttons.calcSum')" type="submit" @click.prevent="underwriterCalculate('sum')" :loading="isCalculating" />
599
+ <base-btn :text="$dataStore.t('buttons.calcSum')" v-if="hasCalcSum" type="submit" @click.prevent="underwriterCalculate('sum')" :loading="isCalculating" />
309
600
  <base-btn :text="$dataStore.t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
310
601
  </div>
311
- <Teleport v-if="isPanelOpen" to="#panel-actions">
602
+ <Teleport v-if="isPanelOpen" to="#right-panel-actions">
312
603
  <div :class="[$styles.scrollPage]" class="flex flex-col items-center">
313
604
  <base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
314
605
  <div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
@@ -324,30 +615,59 @@
324
615
  <base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
325
616
  </div>
326
617
  </Teleport>
327
- <Teleport v-if="isTermsPanelOpen" to="#panel-actions">
618
+ <Teleport v-if="isMultiplePanelOpen && calculatorForm.countries !== null" to="#right-panel-actions">
328
619
  <div :class="[$styles.scrollPage]" class="flex flex-col items-center">
329
620
  <base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
330
- <div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
621
+ <v-fade-transition>
622
+ <base-form-section v-if="countriesComputed" class="w-[95%]" :title="$dataStore.t('calculatorForm.selectedCountries')">
623
+ <base-white-block class="text-center" :class="[$styles.textSimple]"> {{ countriesComputed }} </base-white-block>
624
+ </base-form-section>
625
+ </v-fade-transition>
626
+ <div v-if="multiplePanelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
627
+ <base-panel-select-item :text="$dataStore.t('buttons.clearOrReset')" @click="calculatorForm.countries = []" false-icon="mdi-close-circle-outline" />
331
628
  <base-panel-select-item
332
- v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
629
+ v-for="(item, index) of multiplePanelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
333
630
  :key="index"
334
631
  :text="(item.nameRu as string)"
335
- :selected="item.nameRu === termValue?.coverSumName"
336
- @click="pickTermValue(item)"
632
+ :selected="calculatorForm.countries && calculatorForm.countries.some(option => option.id === item.id)"
633
+ :disabled="calculatorForm.countries.length >= 3 && !calculatorForm.countries.some(option => option.id === item.id)"
634
+ true-icon="mdi-check-circle-outline"
635
+ @click="selectOption(item)"
337
636
  />
338
637
  </div>
339
638
  <base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
340
639
  </div>
341
640
  </Teleport>
641
+ <Teleport v-if="isTermsPanelOpen" to="#right-panel-actions">
642
+ <div :class="[$styles.scrollPage]" class="flex flex-col items-center">
643
+ <base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
644
+ <div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
645
+ <div v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))">
646
+ <v-expansion-panels v-if="panelCodeList.includes(String(item.code)) && (whichProduct === 'lifebusiness' || whichProduct === 'gns')" variant="accordion">
647
+ <v-expansion-panel class="hover:bg-[#f5f8fd]" elevation="0" bg-color="#F3F6FC">
648
+ <v-expansion-panel-title @click="pickTermValue(item)">
649
+ {{ item.nameRu }}
650
+ </v-expansion-panel-title>
651
+ <v-expansion-panel-text class="border-t-[1px] border-t-white cursor-pointer" :class="[$styles.textSimple]" v-for="(i, idx) of subPanelList">
652
+ <base-panel-select-item class="!p-0" :key="idx" :text="(i.nameRu as string)" :selected="i.code === subTermValue" @click="pickSubTermValue(item, i)" />
653
+ </v-expansion-panel-text>
654
+ </v-expansion-panel>
655
+ </v-expansion-panels>
656
+ <base-panel-select-item v-else :key="index" :text="(item.nameRu as string)" :selected="item.nameRu === termValue?.coverSumName" @click="pickTermValue(item)" />
657
+ </div>
658
+ </div>
659
+ <base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
660
+ </div>
661
+ </Teleport>
342
662
  </section>
343
663
  </template>
344
664
 
345
665
  <script lang="ts">
346
- import { Member, Value } from '../../composables/classes';
666
+ import { Member, Value, CountryValue, CalculatorForm } from '../../composables/classes';
347
667
 
348
668
  export default defineComponent({
349
669
  props: {
350
- isRecalculation: {
670
+ isCalculator: {
351
671
  type: Boolean,
352
672
  default: false,
353
673
  },
@@ -371,16 +691,38 @@ export default defineComponent({
371
691
  const isTermsPanelOpen = ref<boolean>(false);
372
692
  const panelValue = ref<Value>(new Value());
373
693
  const termValue = ref<AddCover>();
694
+ const subTermValue = ref<string>('');
374
695
  const panelList = ref<Value[]>([]);
696
+ const subPanelList = ref<AddCoverAnswer[] | Value[]>([]);
375
697
  const productConditionsForm = formStore.productConditionsForm;
376
698
  const currentPanel = ref<keyof typeof productConditionsForm>();
377
699
  const currentIndex = ref<number>();
378
700
  const searchQuery = ref<string>('');
379
701
  const whichSum = ref<'insurancePremiumPerMonth' | 'requestedSumInsured' | ''>('');
702
+ const panelCodeList = ['processcovertypesum', 'fixedinssum'];
703
+ const enabled = 'включено';
380
704
 
381
705
  const additionalTerms = ref<AddCover[]>([]);
706
+ const ksj = ref(new Value());
707
+ const maxDate = ref();
708
+ const dateOfBegin = ref();
709
+ const contractDate = ref();
710
+ const guaranteedPeriodList = ref();
711
+ const isMultiplePanelOpen = ref<boolean>(false);
712
+ const pensionForm = formStore.applicationData?.pensionApp ?? undefined;
713
+
714
+ const multiplePanelValue = ref<CountryValue>(new CountryValue());
715
+ const multiplePanelList = ref<CountryValue[]>([]);
716
+ const calculatorForm = productConditionsForm.calculatorForm;
717
+
718
+ const isShownAdditionalTerms = computed(() => {
719
+ if (whichProduct.value === 'gons') {
720
+ return false;
721
+ }
722
+ return true;
723
+ });
382
724
  const isUnderwriterForm = computed(() => {
383
- if (route.params.taskId === '0 ' || props.isRecalculation === true) {
725
+ if (route.params.taskId === '0 ' || props.isCalculator === true) {
384
726
  return false;
385
727
  } else {
386
728
  return formStore.applicationData.statusCode === 'UnderwriterForm';
@@ -388,20 +730,45 @@ export default defineComponent({
388
730
  });
389
731
  const isDisabled = computed(() => (dataStore.isCalculator ? false : !memberStore.isStatementEditible('productConditionsForm')));
390
732
  const isTermsDisabled = computed(() => {
391
- if (dataStore.isGons) {
733
+ if (whichProduct.value === 'gons') {
392
734
  return true;
393
735
  }
736
+ if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && dataStore.isUnderwriter()) {
737
+ return false;
738
+ }
394
739
  return isDisabled.value;
395
740
  });
396
- const isTask = computed(() => (route.params.taskId === '0' && props.isRecalculation === true) || dataStore.isTask());
397
- const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm);
741
+ const isTask = computed(() => (route.params.taskId === '0' && props.isCalculator === true) || dataStore.isTask());
742
+ const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm || formStore.canBeClaimed === true);
398
743
  const isUnderwriterRole = computed(() => dataStore.isUnderwriter() || dataStore.isAdmin() || dataStore.isSupport());
399
- const insurancePremiumPerMonth = computed(() => (!!productConditionsForm.insurancePremiumPerMonth ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
400
- const requestedSumInsured = computed(() => (!!productConditionsForm.requestedSumInsured ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
401
- const hasCalculated = computed(() => !!productConditionsForm.requestedSumInsured && !!productConditionsForm.insurancePremiumPerMonth);
744
+ const insurancePremiumPerMonthRule = computed(() => (!!productConditionsForm.insurancePremiumPerMonth ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
745
+ const insurancePremiumPerMonthDisabled = computed(() => {
746
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
747
+ return true;
748
+ }
749
+ if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
750
+ return false;
751
+ }
752
+ return isDisabled.value;
753
+ });
754
+ const requestedSumInsuredRule = computed(() => (!!productConditionsForm.requestedSumInsured ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
755
+ const fixInsSumRule = computed(() => (!!productConditionsForm.fixInsSum ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
402
756
  const amountAnnuityPayments = computed(() => (!!productConditionsForm.amountAnnuityPayments ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
757
+ const hasCalculated = computed(() => {
758
+ if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && productConditionsForm.requestedSumInsured === null) {
759
+ return !!productConditionsForm.insurancePremiumPerMonth;
760
+ }
761
+ return !!productConditionsForm.requestedSumInsured && !!productConditionsForm.insurancePremiumPerMonth;
762
+ });
403
763
  const hasProcessIndexRate = computed(() => {
404
- if (whichProduct.value === 'gons' || whichProduct.value === 'halykkazyna' || whichProduct.value === 'liferenta') {
764
+ if (
765
+ whichProduct.value === 'gons' ||
766
+ whichProduct.value === 'halykkazyna' ||
767
+ whichProduct.value === 'liferenta' ||
768
+ whichProduct.value === 'lifebusiness' ||
769
+ whichProduct.value === 'amuletlife' ||
770
+ whichProduct.value === 'gns'
771
+ ) {
405
772
  return false;
406
773
  }
407
774
  return true;
@@ -436,6 +803,24 @@ export default defineComponent({
436
803
  }
437
804
  return true;
438
805
  });
806
+ const readonlyLifeAdditive = computed(() => {
807
+ if (whichProduct.value === 'gons') {
808
+ return true;
809
+ }
810
+ return isRecalculationDisabled.value;
811
+ });
812
+ const readonlyDisabilityMultiply = computed(() => {
813
+ if (whichProduct.value === 'gons') {
814
+ return true;
815
+ }
816
+ return isRecalculationDisabled.value;
817
+ });
818
+ const readonlyDisabilityAdditive = computed(() => {
819
+ if (whichProduct.value === 'gons') {
820
+ return true;
821
+ }
822
+ return isRecalculationDisabled.value;
823
+ });
439
824
  const hasAdbAdditive = computed(() => {
440
825
  if (whichProduct.value === 'gons') {
441
826
  return false;
@@ -454,6 +839,30 @@ export default defineComponent({
454
839
  }
455
840
  return false;
456
841
  });
842
+ const hasBirthDate = computed(() => {
843
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
844
+ return false;
845
+ }
846
+ return true;
847
+ });
848
+ const hasGender = computed(() => {
849
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
850
+ return false;
851
+ }
852
+ return true;
853
+ });
854
+ const hasAgencyPart = computed(() => {
855
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
856
+ return true;
857
+ }
858
+ return false;
859
+ });
860
+ const hasProcessGfot = computed(() => {
861
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
862
+ return true;
863
+ }
864
+ return false;
865
+ });
457
866
  const coverPeriodRule = computed(() => {
458
867
  const baseCondition = dataStore.rules.required.concat(dataStore.rules.numbers);
459
868
  if (whichProduct.value === 'gons') {
@@ -462,6 +871,9 @@ export default defineComponent({
462
871
  if (whichProduct.value === 'halykkazyna') {
463
872
  return baseCondition.concat(dataStore.rules.coverPeriodFrom2to20);
464
873
  }
874
+ if (whichProduct.value === 'amuletlife') {
875
+ return baseCondition.concat(dataStore.rules.coverPeriodFrom1or5to15);
876
+ }
465
877
  return baseCondition;
466
878
  });
467
879
  const currencySymbolsAddTerm = computed(() => {
@@ -474,30 +886,152 @@ export default defineComponent({
474
886
  if (whichProduct.value === 'halykkazyna') {
475
887
  return dataStore.t('productConditionsForm.requestedSumInsuredInTenge');
476
888
  }
889
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
890
+ return dataStore.t('productConditionsForm.totalRequestedSumInsured');
891
+ }
477
892
  return dataStore.t('productConditionsForm.requestedSumInsured');
478
893
  });
894
+ const coverPeriodLabel = computed(() => {
895
+ if (whichProduct.value === 'gons') {
896
+ return dataStore.t('productConditionsForm.coverPeriodFrom3to20');
897
+ }
898
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
899
+ return dataStore.t('productConditionsForm.coverPeriodMonth');
900
+ }
901
+ return dataStore.t('productConditionsForm.coverPeriod');
902
+ });
903
+ const insurancePremiumPerMonthLabel = computed(() => {
904
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
905
+ return dataStore.t('productConditionsForm.totalInsurancePremiumAmountWithCommission');
906
+ }
907
+ return dataStore.t('productConditionsForm.insurancePremiumAmount');
908
+ });
909
+ const isDisabledFixInsSum = computed(() => {
910
+ if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && productConditionsForm.processGfot.id !== null) {
911
+ return true;
912
+ }
913
+ if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
914
+ return false;
915
+ }
916
+ return isDisabled.value;
917
+ });
479
918
  const isDisabledSum = computed(() => {
480
919
  if (whichProduct.value === 'halykkazyna') {
481
920
  return true;
482
921
  }
922
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
923
+ return true;
924
+ }
925
+ if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
926
+ return false;
927
+ }
483
928
  return isDisabled.value;
484
929
  });
485
930
  const isDisabledSumDollar = computed(() => {
486
931
  if (whichProduct.value === 'halykkazyna') {
487
932
  return true;
488
933
  }
934
+ if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
935
+ return false;
936
+ }
937
+ return isDisabled.value;
938
+ });
939
+ const countriesComputed = computed(() => {
940
+ let message = '';
941
+ for (let country in calculatorForm.countries) {
942
+ message += calculatorForm.countries[country as any].nameRu + ', ';
943
+ }
944
+ return message.slice(0, -2);
945
+ });
946
+ const isDisabledCoverPeriod = computed(() => {
947
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
948
+ return true;
949
+ }
950
+ return isDisabled.value;
951
+ });
952
+ const hasDefault = computed(() => {
953
+ if (whichProduct.value === 'lifetrip' || whichProduct.value === 'pensionannuity') {
954
+ return false;
955
+ }
956
+ return true;
957
+ });
958
+ const isDisabledProcessGfot = computed(() => {
959
+ if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && !!productConditionsForm.fixInsSum) {
960
+ return true;
961
+ }
962
+ if (dataStore.isUnderwriter()) {
963
+ return false;
964
+ }
965
+ return isDisabled.value;
966
+ });
967
+ const isDisabledAgentCommission = computed(() => {
968
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns' || dataStore.isUnderwriter()) {
969
+ return false;
970
+ }
489
971
  return isDisabled.value;
490
972
  });
973
+ const hasCalcSum = computed(() => {
974
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
975
+ return false;
976
+ }
977
+ return true;
978
+ });
979
+ const hasFixInsSum = computed(() => {
980
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
981
+ return true;
982
+ }
983
+ return false;
984
+ });
985
+ const hasDeathInsFromNS = computed(() => {
986
+ if (whichProduct.value === 'gns') {
987
+ return true;
988
+ }
989
+ return false;
990
+ });
991
+ const hasDeathInsAnyReason = computed(() => {
992
+ if (whichProduct.value === 'lifebusiness') {
993
+ return true;
994
+ }
995
+ return false;
996
+ });
997
+ const defaultText = computed(() => {
998
+ if (whichProduct.value === 'gns' || whichProduct.value === 'lifebusiness') {
999
+ return dataStore.t('clients.form.calculation');
1000
+ }
1001
+ return dataStore.t('generalConditions');
1002
+ });
1003
+
1004
+ const pensionCalculationParams = ref({
1005
+ compulsoryContractAmount: pensionForm && pensionForm.compulsoryContractAmount && pensionForm.compulsoryContractAmount != 0 ? pensionForm.compulsoryContractAmount : null,
1006
+ voluntaryContractAmount: pensionForm && pensionForm.voluntaryContractAmount && pensionForm.voluntaryContractAmount != 0 ? pensionForm.voluntaryContractAmount : null,
1007
+ ownFundsRaisAmount: pensionForm && pensionForm.ownFundsRaisAmount && pensionForm.ownFundsRaisAmount != 0 ? pensionForm.ownFundsRaisAmount : null,
1008
+ compulsoryProfContractAmount:
1009
+ pensionForm && pensionForm.compulsoryProfContractAmount && pensionForm.compulsoryProfContractAmount != 0 ? pensionForm.compulsoryProfContractAmount : null,
1010
+ });
1011
+
1012
+ const pensionAmount = computed(() =>
1013
+ pensionCalculationParams.value
1014
+ ? (Number(pensionCalculationParams.value.compulsoryContractAmount) ?? 0) +
1015
+ (Number(pensionCalculationParams.value.voluntaryContractAmount) ?? 0) +
1016
+ (Number(pensionCalculationParams.value.ownFundsRaisAmount) ?? 0) +
1017
+ (Number(pensionCalculationParams.value.compulsoryProfContractAmount) ?? 0)
1018
+ : 0,
1019
+ );
491
1020
 
492
1021
  const formatTermValue = (term: number) => {
493
1022
  if (term !== null) {
494
- return Number.isInteger(term) ? dataStore.getNumberWithSpaces(term) : dataStore.getNumberWithDot(term);
1023
+ const termNumber = Number(term);
1024
+ return Number.isInteger(termNumber) ? dataStore.getNumberWithSpaces(termNumber) : dataStore.getNumberWithDot(termNumber);
495
1025
  }
496
1026
  return null;
497
1027
  };
498
1028
 
499
1029
  const toStatement = async () => {
500
1030
  const statementItem = dataStore.menuItems.find(i => i.id === 'statement');
1031
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1032
+ await router.push({ name: 'taskId-NewApp', params: route.params, query: { tab: 'statement' } });
1033
+ return;
1034
+ }
501
1035
  if (statementItem) {
502
1036
  dataStore.menu.selectedItem = statementItem;
503
1037
  await router.replace({
@@ -511,30 +1045,112 @@ export default defineComponent({
511
1045
  };
512
1046
 
513
1047
  const pickPanelValue = (item: Value) => {
514
- dataStore.panel.open = false;
1048
+ dataStore.rightPanel.open = false;
515
1049
  isPanelOpen.value = false;
1050
+ isMultiplePanelOpen.value = false;
1051
+ if (item.id === null) {
1052
+ calculatorForm.countries = [];
1053
+ }
516
1054
  if (!currentPanel.value) return;
517
- // @ts-ignore
518
- productConditionsForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
1055
+ if (whichProduct.value === 'lifetrip') {
1056
+ // @ts-ignore
1057
+ calculatorForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
1058
+ } else {
1059
+ // @ts-ignore
1060
+ productConditionsForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
1061
+ }
519
1062
  };
520
-
521
- const pickTermValue = (item: Value) => {
522
- dataStore.panel.open = false;
523
- isTermsPanelOpen.value = false;
1063
+ const selectOption = (value: CountryValue) => {
1064
+ if (calculatorForm.countries !== null) {
1065
+ if (value.id == 0) {
1066
+ calculatorForm.countries = [];
1067
+ return (dataStore.dicCountries = dataStore.dicAllCountries);
1068
+ }
1069
+ if (calculatorForm.countries.some((option: CountryValue) => option.id == value.id)) {
1070
+ calculatorForm.countries = calculatorForm.countries.filter((obj: CountryValue) => obj.id !== value.id);
1071
+ dataStore.dicCountries = dataStore.dicAllCountries;
1072
+ } else {
1073
+ dataStore.dicCountries = dataStore.dicAllCountries.filter(i =>
1074
+ i.id == 0 || (value.countryTypeCode == '1' && i.countryTypeCode == value.countryTypeCode) || (value.countryTypeCode != '1' && i.countryTypeCode != '1') ? true : false,
1075
+ );
1076
+ if (value.countryTypeCode == 1) {
1077
+ dataStore.showToaster('success', dataStore.t('toaster.shengenZoneCondition'), 3000);
1078
+ formStore.insuredForm.length = 1;
1079
+ }
1080
+ if (calculatorForm.countries.length < 3) {
1081
+ calculatorForm.countries.push(value);
1082
+ } else if (calculatorForm.countries.length >= 3) {
1083
+ closeMultiplePanel();
1084
+ }
1085
+ }
1086
+ }
1087
+ };
1088
+ const pickTermValue = async (item: Value) => {
1089
+ if (!panelCodeList.includes(item.code as string)) {
1090
+ dataStore.rightPanel.open = false;
1091
+ isTermsPanelOpen.value = false;
1092
+ }
524
1093
  if (typeof currentIndex.value !== 'number') return;
1094
+
1095
+ if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && item.code === 'processcovertypesum') {
1096
+ if (item.id !== additionalTerms.value[currentIndex.value].coverSumId) {
1097
+ additionalTerms.value[currentIndex.value].coverPeriodCode = null;
1098
+ additionalTerms.value[currentIndex.value].coverPeriodId = null;
1099
+ additionalTerms.value[currentIndex.value].coverPeriodName = null;
1100
+ }
1101
+ }
1102
+
525
1103
  additionalTerms.value[currentIndex.value].coverSumId = item.id as string;
526
1104
  additionalTerms.value[currentIndex.value].coverSumName = item.nameRu as string;
1105
+
1106
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1107
+ if (termValue.value && item.code === 'fixedinssum') {
1108
+ if (termValue.value.coverTypeCode === 11) {
1109
+ subPanelList.value = constants.fixInsAmount.slice(0, 5);
1110
+ } else {
1111
+ subPanelList.value = constants.fixInsAmount;
1112
+ }
1113
+ subTermValue.value = String(termValue.value.amount);
1114
+ } else {
1115
+ additionalTerms.value[currentIndex.value].amount = 0;
1116
+ }
1117
+
1118
+ if (termValue.value && termValue.value.coverTypeCode === 6 && item.code === 'processcovertypesum') {
1119
+ const response = await dataStore.getProcessCoverTypePeriod(termValue.value.coverTypeId);
1120
+ if (response) {
1121
+ subPanelList.value = response;
1122
+ subTermValue.value = termValue.value.coverPeriodCode as string;
1123
+ }
1124
+ }
1125
+
1126
+ if (termValue.value && termValue.value.coverTypeCode === 6 && item.code !== 'processcovertypesum') {
1127
+ additionalTerms.value[currentIndex.value].coverPeriodCode = null;
1128
+ additionalTerms.value[currentIndex.value].coverPeriodId = null;
1129
+ additionalTerms.value[currentIndex.value].coverPeriodName = null;
1130
+ }
1131
+ }
527
1132
  };
528
1133
 
529
1134
  const openPanel = async (title: string, list: Value[], key: string, asyncFunction?: Function, filterKey?: string) => {
530
- if (!isDisabled.value || (key === 'riskGroup' && !isRecalculationDisabled.value)) {
1135
+ if (!isDisabled.value || (key === 'riskGroup' && !isRecalculationDisabled.value) || (key === 'processGfot' && !isDisabledProcessGfot.value)) {
1136
+ if (key === 'amount') {
1137
+ if (calculatorForm.type.nameRu === null || !calculatorForm.countries || (calculatorForm.countries && calculatorForm.countries.length === 0)) {
1138
+ return dataStore.showToaster('error', dataStore.t('toaster.noAmountBeforeTypeAndCountries'), 2000);
1139
+ }
1140
+ }
1141
+ if (key === 'maxDays') {
1142
+ if (calculatorForm.period.code === null) {
1143
+ return dataStore.showToaster('error', dataStore.t('toaster.noMaxDaysBeforePeriod'), 2000);
1144
+ }
1145
+ }
531
1146
  searchQuery.value = '';
532
1147
  currentPanel.value = key as keyof typeof productConditionsForm;
533
1148
  isPanelOpen.value = true;
534
1149
  isTermsPanelOpen.value = false;
535
1150
  dataStore.panelAction = null;
536
- dataStore.panel.open = true;
537
- dataStore.panel.title = title;
1151
+ dataStore.rightPanel.open = true;
1152
+ dataStore.rightPanel.title = title;
1153
+ isMultiplePanelOpen.value = false;
538
1154
 
539
1155
  let newList = list;
540
1156
  if (asyncFunction) {
@@ -542,32 +1158,73 @@ export default defineComponent({
542
1158
  newList = await asyncFunction(filterKey, formStore.productConditionsFormKey);
543
1159
  }
544
1160
  panelList.value = filterList(newList, key);
545
- // @ts-ignore
546
- panelValue.value = productConditionsForm[currentPanel.value];
1161
+ if (whichProduct.value === 'lifetrip') {
1162
+ // @ts-ignore
1163
+ panelValue.value = calculatorForm[currentPanel.value];
1164
+ } else {
1165
+ // @ts-ignore
1166
+ panelValue.value = productConditionsForm[currentPanel.value];
1167
+ }
547
1168
  isPanelLoading.value = false;
548
1169
  } else {
549
1170
  dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
550
1171
  }
551
1172
  };
552
-
553
- const filterList = (list: Value[], key: string) => {
554
- if (whichProduct.value === 'baiterek') {
555
- if (dataStore.isManagerHalykBank()) {
556
- if (key === 'paymentPeriod') return list.filter(i => i.code !== 'single');
1173
+ const openMultiplePanel = async (title: string, list: CountryValue[], key: string, asyncFunction?: Function, filterKey?: string) => {
1174
+ if (!isDisabled.value || !isRecalculationDisabled.value) {
1175
+ isPanelOpen.value = false;
1176
+ isMultiplePanelOpen.value = true;
1177
+ isPanelLoading.value = true;
1178
+ let newList = list;
1179
+ if (asyncFunction !== null) {
1180
+ // @ts-ignore
1181
+ newList = await asyncFunction(filterKey, formStore.productConditionsFormKey);
1182
+ }
1183
+ if (newList[0].nameRu !== null) {
1184
+ // @ts-ignore
1185
+ newList.unshift(new CountryValue(0, null));
557
1186
  }
1187
+
1188
+ dataStore.panelAction = null;
1189
+ dataStore.rightPanel.open = true;
1190
+ dataStore.rightPanel.title = title;
1191
+
1192
+ // @ts-ignore
1193
+ multiplePanelList.value = filterList(newList, key);
1194
+ // @ts-ignore
1195
+ multiplePanelValue.value = calculatorForm[currentPanel.value];
1196
+ isPanelLoading.value = false;
1197
+ } else {
1198
+ dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'), 2000);
558
1199
  }
1200
+ };
1201
+ const closeMultiplePanel = (item?: CountryValue) => {
1202
+ dataStore.rightPanel.open = false;
1203
+ isMultiplePanelOpen.value = false;
1204
+ if (!currentPanel.value) return;
1205
+ // @ts-ignore
1206
+ calculatorForm[currentPanel.value] = item?.nameRu === null ? new Value() : item;
1207
+ };
1208
+
1209
+ const filterList = (list: Value[], key: string) => {
1210
+ // if (whichProduct.value === 'baiterek') {
1211
+ // if (dataStore.isManagerHalykBank()) {
1212
+ // if (key === 'paymentPeriod') return list.filter(i => i.code !== 'single');
1213
+ // }
1214
+ // }
559
1215
  return list;
560
1216
  };
561
1217
 
562
1218
  const openTermPanel = async (title: string, asyncFunction: Function, questionId: string, index: number) => {
563
- if (!isDisabled.value) {
1219
+ if (!isDisabled.value || ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && dataStore.isUnderwriter())) {
564
1220
  searchQuery.value = '';
565
1221
  currentIndex.value = index;
566
1222
  isPanelOpen.value = false;
1223
+ isMultiplePanelOpen.value = false;
567
1224
  isTermsPanelOpen.value = true;
568
1225
  dataStore.panelAction = null;
569
- dataStore.panel.open = true;
570
- dataStore.panel.title = title;
1226
+ dataStore.rightPanel.open = true;
1227
+ dataStore.rightPanel.title = title;
571
1228
 
572
1229
  let newList;
573
1230
  if (asyncFunction) {
@@ -583,6 +1240,23 @@ export default defineComponent({
583
1240
  }
584
1241
  };
585
1242
 
1243
+ const pickSubTermValue = (item: any, subItem: any) => {
1244
+ dataStore.rightPanel.open = false;
1245
+ isTermsPanelOpen.value = false;
1246
+ subTermValue.value = item.code as string;
1247
+ if (typeof currentIndex.value !== 'number') return;
1248
+
1249
+ if (item.code === 'fixedinssum') {
1250
+ additionalTerms.value[currentIndex.value].amount = Number(subItem.code);
1251
+ }
1252
+
1253
+ if (item.code === 'processcovertypesum') {
1254
+ additionalTerms.value[currentIndex.value].coverPeriodCode = subItem.code as string;
1255
+ additionalTerms.value[currentIndex.value].coverPeriodId = subItem.id as string;
1256
+ additionalTerms.value[currentIndex.value].coverPeriodName = subItem.nameRu as string;
1257
+ }
1258
+ };
1259
+
586
1260
  const underwriterCalculate = async (type: 'sum' | 'premium') => {
587
1261
  if (!type) return;
588
1262
  if (type === 'sum') {
@@ -645,6 +1319,15 @@ export default defineComponent({
645
1319
  }
646
1320
  };
647
1321
 
1322
+ const onInputFixInsSum = (event: Event) => {
1323
+ if (event.target && 'value' in event.target && event.target.value) {
1324
+ const calculatedFixInsSum = getNumber(event.target.value as string);
1325
+ if (calculatedFixInsSum) {
1326
+ productConditionsForm.fixInsSum = dataStore.getNumberWithSpaces(productConditionsForm.fixInsSum);
1327
+ }
1328
+ }
1329
+ };
1330
+
648
1331
  const onInputSumDollar = (event: Event) => {
649
1332
  if (event.target && 'value' in event.target && event.target.value && dataStore.currencies.usd) {
650
1333
  whichSum.value = 'requestedSumInsured';
@@ -682,6 +1365,12 @@ export default defineComponent({
682
1365
  productConditionsForm.requestedSumInsuredInDollar = null;
683
1366
  productConditionsForm.insurancePremiumPerMonth = null;
684
1367
  productConditionsForm.insurancePremiumPerMonthInDollar = null;
1368
+ if (whichProduct.value === 'lifetrip') {
1369
+ Object.keys(calculatorForm).forEach(key => {
1370
+ //@ts-ignore
1371
+ calculatorForm[key] = new CalculatorForm()[key];
1372
+ });
1373
+ }
685
1374
  };
686
1375
 
687
1376
  const filterTermConditions = (term: AddCover) => {
@@ -691,88 +1380,146 @@ export default defineComponent({
691
1380
  return true;
692
1381
  };
693
1382
 
1383
+ const coverTypeName = (term: AddCover) => {
1384
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1385
+ return String(term.coverTypeNameRu);
1386
+ }
1387
+ return term.coverTypeName;
1388
+ };
1389
+
694
1390
  const submitForm = async () => {
695
1391
  vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
696
1392
  if (v.valid) {
697
- if (whichSum.value === 'requestedSumInsured') {
698
- productConditionsForm.insurancePremiumPerMonth = null;
699
- if (whichProduct.value === 'halykkazyna') {
700
- productConditionsForm.insurancePremiumPerMonthInDollar = null;
1393
+ if (whichProduct.value === 'lifetrip') {
1394
+ if (calculatorForm.type.code === 'Single' && calculatorForm.startDate && calculatorForm.endDate) {
1395
+ const formattedStartDate = formatDate(calculatorForm.startDate);
1396
+ const formattedEndDate = formatDate(calculatorForm.endDate);
1397
+ if (formattedStartDate && formattedEndDate && formattedStartDate.getTime() > formattedEndDate.getTime()) {
1398
+ return dataStore.showToaster('error', dataStore.t('toaster.startMoreEnd'));
1399
+ }
701
1400
  }
702
- }
703
- if (whichSum.value === 'insurancePremiumPerMonth') {
704
- productConditionsForm.requestedSumInsured = null;
705
- if (whichProduct.value === 'halykkazyna') {
706
- productConditionsForm.requestedSumInsuredInDollar = null;
1401
+ if (dataStore.isTask()) {
1402
+ await dataStore.calculatePrice(route.params.taskId as string);
1403
+ } else {
1404
+ await dataStore.calculatePrice();
1405
+ }
1406
+ } else if (whichProduct.value === 'pensionannuity') {
1407
+ if (
1408
+ pensionCalculationParams.value &&
1409
+ pensionCalculationParams.value.compulsoryProfContractAmount &&
1410
+ pensionForm &&
1411
+ pensionForm.compulsoryProfContractAmount != 0 &&
1412
+ pensionForm.compulsoryProfMonthCount < 60
1413
+ ) {
1414
+ dataStore.showToaster('error', 'Минимальное число дней уплаты ОППВ должно быть больше 60');
1415
+ return;
1416
+ }
1417
+ Object.assign(
1418
+ pensionForm,
1419
+ (pensionCalculationParams.value = {
1420
+ ...pensionCalculationParams.value,
1421
+ compulsoryContractAmount: Number(pensionCalculationParams.value.compulsoryContractAmount),
1422
+ voluntaryContractAmount: Number(pensionCalculationParams.value.voluntaryContractAmount),
1423
+ ownFundsRaisAmount: Number(pensionCalculationParams.value.ownFundsRaisAmount),
1424
+ compulsoryProfContractAmount: Number(pensionCalculationParams.value.compulsoryProfContractAmount),
1425
+ }),
1426
+ );
1427
+ await dataStore.setApplication(true);
1428
+ } else {
1429
+ if (whichSum.value === 'requestedSumInsured') {
1430
+ productConditionsForm.insurancePremiumPerMonth = null;
1431
+ if (whichProduct.value === 'halykkazyna') {
1432
+ productConditionsForm.insurancePremiumPerMonthInDollar = null;
1433
+ }
1434
+ }
1435
+ if (whichSum.value === 'insurancePremiumPerMonth') {
1436
+ productConditionsForm.requestedSumInsured = null;
1437
+ if (whichProduct.value === 'halykkazyna') {
1438
+ productConditionsForm.requestedSumInsuredInDollar = null;
1439
+ }
1440
+ }
1441
+ if (productConditionsForm.requestedSumInsured !== '' && productConditionsForm.requestedSumInsured != null) {
1442
+ productConditionsForm.insurancePremiumPerMonth = null;
1443
+ if (props.isCalculator) whichSum.value = 'requestedSumInsured';
1444
+ }
1445
+ if (productConditionsForm.insurancePremiumPerMonth !== '' && productConditionsForm.insurancePremiumPerMonth != null) {
1446
+ productConditionsForm.requestedSumInsured = null;
1447
+ if (props.isCalculator) whichSum.value = 'insurancePremiumPerMonth';
707
1448
  }
708
- }
709
- if (productConditionsForm.requestedSumInsured !== '' && productConditionsForm.requestedSumInsured != null) {
710
- productConditionsForm.insurancePremiumPerMonth = null;
711
- if (props.isRecalculation) whichSum.value = 'requestedSumInsured';
712
- }
713
- if (productConditionsForm.insurancePremiumPerMonth !== '' && productConditionsForm.insurancePremiumPerMonth != null) {
714
- productConditionsForm.requestedSumInsured = null;
715
- if (props.isRecalculation) whichSum.value = 'insurancePremiumPerMonth';
716
- }
717
1449
 
718
- if (!whichSum.value && isUnderwriterForm.value === false) {
719
- dataStore.showToaster('error', dataStore.t('toaster.emptyProductConditions'));
720
- return;
721
- }
1450
+ if (!whichSum.value && isUnderwriterForm.value === false) {
1451
+ dataStore.showToaster('error', dataStore.t('toaster.emptyProductConditions'));
1452
+ return;
1453
+ }
722
1454
 
723
- if (isUnderwriterForm.value) {
724
- type recalculationInfo = {
725
- lifeMultiply: string | null | number;
726
- lifeAdditive: string | null | number;
727
- lifeMultiplyClient?: string | number | null;
728
- lifeAdditiveClient?: string | number | null;
729
- adbMultiply: string | null | number;
730
- adbAdditive: string | null | number;
731
- disabilityMultiply: string | null | number;
732
- disabilityAdditive: string | null | number;
733
- amount?: string | number | null;
734
- premium?: string | number | null;
735
- riskGroup?: string | string | number | null;
736
- };
737
- const recalculationData: recalculationInfo = (({ lifeMultiply, lifeAdditive, adbMultiply, adbAdditive, disabilityMultiply, disabilityAdditive }) => ({
738
- lifeMultiply,
739
- lifeAdditive,
740
- adbMultiply,
741
- adbAdditive,
742
- disabilityMultiply,
743
- disabilityAdditive,
744
- }))(productConditionsForm);
745
- Object.keys(recalculationData).forEach(key => {
746
- // @ts-ignore
747
- recalculationData[key] = formatProcents(recalculationData[key]);
748
- });
749
- recalculationData.lifeMultiplyClient = dataStore.isClientAnketaCondition
750
- ? formStore.productConditionsForm.lifeMultiplyClient === null
751
- ? null
752
- : formatProcents(formStore.productConditionsForm.lifeMultiplyClient)
753
- : null;
754
- recalculationData.lifeAdditiveClient = dataStore.isClientAnketaCondition
755
- ? formStore.productConditionsForm.lifeAdditiveClient === null
756
- ? null
757
- : formatProcents(formStore.productConditionsForm.lifeAdditiveClient)
758
- : null;
759
- recalculationData.amount = Number((productConditionsForm.requestedSumInsured as string)?.replace(/\s/g, ''));
760
- recalculationData.premium = Number((productConditionsForm.insurancePremiumPerMonth as string)?.replace(/\s/g, ''));
761
- recalculationData.riskGroup = productConditionsForm.riskGroup?.id ? productConditionsForm.riskGroup.id : 1;
1455
+ if (
1456
+ whichProduct.value === 'gons' &&
1457
+ (formStore.applicationData.statusCode === 'EditForm' || formStore.applicationData.statusCode === 'StartForm') &&
1458
+ getNumber(productConditionsForm.requestedSumInsured as string)! >= 10_000_000
1459
+ ) {
1460
+ dataStore.showToaster('info', dataStore.t('toaster.calcSumForUnder'), 6000);
1461
+ }
1462
+ if (isUnderwriterForm.value) {
1463
+ type recalculationInfo = {
1464
+ lifeMultiply: string | null | number;
1465
+ lifeAdditive: string | null | number;
1466
+ lifeMultiplyClient?: string | number | null;
1467
+ lifeAdditiveClient?: string | number | null;
1468
+ adbMultiply: string | null | number;
1469
+ adbAdditive: string | null | number;
1470
+ disabilityMultiply: string | null | number;
1471
+ disabilityAdditive: string | null | number;
1472
+ amount?: string | number | null;
1473
+ premium?: string | number | null;
1474
+ riskGroup?: string | string | number | null;
1475
+ };
1476
+ const recalculationData: recalculationInfo = (({ lifeMultiply, lifeAdditive, adbMultiply, adbAdditive, disabilityMultiply, disabilityAdditive }) => ({
1477
+ lifeMultiply,
1478
+ lifeAdditive,
1479
+ adbMultiply,
1480
+ adbAdditive,
1481
+ disabilityMultiply,
1482
+ disabilityAdditive,
1483
+ }))(productConditionsForm);
1484
+ Object.keys(recalculationData).forEach(key => {
1485
+ // @ts-ignore
1486
+ recalculationData[key] = formatProcents(recalculationData[key]);
1487
+ });
1488
+ recalculationData.lifeMultiplyClient = dataStore.isClientAnketaCondition
1489
+ ? formStore.productConditionsForm.lifeMultiplyClient === null
1490
+ ? null
1491
+ : formatProcents(formStore.productConditionsForm.lifeMultiplyClient)
1492
+ : null;
1493
+ recalculationData.lifeAdditiveClient = dataStore.isClientAnketaCondition
1494
+ ? formStore.productConditionsForm.lifeAdditiveClient === null
1495
+ ? null
1496
+ : formatProcents(formStore.productConditionsForm.lifeAdditiveClient)
1497
+ : null;
1498
+ recalculationData.amount = Number((productConditionsForm.requestedSumInsured as string)?.replace(/\s/g, ''));
1499
+ recalculationData.premium = Number((productConditionsForm.insurancePremiumPerMonth as string)?.replace(/\s/g, ''));
1500
+ recalculationData.riskGroup = productConditionsForm.riskGroup?.id ? productConditionsForm.riskGroup.id : 1;
1501
+ isCalculating.value = true;
1502
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1503
+ await dataStore.calculate(route.params.taskId as string);
1504
+ additionalTerms.value = formStore.additionalInsuranceTerms;
1505
+ } else {
1506
+ await dataStore.reCalculate(formStore.applicationData.processInstanceId, recalculationData, route.params.taskId as string, whichSum.value);
1507
+ additionalTerms.value = formStore.additionalInsuranceTerms;
1508
+ }
1509
+ }
762
1510
  isCalculating.value = true;
763
- await dataStore.reCalculate(formStore.applicationData.processInstanceId, recalculationData, route.params.taskId as string, whichSum.value);
764
- }
765
- isCalculating.value = true;
766
- if (props.isRecalculation) {
767
- //@ts-ignore
768
- await dataStore.calculateWithoutApplication(true, whichProduct.value);
769
- additionalTerms.value = formStore.additionalInsuranceTermsWithout;
770
- } else {
771
- if (dataStore.isProcessEditable(formStore.applicationData.statusCode)) {
772
- await dataStore.calculate(route.params.taskId as string);
773
- additionalTerms.value = formStore.additionalInsuranceTerms;
1511
+ if (props.isCalculator) {
1512
+ //@ts-ignore
1513
+ await dataStore.calculateWithoutApplication(true, whichProduct.value);
1514
+ additionalTerms.value = formStore.additionalInsuranceTermsWithout;
1515
+ } else {
1516
+ if (dataStore.isProcessEditable(formStore.applicationData.statusCode)) {
1517
+ await dataStore.calculate(route.params.taskId as string);
1518
+ additionalTerms.value = formStore.additionalInsuranceTerms;
1519
+ }
774
1520
  }
775
1521
  }
1522
+
776
1523
  isCalculating.value = false;
777
1524
  } else {
778
1525
  const errors = document.querySelector('.v-input--error');
@@ -797,38 +1544,49 @@ export default defineComponent({
797
1544
  };
798
1545
 
799
1546
  onMounted(async () => {
800
- if (props.isRecalculation === true) {
1547
+ if (props.isCalculator === true) {
801
1548
  if (dataStore.isCalculator) {
802
1549
  clearFields();
803
1550
  }
804
- if (
805
- (dataStore.isCalculator || route.params.taskId === '0') &&
806
- productConditionsForm.requestedSumInsured === null &&
807
- productConditionsForm.insurancePremiumPerMonth === null
808
- ) {
809
- // @ts-ignore
810
- const defaultData = await dataStore.getDefaultCalculationData(true, whichProduct.value);
811
- if (!defaultData) {
812
- dataStore.showToaster('error', 'Отсутствуют базовые данные');
813
- return;
1551
+ if (whichProduct.value !== 'lifetrip' && whichProduct.value !== 'pensionannuity') {
1552
+ if (
1553
+ (dataStore.isCalculator || route.params.taskId === '0') &&
1554
+ productConditionsForm.requestedSumInsured === null &&
1555
+ productConditionsForm.insurancePremiumPerMonth === null
1556
+ ) {
1557
+ // @ts-ignore
1558
+ const defaultData = await dataStore.getDefaultCalculationData(true, whichProduct.value);
1559
+ if (!defaultData) {
1560
+ dataStore.showToaster('error', 'Отсутствуют базовые данные');
1561
+ return;
1562
+ }
1563
+ formStore.additionalInsuranceTermsWithout = defaultData.addCovers;
1564
+ productConditionsForm.requestedSumInsured = defaultData.amount;
1565
+ productConditionsForm.insurancePremiumPerMonth = defaultData.premium;
1566
+ const indexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
1567
+ if (indexRate) productConditionsForm.processIndexRate = indexRate;
1568
+ const paymendPeriod = dataStore.processPaymentPeriod.find(i => i.id === defaultData.paymentPeriodId);
1569
+ if (paymendPeriod) productConditionsForm.paymentPeriod = paymendPeriod;
1570
+ if (defaultData.signDate) {
1571
+ productConditionsForm.signDate = reformatDate(defaultData.signDate);
1572
+ }
1573
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1574
+ productConditionsForm.coverPeriod = defaultData.insTermInMonth ?? null;
1575
+ productConditionsForm.insurancePremiumPerMonth = null;
1576
+ }
814
1577
  }
815
- formStore.additionalInsuranceTermsWithout = defaultData.addCovers;
816
- productConditionsForm.requestedSumInsured = defaultData.amount;
817
- productConditionsForm.insurancePremiumPerMonth = defaultData.premium;
818
- const indexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
819
- if (indexRate) productConditionsForm.processIndexRate = indexRate;
820
- const paymendPeriod = dataStore.processPaymentPeriod.find(i => i.id == defaultData.paymentPeriodId);
821
- if (paymendPeriod) productConditionsForm.paymentPeriod = paymendPeriod;
822
- productConditionsForm.signDate = reformatDate(defaultData.signDate);
823
1578
  }
824
1579
  }
825
- additionalTerms.value = props.isRecalculation ? formStore.additionalInsuranceTermsWithout : formStore.additionalInsuranceTerms;
1580
+ additionalTerms.value = props.isCalculator ? formStore.additionalInsuranceTermsWithout : formStore.additionalInsuranceTerms;
826
1581
  if (!!productConditionsForm.insurancePremiumPerMonth) {
827
1582
  whichSum.value = 'insurancePremiumPerMonth';
828
1583
  }
829
1584
  if (!!productConditionsForm.requestedSumInsured) {
830
1585
  whichSum.value = 'requestedSumInsured';
831
1586
  }
1587
+ if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && !productConditionsForm.requestedSumInsured) {
1588
+ whichSum.value = 'requestedSumInsured';
1589
+ }
832
1590
  if (dataStore.isCalculator) {
833
1591
  dataStore.processCode = constants.products[whichProduct.value as keyof typeof constants.products];
834
1592
  await dataStore.getProcessPaymentPeriod();
@@ -838,6 +1596,19 @@ export default defineComponent({
838
1596
  if (kazynaPaymentPeriod) productConditionsForm.paymentPeriod = kazynaPaymentPeriod;
839
1597
  await dataStore.getCurrencies();
840
1598
  }
1599
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1600
+ productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(
1601
+ formStore.lfb.clients.reduce((sum: number, i: any) => {
1602
+ return sum + Number(i.insSum);
1603
+ }, 0),
1604
+ );
1605
+ }
1606
+ if (whichProduct.value === 'pensionannuity') {
1607
+ contractDate.value = reformatDate(formStore.applicationData.pensionApp.contractDate);
1608
+ dateOfBegin.value = reformatDate(formStore.applicationData.pensionApp.dateOfBegin);
1609
+ maxDate.value = await dataStore.getVariableData(formStore.applicationData.processCode ?? 1);
1610
+ guaranteedPeriodList.value = Array.from(Array(35), (e, i) => i + 1);
1611
+ }
841
1612
  });
842
1613
 
843
1614
  watch(
@@ -859,9 +1630,9 @@ export default defineComponent({
859
1630
  },
860
1631
  );
861
1632
  watch(
862
- () => dataStore.panel.open,
1633
+ () => dataStore.rightPanel.open,
863
1634
  () => {
864
- if (dataStore.panel.open === false) {
1635
+ if (dataStore.rightPanel.open === false) {
865
1636
  isPanelOpen.value = false;
866
1637
  isTermsPanelOpen.value = false;
867
1638
  dataStore.panelAction = null;
@@ -870,6 +1641,57 @@ export default defineComponent({
870
1641
  { immediate: true },
871
1642
  );
872
1643
 
1644
+ if (whichProduct.value === 'lifetrip') {
1645
+ watch(
1646
+ () => calculatorForm.type,
1647
+ async val => {
1648
+ if (val.code === 'Multiple') {
1649
+ await dataStore.getPeriod();
1650
+ calculatorForm.period = new Value();
1651
+ calculatorForm.endDate = null;
1652
+ }
1653
+ if (calculatorForm.countries?.length != 0) {
1654
+ await dataStore.getTripInsuredAmount();
1655
+ }
1656
+ },
1657
+ );
1658
+ watch(
1659
+ () => calculatorForm.countries,
1660
+ async val => {
1661
+ if (val?.length && val.every(option => option.id != 0) && calculatorForm.type?.nameRu != null) {
1662
+ await dataStore.getTripInsuredAmount();
1663
+ }
1664
+ },
1665
+ { deep: true },
1666
+ );
1667
+
1668
+ watch(
1669
+ () => calculatorForm.period,
1670
+ val => {
1671
+ if (val) {
1672
+ dataStore.maxDaysFiltered = dataStore.maxDaysAllArray.filter(days => days.code == val.code);
1673
+ calculatorForm.maxDays = new Value();
1674
+ }
1675
+ },
1676
+ );
1677
+
1678
+ watch(
1679
+ () => calculatorForm.startDate,
1680
+ val => {
1681
+ if (val !== null && val.length === 10 && calculatorForm.endDate != null && calculatorForm.endDate.length === 10) {
1682
+ calculatorForm.days = productConditionsForm.getSingleTripDays();
1683
+ }
1684
+ },
1685
+ );
1686
+ watch(
1687
+ () => calculatorForm.endDate,
1688
+ val => {
1689
+ if (val !== null && val.length === 10 && calculatorForm.startDate != null && calculatorForm.startDate.length === 10) {
1690
+ calculatorForm.days = productConditionsForm.getSingleTripDays();
1691
+ }
1692
+ },
1693
+ );
1694
+ }
873
1695
  return {
874
1696
  // State
875
1697
  formStore,
@@ -880,21 +1702,36 @@ export default defineComponent({
880
1702
  isCalculating,
881
1703
  isPanelLoading,
882
1704
  isPanelOpen,
1705
+ isMultiplePanelOpen,
883
1706
  isTermsPanelOpen,
884
1707
  panelValue,
885
1708
  termValue,
886
1709
  panelList,
1710
+ multiplePanelList,
1711
+ multiplePanelValue,
887
1712
  searchQuery,
888
1713
  whichSum,
889
1714
  Value,
1715
+ calculatorForm,
1716
+ subPanelList,
1717
+ subTermValue,
1718
+ panelCodeList,
1719
+ pensionForm,
1720
+ dateOfBegin,
1721
+ contractDate,
1722
+ ksj,
1723
+ enabled,
1724
+ maxDate,
1725
+ guaranteedPeriodList,
890
1726
 
891
1727
  // Computed
892
1728
  isTask,
893
1729
  isDisabled,
894
1730
  isTermsDisabled,
895
1731
  isUnderwriterForm,
896
- insurancePremiumPerMonth,
897
- requestedSumInsured,
1732
+ insurancePremiumPerMonthRule,
1733
+ insurancePremiumPerMonthDisabled,
1734
+ requestedSumInsuredRule,
898
1735
  isRecalculationDisabled,
899
1736
  isUnderwriterRole,
900
1737
  hasProcessIndexRate,
@@ -903,24 +1740,49 @@ export default defineComponent({
903
1740
  hasInsurancePremiumPerMonthInDollar,
904
1741
  hasCurrency,
905
1742
  hasAdbMultiply,
1743
+ readonlyLifeAdditive,
1744
+ readonlyDisabilityMultiply,
1745
+ readonlyDisabilityAdditive,
906
1746
  hasAdbAdditive,
907
1747
  hasRiskGroup,
908
1748
  hasCalculated,
909
1749
  hasAnnuityPayments,
1750
+ hasAgencyPart,
1751
+ hasProcessGfot,
910
1752
  currencySymbolsAddTerm,
911
1753
  amountAnnuityPayments,
912
1754
  requestedSumInsuredLabel,
913
1755
  isDisabledSum,
914
1756
  isDisabledSumDollar,
1757
+ countriesComputed,
1758
+ hasBirthDate,
1759
+ hasGender,
1760
+ coverPeriodLabel,
1761
+ insurancePremiumPerMonthLabel,
1762
+ isDisabledCoverPeriod,
1763
+ hasDefault,
1764
+ isDisabledProcessGfot,
1765
+ isShownAdditionalTerms,
1766
+ hasCalcSum,
1767
+ isDisabledAgentCommission,
1768
+ hasFixInsSum,
1769
+ isDisabledFixInsSum,
1770
+ defaultText,
1771
+ hasDeathInsFromNS,
1772
+ pensionAmount,
1773
+ pensionCalculationParams,
1774
+ hasDeathInsAnyReason,
915
1775
 
916
1776
  // Rules
917
1777
  coverPeriodRule,
1778
+ fixInsSumRule,
918
1779
 
919
1780
  // Functions
920
1781
  submitForm,
921
1782
  pickPanelValue,
922
1783
  pickTermValue,
923
1784
  openPanel,
1785
+ openMultiplePanel,
924
1786
  openTermPanel,
925
1787
  pickCalculation,
926
1788
  underwriterCalculate,
@@ -936,7 +1798,17 @@ export default defineComponent({
936
1798
  clearFields,
937
1799
  formatTermValue,
938
1800
  filterTermConditions,
1801
+ selectOption,
1802
+ coverTypeName,
1803
+ pickSubTermValue,
1804
+ onInputFixInsSum,
939
1805
  };
940
1806
  },
941
1807
  });
942
1808
  </script>
1809
+
1810
+ <style>
1811
+ .pension-guaranteed-period .v-field {
1812
+ border: none !important;
1813
+ }
1814
+ </style>