hl-core 0.0.9-beta.9 → 0.0.10-beta.2

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 (72) hide show
  1. package/api/base.api.ts +1109 -0
  2. package/api/index.ts +2 -620
  3. package/api/interceptors.ts +38 -1
  4. package/components/Button/Btn.vue +1 -6
  5. package/components/Complex/MessageBlock.vue +1 -1
  6. package/components/Complex/Page.vue +1 -1
  7. package/components/Complex/TextBlock.vue +23 -0
  8. package/components/Dialog/Dialog.vue +70 -16
  9. package/components/Dialog/FamilyDialog.vue +1 -1
  10. package/components/Form/DynamicForm.vue +100 -0
  11. package/components/Form/FormBlock.vue +12 -3
  12. package/components/Form/FormData.vue +110 -0
  13. package/components/Form/FormSection.vue +3 -3
  14. package/components/Form/FormTextSection.vue +11 -3
  15. package/components/Form/FormToggle.vue +25 -5
  16. package/components/Form/ManagerAttachment.vue +177 -89
  17. package/components/Form/ProductConditionsBlock.vue +59 -6
  18. package/components/Input/Datepicker.vue +43 -7
  19. package/components/Input/DynamicInput.vue +23 -0
  20. package/components/Input/FileInput.vue +25 -5
  21. package/components/Input/FormInput.vue +7 -4
  22. package/components/Input/Monthpicker.vue +34 -0
  23. package/components/Input/PanelInput.vue +5 -1
  24. package/components/Input/RoundedSelect.vue +7 -2
  25. package/components/Input/SwitchInput.vue +64 -0
  26. package/components/Input/TextInput.vue +160 -0
  27. package/components/Layout/Drawer.vue +16 -4
  28. package/components/Layout/Header.vue +23 -2
  29. package/components/Layout/Loader.vue +2 -1
  30. package/components/Layout/SettingsPanel.vue +24 -11
  31. package/components/Menu/InfoMenu.vue +35 -0
  32. package/components/Menu/MenuNav.vue +25 -3
  33. package/components/Pages/Anketa.vue +254 -65
  34. package/components/Pages/Auth.vue +56 -9
  35. package/components/Pages/ContragentForm.vue +9 -9
  36. package/components/Pages/Documents.vue +266 -30
  37. package/components/Pages/InvoiceInfo.vue +1 -1
  38. package/components/Pages/MemberForm.vue +774 -102
  39. package/components/Pages/ProductAgreement.vue +1 -8
  40. package/components/Pages/ProductConditions.vue +1132 -180
  41. package/components/Panel/PanelHandler.vue +626 -49
  42. package/components/Panel/PanelSelectItem.vue +17 -2
  43. package/components/Panel/RightPanelCloser.vue +7 -0
  44. package/components/Transitions/Animation.vue +28 -0
  45. package/components/Utilities/JsonViewer.vue +3 -2
  46. package/components/Utilities/Qr.vue +44 -0
  47. package/composables/axios.ts +1 -0
  48. package/composables/classes.ts +501 -14
  49. package/composables/constants.ts +126 -6
  50. package/composables/fields.ts +328 -0
  51. package/composables/index.ts +355 -20
  52. package/composables/styles.ts +23 -6
  53. package/configs/pwa.ts +63 -0
  54. package/layouts/clear.vue +21 -0
  55. package/layouts/default.vue +62 -3
  56. package/layouts/full.vue +21 -0
  57. package/locales/ru.json +558 -16
  58. package/nuxt.config.ts +11 -15
  59. package/package.json +37 -39
  60. package/pages/Token.vue +0 -13
  61. package/plugins/head.ts +26 -0
  62. package/plugins/vuetifyPlugin.ts +1 -5
  63. package/store/data.store.ts +1610 -321
  64. package/store/extractStore.ts +17 -0
  65. package/store/form.store.ts +13 -1
  66. package/store/member.store.ts +1 -1
  67. package/store/rules.ts +97 -3
  68. package/store/toast.ts +1 -1
  69. package/types/enum.ts +81 -0
  70. package/types/env.d.ts +2 -0
  71. package/types/form.ts +94 -0
  72. package/types/index.ts +419 -24
@@ -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 !== 'pensionannuitynew'"
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 !== 'pensionannuitynew'"
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 !== 'pensionannuitynew'"
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,15 +91,15 @@
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
@@ -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 || fromIndexPage)">
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,6 +134,7 @@
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
139
  :value="productConditionsForm.gender?.nameRu"
134
140
  :readonly="isDisabled"
@@ -140,12 +146,33 @@
140
146
  />
141
147
  </div>
142
148
  <base-form-input
149
+ v-if="hasInsStartDate"
150
+ v-model="productConditionsForm.calcDate"
151
+ :maska="$maska.date"
152
+ :readonly="isDisabled"
153
+ :clearable="!isDisabled"
154
+ :label="$dataStore.t('labels.insuranceStartDate')"
155
+ :rules="$rules.required"
156
+ append-inner-icon="mdi mdi-calendar-blank-outline"
157
+ />
158
+ <base-form-input
159
+ v-if="hasInsEndDate"
160
+ v-model="productConditionsForm.contractEndDate"
161
+ :maska="$maska.date"
162
+ :readonly="true"
163
+ :clearable="false"
164
+ :label="$dataStore.t('labels.insuranceEndDate')"
165
+ :rules="$rules.required"
166
+ append-inner-icon="mdi mdi-calendar-blank-outline"
167
+ />
168
+ <base-form-input
169
+ v-if="hasCoverPeriod"
143
170
  v-model="productConditionsForm.coverPeriod"
144
171
  :maska="$maska.numbers"
145
- :readonly="isDisabled"
172
+ :readonly="isDisabledCoverPeriod"
146
173
  :clearable="!isDisabled"
147
174
  :rules="coverPeriodRule"
148
- :label="$dataStore.t(whichProduct === 'gons' ? 'productConditionsForm.coverPeriodFrom3to20' : 'productConditionsForm.coverPeriod')"
175
+ :label="coverPeriodLabel"
149
176
  />
150
177
  <base-panel-input
151
178
  v-if="hasPaymentPeriod"
@@ -162,18 +189,28 @@
162
189
  v-if="hasProcessIndexRate"
163
190
  v-model="productConditionsForm.processIndexRate"
164
191
  :value="productConditionsForm.processIndexRate?.nameRu"
165
- :readonly="isDisabled"
166
- :clearable="!isDisabled"
192
+ :readonly="isDisabled || productConditionsForm.paymentPeriod.code === 'single'"
193
+ :clearable="!isDisabled && !(productConditionsForm.paymentPeriod.code === 'single')"
167
194
  :rules="$rules.objectRequired"
168
195
  :label="$dataStore.t('productConditionsForm.processIndexRate')"
169
196
  append-inner-icon="mdi mdi-chevron-right"
170
197
  @append="openPanel($dataStore.t('productConditionsForm.processIndexRate'), $dataStore.processIndexRate, 'processIndexRate', $dataStore.getProcessIndexRate)"
171
198
  />
199
+ <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
+ />
172
209
  <base-form-input
173
210
  v-model="productConditionsForm.requestedSumInsured"
174
211
  :readonly="isDisabledSum"
175
- :clearable="!isDisabled"
176
- :rules="requestedSumInsured"
212
+ :clearable="!isDisabledSum"
213
+ :rules="requestedSumInsuredRule"
177
214
  :label="requestedSumInsuredLabel"
178
215
  :suffix="$constants.currencySymbols.kzt"
179
216
  @input="onInputSum"
@@ -183,8 +220,8 @@
183
220
  v-if="hasRequestedSumInsuredInDollar"
184
221
  v-model="productConditionsForm.requestedSumInsuredInDollar"
185
222
  :readonly="isDisabledSumDollar"
186
- :clearable="!isDisabled"
187
- :rules="requestedSumInsured"
223
+ :clearable="!isDisabledSumDollar"
224
+ :rules="requestedSumInsuredRule"
188
225
  :label="$dataStore.t('productConditionsForm.requestedSumInsuredInDollar')"
189
226
  :suffix="$constants.currencySymbols.usd"
190
227
  @input="onInputSumDollar"
@@ -192,10 +229,10 @@
192
229
  />
193
230
  <base-form-input
194
231
  v-model="productConditionsForm.insurancePremiumPerMonth"
195
- :readonly="isDisabled"
196
- :clearable="!isDisabled"
197
- :rules="insurancePremiumPerMonth"
198
- :label="$dataStore.t('productConditionsForm.insurancePremiumAmount')"
232
+ :readonly="insurancePremiumPerMonthDisabled"
233
+ :clearable="!insurancePremiumPerMonthDisabled"
234
+ :rules="insurancePremiumPerMonthRule"
235
+ :label="insurancePremiumPerMonthLabel"
199
236
  :suffix="$constants.currencySymbols.kzt"
200
237
  @input="onInputInsurancePremiumPerMonth"
201
238
  @onClear="onClearPremium"
@@ -203,9 +240,9 @@
203
240
  <base-form-input
204
241
  v-if="hasInsurancePremiumPerMonthInDollar"
205
242
  v-model="productConditionsForm.insurancePremiumPerMonthInDollar"
206
- :readonly="isDisabled"
207
- :clearable="!isDisabled"
208
- :rules="insurancePremiumPerMonth"
243
+ :readonly="insurancePremiumPerMonthDisabled"
244
+ :clearable="!insurancePremiumPerMonthDisabled"
245
+ :rules="insurancePremiumPerMonthRule"
209
246
  :label="$dataStore.t('productConditionsForm.insurancePremiumAmountInDollar')"
210
247
  :suffix="$constants.currencySymbols.usd"
211
248
  @input="onInputInsurancePremiumPerMonthInDollar"
@@ -218,8 +255,159 @@
218
255
  :label="$dataStore.t('productConditionsForm.dollarExchangeRateNBRK')"
219
256
  :suffix="$constants.currencySymbols.kzt"
220
257
  />
258
+ <base-form-input
259
+ v-if="whichProduct === 'gons'"
260
+ v-model="productConditionsForm.totalAmount5"
261
+ :readonly="true"
262
+ :label="$dataStore.t('productConditionsForm.totalAmount5')"
263
+ :suffix="$constants.currencySymbols.kzt"
264
+ />
265
+ <base-form-input
266
+ v-if="whichProduct === 'gons'"
267
+ v-model="productConditionsForm.statePremium5"
268
+ :readonly="true"
269
+ :label="$dataStore.t('productConditionsForm.statePremium5')"
270
+ :suffix="$constants.currencySymbols.kzt"
271
+ />
272
+ <base-form-input
273
+ v-if="whichProduct === 'gons'"
274
+ v-model="productConditionsForm.totalAmount7"
275
+ :readonly="true"
276
+ :label="$dataStore.t('productConditionsForm.totalAmount7')"
277
+ :suffix="$constants.currencySymbols.kzt"
278
+ />
279
+ <base-form-input
280
+ v-if="whichProduct === 'gons'"
281
+ v-model="productConditionsForm.statePremium7"
282
+ :readonly="true"
283
+ :label="$dataStore.t('productConditionsForm.statePremium7')"
284
+ :suffix="$constants.currencySymbols.kzt"
285
+ />
286
+ <base-form-input
287
+ v-if="hasAgencyPart"
288
+ v-model="productConditionsForm.agentCommission"
289
+ :label="$dataStore.t('productConditionsForm.agencyPart')"
290
+ :readonly="isDisabledAgentCommission"
291
+ :clearable="!isDisabledAgentCommission"
292
+ :rules="$rules.required.concat($rules.numbers, $rules.agentCommission)"
293
+ />
221
294
  </base-form-section>
222
- <base-form-section :title="$dataStore.t('calculationAnnuityPayments')" v-if="hasAnnuityPayments">
295
+ <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')">
298
+ <base-form-input
299
+ v-model="pensionCalculationParams.compulsoryContractAmount"
300
+ :maska="$maska.numbers"
301
+ :readonly="isDisabled || isEnpfSum"
302
+ :clearable="!isDisabled && !isEnpfSum"
303
+ :label="$dataStore.t('pension.compulsoryContractAmount')"
304
+ />
305
+ <base-form-input
306
+ v-model="pensionCalculationParams.compulsoryProfContractAmount"
307
+ :maska="$maska.numbers"
308
+ :readonly="isDisabled || isEnpfSum"
309
+ :clearable="!isDisabled && !isEnpfSum"
310
+ :label="$dataStore.t('pension.compulsoryProfContractAmount')"
311
+ />
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
+ <base-form-input
323
+ v-model="pensionCalculationParams.voluntaryContractAmount"
324
+ :maska="$maska.numbers"
325
+ :readonly="isDisabled"
326
+ :clearable="!isDisabled"
327
+ :label="$dataStore.t('pension.voluntaryContractAmount')"
328
+ />
329
+ <base-form-input
330
+ v-model="pensionCalculationParams.ownFundsRaisAmount"
331
+ :maska="$maska.numbers"
332
+ :readonly="isDisabled"
333
+ :clearable="!isDisabled"
334
+ :label="$dataStore.t('pension.ownFundsRaisAmount')"
335
+ />
336
+ </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')" />
379
+ </base-form-section>
380
+ <base-form-section :title="$dataStore.t('pension.paymentTerms')">
381
+ <base-form-input
382
+ v-model="contractDate"
383
+ :maska="$maska.date"
384
+ :rules="!isDisabled ? $rules.required.concat($rules.date) : []"
385
+ :readonly="isDisabled"
386
+ :clearable="!isDisabled"
387
+ :min-date="new Date()"
388
+ :label="$dataStore.t('pension.contractDate')"
389
+ append-inner-icon="mdi mdi-calendar-blank-outline"
390
+ />
391
+ <span v-if="maxDate && !isDisabled" class="px-3 font-light text-sm bg-white py-0 mt-[-5px]" style="color: #a0b3d8 !important">до {{ maxDate }}</span>
392
+ <base-form-input v-model="dateOfBegin" :maska="$maska.date" readonly :label="$dataStore.t('pension.paymentsDate')" append-inner-icon="mdi mdi-calendar-blank-outline" />
393
+ <base-rounded-select
394
+ v-model="pensionForm.guaranteedPeriod"
395
+ class="pension-guaranteed-period"
396
+ :readonly="isDisabled"
397
+ :clearable="!isDisabled"
398
+ :rules="$rules.notZero"
399
+ :label="$dataStore.t('pension.guaranteedPeriod')"
400
+ :items="guaranteedPeriodList"
401
+ :hide-details="true"
402
+ />
403
+ <base-form-input v-model="pensionForm.frequencyPayments" disabled :label="$dataStore.t('pension.frequencyPayments')" />
404
+ <base-form-input v-model="pensionForm.periodPayments" disabled :label="$dataStore.t('pension.paymentPeriod')" />
405
+ <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')" />
408
+ </base-form-section>
409
+ </section>
410
+ <base-form-section v-if="hasAnnuityPayments" :title="$dataStore.t('calculationAnnuityPayments')">
223
411
  <base-form-toggle
224
412
  v-model="productConditionsForm.additionalConditionAnnuityPayments"
225
413
  :title="$dataStore.t('productConditionsForm.guaranteedTermAnnuityPayments')"
@@ -281,7 +469,135 @@
281
469
  :label="$dataStore.t('productConditionsForm.amountAnnuityPayments')"
282
470
  />
283
471
  </base-form-section>
284
- <base-form-section v-if="additionalTerms && additionalTerms.length" :title="$dataStore.t('productConditionsForm.additional')">
472
+ <base-form-section v-if="whichProduct === 'lifetrip'" :title="$dataStore.t('generalConditions')">
473
+ <base-panel-input
474
+ v-model="calculatorForm.type"
475
+ :value="calculatorForm.type.nameRu ?? $dataStore.t('form.notChosen')"
476
+ :readonly="isDisabled"
477
+ :clearable="!isDisabled"
478
+ :rules="$rules.objectRequired"
479
+ :label="$dataStore.t('calculatorForm.type')"
480
+ append-inner-icon="mdi mdi-chevron-right"
481
+ @append="openPanel($dataStore.t('calculatorForm.type'), [], 'type', $dataStore.getDicTripType)"
482
+ />
483
+ <base-panel-input
484
+ v-model="calculatorForm.countries"
485
+ :value="calculatorForm?.countries![0]?.nameRu && calculatorForm.countries.length ? countriesComputed : $dataStore.t('form.notChosen')"
486
+ :readonly="isDisabled"
487
+ :clearable="!isDisabled"
488
+ :clear-value="[]"
489
+ :label="$dataStore.t('calculatorForm.countries')"
490
+ append-inner-icon="mdi mdi-chevron-right"
491
+ @append="openMultiplePanel($dataStore.t('calculatorForm.countries'), $dataStore.dicAllCountries, 'countries', $dataStore.getDicCountries)"
492
+ />
493
+ <base-panel-input
494
+ v-model="calculatorForm.amount"
495
+ :value="calculatorForm.amount.nameRu ? calculatorForm.amount.nameRu + $dataStore.currency : $dataStore.t('form.notChosen')"
496
+ :readonly="isDisabled"
497
+ :clearable="!isDisabled"
498
+ :rules="$rules.objectRequired"
499
+ :label="$dataStore.t('calculatorForm.amount')"
500
+ append-inner-icon="mdi mdi-chevron-right"
501
+ @append="openPanel($dataStore.t('calculatorForm.amount'), $dataStore.amountArray, 'amount')"
502
+ />
503
+ <base-panel-input
504
+ v-model="calculatorForm.purpose"
505
+ :value="calculatorForm.purpose.nameRu ?? $dataStore.t('form.notChosen')"
506
+ :readonly="isDisabled"
507
+ :clearable="!isDisabled"
508
+ :rules="$rules.objectRequired"
509
+ :label="$dataStore.t('calculatorForm.purpose')"
510
+ append-inner-icon="mdi mdi-chevron-right"
511
+ @append="openPanel($dataStore.t('calculatorForm.purpose'), [], 'purpose', $dataStore.getDicTripPurpose)"
512
+ />
513
+ <base-panel-input
514
+ v-if="calculatorForm.purpose.code === 'WorkStudy'"
515
+ v-model="calculatorForm.workType"
516
+ :value="calculatorForm.workType.nameRu ?? $dataStore.t('form.notChosen')"
517
+ :readonly="isDisabled"
518
+ :clearable="!isDisabled"
519
+ :rules="$rules.objectRequired"
520
+ :label="$dataStore.t('calculatorForm.workType')"
521
+ append-inner-icon="mdi mdi-chevron-right"
522
+ @append="openPanel($dataStore.t('calculatorForm.workType'), [], 'workType', $dataStore.getDicTripWorkType)"
523
+ />
524
+ <base-panel-input
525
+ v-if="calculatorForm.purpose.code === 'Sport'"
526
+ v-model="calculatorForm.sportsType"
527
+ :value="calculatorForm.sportsType.nameRu ?? $dataStore.t('form.notChosen')"
528
+ :readonly="isDisabled"
529
+ :clearable="!isDisabled"
530
+ :rules="$rules.objectRequired"
531
+ :label="$dataStore.t('calculatorForm.sportsType')"
532
+ append-inner-icon="mdi mdi-chevron-right"
533
+ @append="openPanel($dataStore.t('calculatorForm.sportsType'), [], 'sportsType', $dataStore.getDicSportsType)"
534
+ />
535
+ <base-panel-input
536
+ v-if="calculatorForm.type.code === 'Multiple'"
537
+ v-model="calculatorForm.period"
538
+ :value="calculatorForm.period && calculatorForm.period.nameRu ? calculatorForm.period.nameRu : $dataStore.t('form.notChosen')"
539
+ :readonly="isDisabled"
540
+ :clearable="!isDisabled"
541
+ :rules="$rules.objectRequired"
542
+ :label="$dataStore.t('calculatorForm.period')"
543
+ append-inner-icon="mdi mdi-chevron-right"
544
+ @append="openPanel($dataStore.t('calculatorForm.period'), $dataStore.periodArray, 'period')"
545
+ />
546
+ <base-panel-input
547
+ v-if="calculatorForm.type.code === 'Multiple'"
548
+ v-model="calculatorForm.maxDays"
549
+ :value="calculatorForm.period && calculatorForm.maxDays.nameRu ? calculatorForm.maxDays.nameRu : $dataStore.t('form.notChosen')"
550
+ :readonly="isDisabled"
551
+ :clearable="!isDisabled"
552
+ :rules="$rules.objectRequired"
553
+ :label="$dataStore.t('calculatorForm.maxDays')"
554
+ append-inner-icon="mdi mdi-chevron-right"
555
+ @append="openPanel($dataStore.t('calculatorForm.maxDays'), $dataStore.maxDaysFiltered, 'maxDays')"
556
+ />
557
+ <base-form-input
558
+ v-if="calculatorForm.type.code === 'Single'"
559
+ v-model="calculatorForm.days"
560
+ :readonly="isDisabled || !isCalculator"
561
+ :label="$dataStore.t('calculatorForm.days')"
562
+ :rules="$rules.required"
563
+ />
564
+ <base-form-input
565
+ v-if="isCalculator && whichProduct === 'lifetrip'"
566
+ v-model="calculatorForm.age"
567
+ :rules="$rules.required"
568
+ :readonly="isDisabledSum"
569
+ :clearable="!isDisabled"
570
+ :label="$dataStore.t('calculatorForm.age')"
571
+ />
572
+ <base-form-input
573
+ v-if="!isCalculator && whichProduct === 'lifetrip'"
574
+ v-model="calculatorForm.startDate"
575
+ :readonly="isDisabled"
576
+ :clearable="!isDisabled"
577
+ :label="$dataStore.t('calculatorForm.startDate')"
578
+ :rules="$dataStore.rules.required.concat($dataStore.rules.planDate)"
579
+ :maska="$maska.date"
580
+ append-inner-icon="mdi mdi-calendar-blank-outline"
581
+ />
582
+ <base-form-input
583
+ v-if="!isCalculator && calculatorForm.type.code != 'Multiple'"
584
+ v-model="calculatorForm.endDate"
585
+ :readonly="isDisabled"
586
+ :clearable="!isDisabled"
587
+ :label="$dataStore.t('calculatorForm.endDate')"
588
+ :rules="$dataStore.rules.required"
589
+ :maska="$maska.date"
590
+ append-inner-icon="mdi mdi-calendar-blank-outline"
591
+ />
592
+ <base-form-input v-model="calculatorForm.price" :readonly="true" :label="isCalculator ? $dataStore.t('calculatorForm.premium') : $dataStore.t('calculatorForm.price')" />
593
+ </base-form-section>
594
+ <base-form-section v-if="hasDeathInsFromNS" :title="$dataStore.t('generalConditions')">
595
+ <base-form-input v-model="enabled" :readonly="true" :clearable="false" :label="$dataStore.t('form.deathInsFromNS')" />
596
+ </base-form-section>
597
+ <base-form-section v-if="hasDeathInsAnyReason" :title="$dataStore.t('generalConditions')">
598
+ <base-form-input v-model="enabled" :readonly="true" :clearable="false" :label="$dataStore.t('form.deathInsAnyReason')" />
599
+ </base-form-section>
600
+ <base-form-section v-if="isShownAdditionalTerms && additionalTerms && additionalTerms.length" :title="$dataStore.t('productConditionsForm.additional')">
285
601
  <div v-for="(term, index) of additionalTerms" :key="index">
286
602
  <base-panel-input
287
603
  v-if="filterTermConditions(term)"
@@ -289,26 +605,33 @@
289
605
  :value="term.coverSumName"
290
606
  :readonly="isTermsDisabled"
291
607
  :clearable="false"
292
- :label="term.coverTypeName"
608
+ :label="coverTypeName(term)"
293
609
  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)"
610
+ :suffix="
611
+ (whichProduct === 'lifebusiness' || whichProduct === 'gns') && term.coverTypeCode === 6
612
+ ? String(term.coverPeriodName ?? '')
613
+ : !!term.amount
614
+ ? `${formatTermValue(term.amount)} ${currencySymbolsAddTerm}`
615
+ : ''
616
+ "
617
+ @append="openTermPanel(coverTypeName(term), $dataStore.getAdditionalInsuranceTermsAnswers, term.coverTypeId, index)"
296
618
  />
297
619
  </div>
298
620
  </base-form-section>
299
621
  </v-form>
300
- <base-btn v-if="!$dataStore.isCalculator && isRecalculation && hasCalculated" :btn="$styles.greenLightBtn" :text="$dataStore.t('buttons.toStatement')" @click="toStatement" />
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" />
301
624
  <base-btn
302
- v-if="$dataStore.isCalculator ? true : !isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter())"
625
+ v-if="$dataStore.isCalculator ? true : !isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter()) && !$dataStore.isPension"
303
626
  :loading="isCalculating"
304
627
  :text="$dataStore.t('buttons.calculate')"
305
628
  @click="submitForm"
306
629
  />
307
630
  <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" />
631
+ <base-btn :text="$dataStore.t('buttons.calcSum')" v-if="hasCalcSum" type="submit" @click.prevent="underwriterCalculate('sum')" :loading="isCalculating" />
309
632
  <base-btn :text="$dataStore.t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
310
633
  </div>
311
- <Teleport v-if="isPanelOpen" to="#panel-actions">
634
+ <Teleport v-if="isPanelOpen" to="#right-panel-actions">
312
635
  <div :class="[$styles.scrollPage]" class="flex flex-col items-center">
313
636
  <base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
314
637
  <div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
@@ -316,7 +639,7 @@
316
639
  <base-panel-select-item
317
640
  v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
318
641
  :key="index"
319
- :text="(item.nameRu as string)"
642
+ :text="String(item.nameRu)"
320
643
  :selected="item.nameRu === panelValue.nameRu"
321
644
  @click="pickPanelValue(item)"
322
645
  />
@@ -324,30 +647,59 @@
324
647
  <base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
325
648
  </div>
326
649
  </Teleport>
327
- <Teleport v-if="isTermsPanelOpen" to="#panel-actions">
650
+ <Teleport v-if="isMultiplePanelOpen && calculatorForm.countries !== null" to="#right-panel-actions">
328
651
  <div :class="[$styles.scrollPage]" class="flex flex-col items-center">
329
652
  <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">
653
+ <v-fade-transition>
654
+ <base-form-section v-if="countriesComputed" class="w-[95%]" :title="$dataStore.t('calculatorForm.selectedCountries')">
655
+ <base-white-block class="text-center" :class="[$styles.textSimple]"> {{ countriesComputed }} </base-white-block>
656
+ </base-form-section>
657
+ </v-fade-transition>
658
+ <div v-if="multiplePanelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
659
+ <base-panel-select-item :text="$dataStore.t('buttons.clearOrReset')" @click="calculatorForm.countries = []" false-icon="mdi-close-circle-outline" />
331
660
  <base-panel-select-item
332
- v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
661
+ v-for="(item, index) of multiplePanelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
333
662
  :key="index"
334
- :text="(item.nameRu as string)"
335
- :selected="item.nameRu === termValue?.coverSumName"
336
- @click="pickTermValue(item)"
663
+ :text="String(item.nameRu)"
664
+ :selected="calculatorForm.countries && calculatorForm.countries.some(option => option.id === item.id)"
665
+ :disabled="calculatorForm.countries.length >= 3 && !calculatorForm.countries.some(option => option.id === item.id)"
666
+ true-icon="mdi-check-circle-outline"
667
+ @click="selectOption(item)"
337
668
  />
338
669
  </div>
339
670
  <base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
340
671
  </div>
341
672
  </Teleport>
673
+ <Teleport v-if="isTermsPanelOpen" to="#right-panel-actions">
674
+ <div :class="[$styles.scrollPage]" class="flex flex-col items-center">
675
+ <base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
676
+ <div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
677
+ <div v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))">
678
+ <v-expansion-panels v-if="panelCodeList.includes(String(item.code)) && (whichProduct === 'lifebusiness' || whichProduct === 'gns')" variant="accordion">
679
+ <v-expansion-panel class="hover:bg-[#f5f8fd]" elevation="0" bg-color="#F3F6FC">
680
+ <v-expansion-panel-title @click="pickTermValue(item)">
681
+ {{ item.nameRu }}
682
+ </v-expansion-panel-title>
683
+ <v-expansion-panel-text class="border-t-[1px] border-t-white cursor-pointer" :class="[$styles.textSimple]" v-for="(i, idx) of subPanelList">
684
+ <base-panel-select-item class="!p-0" :key="idx" :text="String(i.nameRu)" :selected="i.code === subTermValue" @click="pickSubTermValue(item, i)" />
685
+ </v-expansion-panel-text>
686
+ </v-expansion-panel>
687
+ </v-expansion-panels>
688
+ <base-panel-select-item v-else :key="index" :text="String(item.nameRu)" :selected="item.nameRu === termValue?.coverSumName" @click="pickTermValue(item)" />
689
+ </div>
690
+ </div>
691
+ <base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
692
+ </div>
693
+ </Teleport>
342
694
  </section>
343
695
  </template>
344
696
 
345
697
  <script lang="ts">
346
- import { Member, Value } from '../../composables/classes';
698
+ import { Member, Value, CountryValue, CalculatorForm } from '../../composables/classes';
347
699
 
348
700
  export default defineComponent({
349
701
  props: {
350
- isRecalculation: {
702
+ isCalculator: {
351
703
  type: Boolean,
352
704
  default: false,
353
705
  },
@@ -371,16 +723,41 @@ export default defineComponent({
371
723
  const isTermsPanelOpen = ref<boolean>(false);
372
724
  const panelValue = ref<Value>(new Value());
373
725
  const termValue = ref<AddCover>();
726
+ const subTermValue = ref<string>('');
374
727
  const panelList = ref<Value[]>([]);
728
+ const subPanelList = ref<AddCoverAnswer[] | Value[]>([]);
375
729
  const productConditionsForm = formStore.productConditionsForm;
376
730
  const currentPanel = ref<keyof typeof productConditionsForm>();
377
731
  const currentIndex = ref<number>();
378
732
  const searchQuery = ref<string>('');
379
733
  const whichSum = ref<'insurancePremiumPerMonth' | 'requestedSumInsured' | ''>('');
734
+ const panelCodeList = ['processcovertypesum', 'fixedinssum'];
735
+ const enabled = 'включено';
380
736
 
381
737
  const additionalTerms = ref<AddCover[]>([]);
738
+
739
+ const maxDate = ref();
740
+ const dateOfBegin = ref();
741
+ const contractDate = ref();
742
+ const transferContractDate = ref();
743
+ const transferContractFirstPaymentDate = ref();
744
+ const guaranteedPeriodList = Array.from(Array(35), (e, i) => i + 1);
745
+ const pensionForm = formStore.applicationData?.pensionApp ?? undefined;
746
+ const isEnpfSum = (formStore.applicationData?.isEnpfSum ?? false) && useEnv().isProduction;
747
+
748
+ const isMultiplePanelOpen = ref<boolean>(false);
749
+ const multiplePanelValue = ref<CountryValue>(new CountryValue());
750
+ const multiplePanelList = ref<CountryValue[]>([]);
751
+ const calculatorForm = productConditionsForm.calculatorForm;
752
+ const minInsSum = computed(() => formStore.lfb.clients && formStore.lfb.clients.reduce((min, item) => Math.min(min, item.insSum), Infinity));
753
+ const isShownAdditionalTerms = computed(() => {
754
+ if (whichProduct.value === 'gons') {
755
+ return false;
756
+ }
757
+ return true;
758
+ });
382
759
  const isUnderwriterForm = computed(() => {
383
- if (route.params.taskId === '0 ' || props.isRecalculation === true) {
760
+ if (route.params.taskId === '0 ' || props.isCalculator === true) {
384
761
  return false;
385
762
  } else {
386
763
  return formStore.applicationData.statusCode === 'UnderwriterForm';
@@ -388,20 +765,50 @@ export default defineComponent({
388
765
  });
389
766
  const isDisabled = computed(() => (dataStore.isCalculator ? false : !memberStore.isStatementEditible('productConditionsForm')));
390
767
  const isTermsDisabled = computed(() => {
391
- if (dataStore.isGons) {
768
+ if (whichProduct.value === 'gons') {
392
769
  return true;
393
770
  }
771
+ if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && dataStore.isUnderwriter()) {
772
+ return false;
773
+ }
394
774
  return isDisabled.value;
395
775
  });
396
- const isTask = computed(() => (route.params.taskId === '0' && props.isRecalculation === true) || dataStore.isTask());
397
- const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm);
776
+ const fromIndexPage = computed(() => whichProduct.value === 'gons' && route.name === 'index' && route.query.tab === 'calculator');
777
+ const isTask = computed(() => (route.params.taskId === '0' && props.isCalculator === true) || dataStore.isTask() || fromIndexPage.value);
778
+ const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm || formStore.canBeClaimed === true);
398
779
  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);
780
+ const insurancePremiumPerMonthRule = computed(() => (!!productConditionsForm.insurancePremiumPerMonth ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
781
+ const insurancePremiumPerMonthDisabled = computed(() => {
782
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
783
+ return true;
784
+ }
785
+ if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
786
+ return false;
787
+ }
788
+ return isDisabled.value;
789
+ });
790
+ const requestedSumInsuredRule = computed(() => (!!productConditionsForm.requestedSumInsured ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
791
+ const fixInsSumRule = computed(() =>
792
+ !!productConditionsForm.fixInsSum
793
+ ? dataStore.rules.required.concat(dataStore.rules.sums, dataStore.rules.fixInsSumLimit(getNumber(productConditionsForm.fixInsSum as string), minInsSum.value))
794
+ : [],
795
+ );
402
796
  const amountAnnuityPayments = computed(() => (!!productConditionsForm.amountAnnuityPayments ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
797
+ const hasCalculated = computed(() => {
798
+ if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && productConditionsForm.requestedSumInsured === null) {
799
+ return !!productConditionsForm.insurancePremiumPerMonth;
800
+ }
801
+ return !!productConditionsForm.requestedSumInsured && !!productConditionsForm.insurancePremiumPerMonth;
802
+ });
403
803
  const hasProcessIndexRate = computed(() => {
404
- if (whichProduct.value === 'gons' || whichProduct.value === 'halykkazyna' || whichProduct.value === 'liferenta') {
804
+ if (
805
+ whichProduct.value === 'gons' ||
806
+ whichProduct.value === 'halykkazyna' ||
807
+ whichProduct.value === 'liferenta' ||
808
+ whichProduct.value === 'lifebusiness' ||
809
+ whichProduct.value === 'amuletlife' ||
810
+ whichProduct.value === 'gns'
811
+ ) {
405
812
  return false;
406
813
  }
407
814
  return true;
@@ -412,6 +819,12 @@ export default defineComponent({
412
819
  }
413
820
  return true;
414
821
  });
822
+ const hasCoverPeriod = computed(() => {
823
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
824
+ return false;
825
+ }
826
+ return true;
827
+ });
415
828
  const hasRequestedSumInsuredInDollar = computed(() => {
416
829
  if (whichProduct.value === 'halykkazyna') {
417
830
  return true;
@@ -436,6 +849,24 @@ export default defineComponent({
436
849
  }
437
850
  return true;
438
851
  });
852
+ const readonlyLifeAdditive = computed(() => {
853
+ if (whichProduct.value === 'gons') {
854
+ return true;
855
+ }
856
+ return isRecalculationDisabled.value;
857
+ });
858
+ const readonlyDisabilityMultiply = computed(() => {
859
+ if (whichProduct.value === 'gons') {
860
+ return true;
861
+ }
862
+ return isRecalculationDisabled.value;
863
+ });
864
+ const readonlyDisabilityAdditive = computed(() => {
865
+ if (whichProduct.value === 'gons') {
866
+ return true;
867
+ }
868
+ return isRecalculationDisabled.value;
869
+ });
439
870
  const hasAdbAdditive = computed(() => {
440
871
  if (whichProduct.value === 'gons') {
441
872
  return false;
@@ -454,6 +885,24 @@ export default defineComponent({
454
885
  }
455
886
  return false;
456
887
  });
888
+ const hasBirthDate = computed(() => {
889
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
890
+ return false;
891
+ }
892
+ return true;
893
+ });
894
+ const hasGender = computed(() => {
895
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
896
+ return false;
897
+ }
898
+ return true;
899
+ });
900
+ const hasAgencyPart = computed(() => {
901
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
902
+ return true;
903
+ }
904
+ return false;
905
+ });
457
906
  const coverPeriodRule = computed(() => {
458
907
  const baseCondition = dataStore.rules.required.concat(dataStore.rules.numbers);
459
908
  if (whichProduct.value === 'gons') {
@@ -462,6 +911,9 @@ export default defineComponent({
462
911
  if (whichProduct.value === 'halykkazyna') {
463
912
  return baseCondition.concat(dataStore.rules.coverPeriodFrom2to20);
464
913
  }
914
+ if (whichProduct.value === 'amuletlife') {
915
+ return baseCondition.concat(dataStore.rules.coverPeriodFrom1or5to15);
916
+ }
465
917
  return baseCondition;
466
918
  });
467
919
  const currencySymbolsAddTerm = computed(() => {
@@ -474,30 +926,155 @@ export default defineComponent({
474
926
  if (whichProduct.value === 'halykkazyna') {
475
927
  return dataStore.t('productConditionsForm.requestedSumInsuredInTenge');
476
928
  }
929
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
930
+ return dataStore.t('productConditionsForm.totalRequestedSumInsured');
931
+ }
477
932
  return dataStore.t('productConditionsForm.requestedSumInsured');
478
933
  });
934
+ const coverPeriodLabel = computed(() => {
935
+ if (whichProduct.value === 'gons') {
936
+ return dataStore.t('productConditionsForm.coverPeriodFrom3to20');
937
+ }
938
+ return dataStore.t('productConditionsForm.coverPeriod');
939
+ });
940
+ const insurancePremiumPerMonthLabel = computed(() => {
941
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
942
+ return dataStore.t('productConditionsForm.totalInsurancePremiumAmountWithCommission');
943
+ }
944
+ return dataStore.t('productConditionsForm.insurancePremiumAmount');
945
+ });
946
+ const isDisabledFixInsSum = computed(() => {
947
+ if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
948
+ return false;
949
+ }
950
+ return isDisabled.value;
951
+ });
479
952
  const isDisabledSum = computed(() => {
480
953
  if (whichProduct.value === 'halykkazyna') {
481
954
  return true;
482
955
  }
956
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
957
+ return true;
958
+ }
959
+ if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
960
+ return false;
961
+ }
483
962
  return isDisabled.value;
484
963
  });
485
964
  const isDisabledSumDollar = computed(() => {
486
965
  if (whichProduct.value === 'halykkazyna') {
487
966
  return true;
488
967
  }
968
+ if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
969
+ return false;
970
+ }
489
971
  return isDisabled.value;
490
972
  });
973
+ const countriesComputed = computed(() => {
974
+ let message = '';
975
+ for (let country in calculatorForm.countries) {
976
+ message += calculatorForm.countries[country as any].nameRu + ', ';
977
+ }
978
+ return message.slice(0, -2);
979
+ });
980
+ const isDisabledCoverPeriod = computed(() => {
981
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
982
+ return true;
983
+ }
984
+ return isDisabled.value;
985
+ });
986
+ const hasDefault = computed(() => {
987
+ if (whichProduct.value === 'lifetrip' || whichProduct.value === 'pensionannuitynew') {
988
+ return false;
989
+ }
990
+ return true;
991
+ });
992
+ const isDisabledAgentCommission = computed(() => {
993
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns' || dataStore.isUnderwriter()) {
994
+ return false;
995
+ }
996
+ return isDisabled.value;
997
+ });
998
+ const hasCalcSum = computed(() => {
999
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1000
+ return false;
1001
+ }
1002
+ return true;
1003
+ });
1004
+ const hasFixInsSum = computed(() => {
1005
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1006
+ return true;
1007
+ }
1008
+ return false;
1009
+ });
1010
+ const hasDeathInsFromNS = computed(() => {
1011
+ if (whichProduct.value === 'gns') {
1012
+ return true;
1013
+ }
1014
+ return false;
1015
+ });
1016
+ const hasDeathInsAnyReason = computed(() => {
1017
+ if (whichProduct.value === 'lifebusiness') {
1018
+ return true;
1019
+ }
1020
+ return false;
1021
+ });
1022
+ const defaultText = computed(() => {
1023
+ if (whichProduct.value === 'gns' || whichProduct.value === 'lifebusiness') {
1024
+ return dataStore.t('clients.form.calculation');
1025
+ }
1026
+ return dataStore.t('generalConditions');
1027
+ });
1028
+ const hasInsStartDate = computed(() => {
1029
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1030
+ return true;
1031
+ }
1032
+ return false;
1033
+ });
1034
+ const hasInsEndDate = computed(() => {
1035
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1036
+ return true;
1037
+ }
1038
+ return false;
1039
+ });
1040
+
1041
+ const pensionCalculationParams = ref({
1042
+ compulsoryContractAmount: pensionForm && pensionForm.compulsoryContractAmount && pensionForm.compulsoryContractAmount != 0 ? pensionForm.compulsoryContractAmount : null,
1043
+ voluntaryContractAmount: pensionForm && pensionForm.voluntaryContractAmount && pensionForm.voluntaryContractAmount != 0 ? pensionForm.voluntaryContractAmount : null,
1044
+ ownFundsRaisAmount: pensionForm && pensionForm.ownFundsRaisAmount && pensionForm.ownFundsRaisAmount != 0 ? pensionForm.ownFundsRaisAmount : null,
1045
+ compulsoryProfContractAmount:
1046
+ pensionForm && pensionForm.compulsoryProfContractAmount && pensionForm.compulsoryProfContractAmount != 0 ? pensionForm.compulsoryProfContractAmount : null,
1047
+ transferContractAmount: pensionForm && pensionForm.transferContractAmount && pensionForm.transferContractAmount != 0 ? pensionForm.transferContractAmount : null,
1048
+ });
1049
+
1050
+ const pensionAmount = computed(() =>
1051
+ pensionCalculationParams.value
1052
+ ? (Number(pensionCalculationParams.value.compulsoryContractAmount) ?? 0) +
1053
+ (Number(pensionCalculationParams.value.voluntaryContractAmount) ?? 0) +
1054
+ (Number(pensionCalculationParams.value.ownFundsRaisAmount) ?? 0) +
1055
+ (Number(pensionCalculationParams.value.compulsoryProfContractAmount) ?? 0) +
1056
+ (Number(pensionCalculationParams.value.transferContractAmount) ?? 0)
1057
+ : 0,
1058
+ );
491
1059
 
492
1060
  const formatTermValue = (term: number) => {
493
1061
  if (term !== null) {
494
- return Number.isInteger(term) ? dataStore.getNumberWithSpaces(term) : dataStore.getNumberWithDot(term);
1062
+ const termNumber = Number(term);
1063
+ return Number.isInteger(termNumber) ? dataStore.getNumberWithSpaces(termNumber) : dataStore.getNumberWithDot(termNumber);
495
1064
  }
496
1065
  return null;
497
1066
  };
498
1067
 
499
1068
  const toStatement = async () => {
500
1069
  const statementItem = dataStore.menuItems.find(i => i.id === 'statement');
1070
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1071
+ await router.push({ name: 'taskId-NewApp', params: route.params, query: { tab: 'statement' } });
1072
+ return;
1073
+ }
1074
+ if (whichProduct.value === 'gons') {
1075
+ await router.push({ name: 'taskId', params: { taskId: '0' }, query: { tab: 'statement' } });
1076
+ return;
1077
+ }
501
1078
  if (statementItem) {
502
1079
  dataStore.menu.selectedItem = statementItem;
503
1080
  await router.replace({
@@ -511,30 +1088,119 @@ export default defineComponent({
511
1088
  };
512
1089
 
513
1090
  const pickPanelValue = (item: Value) => {
514
- dataStore.panel.open = false;
1091
+ dataStore.rightPanel.open = false;
515
1092
  isPanelOpen.value = false;
1093
+ isMultiplePanelOpen.value = false;
1094
+ if (item.id === null) {
1095
+ calculatorForm.countries = [];
1096
+ }
516
1097
  if (!currentPanel.value) return;
517
- // @ts-ignore
518
- productConditionsForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
1098
+ if (whichProduct.value === 'lifetrip') {
1099
+ // @ts-ignore
1100
+ calculatorForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
1101
+ } else if (whichProduct.value === 'pensionannuitynew') {
1102
+ // @ts-ignore
1103
+ pensionForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
1104
+ } else {
1105
+ // @ts-ignore
1106
+ productConditionsForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
1107
+ if (currentPanel.value === 'paymentPeriod' && hasProcessIndexRate.value && item.code === 'single') {
1108
+ const defaultIndexRate = dataStore.processIndexRate.find((i: any) => i.isDefault === true);
1109
+ if (defaultIndexRate) productConditionsForm.processIndexRate = defaultIndexRate;
1110
+ }
1111
+ }
519
1112
  };
520
-
521
- const pickTermValue = (item: Value) => {
522
- dataStore.panel.open = false;
523
- isTermsPanelOpen.value = false;
1113
+ const selectOption = (value: CountryValue) => {
1114
+ if (calculatorForm.countries !== null) {
1115
+ if (value.id == 0) {
1116
+ calculatorForm.countries = [];
1117
+ return (dataStore.dicCountries = dataStore.dicAllCountries);
1118
+ }
1119
+ if (calculatorForm.countries.some((option: CountryValue) => option.id == value.id)) {
1120
+ calculatorForm.countries = calculatorForm.countries.filter((obj: CountryValue) => obj.id !== value.id);
1121
+ dataStore.dicCountries = dataStore.dicAllCountries;
1122
+ } else {
1123
+ dataStore.dicCountries = dataStore.dicAllCountries.filter(i =>
1124
+ i.id == 0 || (value.countryTypeCode == '1' && i.countryTypeCode == value.countryTypeCode) || (value.countryTypeCode != '1' && i.countryTypeCode != '1') ? true : false,
1125
+ );
1126
+ if (value.countryTypeCode == 1) {
1127
+ dataStore.showToaster('success', dataStore.t('toaster.shengenZoneCondition'), 3000);
1128
+ formStore.insuredForm.length = 1;
1129
+ }
1130
+ if (calculatorForm.countries.length < 3) {
1131
+ calculatorForm.countries.push(value);
1132
+ } else if (calculatorForm.countries.length >= 3) {
1133
+ closeMultiplePanel();
1134
+ }
1135
+ }
1136
+ }
1137
+ };
1138
+ const pickTermValue = async (item: Value) => {
1139
+ if (!panelCodeList.includes(item.code as string)) {
1140
+ dataStore.rightPanel.open = false;
1141
+ isTermsPanelOpen.value = false;
1142
+ }
524
1143
  if (typeof currentIndex.value !== 'number') return;
1144
+
1145
+ if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && item.code === 'processcovertypesum') {
1146
+ if (item.id !== additionalTerms.value[currentIndex.value].coverSumId) {
1147
+ additionalTerms.value[currentIndex.value].coverPeriodCode = null;
1148
+ additionalTerms.value[currentIndex.value].coverPeriodId = null;
1149
+ additionalTerms.value[currentIndex.value].coverPeriodName = null;
1150
+ }
1151
+ }
1152
+
525
1153
  additionalTerms.value[currentIndex.value].coverSumId = item.id as string;
526
1154
  additionalTerms.value[currentIndex.value].coverSumName = item.nameRu as string;
1155
+
1156
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1157
+ if (termValue.value && item.code === 'fixedinssum') {
1158
+ if (termValue.value.coverTypeCode === 11) {
1159
+ subPanelList.value = constants.fixInsAmount.slice(0, 5);
1160
+ } else {
1161
+ subPanelList.value = constants.fixInsAmount;
1162
+ }
1163
+ subTermValue.value = String(termValue.value.amount);
1164
+ } else {
1165
+ additionalTerms.value[currentIndex.value].amount = 0;
1166
+ }
1167
+
1168
+ if (termValue.value && termValue.value.coverTypeCode === 6 && item.code === 'processcovertypesum') {
1169
+ const response = await dataStore.getProcessCoverTypePeriod(termValue.value.coverTypeId);
1170
+ if (response) {
1171
+ subPanelList.value = response;
1172
+ subTermValue.value = termValue.value.coverPeriodCode as string;
1173
+ }
1174
+ }
1175
+
1176
+ if (termValue.value && termValue.value.coverTypeCode === 6 && item.code !== 'processcovertypesum') {
1177
+ additionalTerms.value[currentIndex.value].coverPeriodCode = null;
1178
+ additionalTerms.value[currentIndex.value].coverPeriodId = null;
1179
+ additionalTerms.value[currentIndex.value].coverPeriodName = null;
1180
+ }
1181
+ }
527
1182
  };
528
1183
 
529
1184
  const openPanel = async (title: string, list: Value[], key: string, asyncFunction?: Function, filterKey?: string) => {
530
1185
  if (!isDisabled.value || (key === 'riskGroup' && !isRecalculationDisabled.value)) {
1186
+ if (key === 'amount') {
1187
+ if (calculatorForm.type.nameRu === null || !calculatorForm.countries || (calculatorForm.countries && calculatorForm.countries.length === 0)) {
1188
+ return dataStore.showToaster('error', dataStore.t('toaster.noAmountBeforeTypeAndCountries'), 2000);
1189
+ }
1190
+ }
1191
+ if (key === 'maxDays') {
1192
+ if (calculatorForm.period.code === null) {
1193
+ return dataStore.showToaster('error', dataStore.t('toaster.noMaxDaysBeforePeriod'), 2000);
1194
+ }
1195
+ }
531
1196
  searchQuery.value = '';
532
1197
  currentPanel.value = key as keyof typeof productConditionsForm;
533
1198
  isPanelOpen.value = true;
534
1199
  isTermsPanelOpen.value = false;
535
1200
  dataStore.panelAction = null;
536
- dataStore.panel.open = true;
537
- dataStore.panel.title = title;
1201
+ dataStore.rightPanel.open = true;
1202
+ dataStore.rightPanel.title = title;
1203
+ isMultiplePanelOpen.value = false;
538
1204
 
539
1205
  let newList = list;
540
1206
  if (asyncFunction) {
@@ -542,32 +1208,73 @@ export default defineComponent({
542
1208
  newList = await asyncFunction(filterKey, formStore.productConditionsFormKey);
543
1209
  }
544
1210
  panelList.value = filterList(newList, key);
545
- // @ts-ignore
546
- panelValue.value = productConditionsForm[currentPanel.value];
1211
+ if (whichProduct.value === 'lifetrip') {
1212
+ // @ts-ignore
1213
+ panelValue.value = calculatorForm[currentPanel.value];
1214
+ } else {
1215
+ // @ts-ignore
1216
+ panelValue.value = productConditionsForm[currentPanel.value];
1217
+ }
547
1218
  isPanelLoading.value = false;
548
1219
  } else {
549
1220
  dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
550
1221
  }
551
1222
  };
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');
1223
+ const openMultiplePanel = async (title: string, list: CountryValue[], key: string, asyncFunction?: Function, filterKey?: string) => {
1224
+ if (!isDisabled.value || !isRecalculationDisabled.value) {
1225
+ isPanelOpen.value = false;
1226
+ isMultiplePanelOpen.value = true;
1227
+ isPanelLoading.value = true;
1228
+ let newList = list;
1229
+ if (asyncFunction !== null) {
1230
+ // @ts-ignore
1231
+ newList = await asyncFunction(filterKey, formStore.productConditionsFormKey);
557
1232
  }
1233
+ if (newList[0].nameRu !== null) {
1234
+ // @ts-ignore
1235
+ newList.unshift(new CountryValue(0, null));
1236
+ }
1237
+
1238
+ dataStore.panelAction = null;
1239
+ dataStore.rightPanel.open = true;
1240
+ dataStore.rightPanel.title = title;
1241
+
1242
+ // @ts-ignore
1243
+ multiplePanelList.value = filterList(newList, key);
1244
+ // @ts-ignore
1245
+ multiplePanelValue.value = calculatorForm[currentPanel.value];
1246
+ isPanelLoading.value = false;
1247
+ } else {
1248
+ dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'), 2000);
558
1249
  }
1250
+ };
1251
+ const closeMultiplePanel = (item?: CountryValue) => {
1252
+ dataStore.rightPanel.open = false;
1253
+ isMultiplePanelOpen.value = false;
1254
+ if (!currentPanel.value) return;
1255
+ // @ts-ignore
1256
+ calculatorForm[currentPanel.value] = item?.nameRu === null ? new Value() : item;
1257
+ };
1258
+
1259
+ const filterList = (list: Value[], key: string) => {
1260
+ // if (whichProduct.value === 'baiterek') {
1261
+ // if (dataStore.isManagerHalykBank()) {
1262
+ // if (key === 'paymentPeriod') return list.filter(i => i.code !== 'single');
1263
+ // }
1264
+ // }
559
1265
  return list;
560
1266
  };
561
1267
 
562
1268
  const openTermPanel = async (title: string, asyncFunction: Function, questionId: string, index: number) => {
563
- if (!isDisabled.value) {
1269
+ if (!isDisabled.value || ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && dataStore.isUnderwriter())) {
564
1270
  searchQuery.value = '';
565
1271
  currentIndex.value = index;
566
1272
  isPanelOpen.value = false;
1273
+ isMultiplePanelOpen.value = false;
567
1274
  isTermsPanelOpen.value = true;
568
1275
  dataStore.panelAction = null;
569
- dataStore.panel.open = true;
570
- dataStore.panel.title = title;
1276
+ dataStore.rightPanel.open = true;
1277
+ dataStore.rightPanel.title = title;
571
1278
 
572
1279
  let newList;
573
1280
  if (asyncFunction) {
@@ -583,6 +1290,23 @@ export default defineComponent({
583
1290
  }
584
1291
  };
585
1292
 
1293
+ const pickSubTermValue = (item: any, subItem: any) => {
1294
+ dataStore.rightPanel.open = false;
1295
+ isTermsPanelOpen.value = false;
1296
+ subTermValue.value = item.code as string;
1297
+ if (typeof currentIndex.value !== 'number') return;
1298
+
1299
+ if (item.code === 'fixedinssum') {
1300
+ additionalTerms.value[currentIndex.value].amount = Number(subItem.code);
1301
+ }
1302
+
1303
+ if (item.code === 'processcovertypesum') {
1304
+ additionalTerms.value[currentIndex.value].coverPeriodCode = subItem.code as string;
1305
+ additionalTerms.value[currentIndex.value].coverPeriodId = subItem.id as string;
1306
+ additionalTerms.value[currentIndex.value].coverPeriodName = subItem.nameRu as string;
1307
+ }
1308
+ };
1309
+
586
1310
  const underwriterCalculate = async (type: 'sum' | 'premium') => {
587
1311
  if (!type) return;
588
1312
  if (type === 'sum') {
@@ -645,6 +1369,15 @@ export default defineComponent({
645
1369
  }
646
1370
  };
647
1371
 
1372
+ const onInputFixInsSum = (event: Event) => {
1373
+ if (event.target && 'value' in event.target && event.target.value) {
1374
+ const calculatedFixInsSum = getNumber(event.target.value as string);
1375
+ if (calculatedFixInsSum) {
1376
+ productConditionsForm.fixInsSum = dataStore.getNumberWithSpaces(productConditionsForm.fixInsSum);
1377
+ }
1378
+ }
1379
+ };
1380
+
648
1381
  const onInputSumDollar = (event: Event) => {
649
1382
  if (event.target && 'value' in event.target && event.target.value && dataStore.currencies.usd) {
650
1383
  whichSum.value = 'requestedSumInsured';
@@ -682,6 +1415,12 @@ export default defineComponent({
682
1415
  productConditionsForm.requestedSumInsuredInDollar = null;
683
1416
  productConditionsForm.insurancePremiumPerMonth = null;
684
1417
  productConditionsForm.insurancePremiumPerMonthInDollar = null;
1418
+ if (whichProduct.value === 'lifetrip') {
1419
+ Object.keys(calculatorForm).forEach(key => {
1420
+ //@ts-ignore
1421
+ calculatorForm[key] = new CalculatorForm()[key];
1422
+ });
1423
+ }
685
1424
  };
686
1425
 
687
1426
  const filterTermConditions = (term: AddCover) => {
@@ -691,88 +1430,150 @@ export default defineComponent({
691
1430
  return true;
692
1431
  };
693
1432
 
1433
+ const coverTypeName = (term: AddCover) => {
1434
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1435
+ return String(term.coverTypeNameRu);
1436
+ }
1437
+ return term.coverTypeName;
1438
+ };
1439
+
694
1440
  const submitForm = async () => {
695
1441
  vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
696
1442
  if (v.valid) {
697
- if (whichSum.value === 'requestedSumInsured') {
698
- productConditionsForm.insurancePremiumPerMonth = null;
699
- if (whichProduct.value === 'halykkazyna') {
700
- productConditionsForm.insurancePremiumPerMonthInDollar = null;
1443
+ if (whichProduct.value === 'lifetrip') {
1444
+ if (calculatorForm.type.code === 'Single' && calculatorForm.startDate && calculatorForm.endDate) {
1445
+ const formattedStartDate = formatDate(calculatorForm.startDate);
1446
+ const formattedEndDate = formatDate(calculatorForm.endDate);
1447
+ if (formattedStartDate && formattedEndDate && formattedStartDate.getTime() > formattedEndDate.getTime()) {
1448
+ return dataStore.showToaster('error', dataStore.t('toaster.startMoreEnd'));
1449
+ }
701
1450
  }
702
- }
703
- if (whichSum.value === 'insurancePremiumPerMonth') {
704
- productConditionsForm.requestedSumInsured = null;
705
- if (whichProduct.value === 'halykkazyna') {
706
- productConditionsForm.requestedSumInsuredInDollar = null;
1451
+ if (dataStore.isTask()) {
1452
+ await dataStore.calculatePrice(route.params.taskId as string);
1453
+ } else {
1454
+ await dataStore.calculatePrice();
1455
+ }
1456
+ } else if (whichProduct.value === 'pensionannuitynew') {
1457
+ if (
1458
+ pensionCalculationParams.value &&
1459
+ pensionCalculationParams.value.compulsoryProfContractAmount &&
1460
+ pensionForm &&
1461
+ pensionForm.compulsoryProfContractAmount != 0 &&
1462
+ pensionForm.compulsoryProfMonthCount < 60
1463
+ ) {
1464
+ dataStore.showToaster('error', 'Минимальное число дней уплаты ОППВ должно быть больше 60');
1465
+ return;
1466
+ }
1467
+ const data = {
1468
+ ...pensionForm,
1469
+ ...(pensionCalculationParams.value = {
1470
+ ...pensionCalculationParams.value,
1471
+ compulsoryContractAmount: Number(pensionCalculationParams.value.compulsoryContractAmount),
1472
+ voluntaryContractAmount: Number(pensionCalculationParams.value.voluntaryContractAmount),
1473
+ ownFundsRaisAmount: Number(pensionCalculationParams.value.ownFundsRaisAmount),
1474
+ compulsoryProfContractAmount: Number(pensionCalculationParams.value.compulsoryProfContractAmount),
1475
+ transferContractAmount: Number(pensionCalculationParams.value.transferContractAmount),
1476
+ }),
1477
+ transferContractCompany: pensionForm.transferContractCompany?.nameRu ?? null,
1478
+ transferContractDate: transferContractDate.value ? formatDate(transferContractDate.value) : null,
1479
+ transferContractFirstPaymentDate: transferContractFirstPaymentDate.value ? formatDate(transferContractFirstPaymentDate.value) : null,
1480
+ };
1481
+ await dataStore.setApplication(data, true);
1482
+ } else {
1483
+ if (whichSum.value === 'requestedSumInsured') {
1484
+ productConditionsForm.insurancePremiumPerMonth = null;
1485
+ if (whichProduct.value === 'halykkazyna') {
1486
+ productConditionsForm.insurancePremiumPerMonthInDollar = null;
1487
+ }
1488
+ }
1489
+ if (whichSum.value === 'insurancePremiumPerMonth') {
1490
+ productConditionsForm.requestedSumInsured = null;
1491
+ if (whichProduct.value === 'halykkazyna') {
1492
+ productConditionsForm.requestedSumInsuredInDollar = null;
1493
+ }
1494
+ }
1495
+ if (productConditionsForm.requestedSumInsured !== '' && productConditionsForm.requestedSumInsured != null) {
1496
+ productConditionsForm.insurancePremiumPerMonth = null;
1497
+ if (props.isCalculator) whichSum.value = 'requestedSumInsured';
1498
+ }
1499
+ if (productConditionsForm.insurancePremiumPerMonth !== '' && productConditionsForm.insurancePremiumPerMonth != null) {
1500
+ productConditionsForm.requestedSumInsured = null;
1501
+ if (props.isCalculator) whichSum.value = 'insurancePremiumPerMonth';
707
1502
  }
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
1503
 
718
- if (!whichSum.value && isUnderwriterForm.value === false) {
719
- dataStore.showToaster('error', dataStore.t('toaster.emptyProductConditions'));
720
- return;
721
- }
1504
+ if (!whichSum.value && isUnderwriterForm.value === false) {
1505
+ dataStore.showToaster('error', dataStore.t('toaster.emptyProductConditions'));
1506
+ return;
1507
+ }
722
1508
 
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;
1509
+ if (
1510
+ whichProduct.value === 'gons' &&
1511
+ (formStore.applicationData.statusCode === 'EditForm' || formStore.applicationData.statusCode === 'StartForm') &&
1512
+ getNumber(productConditionsForm.requestedSumInsured as string)! >= 10_000_000
1513
+ ) {
1514
+ dataStore.showToaster('info', dataStore.t('toaster.calcSumForUnder'), 6000);
1515
+ }
1516
+ if (isUnderwriterForm.value) {
1517
+ type recalculationInfo = {
1518
+ lifeMultiply: string | null | number;
1519
+ lifeAdditive: string | null | number;
1520
+ lifeMultiplyClient?: string | number | null;
1521
+ lifeAdditiveClient?: string | number | null;
1522
+ adbMultiply: string | null | number;
1523
+ adbAdditive: string | null | number;
1524
+ disabilityMultiply: string | null | number;
1525
+ disabilityAdditive: string | null | number;
1526
+ amount?: string | number | null;
1527
+ premium?: string | number | null;
1528
+ riskGroup?: string | string | number | null;
1529
+ };
1530
+ const recalculationData: recalculationInfo = (({ lifeMultiply, lifeAdditive, adbMultiply, adbAdditive, disabilityMultiply, disabilityAdditive }) => ({
1531
+ lifeMultiply,
1532
+ lifeAdditive,
1533
+ adbMultiply,
1534
+ adbAdditive,
1535
+ disabilityMultiply,
1536
+ disabilityAdditive,
1537
+ }))(productConditionsForm);
1538
+ Object.keys(recalculationData).forEach(key => {
1539
+ // @ts-ignore
1540
+ recalculationData[key] = formatProcents(recalculationData[key]);
1541
+ });
1542
+ recalculationData.lifeMultiplyClient = dataStore.isClientAnketaCondition
1543
+ ? formStore.productConditionsForm.lifeMultiplyClient === null
1544
+ ? null
1545
+ : formatProcents(formStore.productConditionsForm.lifeMultiplyClient)
1546
+ : null;
1547
+ recalculationData.lifeAdditiveClient = dataStore.isClientAnketaCondition
1548
+ ? formStore.productConditionsForm.lifeAdditiveClient === null
1549
+ ? null
1550
+ : formatProcents(formStore.productConditionsForm.lifeAdditiveClient)
1551
+ : null;
1552
+ recalculationData.amount = Number((productConditionsForm.requestedSumInsured as string)?.replace(/\s/g, ''));
1553
+ recalculationData.premium = Number((productConditionsForm.insurancePremiumPerMonth as string)?.replace(/\s/g, ''));
1554
+ recalculationData.riskGroup = productConditionsForm.riskGroup?.id ? productConditionsForm.riskGroup.id : 1;
1555
+ isCalculating.value = true;
1556
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1557
+ await dataStore.calculate(route.params.taskId as string);
1558
+ additionalTerms.value = formStore.additionalInsuranceTerms;
1559
+ } else {
1560
+ await dataStore.reCalculate(formStore.applicationData.processInstanceId, recalculationData, route.params.taskId as string, whichSum.value);
1561
+ additionalTerms.value = formStore.additionalInsuranceTerms;
1562
+ }
1563
+ }
762
1564
  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;
1565
+ if (props.isCalculator) {
1566
+ //@ts-ignore
1567
+ await dataStore.calculateWithoutApplication(true, whichProduct.value);
1568
+ additionalTerms.value = formStore.additionalInsuranceTermsWithout;
1569
+ } else {
1570
+ if (dataStore.isProcessEditable(formStore.applicationData.statusCode)) {
1571
+ await dataStore.calculate(route.params.taskId as string);
1572
+ additionalTerms.value = formStore.additionalInsuranceTerms;
1573
+ }
774
1574
  }
775
1575
  }
1576
+
776
1577
  isCalculating.value = false;
777
1578
  } else {
778
1579
  const errors = document.querySelector('.v-input--error');
@@ -797,38 +1598,49 @@ export default defineComponent({
797
1598
  };
798
1599
 
799
1600
  onMounted(async () => {
800
- if (props.isRecalculation === true) {
1601
+ if (props.isCalculator === true) {
801
1602
  if (dataStore.isCalculator) {
802
1603
  clearFields();
803
1604
  }
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;
1605
+ if (whichProduct.value !== 'lifetrip' && whichProduct.value !== 'pensionannuitynew') {
1606
+ if (
1607
+ (dataStore.isCalculator || route.params.taskId === '0' || fromIndexPage.value) &&
1608
+ productConditionsForm.requestedSumInsured === null &&
1609
+ productConditionsForm.insurancePremiumPerMonth === null
1610
+ ) {
1611
+ // @ts-ignore
1612
+ const defaultData = await dataStore.getDefaultCalculationData(true, whichProduct.value);
1613
+ if (!defaultData) {
1614
+ dataStore.showToaster('error', 'Отсутствуют базовые данные');
1615
+ return;
1616
+ }
1617
+ formStore.additionalInsuranceTermsWithout = defaultData.addCovers;
1618
+ productConditionsForm.requestedSumInsured = defaultData.amount;
1619
+ productConditionsForm.insurancePremiumPerMonth = defaultData.premium;
1620
+ const indexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
1621
+ if (indexRate) productConditionsForm.processIndexRate = indexRate;
1622
+ const paymendPeriod = dataStore.processPaymentPeriod.find(i => i.id === defaultData.paymentPeriodId);
1623
+ if (paymendPeriod) productConditionsForm.paymentPeriod = paymendPeriod;
1624
+ if (defaultData.signDate) {
1625
+ productConditionsForm.signDate = reformatDate(defaultData.signDate);
1626
+ }
1627
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1628
+ productConditionsForm.coverPeriod = defaultData.insTermInMonth ?? null;
1629
+ productConditionsForm.insurancePremiumPerMonth = null;
1630
+ }
814
1631
  }
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
1632
  }
824
1633
  }
825
- additionalTerms.value = props.isRecalculation ? formStore.additionalInsuranceTermsWithout : formStore.additionalInsuranceTerms;
1634
+ additionalTerms.value = props.isCalculator ? formStore.additionalInsuranceTermsWithout : formStore.additionalInsuranceTerms;
826
1635
  if (!!productConditionsForm.insurancePremiumPerMonth) {
827
1636
  whichSum.value = 'insurancePremiumPerMonth';
828
1637
  }
829
1638
  if (!!productConditionsForm.requestedSumInsured) {
830
1639
  whichSum.value = 'requestedSumInsured';
831
1640
  }
1641
+ if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && !productConditionsForm.requestedSumInsured) {
1642
+ whichSum.value = 'requestedSumInsured';
1643
+ }
832
1644
  if (dataStore.isCalculator) {
833
1645
  dataStore.processCode = constants.products[whichProduct.value as keyof typeof constants.products];
834
1646
  await dataStore.getProcessPaymentPeriod();
@@ -838,6 +1650,20 @@ export default defineComponent({
838
1650
  if (kazynaPaymentPeriod) productConditionsForm.paymentPeriod = kazynaPaymentPeriod;
839
1651
  await dataStore.getCurrencies();
840
1652
  }
1653
+ if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
1654
+ productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(
1655
+ formStore.lfb.clients.reduce((sum: number, i: any) => {
1656
+ return sum + Number(i.insSum);
1657
+ }, 0),
1658
+ );
1659
+ }
1660
+ if (whichProduct.value === 'pensionannuitynew') {
1661
+ contractDate.value = reformatDate(formStore.applicationData.pensionApp.contractDate);
1662
+ dateOfBegin.value = reformatDate(formStore.applicationData.pensionApp.dateOfBegin);
1663
+ transferContractDate.value = reformatDate(formStore.applicationData.pensionApp.transferContractDate);
1664
+ transferContractFirstPaymentDate.value = reformatDate(formStore.applicationData.pensionApp.transferContractFirstPaymentDate);
1665
+ maxDate.value = await dataStore.getVariableData(formStore.applicationData.processCode ?? 19);
1666
+ }
841
1667
  });
842
1668
 
843
1669
  watch(
@@ -859,9 +1685,9 @@ export default defineComponent({
859
1685
  },
860
1686
  );
861
1687
  watch(
862
- () => dataStore.panel.open,
1688
+ () => dataStore.rightPanel.open,
863
1689
  () => {
864
- if (dataStore.panel.open === false) {
1690
+ if (dataStore.rightPanel.open === false) {
865
1691
  isPanelOpen.value = false;
866
1692
  isTermsPanelOpen.value = false;
867
1693
  dataStore.panelAction = null;
@@ -870,6 +1696,77 @@ export default defineComponent({
870
1696
  { immediate: true },
871
1697
  );
872
1698
 
1699
+ if (hasInsStartDate.value) {
1700
+ watch(
1701
+ () => productConditionsForm.calcDate,
1702
+ val => {
1703
+ if (val !== null && val.length === 10) {
1704
+ const formattedStartDate = formatDate(val);
1705
+ formattedStartDate?.setFullYear(formattedStartDate?.getFullYear() + 1);
1706
+ formattedStartDate?.setDate(formattedStartDate?.getDate() - 1);
1707
+ productConditionsForm.contractEndDate = reformatDate(String(formattedStartDate));
1708
+ }
1709
+ },
1710
+ );
1711
+ }
1712
+
1713
+ if (whichProduct.value === 'lifetrip') {
1714
+ watch(
1715
+ () => calculatorForm.type,
1716
+ async val => {
1717
+ if (val.code === 'Multiple') {
1718
+ await dataStore.getPeriod();
1719
+ calculatorForm.period = new Value();
1720
+ calculatorForm.endDate = null;
1721
+ }
1722
+ if (calculatorForm.countries?.length != 0) {
1723
+ await dataStore.getTripInsuredAmount();
1724
+ }
1725
+ },
1726
+ );
1727
+ watch(
1728
+ () => calculatorForm.countries,
1729
+ async val => {
1730
+ if (val?.length && val.every(option => option.id != 0) && calculatorForm.type?.nameRu != null) {
1731
+ await dataStore.getTripInsuredAmount();
1732
+ }
1733
+ },
1734
+ { deep: true },
1735
+ );
1736
+
1737
+ watch(
1738
+ () => calculatorForm.period,
1739
+ val => {
1740
+ if (val) {
1741
+ dataStore.maxDaysFiltered = dataStore.maxDaysAllArray.filter(days => days.code == val.code);
1742
+ calculatorForm.maxDays = new Value();
1743
+ }
1744
+ },
1745
+ );
1746
+
1747
+ watch(
1748
+ () => calculatorForm.startDate,
1749
+ val => {
1750
+ if (val !== null && val.length === 10 && calculatorForm.endDate != null && calculatorForm.endDate.length === 10) {
1751
+ calculatorForm.days = productConditionsForm.getSingleTripDays();
1752
+ }
1753
+ },
1754
+ );
1755
+ watch(
1756
+ () => calculatorForm.endDate,
1757
+ val => {
1758
+ if (val !== null && val.length === 10 && calculatorForm.startDate != null && calculatorForm.startDate.length === 10) {
1759
+ calculatorForm.days = productConditionsForm.getSingleTripDays();
1760
+ }
1761
+ },
1762
+ );
1763
+ }
1764
+
1765
+ const copyRedirect = async () => {
1766
+ const url = await dataStore.api.getEnpfRedirectUrl(String(formStore.applicationData.processInstanceId));
1767
+ dataStore.copyToClipboard(url.redirectUrl);
1768
+ };
1769
+
873
1770
  return {
874
1771
  // State
875
1772
  formStore,
@@ -880,21 +1777,38 @@ export default defineComponent({
880
1777
  isCalculating,
881
1778
  isPanelLoading,
882
1779
  isPanelOpen,
1780
+ isMultiplePanelOpen,
883
1781
  isTermsPanelOpen,
884
1782
  panelValue,
885
1783
  termValue,
886
1784
  panelList,
1785
+ multiplePanelList,
1786
+ multiplePanelValue,
887
1787
  searchQuery,
888
1788
  whichSum,
889
1789
  Value,
1790
+ calculatorForm,
1791
+ subPanelList,
1792
+ subTermValue,
1793
+ panelCodeList,
1794
+ pensionForm,
1795
+ dateOfBegin,
1796
+ contractDate,
1797
+ transferContractDate,
1798
+ transferContractFirstPaymentDate,
1799
+ enabled,
1800
+ maxDate,
1801
+ guaranteedPeriodList,
1802
+ isEnpfSum,
890
1803
 
891
1804
  // Computed
892
1805
  isTask,
893
1806
  isDisabled,
894
1807
  isTermsDisabled,
895
1808
  isUnderwriterForm,
896
- insurancePremiumPerMonth,
897
- requestedSumInsured,
1809
+ insurancePremiumPerMonthRule,
1810
+ insurancePremiumPerMonthDisabled,
1811
+ requestedSumInsuredRule,
898
1812
  isRecalculationDisabled,
899
1813
  isUnderwriterRole,
900
1814
  hasProcessIndexRate,
@@ -903,24 +1817,51 @@ export default defineComponent({
903
1817
  hasInsurancePremiumPerMonthInDollar,
904
1818
  hasCurrency,
905
1819
  hasAdbMultiply,
1820
+ readonlyLifeAdditive,
1821
+ readonlyDisabilityMultiply,
1822
+ readonlyDisabilityAdditive,
906
1823
  hasAdbAdditive,
907
1824
  hasRiskGroup,
908
1825
  hasCalculated,
909
1826
  hasAnnuityPayments,
1827
+ hasAgencyPart,
910
1828
  currencySymbolsAddTerm,
911
1829
  amountAnnuityPayments,
912
1830
  requestedSumInsuredLabel,
913
1831
  isDisabledSum,
914
1832
  isDisabledSumDollar,
1833
+ countriesComputed,
1834
+ hasBirthDate,
1835
+ hasGender,
1836
+ coverPeriodLabel,
1837
+ insurancePremiumPerMonthLabel,
1838
+ isDisabledCoverPeriod,
1839
+ hasDefault,
1840
+ isShownAdditionalTerms,
1841
+ hasCalcSum,
1842
+ isDisabledAgentCommission,
1843
+ hasFixInsSum,
1844
+ isDisabledFixInsSum,
1845
+ defaultText,
1846
+ hasDeathInsFromNS,
1847
+ pensionAmount,
1848
+ pensionCalculationParams,
1849
+ hasDeathInsAnyReason,
1850
+ fromIndexPage,
1851
+ hasCoverPeriod,
1852
+ hasInsStartDate,
1853
+ hasInsEndDate,
915
1854
 
916
1855
  // Rules
917
1856
  coverPeriodRule,
1857
+ fixInsSumRule,
918
1858
 
919
1859
  // Functions
920
1860
  submitForm,
921
1861
  pickPanelValue,
922
1862
  pickTermValue,
923
1863
  openPanel,
1864
+ openMultiplePanel,
924
1865
  openTermPanel,
925
1866
  pickCalculation,
926
1867
  underwriterCalculate,
@@ -936,7 +1877,18 @@ export default defineComponent({
936
1877
  clearFields,
937
1878
  formatTermValue,
938
1879
  filterTermConditions,
1880
+ selectOption,
1881
+ coverTypeName,
1882
+ pickSubTermValue,
1883
+ onInputFixInsSum,
1884
+ copyRedirect,
939
1885
  };
940
1886
  },
941
1887
  });
942
1888
  </script>
1889
+
1890
+ <style>
1891
+ .pension-guaranteed-period .v-field {
1892
+ border: none !important;
1893
+ }
1894
+ </style>