hl-core 0.0.9-beta.9 → 0.0.10-beta.10
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.
- package/api/base.api.ts +1110 -0
- package/api/index.ts +2 -620
- package/api/interceptors.ts +38 -1
- package/components/Button/Btn.vue +1 -6
- package/components/Complex/MessageBlock.vue +1 -1
- package/components/Complex/Page.vue +1 -1
- package/components/Complex/TextBlock.vue +25 -0
- package/components/Dialog/Dialog.vue +72 -16
- package/components/Dialog/FamilyDialog.vue +3 -1
- package/components/Form/DynamicForm.vue +101 -0
- package/components/Form/FormBlock.vue +12 -3
- package/components/Form/FormData.vue +111 -0
- package/components/Form/FormSection.vue +3 -3
- package/components/Form/FormTextSection.vue +11 -3
- package/components/Form/FormToggle.vue +25 -5
- package/components/Form/ManagerAttachment.vue +178 -89
- package/components/Form/ProductConditionsBlock.vue +59 -6
- package/components/Input/Datepicker.vue +43 -7
- package/components/Input/DynamicInput.vue +25 -0
- package/components/Input/FileInput.vue +25 -5
- package/components/Input/FormInput.vue +9 -4
- package/components/Input/Monthpicker.vue +34 -0
- package/components/Input/PanelInput.vue +6 -1
- package/components/Input/RoundedInput.vue +2 -0
- package/components/Input/RoundedSelect.vue +9 -2
- package/components/Input/SwitchInput.vue +66 -0
- package/components/Input/TextInput.vue +162 -0
- package/components/Layout/Drawer.vue +18 -4
- package/components/Layout/Header.vue +23 -2
- package/components/Layout/Loader.vue +2 -1
- package/components/Layout/SettingsPanel.vue +24 -11
- package/components/Menu/InfoMenu.vue +35 -0
- package/components/Menu/MenuNav.vue +25 -3
- package/components/Pages/Anketa.vue +255 -65
- package/components/Pages/Auth.vue +58 -9
- package/components/Pages/ContragentForm.vue +10 -9
- package/components/Pages/Documents.vue +267 -30
- package/components/Pages/InvoiceInfo.vue +1 -1
- package/components/Pages/MemberForm.vue +775 -102
- package/components/Pages/ProductAgreement.vue +1 -8
- package/components/Pages/ProductConditions.vue +1133 -180
- package/components/Panel/PanelHandler.vue +627 -49
- package/components/Panel/PanelSelectItem.vue +17 -2
- package/components/Panel/RightPanelCloser.vue +7 -0
- package/components/Transitions/Animation.vue +30 -0
- package/components/Utilities/Chip.vue +2 -0
- package/components/Utilities/JsonViewer.vue +2 -2
- package/components/Utilities/Qr.vue +44 -0
- package/composables/axios.ts +1 -0
- package/composables/classes.ts +550 -44
- package/composables/constants.ts +126 -6
- package/composables/fields.ts +330 -0
- package/composables/index.ts +356 -20
- package/composables/styles.ts +23 -6
- package/configs/pwa.ts +63 -0
- package/layouts/clear.vue +21 -0
- package/layouts/default.vue +62 -3
- package/layouts/full.vue +21 -0
- package/locales/ru.json +558 -16
- package/nuxt.config.ts +6 -15
- package/package.json +38 -39
- package/pages/Token.vue +0 -13
- package/plugins/head.ts +26 -0
- package/plugins/vuetifyPlugin.ts +1 -5
- package/store/data.store.ts +1647 -348
- package/store/extractStore.ts +17 -0
- package/store/form.store.ts +13 -1
- package/store/member.store.ts +2 -1
- package/store/rules.ts +97 -3
- package/store/toast.ts +1 -1
- package/tsconfig.json +3 -0
- package/types/enum.ts +82 -0
- package/types/env.d.ts +2 -0
- package/types/form.ts +90 -0
- package/types/index.ts +847 -506
|
@@ -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-[
|
|
4
|
-
<base-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
|
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
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
113
|
-
<div v-if="
|
|
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="
|
|
172
|
+
:readonly="isDisabledCoverPeriod"
|
|
146
173
|
:clearable="!isDisabled"
|
|
147
174
|
:rules="coverPeriodRule"
|
|
148
|
-
:label="
|
|
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="!
|
|
176
|
-
:rules="
|
|
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="!
|
|
187
|
-
:rules="
|
|
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="
|
|
196
|
-
:clearable="!
|
|
197
|
-
:rules="
|
|
198
|
-
:label="
|
|
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="
|
|
207
|
-
:clearable="!
|
|
208
|
-
:rules="
|
|
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
|
-
<
|
|
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="
|
|
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
|
|
608
|
+
:label="coverTypeName(term)"
|
|
293
609
|
append-inner-icon="mdi mdi-chevron-right"
|
|
294
|
-
:suffix="
|
|
295
|
-
|
|
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 &&
|
|
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
|
|
642
|
+
:text="String(item.nameRu)"
|
|
320
643
|
:selected="item.nameRu === panelValue.nameRu"
|
|
321
644
|
@click="pickPanelValue(item)"
|
|
322
645
|
/>
|
|
@@ -324,30 +647,60 @@
|
|
|
324
647
|
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
|
|
325
648
|
</div>
|
|
326
649
|
</Teleport>
|
|
327
|
-
<Teleport v-if="
|
|
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
|
-
<
|
|
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
|
|
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
|
|
335
|
-
:selected="
|
|
336
|
-
|
|
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';
|
|
699
|
+
import type { Projects, AddCover, AddCoverAnswer } from '../../types';
|
|
347
700
|
|
|
348
701
|
export default defineComponent({
|
|
349
702
|
props: {
|
|
350
|
-
|
|
703
|
+
isCalculator: {
|
|
351
704
|
type: Boolean,
|
|
352
705
|
default: false,
|
|
353
706
|
},
|
|
@@ -371,16 +724,41 @@ export default defineComponent({
|
|
|
371
724
|
const isTermsPanelOpen = ref<boolean>(false);
|
|
372
725
|
const panelValue = ref<Value>(new Value());
|
|
373
726
|
const termValue = ref<AddCover>();
|
|
727
|
+
const subTermValue = ref<string>('');
|
|
374
728
|
const panelList = ref<Value[]>([]);
|
|
729
|
+
const subPanelList = ref<AddCoverAnswer[] | Value[]>([]);
|
|
375
730
|
const productConditionsForm = formStore.productConditionsForm;
|
|
376
731
|
const currentPanel = ref<keyof typeof productConditionsForm>();
|
|
377
732
|
const currentIndex = ref<number>();
|
|
378
733
|
const searchQuery = ref<string>('');
|
|
379
734
|
const whichSum = ref<'insurancePremiumPerMonth' | 'requestedSumInsured' | ''>('');
|
|
735
|
+
const panelCodeList = ['processcovertypesum', 'fixedinssum'];
|
|
736
|
+
const enabled = 'включено';
|
|
380
737
|
|
|
381
738
|
const additionalTerms = ref<AddCover[]>([]);
|
|
739
|
+
|
|
740
|
+
const maxDate = ref();
|
|
741
|
+
const dateOfBegin = ref();
|
|
742
|
+
const contractDate = ref();
|
|
743
|
+
const transferContractDate = ref();
|
|
744
|
+
const transferContractFirstPaymentDate = ref();
|
|
745
|
+
const guaranteedPeriodList = Array.from(Array(35), (e, i) => i + 1);
|
|
746
|
+
const pensionForm = formStore.applicationData?.pensionApp ?? undefined;
|
|
747
|
+
const isEnpfSum = (formStore.applicationData?.isEnpfSum ?? false) && useEnv().isProduction;
|
|
748
|
+
|
|
749
|
+
const isMultiplePanelOpen = ref<boolean>(false);
|
|
750
|
+
const multiplePanelValue = ref<CountryValue>(new CountryValue());
|
|
751
|
+
const multiplePanelList = ref<CountryValue[]>([]);
|
|
752
|
+
const calculatorForm = productConditionsForm.calculatorForm;
|
|
753
|
+
const minInsSum = computed(() => formStore.lfb.clients && formStore.lfb.clients.reduce((min, item) => Math.min(min, item.insSum), Infinity));
|
|
754
|
+
const isShownAdditionalTerms = computed(() => {
|
|
755
|
+
if (whichProduct.value === 'gons') {
|
|
756
|
+
return false;
|
|
757
|
+
}
|
|
758
|
+
return true;
|
|
759
|
+
});
|
|
382
760
|
const isUnderwriterForm = computed(() => {
|
|
383
|
-
if (route.params.taskId === '0 ' || props.
|
|
761
|
+
if (route.params.taskId === '0 ' || props.isCalculator === true) {
|
|
384
762
|
return false;
|
|
385
763
|
} else {
|
|
386
764
|
return formStore.applicationData.statusCode === 'UnderwriterForm';
|
|
@@ -388,20 +766,50 @@ export default defineComponent({
|
|
|
388
766
|
});
|
|
389
767
|
const isDisabled = computed(() => (dataStore.isCalculator ? false : !memberStore.isStatementEditible('productConditionsForm')));
|
|
390
768
|
const isTermsDisabled = computed(() => {
|
|
391
|
-
if (
|
|
769
|
+
if (whichProduct.value === 'gons') {
|
|
392
770
|
return true;
|
|
393
771
|
}
|
|
772
|
+
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && dataStore.isUnderwriter()) {
|
|
773
|
+
return false;
|
|
774
|
+
}
|
|
394
775
|
return isDisabled.value;
|
|
395
776
|
});
|
|
396
|
-
const
|
|
397
|
-
const
|
|
777
|
+
const fromIndexPage = computed(() => whichProduct.value === 'gons' && route.name === 'index' && route.query.tab === 'calculator');
|
|
778
|
+
const isTask = computed(() => (route.params.taskId === '0' && props.isCalculator === true) || dataStore.isTask() || fromIndexPage.value);
|
|
779
|
+
const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm || formStore.canBeClaimed === true);
|
|
398
780
|
const isUnderwriterRole = computed(() => dataStore.isUnderwriter() || dataStore.isAdmin() || dataStore.isSupport());
|
|
399
|
-
const
|
|
400
|
-
const
|
|
401
|
-
|
|
781
|
+
const insurancePremiumPerMonthRule = computed(() => (!!productConditionsForm.insurancePremiumPerMonth ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
782
|
+
const insurancePremiumPerMonthDisabled = computed(() => {
|
|
783
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
784
|
+
return true;
|
|
785
|
+
}
|
|
786
|
+
if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
|
|
787
|
+
return false;
|
|
788
|
+
}
|
|
789
|
+
return isDisabled.value;
|
|
790
|
+
});
|
|
791
|
+
const requestedSumInsuredRule = computed(() => (!!productConditionsForm.requestedSumInsured ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
792
|
+
const fixInsSumRule = computed(() =>
|
|
793
|
+
!!productConditionsForm.fixInsSum
|
|
794
|
+
? dataStore.rules.required.concat(dataStore.rules.sums, dataStore.rules.fixInsSumLimit(getNumber(productConditionsForm.fixInsSum as string), minInsSum.value))
|
|
795
|
+
: [],
|
|
796
|
+
);
|
|
402
797
|
const amountAnnuityPayments = computed(() => (!!productConditionsForm.amountAnnuityPayments ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
798
|
+
const hasCalculated = computed(() => {
|
|
799
|
+
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && productConditionsForm.requestedSumInsured === null) {
|
|
800
|
+
return !!productConditionsForm.insurancePremiumPerMonth;
|
|
801
|
+
}
|
|
802
|
+
return !!productConditionsForm.requestedSumInsured && !!productConditionsForm.insurancePremiumPerMonth;
|
|
803
|
+
});
|
|
403
804
|
const hasProcessIndexRate = computed(() => {
|
|
404
|
-
if (
|
|
805
|
+
if (
|
|
806
|
+
whichProduct.value === 'gons' ||
|
|
807
|
+
whichProduct.value === 'halykkazyna' ||
|
|
808
|
+
whichProduct.value === 'liferenta' ||
|
|
809
|
+
whichProduct.value === 'lifebusiness' ||
|
|
810
|
+
whichProduct.value === 'amuletlife' ||
|
|
811
|
+
whichProduct.value === 'gns'
|
|
812
|
+
) {
|
|
405
813
|
return false;
|
|
406
814
|
}
|
|
407
815
|
return true;
|
|
@@ -412,6 +820,12 @@ export default defineComponent({
|
|
|
412
820
|
}
|
|
413
821
|
return true;
|
|
414
822
|
});
|
|
823
|
+
const hasCoverPeriod = computed(() => {
|
|
824
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
825
|
+
return false;
|
|
826
|
+
}
|
|
827
|
+
return true;
|
|
828
|
+
});
|
|
415
829
|
const hasRequestedSumInsuredInDollar = computed(() => {
|
|
416
830
|
if (whichProduct.value === 'halykkazyna') {
|
|
417
831
|
return true;
|
|
@@ -436,6 +850,24 @@ export default defineComponent({
|
|
|
436
850
|
}
|
|
437
851
|
return true;
|
|
438
852
|
});
|
|
853
|
+
const readonlyLifeAdditive = computed(() => {
|
|
854
|
+
if (whichProduct.value === 'gons') {
|
|
855
|
+
return true;
|
|
856
|
+
}
|
|
857
|
+
return isRecalculationDisabled.value;
|
|
858
|
+
});
|
|
859
|
+
const readonlyDisabilityMultiply = computed(() => {
|
|
860
|
+
if (whichProduct.value === 'gons') {
|
|
861
|
+
return true;
|
|
862
|
+
}
|
|
863
|
+
return isRecalculationDisabled.value;
|
|
864
|
+
});
|
|
865
|
+
const readonlyDisabilityAdditive = computed(() => {
|
|
866
|
+
if (whichProduct.value === 'gons') {
|
|
867
|
+
return true;
|
|
868
|
+
}
|
|
869
|
+
return isRecalculationDisabled.value;
|
|
870
|
+
});
|
|
439
871
|
const hasAdbAdditive = computed(() => {
|
|
440
872
|
if (whichProduct.value === 'gons') {
|
|
441
873
|
return false;
|
|
@@ -454,6 +886,24 @@ export default defineComponent({
|
|
|
454
886
|
}
|
|
455
887
|
return false;
|
|
456
888
|
});
|
|
889
|
+
const hasBirthDate = computed(() => {
|
|
890
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
891
|
+
return false;
|
|
892
|
+
}
|
|
893
|
+
return true;
|
|
894
|
+
});
|
|
895
|
+
const hasGender = computed(() => {
|
|
896
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
897
|
+
return false;
|
|
898
|
+
}
|
|
899
|
+
return true;
|
|
900
|
+
});
|
|
901
|
+
const hasAgencyPart = computed(() => {
|
|
902
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
903
|
+
return true;
|
|
904
|
+
}
|
|
905
|
+
return false;
|
|
906
|
+
});
|
|
457
907
|
const coverPeriodRule = computed(() => {
|
|
458
908
|
const baseCondition = dataStore.rules.required.concat(dataStore.rules.numbers);
|
|
459
909
|
if (whichProduct.value === 'gons') {
|
|
@@ -462,6 +912,9 @@ export default defineComponent({
|
|
|
462
912
|
if (whichProduct.value === 'halykkazyna') {
|
|
463
913
|
return baseCondition.concat(dataStore.rules.coverPeriodFrom2to20);
|
|
464
914
|
}
|
|
915
|
+
if (whichProduct.value === 'amuletlife') {
|
|
916
|
+
return baseCondition.concat(dataStore.rules.coverPeriodFrom1or5to15);
|
|
917
|
+
}
|
|
465
918
|
return baseCondition;
|
|
466
919
|
});
|
|
467
920
|
const currencySymbolsAddTerm = computed(() => {
|
|
@@ -474,30 +927,155 @@ export default defineComponent({
|
|
|
474
927
|
if (whichProduct.value === 'halykkazyna') {
|
|
475
928
|
return dataStore.t('productConditionsForm.requestedSumInsuredInTenge');
|
|
476
929
|
}
|
|
930
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
931
|
+
return dataStore.t('productConditionsForm.totalRequestedSumInsured');
|
|
932
|
+
}
|
|
477
933
|
return dataStore.t('productConditionsForm.requestedSumInsured');
|
|
478
934
|
});
|
|
935
|
+
const coverPeriodLabel = computed(() => {
|
|
936
|
+
if (whichProduct.value === 'gons') {
|
|
937
|
+
return dataStore.t('productConditionsForm.coverPeriodFrom3to20');
|
|
938
|
+
}
|
|
939
|
+
return dataStore.t('productConditionsForm.coverPeriod');
|
|
940
|
+
});
|
|
941
|
+
const insurancePremiumPerMonthLabel = computed(() => {
|
|
942
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
943
|
+
return dataStore.t('productConditionsForm.totalInsurancePremiumAmountWithCommission');
|
|
944
|
+
}
|
|
945
|
+
return dataStore.t('productConditionsForm.insurancePremiumAmount');
|
|
946
|
+
});
|
|
947
|
+
const isDisabledFixInsSum = computed(() => {
|
|
948
|
+
if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
|
|
949
|
+
return false;
|
|
950
|
+
}
|
|
951
|
+
return isDisabled.value;
|
|
952
|
+
});
|
|
479
953
|
const isDisabledSum = computed(() => {
|
|
480
954
|
if (whichProduct.value === 'halykkazyna') {
|
|
481
955
|
return true;
|
|
482
956
|
}
|
|
957
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
958
|
+
return true;
|
|
959
|
+
}
|
|
960
|
+
if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
|
|
961
|
+
return false;
|
|
962
|
+
}
|
|
483
963
|
return isDisabled.value;
|
|
484
964
|
});
|
|
485
965
|
const isDisabledSumDollar = computed(() => {
|
|
486
966
|
if (whichProduct.value === 'halykkazyna') {
|
|
487
967
|
return true;
|
|
488
968
|
}
|
|
969
|
+
if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
|
|
970
|
+
return false;
|
|
971
|
+
}
|
|
489
972
|
return isDisabled.value;
|
|
490
973
|
});
|
|
974
|
+
const countriesComputed = computed(() => {
|
|
975
|
+
let message = '';
|
|
976
|
+
for (let country in calculatorForm.countries) {
|
|
977
|
+
message += calculatorForm.countries[country as any].nameRu + ', ';
|
|
978
|
+
}
|
|
979
|
+
return message.slice(0, -2);
|
|
980
|
+
});
|
|
981
|
+
const isDisabledCoverPeriod = computed(() => {
|
|
982
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
983
|
+
return true;
|
|
984
|
+
}
|
|
985
|
+
return isDisabled.value;
|
|
986
|
+
});
|
|
987
|
+
const hasDefault = computed(() => {
|
|
988
|
+
if (whichProduct.value === 'lifetrip' || whichProduct.value === 'pensionannuitynew') {
|
|
989
|
+
return false;
|
|
990
|
+
}
|
|
991
|
+
return true;
|
|
992
|
+
});
|
|
993
|
+
const isDisabledAgentCommission = computed(() => {
|
|
994
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns' || dataStore.isUnderwriter()) {
|
|
995
|
+
return false;
|
|
996
|
+
}
|
|
997
|
+
return isDisabled.value;
|
|
998
|
+
});
|
|
999
|
+
const hasCalcSum = computed(() => {
|
|
1000
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1001
|
+
return false;
|
|
1002
|
+
}
|
|
1003
|
+
return true;
|
|
1004
|
+
});
|
|
1005
|
+
const hasFixInsSum = computed(() => {
|
|
1006
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1007
|
+
return true;
|
|
1008
|
+
}
|
|
1009
|
+
return false;
|
|
1010
|
+
});
|
|
1011
|
+
const hasDeathInsFromNS = computed(() => {
|
|
1012
|
+
if (whichProduct.value === 'gns') {
|
|
1013
|
+
return true;
|
|
1014
|
+
}
|
|
1015
|
+
return false;
|
|
1016
|
+
});
|
|
1017
|
+
const hasDeathInsAnyReason = computed(() => {
|
|
1018
|
+
if (whichProduct.value === 'lifebusiness') {
|
|
1019
|
+
return true;
|
|
1020
|
+
}
|
|
1021
|
+
return false;
|
|
1022
|
+
});
|
|
1023
|
+
const defaultText = computed(() => {
|
|
1024
|
+
if (whichProduct.value === 'gns' || whichProduct.value === 'lifebusiness') {
|
|
1025
|
+
return dataStore.t('clients.form.calculation');
|
|
1026
|
+
}
|
|
1027
|
+
return dataStore.t('generalConditions');
|
|
1028
|
+
});
|
|
1029
|
+
const hasInsStartDate = computed(() => {
|
|
1030
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1031
|
+
return true;
|
|
1032
|
+
}
|
|
1033
|
+
return false;
|
|
1034
|
+
});
|
|
1035
|
+
const hasInsEndDate = computed(() => {
|
|
1036
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1037
|
+
return true;
|
|
1038
|
+
}
|
|
1039
|
+
return false;
|
|
1040
|
+
});
|
|
1041
|
+
|
|
1042
|
+
const pensionCalculationParams = ref({
|
|
1043
|
+
compulsoryContractAmount: pensionForm && pensionForm.compulsoryContractAmount && pensionForm.compulsoryContractAmount != 0 ? pensionForm.compulsoryContractAmount : null,
|
|
1044
|
+
voluntaryContractAmount: pensionForm && pensionForm.voluntaryContractAmount && pensionForm.voluntaryContractAmount != 0 ? pensionForm.voluntaryContractAmount : null,
|
|
1045
|
+
ownFundsRaisAmount: pensionForm && pensionForm.ownFundsRaisAmount && pensionForm.ownFundsRaisAmount != 0 ? pensionForm.ownFundsRaisAmount : null,
|
|
1046
|
+
compulsoryProfContractAmount:
|
|
1047
|
+
pensionForm && pensionForm.compulsoryProfContractAmount && pensionForm.compulsoryProfContractAmount != 0 ? pensionForm.compulsoryProfContractAmount : null,
|
|
1048
|
+
transferContractAmount: pensionForm && pensionForm.transferContractAmount && pensionForm.transferContractAmount != 0 ? pensionForm.transferContractAmount : null,
|
|
1049
|
+
});
|
|
1050
|
+
|
|
1051
|
+
const pensionAmount = computed(() =>
|
|
1052
|
+
pensionCalculationParams.value
|
|
1053
|
+
? (Number(pensionCalculationParams.value.compulsoryContractAmount) ?? 0) +
|
|
1054
|
+
(Number(pensionCalculationParams.value.voluntaryContractAmount) ?? 0) +
|
|
1055
|
+
(Number(pensionCalculationParams.value.ownFundsRaisAmount) ?? 0) +
|
|
1056
|
+
(Number(pensionCalculationParams.value.compulsoryProfContractAmount) ?? 0) +
|
|
1057
|
+
(Number(pensionCalculationParams.value.transferContractAmount) ?? 0)
|
|
1058
|
+
: 0,
|
|
1059
|
+
);
|
|
491
1060
|
|
|
492
1061
|
const formatTermValue = (term: number) => {
|
|
493
1062
|
if (term !== null) {
|
|
494
|
-
|
|
1063
|
+
const termNumber = Number(term);
|
|
1064
|
+
return Number.isInteger(termNumber) ? dataStore.getNumberWithSpaces(termNumber) : dataStore.getNumberWithDot(termNumber);
|
|
495
1065
|
}
|
|
496
1066
|
return null;
|
|
497
1067
|
};
|
|
498
1068
|
|
|
499
1069
|
const toStatement = async () => {
|
|
500
1070
|
const statementItem = dataStore.menuItems.find(i => i.id === 'statement');
|
|
1071
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1072
|
+
await router.push({ name: 'taskId-NewApp', params: route.params, query: { tab: 'statement' } });
|
|
1073
|
+
return;
|
|
1074
|
+
}
|
|
1075
|
+
if (whichProduct.value === 'gons') {
|
|
1076
|
+
await router.push({ name: 'taskId', params: { taskId: '0' }, query: { tab: 'statement' } });
|
|
1077
|
+
return;
|
|
1078
|
+
}
|
|
501
1079
|
if (statementItem) {
|
|
502
1080
|
dataStore.menu.selectedItem = statementItem;
|
|
503
1081
|
await router.replace({
|
|
@@ -511,30 +1089,119 @@ export default defineComponent({
|
|
|
511
1089
|
};
|
|
512
1090
|
|
|
513
1091
|
const pickPanelValue = (item: Value) => {
|
|
514
|
-
dataStore.
|
|
1092
|
+
dataStore.rightPanel.open = false;
|
|
515
1093
|
isPanelOpen.value = false;
|
|
1094
|
+
isMultiplePanelOpen.value = false;
|
|
1095
|
+
if (item.id === null) {
|
|
1096
|
+
calculatorForm.countries = [];
|
|
1097
|
+
}
|
|
516
1098
|
if (!currentPanel.value) return;
|
|
517
|
-
|
|
518
|
-
|
|
1099
|
+
if (whichProduct.value === 'lifetrip') {
|
|
1100
|
+
// @ts-ignore
|
|
1101
|
+
calculatorForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
1102
|
+
} else if (whichProduct.value === 'pensionannuitynew') {
|
|
1103
|
+
// @ts-ignore
|
|
1104
|
+
pensionForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
1105
|
+
} else {
|
|
1106
|
+
// @ts-ignore
|
|
1107
|
+
productConditionsForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
1108
|
+
if (currentPanel.value === 'paymentPeriod' && hasProcessIndexRate.value && item.code === 'single') {
|
|
1109
|
+
const defaultIndexRate = dataStore.processIndexRate.find((i: any) => i.isDefault === true);
|
|
1110
|
+
if (defaultIndexRate) productConditionsForm.processIndexRate = defaultIndexRate;
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
519
1113
|
};
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
1114
|
+
const selectOption = (value: CountryValue) => {
|
|
1115
|
+
if (calculatorForm.countries !== null) {
|
|
1116
|
+
if (value.id == 0) {
|
|
1117
|
+
calculatorForm.countries = [];
|
|
1118
|
+
return (dataStore.dicCountries = dataStore.dicAllCountries);
|
|
1119
|
+
}
|
|
1120
|
+
if (calculatorForm.countries.some((option: CountryValue) => option.id == value.id)) {
|
|
1121
|
+
calculatorForm.countries = calculatorForm.countries.filter((obj: CountryValue) => obj.id !== value.id);
|
|
1122
|
+
dataStore.dicCountries = dataStore.dicAllCountries;
|
|
1123
|
+
} else {
|
|
1124
|
+
dataStore.dicCountries = dataStore.dicAllCountries.filter(i =>
|
|
1125
|
+
i.id == 0 || (value.countryTypeCode == '1' && i.countryTypeCode == value.countryTypeCode) || (value.countryTypeCode != '1' && i.countryTypeCode != '1') ? true : false,
|
|
1126
|
+
);
|
|
1127
|
+
if (value.countryTypeCode == 1) {
|
|
1128
|
+
dataStore.showToaster('success', dataStore.t('toaster.shengenZoneCondition'), 3000);
|
|
1129
|
+
formStore.insuredForm.length = 1;
|
|
1130
|
+
}
|
|
1131
|
+
if (calculatorForm.countries.length < 3) {
|
|
1132
|
+
calculatorForm.countries.push(value);
|
|
1133
|
+
} else if (calculatorForm.countries.length >= 3) {
|
|
1134
|
+
closeMultiplePanel();
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
};
|
|
1139
|
+
const pickTermValue = async (item: Value) => {
|
|
1140
|
+
if (!panelCodeList.includes(item.code as string)) {
|
|
1141
|
+
dataStore.rightPanel.open = false;
|
|
1142
|
+
isTermsPanelOpen.value = false;
|
|
1143
|
+
}
|
|
524
1144
|
if (typeof currentIndex.value !== 'number') return;
|
|
1145
|
+
|
|
1146
|
+
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && item.code === 'processcovertypesum') {
|
|
1147
|
+
if (item.id !== additionalTerms.value[currentIndex.value].coverSumId) {
|
|
1148
|
+
additionalTerms.value[currentIndex.value].coverPeriodCode = null;
|
|
1149
|
+
additionalTerms.value[currentIndex.value].coverPeriodId = null;
|
|
1150
|
+
additionalTerms.value[currentIndex.value].coverPeriodName = null;
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
|
|
525
1154
|
additionalTerms.value[currentIndex.value].coverSumId = item.id as string;
|
|
526
1155
|
additionalTerms.value[currentIndex.value].coverSumName = item.nameRu as string;
|
|
1156
|
+
|
|
1157
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1158
|
+
if (termValue.value && item.code === 'fixedinssum') {
|
|
1159
|
+
if (termValue.value.coverTypeCode === 11) {
|
|
1160
|
+
subPanelList.value = constants.fixInsAmount.slice(0, 5);
|
|
1161
|
+
} else {
|
|
1162
|
+
subPanelList.value = constants.fixInsAmount;
|
|
1163
|
+
}
|
|
1164
|
+
subTermValue.value = String(termValue.value.amount);
|
|
1165
|
+
} else {
|
|
1166
|
+
additionalTerms.value[currentIndex.value].amount = 0;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
if (termValue.value && termValue.value.coverTypeCode === 6 && item.code === 'processcovertypesum') {
|
|
1170
|
+
const response = await dataStore.getProcessCoverTypePeriod(termValue.value.coverTypeId);
|
|
1171
|
+
if (response) {
|
|
1172
|
+
subPanelList.value = response;
|
|
1173
|
+
subTermValue.value = termValue.value.coverPeriodCode as string;
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
if (termValue.value && termValue.value.coverTypeCode === 6 && item.code !== 'processcovertypesum') {
|
|
1178
|
+
additionalTerms.value[currentIndex.value].coverPeriodCode = null;
|
|
1179
|
+
additionalTerms.value[currentIndex.value].coverPeriodId = null;
|
|
1180
|
+
additionalTerms.value[currentIndex.value].coverPeriodName = null;
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
527
1183
|
};
|
|
528
1184
|
|
|
529
1185
|
const openPanel = async (title: string, list: Value[], key: string, asyncFunction?: Function, filterKey?: string) => {
|
|
530
1186
|
if (!isDisabled.value || (key === 'riskGroup' && !isRecalculationDisabled.value)) {
|
|
1187
|
+
if (key === 'amount') {
|
|
1188
|
+
if (calculatorForm.type.nameRu === null || !calculatorForm.countries || (calculatorForm.countries && calculatorForm.countries.length === 0)) {
|
|
1189
|
+
return dataStore.showToaster('error', dataStore.t('toaster.noAmountBeforeTypeAndCountries'), 2000);
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
if (key === 'maxDays') {
|
|
1193
|
+
if (calculatorForm.period.code === null) {
|
|
1194
|
+
return dataStore.showToaster('error', dataStore.t('toaster.noMaxDaysBeforePeriod'), 2000);
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
531
1197
|
searchQuery.value = '';
|
|
532
1198
|
currentPanel.value = key as keyof typeof productConditionsForm;
|
|
533
1199
|
isPanelOpen.value = true;
|
|
534
1200
|
isTermsPanelOpen.value = false;
|
|
535
1201
|
dataStore.panelAction = null;
|
|
536
|
-
dataStore.
|
|
537
|
-
dataStore.
|
|
1202
|
+
dataStore.rightPanel.open = true;
|
|
1203
|
+
dataStore.rightPanel.title = title;
|
|
1204
|
+
isMultiplePanelOpen.value = false;
|
|
538
1205
|
|
|
539
1206
|
let newList = list;
|
|
540
1207
|
if (asyncFunction) {
|
|
@@ -542,32 +1209,73 @@ export default defineComponent({
|
|
|
542
1209
|
newList = await asyncFunction(filterKey, formStore.productConditionsFormKey);
|
|
543
1210
|
}
|
|
544
1211
|
panelList.value = filterList(newList, key);
|
|
545
|
-
|
|
546
|
-
|
|
1212
|
+
if (whichProduct.value === 'lifetrip') {
|
|
1213
|
+
// @ts-ignore
|
|
1214
|
+
panelValue.value = calculatorForm[currentPanel.value];
|
|
1215
|
+
} else {
|
|
1216
|
+
// @ts-ignore
|
|
1217
|
+
panelValue.value = productConditionsForm[currentPanel.value];
|
|
1218
|
+
}
|
|
547
1219
|
isPanelLoading.value = false;
|
|
548
1220
|
} else {
|
|
549
1221
|
dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
|
|
550
1222
|
}
|
|
551
1223
|
};
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
1224
|
+
const openMultiplePanel = async (title: string, list: CountryValue[], key: string, asyncFunction?: Function, filterKey?: string) => {
|
|
1225
|
+
if (!isDisabled.value || !isRecalculationDisabled.value) {
|
|
1226
|
+
isPanelOpen.value = false;
|
|
1227
|
+
isMultiplePanelOpen.value = true;
|
|
1228
|
+
isPanelLoading.value = true;
|
|
1229
|
+
let newList = list;
|
|
1230
|
+
if (asyncFunction !== null) {
|
|
1231
|
+
// @ts-ignore
|
|
1232
|
+
newList = await asyncFunction(filterKey, formStore.productConditionsFormKey);
|
|
557
1233
|
}
|
|
1234
|
+
if (newList[0].nameRu !== null) {
|
|
1235
|
+
// @ts-ignore
|
|
1236
|
+
newList.unshift(new CountryValue(0, null));
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
dataStore.panelAction = null;
|
|
1240
|
+
dataStore.rightPanel.open = true;
|
|
1241
|
+
dataStore.rightPanel.title = title;
|
|
1242
|
+
|
|
1243
|
+
// @ts-ignore
|
|
1244
|
+
multiplePanelList.value = filterList(newList, key);
|
|
1245
|
+
// @ts-ignore
|
|
1246
|
+
multiplePanelValue.value = calculatorForm[currentPanel.value];
|
|
1247
|
+
isPanelLoading.value = false;
|
|
1248
|
+
} else {
|
|
1249
|
+
dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'), 2000);
|
|
558
1250
|
}
|
|
1251
|
+
};
|
|
1252
|
+
const closeMultiplePanel = (item?: CountryValue) => {
|
|
1253
|
+
dataStore.rightPanel.open = false;
|
|
1254
|
+
isMultiplePanelOpen.value = false;
|
|
1255
|
+
if (!currentPanel.value) return;
|
|
1256
|
+
// @ts-ignore
|
|
1257
|
+
calculatorForm[currentPanel.value] = item?.nameRu === null ? new Value() : item;
|
|
1258
|
+
};
|
|
1259
|
+
|
|
1260
|
+
const filterList = (list: Value[], key: string) => {
|
|
1261
|
+
// if (whichProduct.value === 'baiterek') {
|
|
1262
|
+
// if (dataStore.isManagerHalykBank()) {
|
|
1263
|
+
// if (key === 'paymentPeriod') return list.filter(i => i.code !== 'single');
|
|
1264
|
+
// }
|
|
1265
|
+
// }
|
|
559
1266
|
return list;
|
|
560
1267
|
};
|
|
561
1268
|
|
|
562
1269
|
const openTermPanel = async (title: string, asyncFunction: Function, questionId: string, index: number) => {
|
|
563
|
-
if (!isDisabled.value) {
|
|
1270
|
+
if (!isDisabled.value || ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && dataStore.isUnderwriter())) {
|
|
564
1271
|
searchQuery.value = '';
|
|
565
1272
|
currentIndex.value = index;
|
|
566
1273
|
isPanelOpen.value = false;
|
|
1274
|
+
isMultiplePanelOpen.value = false;
|
|
567
1275
|
isTermsPanelOpen.value = true;
|
|
568
1276
|
dataStore.panelAction = null;
|
|
569
|
-
dataStore.
|
|
570
|
-
dataStore.
|
|
1277
|
+
dataStore.rightPanel.open = true;
|
|
1278
|
+
dataStore.rightPanel.title = title;
|
|
571
1279
|
|
|
572
1280
|
let newList;
|
|
573
1281
|
if (asyncFunction) {
|
|
@@ -583,6 +1291,23 @@ export default defineComponent({
|
|
|
583
1291
|
}
|
|
584
1292
|
};
|
|
585
1293
|
|
|
1294
|
+
const pickSubTermValue = (item: any, subItem: any) => {
|
|
1295
|
+
dataStore.rightPanel.open = false;
|
|
1296
|
+
isTermsPanelOpen.value = false;
|
|
1297
|
+
subTermValue.value = item.code as string;
|
|
1298
|
+
if (typeof currentIndex.value !== 'number') return;
|
|
1299
|
+
|
|
1300
|
+
if (item.code === 'fixedinssum') {
|
|
1301
|
+
additionalTerms.value[currentIndex.value].amount = Number(subItem.code);
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
if (item.code === 'processcovertypesum') {
|
|
1305
|
+
additionalTerms.value[currentIndex.value].coverPeriodCode = subItem.code as string;
|
|
1306
|
+
additionalTerms.value[currentIndex.value].coverPeriodId = subItem.id as string;
|
|
1307
|
+
additionalTerms.value[currentIndex.value].coverPeriodName = subItem.nameRu as string;
|
|
1308
|
+
}
|
|
1309
|
+
};
|
|
1310
|
+
|
|
586
1311
|
const underwriterCalculate = async (type: 'sum' | 'premium') => {
|
|
587
1312
|
if (!type) return;
|
|
588
1313
|
if (type === 'sum') {
|
|
@@ -645,6 +1370,15 @@ export default defineComponent({
|
|
|
645
1370
|
}
|
|
646
1371
|
};
|
|
647
1372
|
|
|
1373
|
+
const onInputFixInsSum = (event: Event) => {
|
|
1374
|
+
if (event.target && 'value' in event.target && event.target.value) {
|
|
1375
|
+
const calculatedFixInsSum = getNumber(event.target.value as string);
|
|
1376
|
+
if (calculatedFixInsSum) {
|
|
1377
|
+
productConditionsForm.fixInsSum = dataStore.getNumberWithSpaces(productConditionsForm.fixInsSum);
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
};
|
|
1381
|
+
|
|
648
1382
|
const onInputSumDollar = (event: Event) => {
|
|
649
1383
|
if (event.target && 'value' in event.target && event.target.value && dataStore.currencies.usd) {
|
|
650
1384
|
whichSum.value = 'requestedSumInsured';
|
|
@@ -682,6 +1416,12 @@ export default defineComponent({
|
|
|
682
1416
|
productConditionsForm.requestedSumInsuredInDollar = null;
|
|
683
1417
|
productConditionsForm.insurancePremiumPerMonth = null;
|
|
684
1418
|
productConditionsForm.insurancePremiumPerMonthInDollar = null;
|
|
1419
|
+
if (whichProduct.value === 'lifetrip') {
|
|
1420
|
+
Object.keys(calculatorForm).forEach(key => {
|
|
1421
|
+
//@ts-ignore
|
|
1422
|
+
calculatorForm[key] = new CalculatorForm()[key];
|
|
1423
|
+
});
|
|
1424
|
+
}
|
|
685
1425
|
};
|
|
686
1426
|
|
|
687
1427
|
const filterTermConditions = (term: AddCover) => {
|
|
@@ -691,88 +1431,150 @@ export default defineComponent({
|
|
|
691
1431
|
return true;
|
|
692
1432
|
};
|
|
693
1433
|
|
|
1434
|
+
const coverTypeName = (term: AddCover) => {
|
|
1435
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1436
|
+
return String(term.coverTypeNameRu);
|
|
1437
|
+
}
|
|
1438
|
+
return term.coverTypeName;
|
|
1439
|
+
};
|
|
1440
|
+
|
|
694
1441
|
const submitForm = async () => {
|
|
695
1442
|
vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
696
1443
|
if (v.valid) {
|
|
697
|
-
if (
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
1444
|
+
if (whichProduct.value === 'lifetrip') {
|
|
1445
|
+
if (calculatorForm.type.code === 'Single' && calculatorForm.startDate && calculatorForm.endDate) {
|
|
1446
|
+
const formattedStartDate = formatDate(calculatorForm.startDate);
|
|
1447
|
+
const formattedEndDate = formatDate(calculatorForm.endDate);
|
|
1448
|
+
if (formattedStartDate && formattedEndDate && formattedStartDate.getTime() > formattedEndDate.getTime()) {
|
|
1449
|
+
return dataStore.showToaster('error', dataStore.t('toaster.startMoreEnd'));
|
|
1450
|
+
}
|
|
701
1451
|
}
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
1452
|
+
if (dataStore.isTask()) {
|
|
1453
|
+
await dataStore.calculatePrice(route.params.taskId as string);
|
|
1454
|
+
} else {
|
|
1455
|
+
await dataStore.calculatePrice();
|
|
1456
|
+
}
|
|
1457
|
+
} else if (whichProduct.value === 'pensionannuitynew') {
|
|
1458
|
+
if (
|
|
1459
|
+
pensionCalculationParams.value &&
|
|
1460
|
+
pensionCalculationParams.value.compulsoryProfContractAmount &&
|
|
1461
|
+
pensionForm &&
|
|
1462
|
+
pensionForm.compulsoryProfContractAmount != 0 &&
|
|
1463
|
+
pensionForm.compulsoryProfMonthCount < 60
|
|
1464
|
+
) {
|
|
1465
|
+
dataStore.showToaster('error', 'Минимальное число дней уплаты ОППВ должно быть больше 60');
|
|
1466
|
+
return;
|
|
1467
|
+
}
|
|
1468
|
+
const data = {
|
|
1469
|
+
...pensionForm,
|
|
1470
|
+
...(pensionCalculationParams.value = {
|
|
1471
|
+
...pensionCalculationParams.value,
|
|
1472
|
+
compulsoryContractAmount: Number(pensionCalculationParams.value.compulsoryContractAmount),
|
|
1473
|
+
voluntaryContractAmount: Number(pensionCalculationParams.value.voluntaryContractAmount),
|
|
1474
|
+
ownFundsRaisAmount: Number(pensionCalculationParams.value.ownFundsRaisAmount),
|
|
1475
|
+
compulsoryProfContractAmount: Number(pensionCalculationParams.value.compulsoryProfContractAmount),
|
|
1476
|
+
transferContractAmount: Number(pensionCalculationParams.value.transferContractAmount),
|
|
1477
|
+
}),
|
|
1478
|
+
transferContractCompany: pensionForm.transferContractCompany?.nameRu ?? null,
|
|
1479
|
+
transferContractDate: transferContractDate.value ? formatDate(transferContractDate.value) : null,
|
|
1480
|
+
transferContractFirstPaymentDate: transferContractFirstPaymentDate.value ? formatDate(transferContractFirstPaymentDate.value) : null,
|
|
1481
|
+
};
|
|
1482
|
+
await dataStore.setApplication(data, true);
|
|
1483
|
+
} else {
|
|
1484
|
+
if (whichSum.value === 'requestedSumInsured') {
|
|
1485
|
+
productConditionsForm.insurancePremiumPerMonth = null;
|
|
1486
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
1487
|
+
productConditionsForm.insurancePremiumPerMonthInDollar = null;
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
if (whichSum.value === 'insurancePremiumPerMonth') {
|
|
1491
|
+
productConditionsForm.requestedSumInsured = null;
|
|
1492
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
1493
|
+
productConditionsForm.requestedSumInsuredInDollar = null;
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
if (productConditionsForm.requestedSumInsured !== '' && productConditionsForm.requestedSumInsured != null) {
|
|
1497
|
+
productConditionsForm.insurancePremiumPerMonth = null;
|
|
1498
|
+
if (props.isCalculator) whichSum.value = 'requestedSumInsured';
|
|
1499
|
+
}
|
|
1500
|
+
if (productConditionsForm.insurancePremiumPerMonth !== '' && productConditionsForm.insurancePremiumPerMonth != null) {
|
|
1501
|
+
productConditionsForm.requestedSumInsured = null;
|
|
1502
|
+
if (props.isCalculator) whichSum.value = 'insurancePremiumPerMonth';
|
|
707
1503
|
}
|
|
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
1504
|
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
1505
|
+
if (!whichSum.value && isUnderwriterForm.value === false) {
|
|
1506
|
+
dataStore.showToaster('error', dataStore.t('toaster.emptyProductConditions'));
|
|
1507
|
+
return;
|
|
1508
|
+
}
|
|
722
1509
|
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
1510
|
+
if (
|
|
1511
|
+
whichProduct.value === 'gons' &&
|
|
1512
|
+
(formStore.applicationData.statusCode === 'EditForm' || formStore.applicationData.statusCode === 'StartForm') &&
|
|
1513
|
+
getNumber(productConditionsForm.requestedSumInsured as string)! >= 10_000_000
|
|
1514
|
+
) {
|
|
1515
|
+
dataStore.showToaster('info', dataStore.t('toaster.calcSumForUnder'), 6000);
|
|
1516
|
+
}
|
|
1517
|
+
if (isUnderwriterForm.value) {
|
|
1518
|
+
type recalculationInfo = {
|
|
1519
|
+
lifeMultiply: string | null | number;
|
|
1520
|
+
lifeAdditive: string | null | number;
|
|
1521
|
+
lifeMultiplyClient?: string | number | null;
|
|
1522
|
+
lifeAdditiveClient?: string | number | null;
|
|
1523
|
+
adbMultiply: string | null | number;
|
|
1524
|
+
adbAdditive: string | null | number;
|
|
1525
|
+
disabilityMultiply: string | null | number;
|
|
1526
|
+
disabilityAdditive: string | null | number;
|
|
1527
|
+
amount?: string | number | null;
|
|
1528
|
+
premium?: string | number | null;
|
|
1529
|
+
riskGroup?: string | string | number | null;
|
|
1530
|
+
};
|
|
1531
|
+
const recalculationData: recalculationInfo = (({ lifeMultiply, lifeAdditive, adbMultiply, adbAdditive, disabilityMultiply, disabilityAdditive }) => ({
|
|
1532
|
+
lifeMultiply,
|
|
1533
|
+
lifeAdditive,
|
|
1534
|
+
adbMultiply,
|
|
1535
|
+
adbAdditive,
|
|
1536
|
+
disabilityMultiply,
|
|
1537
|
+
disabilityAdditive,
|
|
1538
|
+
}))(productConditionsForm);
|
|
1539
|
+
Object.keys(recalculationData).forEach(key => {
|
|
1540
|
+
// @ts-ignore
|
|
1541
|
+
recalculationData[key] = formatProcents(recalculationData[key]);
|
|
1542
|
+
});
|
|
1543
|
+
recalculationData.lifeMultiplyClient = dataStore.isClientAnketaCondition
|
|
1544
|
+
? formStore.productConditionsForm.lifeMultiplyClient === null
|
|
1545
|
+
? null
|
|
1546
|
+
: formatProcents(formStore.productConditionsForm.lifeMultiplyClient)
|
|
1547
|
+
: null;
|
|
1548
|
+
recalculationData.lifeAdditiveClient = dataStore.isClientAnketaCondition
|
|
1549
|
+
? formStore.productConditionsForm.lifeAdditiveClient === null
|
|
1550
|
+
? null
|
|
1551
|
+
: formatProcents(formStore.productConditionsForm.lifeAdditiveClient)
|
|
1552
|
+
: null;
|
|
1553
|
+
recalculationData.amount = Number((productConditionsForm.requestedSumInsured as string)?.replace(/\s/g, ''));
|
|
1554
|
+
recalculationData.premium = Number((productConditionsForm.insurancePremiumPerMonth as string)?.replace(/\s/g, ''));
|
|
1555
|
+
recalculationData.riskGroup = productConditionsForm.riskGroup?.id ? productConditionsForm.riskGroup.id : 1;
|
|
1556
|
+
isCalculating.value = true;
|
|
1557
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1558
|
+
await dataStore.calculate(route.params.taskId as string);
|
|
1559
|
+
additionalTerms.value = formStore.additionalInsuranceTerms;
|
|
1560
|
+
} else {
|
|
1561
|
+
await dataStore.reCalculate(formStore.applicationData.processInstanceId, recalculationData, route.params.taskId as string, whichSum.value);
|
|
1562
|
+
additionalTerms.value = formStore.additionalInsuranceTerms;
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
762
1565
|
isCalculating.value = true;
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
await dataStore.calculate(route.params.taskId as string);
|
|
773
|
-
additionalTerms.value = formStore.additionalInsuranceTerms;
|
|
1566
|
+
if (props.isCalculator) {
|
|
1567
|
+
//@ts-ignore
|
|
1568
|
+
await dataStore.calculateWithoutApplication(true, whichProduct.value);
|
|
1569
|
+
additionalTerms.value = formStore.additionalInsuranceTermsWithout;
|
|
1570
|
+
} else {
|
|
1571
|
+
if (dataStore.isProcessEditable(formStore.applicationData.statusCode)) {
|
|
1572
|
+
await dataStore.calculate(route.params.taskId as string);
|
|
1573
|
+
additionalTerms.value = formStore.additionalInsuranceTerms;
|
|
1574
|
+
}
|
|
774
1575
|
}
|
|
775
1576
|
}
|
|
1577
|
+
|
|
776
1578
|
isCalculating.value = false;
|
|
777
1579
|
} else {
|
|
778
1580
|
const errors = document.querySelector('.v-input--error');
|
|
@@ -797,38 +1599,49 @@ export default defineComponent({
|
|
|
797
1599
|
};
|
|
798
1600
|
|
|
799
1601
|
onMounted(async () => {
|
|
800
|
-
if (props.
|
|
1602
|
+
if (props.isCalculator === true) {
|
|
801
1603
|
if (dataStore.isCalculator) {
|
|
802
1604
|
clearFields();
|
|
803
1605
|
}
|
|
804
|
-
if (
|
|
805
|
-
(
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
1606
|
+
if (whichProduct.value !== 'lifetrip' && whichProduct.value !== 'pensionannuitynew') {
|
|
1607
|
+
if (
|
|
1608
|
+
(dataStore.isCalculator || route.params.taskId === '0' || fromIndexPage.value) &&
|
|
1609
|
+
productConditionsForm.requestedSumInsured === null &&
|
|
1610
|
+
productConditionsForm.insurancePremiumPerMonth === null
|
|
1611
|
+
) {
|
|
1612
|
+
// @ts-ignore
|
|
1613
|
+
const defaultData = await dataStore.getDefaultCalculationData(true, whichProduct.value);
|
|
1614
|
+
if (!defaultData) {
|
|
1615
|
+
dataStore.showToaster('error', 'Отсутствуют базовые данные');
|
|
1616
|
+
return;
|
|
1617
|
+
}
|
|
1618
|
+
formStore.additionalInsuranceTermsWithout = defaultData.addCovers;
|
|
1619
|
+
productConditionsForm.requestedSumInsured = defaultData.amount;
|
|
1620
|
+
productConditionsForm.insurancePremiumPerMonth = defaultData.premium;
|
|
1621
|
+
const indexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
|
|
1622
|
+
if (indexRate) productConditionsForm.processIndexRate = indexRate;
|
|
1623
|
+
const paymendPeriod = dataStore.processPaymentPeriod.find(i => i.id === defaultData.paymentPeriodId);
|
|
1624
|
+
if (paymendPeriod) productConditionsForm.paymentPeriod = paymendPeriod;
|
|
1625
|
+
if (defaultData.signDate) {
|
|
1626
|
+
productConditionsForm.signDate = reformatDate(defaultData.signDate);
|
|
1627
|
+
}
|
|
1628
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1629
|
+
productConditionsForm.coverPeriod = defaultData.insTermInMonth ?? null;
|
|
1630
|
+
productConditionsForm.insurancePremiumPerMonth = null;
|
|
1631
|
+
}
|
|
814
1632
|
}
|
|
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
1633
|
}
|
|
824
1634
|
}
|
|
825
|
-
additionalTerms.value = props.
|
|
1635
|
+
additionalTerms.value = props.isCalculator ? formStore.additionalInsuranceTermsWithout : formStore.additionalInsuranceTerms;
|
|
826
1636
|
if (!!productConditionsForm.insurancePremiumPerMonth) {
|
|
827
1637
|
whichSum.value = 'insurancePremiumPerMonth';
|
|
828
1638
|
}
|
|
829
1639
|
if (!!productConditionsForm.requestedSumInsured) {
|
|
830
1640
|
whichSum.value = 'requestedSumInsured';
|
|
831
1641
|
}
|
|
1642
|
+
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && !productConditionsForm.requestedSumInsured) {
|
|
1643
|
+
whichSum.value = 'requestedSumInsured';
|
|
1644
|
+
}
|
|
832
1645
|
if (dataStore.isCalculator) {
|
|
833
1646
|
dataStore.processCode = constants.products[whichProduct.value as keyof typeof constants.products];
|
|
834
1647
|
await dataStore.getProcessPaymentPeriod();
|
|
@@ -838,6 +1651,20 @@ export default defineComponent({
|
|
|
838
1651
|
if (kazynaPaymentPeriod) productConditionsForm.paymentPeriod = kazynaPaymentPeriod;
|
|
839
1652
|
await dataStore.getCurrencies();
|
|
840
1653
|
}
|
|
1654
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1655
|
+
productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(
|
|
1656
|
+
formStore.lfb.clients.reduce((sum: number, i: any) => {
|
|
1657
|
+
return sum + Number(i.insSum);
|
|
1658
|
+
}, 0),
|
|
1659
|
+
);
|
|
1660
|
+
}
|
|
1661
|
+
if (whichProduct.value === 'pensionannuitynew') {
|
|
1662
|
+
contractDate.value = reformatDate(formStore.applicationData.pensionApp.contractDate);
|
|
1663
|
+
dateOfBegin.value = reformatDate(formStore.applicationData.pensionApp.dateOfBegin);
|
|
1664
|
+
transferContractDate.value = reformatDate(formStore.applicationData.pensionApp.transferContractDate);
|
|
1665
|
+
transferContractFirstPaymentDate.value = reformatDate(formStore.applicationData.pensionApp.transferContractFirstPaymentDate);
|
|
1666
|
+
maxDate.value = await dataStore.getVariableData(formStore.applicationData.processCode ?? 19);
|
|
1667
|
+
}
|
|
841
1668
|
});
|
|
842
1669
|
|
|
843
1670
|
watch(
|
|
@@ -859,9 +1686,9 @@ export default defineComponent({
|
|
|
859
1686
|
},
|
|
860
1687
|
);
|
|
861
1688
|
watch(
|
|
862
|
-
() => dataStore.
|
|
1689
|
+
() => dataStore.rightPanel.open,
|
|
863
1690
|
() => {
|
|
864
|
-
if (dataStore.
|
|
1691
|
+
if (dataStore.rightPanel.open === false) {
|
|
865
1692
|
isPanelOpen.value = false;
|
|
866
1693
|
isTermsPanelOpen.value = false;
|
|
867
1694
|
dataStore.panelAction = null;
|
|
@@ -870,6 +1697,77 @@ export default defineComponent({
|
|
|
870
1697
|
{ immediate: true },
|
|
871
1698
|
);
|
|
872
1699
|
|
|
1700
|
+
if (hasInsStartDate.value) {
|
|
1701
|
+
watch(
|
|
1702
|
+
() => productConditionsForm.calcDate,
|
|
1703
|
+
val => {
|
|
1704
|
+
if (val !== null && val.length === 10) {
|
|
1705
|
+
const formattedStartDate = formatDate(val);
|
|
1706
|
+
formattedStartDate?.setFullYear(formattedStartDate?.getFullYear() + 1);
|
|
1707
|
+
formattedStartDate?.setDate(formattedStartDate?.getDate() - 1);
|
|
1708
|
+
productConditionsForm.contractEndDate = reformatDate(String(formattedStartDate));
|
|
1709
|
+
}
|
|
1710
|
+
},
|
|
1711
|
+
);
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
if (whichProduct.value === 'lifetrip') {
|
|
1715
|
+
watch(
|
|
1716
|
+
() => calculatorForm.type,
|
|
1717
|
+
async val => {
|
|
1718
|
+
if (val.code === 'Multiple') {
|
|
1719
|
+
await dataStore.getPeriod();
|
|
1720
|
+
calculatorForm.period = new Value();
|
|
1721
|
+
calculatorForm.endDate = null;
|
|
1722
|
+
}
|
|
1723
|
+
if (calculatorForm.countries?.length != 0) {
|
|
1724
|
+
await dataStore.getTripInsuredAmount();
|
|
1725
|
+
}
|
|
1726
|
+
},
|
|
1727
|
+
);
|
|
1728
|
+
watch(
|
|
1729
|
+
() => calculatorForm.countries,
|
|
1730
|
+
async val => {
|
|
1731
|
+
if (val?.length && val.every(option => option.id != 0) && calculatorForm.type?.nameRu != null) {
|
|
1732
|
+
await dataStore.getTripInsuredAmount();
|
|
1733
|
+
}
|
|
1734
|
+
},
|
|
1735
|
+
{ deep: true },
|
|
1736
|
+
);
|
|
1737
|
+
|
|
1738
|
+
watch(
|
|
1739
|
+
() => calculatorForm.period,
|
|
1740
|
+
val => {
|
|
1741
|
+
if (val) {
|
|
1742
|
+
dataStore.maxDaysFiltered = dataStore.maxDaysAllArray.filter(days => days.code == val.code);
|
|
1743
|
+
calculatorForm.maxDays = new Value();
|
|
1744
|
+
}
|
|
1745
|
+
},
|
|
1746
|
+
);
|
|
1747
|
+
|
|
1748
|
+
watch(
|
|
1749
|
+
() => calculatorForm.startDate,
|
|
1750
|
+
val => {
|
|
1751
|
+
if (val !== null && val.length === 10 && calculatorForm.endDate != null && calculatorForm.endDate.length === 10) {
|
|
1752
|
+
calculatorForm.days = productConditionsForm.getSingleTripDays();
|
|
1753
|
+
}
|
|
1754
|
+
},
|
|
1755
|
+
);
|
|
1756
|
+
watch(
|
|
1757
|
+
() => calculatorForm.endDate,
|
|
1758
|
+
val => {
|
|
1759
|
+
if (val !== null && val.length === 10 && calculatorForm.startDate != null && calculatorForm.startDate.length === 10) {
|
|
1760
|
+
calculatorForm.days = productConditionsForm.getSingleTripDays();
|
|
1761
|
+
}
|
|
1762
|
+
},
|
|
1763
|
+
);
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
const copyRedirect = async () => {
|
|
1767
|
+
const url = await dataStore.api.getEnpfRedirectUrl(String(formStore.applicationData.processInstanceId));
|
|
1768
|
+
dataStore.copyToClipboard(url.redirectUrl);
|
|
1769
|
+
};
|
|
1770
|
+
|
|
873
1771
|
return {
|
|
874
1772
|
// State
|
|
875
1773
|
formStore,
|
|
@@ -880,21 +1778,38 @@ export default defineComponent({
|
|
|
880
1778
|
isCalculating,
|
|
881
1779
|
isPanelLoading,
|
|
882
1780
|
isPanelOpen,
|
|
1781
|
+
isMultiplePanelOpen,
|
|
883
1782
|
isTermsPanelOpen,
|
|
884
1783
|
panelValue,
|
|
885
1784
|
termValue,
|
|
886
1785
|
panelList,
|
|
1786
|
+
multiplePanelList,
|
|
1787
|
+
multiplePanelValue,
|
|
887
1788
|
searchQuery,
|
|
888
1789
|
whichSum,
|
|
889
1790
|
Value,
|
|
1791
|
+
calculatorForm,
|
|
1792
|
+
subPanelList,
|
|
1793
|
+
subTermValue,
|
|
1794
|
+
panelCodeList,
|
|
1795
|
+
pensionForm,
|
|
1796
|
+
dateOfBegin,
|
|
1797
|
+
contractDate,
|
|
1798
|
+
transferContractDate,
|
|
1799
|
+
transferContractFirstPaymentDate,
|
|
1800
|
+
enabled,
|
|
1801
|
+
maxDate,
|
|
1802
|
+
guaranteedPeriodList,
|
|
1803
|
+
isEnpfSum,
|
|
890
1804
|
|
|
891
1805
|
// Computed
|
|
892
1806
|
isTask,
|
|
893
1807
|
isDisabled,
|
|
894
1808
|
isTermsDisabled,
|
|
895
1809
|
isUnderwriterForm,
|
|
896
|
-
|
|
897
|
-
|
|
1810
|
+
insurancePremiumPerMonthRule,
|
|
1811
|
+
insurancePremiumPerMonthDisabled,
|
|
1812
|
+
requestedSumInsuredRule,
|
|
898
1813
|
isRecalculationDisabled,
|
|
899
1814
|
isUnderwriterRole,
|
|
900
1815
|
hasProcessIndexRate,
|
|
@@ -903,24 +1818,51 @@ export default defineComponent({
|
|
|
903
1818
|
hasInsurancePremiumPerMonthInDollar,
|
|
904
1819
|
hasCurrency,
|
|
905
1820
|
hasAdbMultiply,
|
|
1821
|
+
readonlyLifeAdditive,
|
|
1822
|
+
readonlyDisabilityMultiply,
|
|
1823
|
+
readonlyDisabilityAdditive,
|
|
906
1824
|
hasAdbAdditive,
|
|
907
1825
|
hasRiskGroup,
|
|
908
1826
|
hasCalculated,
|
|
909
1827
|
hasAnnuityPayments,
|
|
1828
|
+
hasAgencyPart,
|
|
910
1829
|
currencySymbolsAddTerm,
|
|
911
1830
|
amountAnnuityPayments,
|
|
912
1831
|
requestedSumInsuredLabel,
|
|
913
1832
|
isDisabledSum,
|
|
914
1833
|
isDisabledSumDollar,
|
|
1834
|
+
countriesComputed,
|
|
1835
|
+
hasBirthDate,
|
|
1836
|
+
hasGender,
|
|
1837
|
+
coverPeriodLabel,
|
|
1838
|
+
insurancePremiumPerMonthLabel,
|
|
1839
|
+
isDisabledCoverPeriod,
|
|
1840
|
+
hasDefault,
|
|
1841
|
+
isShownAdditionalTerms,
|
|
1842
|
+
hasCalcSum,
|
|
1843
|
+
isDisabledAgentCommission,
|
|
1844
|
+
hasFixInsSum,
|
|
1845
|
+
isDisabledFixInsSum,
|
|
1846
|
+
defaultText,
|
|
1847
|
+
hasDeathInsFromNS,
|
|
1848
|
+
pensionAmount,
|
|
1849
|
+
pensionCalculationParams,
|
|
1850
|
+
hasDeathInsAnyReason,
|
|
1851
|
+
fromIndexPage,
|
|
1852
|
+
hasCoverPeriod,
|
|
1853
|
+
hasInsStartDate,
|
|
1854
|
+
hasInsEndDate,
|
|
915
1855
|
|
|
916
1856
|
// Rules
|
|
917
1857
|
coverPeriodRule,
|
|
1858
|
+
fixInsSumRule,
|
|
918
1859
|
|
|
919
1860
|
// Functions
|
|
920
1861
|
submitForm,
|
|
921
1862
|
pickPanelValue,
|
|
922
1863
|
pickTermValue,
|
|
923
1864
|
openPanel,
|
|
1865
|
+
openMultiplePanel,
|
|
924
1866
|
openTermPanel,
|
|
925
1867
|
pickCalculation,
|
|
926
1868
|
underwriterCalculate,
|
|
@@ -936,7 +1878,18 @@ export default defineComponent({
|
|
|
936
1878
|
clearFields,
|
|
937
1879
|
formatTermValue,
|
|
938
1880
|
filterTermConditions,
|
|
1881
|
+
selectOption,
|
|
1882
|
+
coverTypeName,
|
|
1883
|
+
pickSubTermValue,
|
|
1884
|
+
onInputFixInsSum,
|
|
1885
|
+
copyRedirect,
|
|
939
1886
|
};
|
|
940
1887
|
},
|
|
941
1888
|
});
|
|
942
1889
|
</script>
|
|
1890
|
+
|
|
1891
|
+
<style>
|
|
1892
|
+
.pension-guaranteed-period .v-field {
|
|
1893
|
+
border: none !important;
|
|
1894
|
+
}
|
|
1895
|
+
</style>
|