hl-core 0.0.8-beta.9 → 0.0.9-beta.1
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/index.ts +100 -34
- package/api/interceptors.ts +17 -13
- package/components/Button/Btn.vue +1 -1
- package/components/Button/ScrollButtons.vue +2 -2
- package/components/Complex/Page.vue +1 -1
- package/components/Dialog/Dialog.vue +9 -39
- package/components/Dialog/FamilyDialog.vue +7 -4
- package/components/Form/FormBlock.vue +51 -28
- package/components/Form/FormSection.vue +4 -1
- package/components/Form/FormToggle.vue +2 -3
- package/components/Form/ManagerAttachment.vue +21 -20
- package/components/Form/ProductConditionsBlock.vue +60 -10
- package/components/Input/Datepicker.vue +6 -2
- package/components/Input/FileInput.vue +2 -2
- package/components/Input/FormInput.vue +29 -7
- package/components/Input/PanelInput.vue +7 -2
- package/components/Input/RoundedInput.vue +2 -2
- package/components/Input/RoundedSelect.vue +137 -0
- package/components/Layout/Drawer.vue +3 -2
- package/components/Layout/Header.vue +40 -4
- package/components/Layout/Loader.vue +1 -1
- package/components/Layout/SettingsPanel.vue +51 -13
- package/components/Menu/MenuHover.vue +30 -0
- package/components/Menu/MenuNav.vue +29 -13
- package/components/Menu/MenuNavItem.vue +6 -3
- package/components/Pages/Anketa.vue +49 -31
- package/components/Pages/Auth.vue +139 -46
- package/components/Pages/Documents.vue +6 -6
- package/components/Pages/InvoiceInfo.vue +30 -0
- package/components/Pages/MemberForm.vue +503 -343
- package/components/Pages/ProductAgreement.vue +4 -2
- package/components/Pages/ProductConditions.vue +494 -95
- package/components/Panel/PanelHandler.vue +91 -20
- package/components/Panel/PanelSelectItem.vue +1 -1
- package/components/Utilities/Chip.vue +27 -0
- package/components/Utilities/JsonViewer.vue +27 -0
- package/composables/axios.ts +1 -1
- package/composables/classes.ts +165 -81
- package/composables/constants.ts +25 -52
- package/composables/index.ts +80 -2
- package/composables/styles.ts +8 -3
- package/configs/i18n.ts +2 -4
- package/layouts/default.vue +6 -6
- package/locales/kz.json +532 -346
- package/locales/ru.json +210 -22
- package/nuxt.config.ts +1 -1
- package/package.json +38 -12
- package/pages/500.vue +2 -2
- package/pages/Token.vue +51 -0
- package/plugins/helperFunctionsPlugins.ts +2 -1
- package/plugins/vuetifyPlugin.ts +3 -1
- package/store/{data.store.js → data.store.ts} +1116 -752
- package/store/form.store.ts +1 -1
- package/store/member.store.ts +94 -72
- package/store/{rules.js → rules.ts} +54 -26
- package/types/enum.ts +83 -0
- package/types/env.d.ts +10 -0
- package/types/index.ts +197 -7
- package/locales/en.json +0 -399
|
@@ -1,107 +1,143 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section class="flex flex-col gap-4 px-[10px]">
|
|
3
3
|
<v-form ref="vForm" @submit="submitForm" class="max-h-[82svh] overflow-y-scroll">
|
|
4
|
-
<base-form-section v-if="
|
|
4
|
+
<base-form-section v-if="whichProduct === 'gons'" :title="$dataStore.t('productConditionsForm.requestedProductConditions')" :class="[$libStyles.textSimple]">
|
|
5
5
|
<base-form-text-section
|
|
6
6
|
class="mb-4"
|
|
7
7
|
title="Инвалидность I или II группы по причине несчастного случая, начиная с третьего года по любой причине, с освобождением от уплаты страховых взносов"
|
|
8
8
|
subtitle="Равна страховой сумме по основному покрытию"
|
|
9
|
-
|
|
9
|
+
/>
|
|
10
10
|
<base-form-text-section
|
|
11
11
|
title="Если лицо, назначенное Выгодоприобретателем, на дату осуществления Страховщиком страховой выплаты не достигло совершеннолетия (восемнадцатилетнего возраста), страховая
|
|
12
12
|
выплата подлежит осуществлению:"
|
|
13
13
|
subtitle="Если несовершеннолетний не достиг возраста 14 лет - законному представителю в соответствии с законодательством Республики Казахстан"
|
|
14
|
-
|
|
14
|
+
/>
|
|
15
15
|
</base-form-section>
|
|
16
|
-
<base-form-section v-if="isUnderwriterRole" :title="$t('
|
|
16
|
+
<base-form-section v-if="isUnderwriterRole && $dataStore.hasClientAnketa && $dataStore.isClientAnketaCondition" :title="$dataStore.t('policyholderForm')">
|
|
17
|
+
<base-form-input
|
|
18
|
+
v-model="productConditionsForm.lifeMultiplyClient"
|
|
19
|
+
:maska="$maska.numbers"
|
|
20
|
+
:clearable="isRecalculationDisabled === false"
|
|
21
|
+
:label="$dataStore.t('percent') + `Life Multiply`"
|
|
22
|
+
:readonly="isRecalculationDisabled"
|
|
23
|
+
:rules="$dataStore.rules.recalculationMultiply"
|
|
24
|
+
/>
|
|
25
|
+
<base-form-input
|
|
26
|
+
v-model="productConditionsForm.lifeAdditiveClient"
|
|
27
|
+
:maska="$maska.numbers"
|
|
28
|
+
:clearable="isRecalculationDisabled === false"
|
|
29
|
+
:label="$dataStore.t('percent') + `Life Additive`"
|
|
30
|
+
:readonly="isRecalculationDisabled"
|
|
31
|
+
:rules="$dataStore.rules.recalculationAdditive"
|
|
32
|
+
/>
|
|
33
|
+
<base-form-input v-model="formStore.policyholderForm.longName" :label="$dataStore.t('labels.policyholderLongName')" :readonly="true" />
|
|
34
|
+
<base-form-input v-model="formStore.policyholderForm.job" :label="$dataStore.t('form.job')" :readonly="true" />
|
|
35
|
+
<base-form-input v-model="formStore.policyholderForm.jobPosition" :label="$dataStore.t('form.jobPosition')" :readonly="true" />
|
|
36
|
+
<base-form-input v-model="formStore.policyholderForm.birthDate" :label="$dataStore.t('form.birthDate')" :readonly="true" />
|
|
37
|
+
<base-form-input v-model="formStore.policyholderForm.age" :label="$dataStore.t('form.age')" :readonly="true" />
|
|
38
|
+
<base-form-input v-model="formStore.policyholderForm.gender.nameRu" class="mb-4" :label="$dataStore.t('form.gender')" :readonly="true" />
|
|
39
|
+
</base-form-section>
|
|
40
|
+
<base-form-section v-if="isUnderwriterRole && $dataStore.members.insuredApp.has === true" :title="$dataStore.t('insuredForm')">
|
|
41
|
+
<div v-for="(insured, index) of formStore.insuredForm" :key="index">
|
|
42
|
+
<base-form-input v-model="insured.longName" :label="$dataStore.t('labels.insurerLongName')" :readonly="true" />
|
|
43
|
+
<base-form-input v-model="insured.job" :label="$dataStore.t('form.job')" :readonly="true" />
|
|
44
|
+
<base-form-input v-model="insured.jobPosition" :label="$dataStore.t('form.jobPosition')" :readonly="true" />
|
|
45
|
+
<base-form-input v-model="insured.birthDate" :label="$dataStore.t('form.birthDate')" :readonly="true" />
|
|
46
|
+
<base-form-input v-model="insured.age" :label="$dataStore.t('form.age')" :readonly="true" />
|
|
47
|
+
<base-form-input v-model="insured.gender.nameRu" class="mb-4" :label="$dataStore.t('form.gender')" :readonly="true" />
|
|
48
|
+
</div>
|
|
49
|
+
</base-form-section>
|
|
50
|
+
<base-form-section v-if="isUnderwriterRole" :title="$dataStore.t('recalculationInfo')">
|
|
17
51
|
<base-form-input
|
|
18
52
|
v-model="productConditionsForm.lifeMultiply"
|
|
19
53
|
:maska="$maska.numbers"
|
|
20
54
|
:clearable="isRecalculationDisabled === false"
|
|
21
|
-
:label="$t('percent') + `Life Multiply`"
|
|
55
|
+
:label="$dataStore.t('percent') + `Life Multiply`"
|
|
22
56
|
:readonly="isRecalculationDisabled"
|
|
23
57
|
:rules="$dataStore.rules.recalculationMultiply"
|
|
24
|
-
|
|
58
|
+
/>
|
|
25
59
|
<base-form-input
|
|
26
60
|
v-model="productConditionsForm.lifeAdditive"
|
|
27
61
|
:maska="$maska.numbers"
|
|
28
62
|
:clearable="isRecalculationDisabled === false"
|
|
29
|
-
:label="$t('percent') + `Life Additive`"
|
|
63
|
+
:label="$dataStore.t('percent') + `Life Additive`"
|
|
30
64
|
:readonly="isRecalculationDisabled"
|
|
31
65
|
:rules="$dataStore.rules.recalculationAdditive"
|
|
32
|
-
|
|
66
|
+
/>
|
|
33
67
|
<base-form-input
|
|
68
|
+
v-if="hasAdbMultiply"
|
|
34
69
|
v-model="productConditionsForm.adbMultiply"
|
|
35
70
|
:maska="$maska.numbers"
|
|
36
71
|
:clearable="isRecalculationDisabled === false"
|
|
37
|
-
:label="$t('percent') + `Adb Multiply`"
|
|
72
|
+
:label="$dataStore.t('percent') + `Adb Multiply`"
|
|
38
73
|
:readonly="isRecalculationDisabled"
|
|
39
74
|
:rules="$dataStore.rules.recalculationMultiply"
|
|
40
|
-
|
|
75
|
+
/>
|
|
41
76
|
<base-form-input
|
|
77
|
+
v-if="hasAdbAdditive"
|
|
42
78
|
v-model="productConditionsForm.adbAdditive"
|
|
43
79
|
:maska="$maska.numbers"
|
|
44
80
|
:clearable="isRecalculationDisabled === false"
|
|
45
|
-
:label="$t('percent') + `Adb Additive`"
|
|
81
|
+
:label="$dataStore.t('percent') + `Adb Additive`"
|
|
46
82
|
:readonly="isRecalculationDisabled"
|
|
47
83
|
:rules="$dataStore.rules.recalculationAdditive"
|
|
48
|
-
|
|
84
|
+
/>
|
|
49
85
|
<base-form-input
|
|
50
86
|
v-model="productConditionsForm.disabilityMultiply"
|
|
51
87
|
:maska="$maska.numbers"
|
|
52
88
|
:clearable="isRecalculationDisabled === false"
|
|
53
|
-
:label="$t('percent') + `Disability Multiply`"
|
|
89
|
+
:label="$dataStore.t('percent') + `Disability Multiply`"
|
|
54
90
|
:readonly="isRecalculationDisabled"
|
|
55
91
|
:rules="$dataStore.rules.recalculationMultiply"
|
|
56
|
-
|
|
92
|
+
/>
|
|
57
93
|
<base-form-input
|
|
58
94
|
v-model="productConditionsForm.disabilityAdditive"
|
|
59
95
|
:maska="$maska.numbers"
|
|
60
96
|
:clearable="isRecalculationDisabled === false"
|
|
61
|
-
:label="$t('percent') + `Disability Additive`"
|
|
97
|
+
:label="$dataStore.t('percent') + `Disability Additive`"
|
|
62
98
|
:readonly="isRecalculationDisabled"
|
|
63
99
|
:rules="$dataStore.rules.recalculationAdditive"
|
|
64
|
-
|
|
65
|
-
</base-form-input>
|
|
100
|
+
/>
|
|
66
101
|
<base-panel-input
|
|
102
|
+
v-if="hasRiskGroup"
|
|
67
103
|
v-model="productConditionsForm.riskGroup"
|
|
68
104
|
:value="productConditionsForm.riskGroup.nameRu"
|
|
69
|
-
:label="$t('productConditionsForm.riskGroup')"
|
|
105
|
+
:label="$dataStore.t('productConditionsForm.riskGroup')"
|
|
70
106
|
:clearable="isRecalculationDisabled === false"
|
|
71
107
|
:readonly="isRecalculationDisabled"
|
|
72
108
|
append-inner-icon="mdi mdi-chevron-right"
|
|
73
|
-
@append="openPanel($t('productConditionsForm.riskGroup'), $dataStore.riskGroup, 'riskGroup')"
|
|
74
|
-
|
|
109
|
+
@append="openPanel($dataStore.t('productConditionsForm.riskGroup'), $dataStore.riskGroup, 'riskGroup')"
|
|
110
|
+
/>
|
|
75
111
|
</base-form-section>
|
|
76
|
-
<base-form-section :title="$t('generalConditions')">
|
|
77
|
-
<div v-if="isRecalculation && $route.params.taskId === '0'">
|
|
112
|
+
<base-form-section :title="$dataStore.t('generalConditions')">
|
|
113
|
+
<div v-if="isRecalculation && ($route.params.taskId === '0' || $dataStore.isCalculator)">
|
|
78
114
|
<base-form-input
|
|
79
115
|
v-model="productConditionsForm.signDate"
|
|
80
116
|
:maska="$maska.date"
|
|
81
117
|
:clearable="false"
|
|
82
118
|
:readonly="true"
|
|
83
|
-
:label="$t('form.signDate')"
|
|
119
|
+
:label="$dataStore.t('form.signDate')"
|
|
84
120
|
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
85
|
-
|
|
121
|
+
/>
|
|
86
122
|
<base-form-input
|
|
87
123
|
v-model="productConditionsForm.birthDate"
|
|
88
124
|
:maska="$maska.date"
|
|
89
125
|
:readonly="isDisabled"
|
|
90
126
|
:clearable="!isDisabled"
|
|
91
|
-
:label="$t('form.birthDate')"
|
|
127
|
+
:label="$dataStore.t('form.birthDate')"
|
|
92
128
|
:rules="$rules.required.concat($rules.birthDate)"
|
|
93
129
|
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
94
|
-
|
|
130
|
+
/>
|
|
95
131
|
<base-panel-input
|
|
96
132
|
v-model="productConditionsForm.gender"
|
|
97
133
|
:value="productConditionsForm.gender.nameRu"
|
|
98
134
|
:readonly="isDisabled"
|
|
99
135
|
:clearable="!isDisabled"
|
|
100
|
-
:label="$t('form.gender')"
|
|
136
|
+
:label="$dataStore.t('form.gender')"
|
|
101
137
|
:rules="$rules.objectRequired"
|
|
102
138
|
append-inner-icon="mdi mdi-chevron-right"
|
|
103
|
-
@append="openPanel($t('form.gender'), $dataStore.gender, 'gender')"
|
|
104
|
-
|
|
139
|
+
@append="openPanel($dataStore.t('form.gender'), $dataStore.gender, 'gender')"
|
|
140
|
+
/>
|
|
105
141
|
</div>
|
|
106
142
|
<base-form-input
|
|
107
143
|
v-model="productConditionsForm.coverPeriod"
|
|
@@ -109,87 +145,193 @@
|
|
|
109
145
|
:readonly="isDisabled"
|
|
110
146
|
:clearable="!isDisabled"
|
|
111
147
|
:rules="coverPeriodRule"
|
|
112
|
-
:label="$t(
|
|
113
|
-
|
|
148
|
+
:label="$dataStore.t(whichProduct === 'gons' ? 'productConditionsForm.coverPeriodFrom3to20' : 'productConditionsForm.coverPeriod')"
|
|
149
|
+
/>
|
|
114
150
|
<base-panel-input
|
|
151
|
+
v-if="hasPaymentPeriod"
|
|
115
152
|
v-model="productConditionsForm.paymentPeriod"
|
|
116
153
|
:value="productConditionsForm.paymentPeriod.nameRu"
|
|
117
154
|
:readonly="isDisabled"
|
|
118
155
|
:clearable="!isDisabled"
|
|
119
156
|
:rules="$rules.objectRequired"
|
|
120
|
-
:label="$t('productConditionsForm.processPaymentPeriod')"
|
|
157
|
+
:label="$dataStore.t('productConditionsForm.processPaymentPeriod')"
|
|
121
158
|
append-inner-icon="mdi mdi-chevron-right"
|
|
122
|
-
@append="openPanel($t('productConditionsForm.processPaymentPeriod'), $dataStore.processPaymentPeriod, 'paymentPeriod', $dataStore.getProcessPaymentPeriod)"
|
|
123
|
-
|
|
159
|
+
@append="openPanel($dataStore.t('productConditionsForm.processPaymentPeriod'), $dataStore.processPaymentPeriod, 'paymentPeriod', $dataStore.getProcessPaymentPeriod)"
|
|
160
|
+
/>
|
|
124
161
|
<base-panel-input
|
|
125
|
-
v-if="
|
|
162
|
+
v-if="hasProcessIndexRate"
|
|
126
163
|
v-model="productConditionsForm.processIndexRate"
|
|
127
164
|
:value="productConditionsForm.processIndexRate.nameRu"
|
|
128
165
|
:readonly="isDisabled"
|
|
129
166
|
:clearable="!isDisabled"
|
|
130
167
|
:rules="$rules.objectRequired"
|
|
131
|
-
:label="$t('productConditionsForm.processIndexRate')"
|
|
168
|
+
:label="$dataStore.t('productConditionsForm.processIndexRate')"
|
|
132
169
|
append-inner-icon="mdi mdi-chevron-right"
|
|
133
|
-
@append="openPanel($t('productConditionsForm.processIndexRate'), $dataStore.processIndexRate, 'processIndexRate', $dataStore.getProcessIndexRate)"
|
|
134
|
-
|
|
170
|
+
@append="openPanel($dataStore.t('productConditionsForm.processIndexRate'), $dataStore.processIndexRate, 'processIndexRate', $dataStore.getProcessIndexRate)"
|
|
171
|
+
/>
|
|
135
172
|
<base-form-input
|
|
136
173
|
v-model="productConditionsForm.requestedSumInsured"
|
|
137
|
-
:readonly="
|
|
174
|
+
:readonly="isDisabledSum"
|
|
138
175
|
:clearable="!isDisabled"
|
|
139
176
|
:rules="requestedSumInsured"
|
|
140
|
-
:label="
|
|
141
|
-
|
|
177
|
+
:label="requestedSumInsuredLabel"
|
|
178
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
179
|
+
@input="onInputSum"
|
|
180
|
+
@onClear="onClearSum"
|
|
181
|
+
/>
|
|
182
|
+
<base-form-input
|
|
183
|
+
v-if="hasRequestedSumInsuredInDollar"
|
|
184
|
+
v-model="productConditionsForm.requestedSumInsuredInDollar"
|
|
185
|
+
:readonly="isDisabledSumDollar"
|
|
186
|
+
:clearable="!isDisabled"
|
|
187
|
+
:rules="requestedSumInsured"
|
|
188
|
+
:label="$dataStore.t('productConditionsForm.requestedSumInsuredInDollar')"
|
|
189
|
+
:suffix="$constants.currencySymbols.usd"
|
|
190
|
+
@input="onInputSumDollar"
|
|
191
|
+
@onClear="onClearSumDollar"
|
|
192
|
+
/>
|
|
142
193
|
<base-form-input
|
|
143
194
|
v-model="productConditionsForm.insurancePremiumPerMonth"
|
|
144
195
|
:readonly="isDisabled"
|
|
145
196
|
:clearable="!isDisabled"
|
|
146
197
|
:rules="insurancePremiumPerMonth"
|
|
147
|
-
:label="$t('productConditionsForm.insurancePremiumAmount')"
|
|
148
|
-
|
|
198
|
+
:label="$dataStore.t('productConditionsForm.insurancePremiumAmount')"
|
|
199
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
200
|
+
@input="onInputInsurancePremiumPerMonth"
|
|
201
|
+
@onClear="onClearPremium"
|
|
202
|
+
/>
|
|
203
|
+
<base-form-input
|
|
204
|
+
v-if="hasInsurancePremiumPerMonthInDollar"
|
|
205
|
+
v-model="productConditionsForm.insurancePremiumPerMonthInDollar"
|
|
206
|
+
:readonly="isDisabled"
|
|
207
|
+
:clearable="!isDisabled"
|
|
208
|
+
:rules="insurancePremiumPerMonth"
|
|
209
|
+
:label="$dataStore.t('productConditionsForm.insurancePremiumAmountInDollar')"
|
|
210
|
+
:suffix="$constants.currencySymbols.usd"
|
|
211
|
+
@input="onInputInsurancePremiumPerMonthInDollar"
|
|
212
|
+
@onClear="onClearPremiumDollar"
|
|
213
|
+
/>
|
|
214
|
+
<base-form-input
|
|
215
|
+
v-if="hasCurrency && $dataStore.currencies.usd"
|
|
216
|
+
v-model="$dataStore.currencies.usd"
|
|
217
|
+
:readonly="true"
|
|
218
|
+
:label="$dataStore.t('productConditionsForm.dollarExchangeRateNBRK')"
|
|
219
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
220
|
+
/>
|
|
221
|
+
</base-form-section>
|
|
222
|
+
<base-form-section :title="$dataStore.t('calculationAnnuityPayments')" v-if="hasAnnuityPayments">
|
|
223
|
+
<base-form-toggle
|
|
224
|
+
v-model="productConditionsForm.additionalConditionAnnuityPayments"
|
|
225
|
+
:title="$dataStore.t('productConditionsForm.guaranteedTermAnnuityPayments')"
|
|
226
|
+
:disabled="isDisabled"
|
|
227
|
+
:has-border="false"
|
|
228
|
+
/>
|
|
229
|
+
<base-form-input
|
|
230
|
+
v-if="productConditionsForm.additionalConditionAnnuityPayments"
|
|
231
|
+
v-model="productConditionsForm.guaranteedPeriod"
|
|
232
|
+
:readonly="isDisabled"
|
|
233
|
+
:clearable="!isDisabled"
|
|
234
|
+
:rules="
|
|
235
|
+
productConditionsForm.termAnnuityPayments
|
|
236
|
+
? [$dataStore.rules.guaranteedPeriodLimit(productConditionsForm.guaranteedPeriod, productConditionsForm.termAnnuityPayments)]
|
|
237
|
+
: []
|
|
238
|
+
"
|
|
239
|
+
:label="$dataStore.t('productConditionsForm.guaranteedPeriod')"
|
|
240
|
+
/>
|
|
241
|
+
<base-panel-input
|
|
242
|
+
v-model="productConditionsForm.typeAnnuityInsurance"
|
|
243
|
+
:value="productConditionsForm.typeAnnuityInsurance.nameRu"
|
|
244
|
+
:readonly="isDisabled"
|
|
245
|
+
:clearable="!isDisabled"
|
|
246
|
+
:rules="$rules.objectRequired"
|
|
247
|
+
:label="$dataStore.t('productConditionsForm.typeAnnuityInsurance')"
|
|
248
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
249
|
+
@append="openPanel($dataStore.t('productConditionsForm.typeAnnuityInsurance'), $dataStore.dicAnnuityTypeList, 'typeAnnuityInsurance', $dataStore.getDicAnnuityTypeList)"
|
|
250
|
+
/>
|
|
251
|
+
<base-form-input
|
|
252
|
+
v-if="productConditionsForm.typeAnnuityInsurance.code !== 'Lifelong'"
|
|
253
|
+
v-model="productConditionsForm.termAnnuityPayments"
|
|
254
|
+
:readonly="isDisabled"
|
|
255
|
+
:clearable="!isDisabled"
|
|
256
|
+
:rules="$dataStore.rules.required.concat($dataStore.rules.numbers)"
|
|
257
|
+
:label="$dataStore.t('productConditionsForm.termAnnuityPayments')"
|
|
258
|
+
/>
|
|
259
|
+
<base-panel-input
|
|
260
|
+
v-model="productConditionsForm.periodAnnuityPayment"
|
|
261
|
+
:value="productConditionsForm.periodAnnuityPayment.nameRu"
|
|
262
|
+
:readonly="isDisabled"
|
|
263
|
+
:clearable="!isDisabled"
|
|
264
|
+
:rules="$rules.objectRequired"
|
|
265
|
+
:label="$dataStore.t('productConditionsForm.periodAnnuityPayment')"
|
|
266
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
267
|
+
@append="
|
|
268
|
+
openPanel(
|
|
269
|
+
$dataStore.t('productConditionsForm.processPaymentPeriod'),
|
|
270
|
+
$dataStore.processAnnuityPaymentPeriod,
|
|
271
|
+
'periodAnnuityPayment',
|
|
272
|
+
$dataStore.getProcessAnnuityPaymentPeriod,
|
|
273
|
+
)
|
|
274
|
+
"
|
|
275
|
+
/>
|
|
276
|
+
<base-form-input
|
|
277
|
+
v-model="productConditionsForm.amountAnnuityPayments"
|
|
278
|
+
:readonly="isDisabled"
|
|
279
|
+
:clearable="!isDisabled"
|
|
280
|
+
:rules="amountAnnuityPayments"
|
|
281
|
+
:label="$dataStore.t('productConditionsForm.amountAnnuityPayments')"
|
|
282
|
+
/>
|
|
149
283
|
</base-form-section>
|
|
150
|
-
<base-form-section v-if="additionalTerms && additionalTerms.length" :title="$t('productConditionsForm.additional')">
|
|
284
|
+
<base-form-section v-if="additionalTerms && additionalTerms.length" :title="$dataStore.t('productConditionsForm.additional')">
|
|
151
285
|
<div v-for="(term, index) of additionalTerms" :key="index">
|
|
152
286
|
<base-panel-input
|
|
287
|
+
v-if="filterTermConditions(term)"
|
|
153
288
|
v-model="additionalTerms[index]"
|
|
154
289
|
:value="term.coverSumName"
|
|
155
|
-
:readonly="
|
|
156
|
-
:clearable="!
|
|
290
|
+
:readonly="isTermsDisabled"
|
|
291
|
+
:clearable="!isTermsDisabled"
|
|
157
292
|
:label="term.coverTypeName"
|
|
158
293
|
append-inner-icon="mdi mdi-chevron-right"
|
|
294
|
+
:suffix="!!term.amount ? `${formatTermValue(term.amount)} ${currencySymbolsAddTerm}` : ''"
|
|
159
295
|
@append="openTermPanel(term.coverTypeName, $dataStore.getAdditionalInsuranceTermsAnswers, term.coverTypeId, index)"
|
|
160
|
-
|
|
296
|
+
/>
|
|
161
297
|
</div>
|
|
162
298
|
</base-form-section>
|
|
163
299
|
</v-form>
|
|
164
300
|
<base-btn
|
|
165
|
-
v-if="
|
|
301
|
+
v-if="!$dataStore.isCalculator && isRecalculation && hasCalculated"
|
|
302
|
+
:btn="$libStyles.greenLightBtn"
|
|
303
|
+
:text="$dataStore.t('buttons.toStatement')"
|
|
304
|
+
@click="toStatement"
|
|
305
|
+
/>
|
|
306
|
+
<base-btn
|
|
307
|
+
v-if="$dataStore.isCalculator ? true : !isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter())"
|
|
166
308
|
:loading="isCalculating"
|
|
167
|
-
:text="$t('buttons.calculate')"
|
|
309
|
+
:text="$dataStore.t('buttons.calculate')"
|
|
168
310
|
@click="submitForm"
|
|
169
|
-
|
|
311
|
+
/>
|
|
170
312
|
<div v-if="$dataStore.isTask() && $dataStore.isUnderwriter() && !isRecalculationDisabled" class="flex gap-3">
|
|
171
|
-
<base-btn :text="$t('buttons.calcSum')" type="submit" @click.prevent="underwriterCalculate('sum')" :loading="isCalculating" />
|
|
172
|
-
<base-btn :text="$t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
|
|
313
|
+
<base-btn :text="$dataStore.t('buttons.calcSum')" type="submit" @click.prevent="underwriterCalculate('sum')" :loading="isCalculating" />
|
|
314
|
+
<base-btn :text="$dataStore.t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
|
|
173
315
|
</div>
|
|
174
316
|
<Teleport v-if="isPanelOpen" to="#panel-actions">
|
|
175
317
|
<div :class="[$libStyles.scrollPage]" class="flex flex-col items-center">
|
|
176
|
-
<base-rounded-input v-model="searchQuery" :label="$t('labels.search')" class="w-full p-2" :hide-details="true"
|
|
318
|
+
<base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
177
319
|
<div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
178
|
-
<base-panel-select-item :text="$t('form.notChosen')" :selected="panelValue.nameRu === null" @click="pickPanelValue(new Value())"
|
|
320
|
+
<base-panel-select-item :text="$dataStore.t('form.notChosen')" :selected="panelValue.nameRu === null" @click="pickPanelValue(new Value())" />
|
|
179
321
|
<base-panel-select-item
|
|
180
322
|
v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
|
|
181
323
|
:key="index"
|
|
182
324
|
:text="(item.nameRu as string)"
|
|
183
325
|
:selected="item.nameRu === panelValue.nameRu"
|
|
184
326
|
@click="pickPanelValue(item)"
|
|
185
|
-
|
|
327
|
+
/>
|
|
186
328
|
</div>
|
|
187
|
-
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50"
|
|
329
|
+
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
|
|
188
330
|
</div>
|
|
189
331
|
</Teleport>
|
|
190
332
|
<Teleport v-if="isTermsPanelOpen" to="#panel-actions">
|
|
191
333
|
<div :class="[$libStyles.scrollPage]" class="flex flex-col items-center">
|
|
192
|
-
<base-rounded-input v-model="searchQuery" :label="$t('labels.search')" class="w-full p-2" :hide-details="true"
|
|
334
|
+
<base-rounded-input v-model.trim="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
193
335
|
<div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
194
336
|
<base-panel-select-item
|
|
195
337
|
v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
|
|
@@ -197,16 +339,16 @@
|
|
|
197
339
|
:text="(item.nameRu as string)"
|
|
198
340
|
:selected="item.nameRu === termValue?.coverSumName"
|
|
199
341
|
@click="pickTermValue(item)"
|
|
200
|
-
|
|
342
|
+
/>
|
|
201
343
|
</div>
|
|
202
|
-
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50"
|
|
344
|
+
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
|
|
203
345
|
</div>
|
|
204
346
|
</Teleport>
|
|
205
347
|
</section>
|
|
206
348
|
</template>
|
|
207
349
|
|
|
208
350
|
<script lang="ts">
|
|
209
|
-
import { Value } from '
|
|
351
|
+
import { Member, Value } from '../../composables/classes';
|
|
210
352
|
|
|
211
353
|
export default defineComponent({
|
|
212
354
|
props: {
|
|
@@ -214,6 +356,10 @@ export default defineComponent({
|
|
|
214
356
|
type: Boolean,
|
|
215
357
|
default: false,
|
|
216
358
|
},
|
|
359
|
+
product: {
|
|
360
|
+
type: String,
|
|
361
|
+
default: false,
|
|
362
|
+
},
|
|
217
363
|
},
|
|
218
364
|
setup(props) {
|
|
219
365
|
const vForm = ref<any>();
|
|
@@ -223,6 +369,7 @@ export default defineComponent({
|
|
|
223
369
|
const dataStore = useDataStore();
|
|
224
370
|
const memberStore = useMemberStore();
|
|
225
371
|
|
|
372
|
+
const whichProduct = ref<string>(dataStore.isCalculator ? props.product : dataStore.product!);
|
|
226
373
|
const isCalculating = ref<boolean>(false);
|
|
227
374
|
const isPanelLoading = ref<boolean>(false);
|
|
228
375
|
const isPanelOpen = ref<boolean>(false);
|
|
@@ -244,25 +391,129 @@ export default defineComponent({
|
|
|
244
391
|
return formStore.applicationData.statusCode === 'UnderwriterForm';
|
|
245
392
|
}
|
|
246
393
|
});
|
|
247
|
-
const isDisabled = computed(() => !memberStore.isStatementEditible(
|
|
394
|
+
const isDisabled = computed(() => (dataStore.isCalculator ? false : !memberStore.isStatementEditible('productConditionsForm')));
|
|
395
|
+
const isTermsDisabled = computed(() => {
|
|
396
|
+
if (dataStore.isGons) {
|
|
397
|
+
return true;
|
|
398
|
+
}
|
|
399
|
+
return isDisabled.value;
|
|
400
|
+
});
|
|
248
401
|
const isTask = computed(() => (route.params.taskId === '0' && props.isRecalculation === true) || dataStore.isTask());
|
|
249
402
|
const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm);
|
|
250
403
|
const isUnderwriterRole = computed(() => dataStore.isUnderwriter() || dataStore.isAdmin() || dataStore.isSupport());
|
|
251
404
|
const insurancePremiumPerMonth = computed(() => (!!productConditionsForm.insurancePremiumPerMonth ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
252
405
|
const requestedSumInsured = computed(() => (!!productConditionsForm.requestedSumInsured ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
253
|
-
const
|
|
254
|
-
|
|
406
|
+
const hasCalculated = computed(() => !!productConditionsForm.requestedSumInsured && !!productConditionsForm.insurancePremiumPerMonth);
|
|
407
|
+
const amountAnnuityPayments = computed(() => (!!productConditionsForm.amountAnnuityPayments ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
408
|
+
const hasProcessIndexRate = computed(() => {
|
|
409
|
+
if (whichProduct.value === 'gons' || whichProduct.value === 'halykkazyna' || whichProduct.value === 'liferenta') {
|
|
410
|
+
return false;
|
|
411
|
+
}
|
|
412
|
+
return true;
|
|
413
|
+
});
|
|
414
|
+
const hasPaymentPeriod = computed(() => {
|
|
415
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
416
|
+
return false;
|
|
417
|
+
}
|
|
418
|
+
return true;
|
|
419
|
+
});
|
|
420
|
+
const hasRequestedSumInsuredInDollar = computed(() => {
|
|
421
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
422
|
+
return true;
|
|
423
|
+
}
|
|
424
|
+
return false;
|
|
425
|
+
});
|
|
426
|
+
const hasInsurancePremiumPerMonthInDollar = computed(() => {
|
|
427
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
428
|
+
return true;
|
|
429
|
+
}
|
|
430
|
+
return false;
|
|
431
|
+
});
|
|
432
|
+
const hasCurrency = computed(() => {
|
|
433
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
434
|
+
return true;
|
|
435
|
+
}
|
|
436
|
+
return false;
|
|
437
|
+
});
|
|
438
|
+
const hasAdbMultiply = computed(() => {
|
|
439
|
+
if (whichProduct.value === 'gons') {
|
|
255
440
|
return false;
|
|
256
441
|
}
|
|
257
442
|
return true;
|
|
258
443
|
});
|
|
444
|
+
const hasAdbAdditive = computed(() => {
|
|
445
|
+
if (whichProduct.value === 'gons') {
|
|
446
|
+
return false;
|
|
447
|
+
}
|
|
448
|
+
return true;
|
|
449
|
+
});
|
|
450
|
+
const hasRiskGroup = computed(() => {
|
|
451
|
+
if (whichProduct.value === 'gons') {
|
|
452
|
+
return false;
|
|
453
|
+
}
|
|
454
|
+
return true;
|
|
455
|
+
});
|
|
456
|
+
const hasAnnuityPayments = computed(() => {
|
|
457
|
+
if (whichProduct.value === 'liferenta') {
|
|
458
|
+
return true;
|
|
459
|
+
}
|
|
460
|
+
return false;
|
|
461
|
+
});
|
|
259
462
|
const coverPeriodRule = computed(() => {
|
|
260
463
|
const baseCondition = dataStore.rules.required.concat(dataStore.rules.numbers);
|
|
261
|
-
if (
|
|
464
|
+
if (whichProduct.value === 'gons') {
|
|
262
465
|
return baseCondition.concat(dataStore.rules.coverPeriodFrom3to20);
|
|
263
466
|
}
|
|
467
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
468
|
+
return baseCondition.concat(dataStore.rules.coverPeriodFrom2to20);
|
|
469
|
+
}
|
|
264
470
|
return baseCondition;
|
|
265
471
|
});
|
|
472
|
+
const currencySymbolsAddTerm = computed(() => {
|
|
473
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
474
|
+
return constants.currencySymbols.usd;
|
|
475
|
+
}
|
|
476
|
+
return constants.currencySymbols.kzt;
|
|
477
|
+
});
|
|
478
|
+
const requestedSumInsuredLabel = computed(() => {
|
|
479
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
480
|
+
return dataStore.t('productConditionsForm.requestedSumInsuredInTenge');
|
|
481
|
+
}
|
|
482
|
+
return dataStore.t('productConditionsForm.requestedSumInsured');
|
|
483
|
+
});
|
|
484
|
+
const isDisabledSum = computed(() => {
|
|
485
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
486
|
+
return true;
|
|
487
|
+
}
|
|
488
|
+
return isDisabled.value;
|
|
489
|
+
});
|
|
490
|
+
const isDisabledSumDollar = computed(() => {
|
|
491
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
492
|
+
return true;
|
|
493
|
+
}
|
|
494
|
+
return isDisabled.value;
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
const formatTermValue = (term: number) => {
|
|
498
|
+
if (term !== null) {
|
|
499
|
+
return Number.isInteger(term) ? dataStore.getNumberWithSpaces(term) : dataStore.getNumberWithDot(term);
|
|
500
|
+
}
|
|
501
|
+
return null;
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
const toStatement = async () => {
|
|
505
|
+
const statementItem = dataStore.menuItems.find(i => i.id === 'statement');
|
|
506
|
+
if (statementItem) {
|
|
507
|
+
dataStore.menu.selectedItem = statementItem;
|
|
508
|
+
await router.replace({
|
|
509
|
+
name: 'taskId',
|
|
510
|
+
query: {
|
|
511
|
+
...route.query,
|
|
512
|
+
tab: 'statement',
|
|
513
|
+
},
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
};
|
|
266
517
|
|
|
267
518
|
const pickPanelValue = (item: Value) => {
|
|
268
519
|
dataStore.panel.open = false;
|
|
@@ -305,7 +556,7 @@ export default defineComponent({
|
|
|
305
556
|
};
|
|
306
557
|
|
|
307
558
|
const filterList = (list: Value[], key: string) => {
|
|
308
|
-
if (
|
|
559
|
+
if (whichProduct.value === 'baiterek') {
|
|
309
560
|
if (dataStore.isManagerHalykBank()) {
|
|
310
561
|
if (key === 'paymentPeriod') return list.filter(i => i.code !== 'single');
|
|
311
562
|
}
|
|
@@ -354,14 +605,111 @@ export default defineComponent({
|
|
|
354
605
|
await submitForm();
|
|
355
606
|
};
|
|
356
607
|
|
|
608
|
+
const onInputInsurancePremiumPerMonth = (event: Event) => {
|
|
609
|
+
if (event.target && 'value' in event.target && event.target.value) {
|
|
610
|
+
whichSum.value = 'insurancePremiumPerMonth';
|
|
611
|
+
const calculatedPremiumDollar = getNumber(event.target.value as string);
|
|
612
|
+
if (calculatedPremiumDollar) {
|
|
613
|
+
productConditionsForm.insurancePremiumPerMonth = dataStore.getNumberWithSpaces(productConditionsForm.insurancePremiumPerMonth);
|
|
614
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
615
|
+
if (typeof dataStore.currencies.usd === 'number') {
|
|
616
|
+
productConditionsForm.insurancePremiumPerMonthInDollar = dataStore.getNumberWithSpaces(calculatedPremiumDollar / dataStore.currencies.usd);
|
|
617
|
+
} else {
|
|
618
|
+
dataStore.showToaster('error', dataStore.t('toaster.noCurrency'));
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
};
|
|
624
|
+
|
|
625
|
+
const onInputInsurancePremiumPerMonthInDollar = (event: Event) => {
|
|
626
|
+
if (event.target && 'value' in event.target && event.target.value && dataStore.currencies.usd) {
|
|
627
|
+
whichSum.value = 'insurancePremiumPerMonth';
|
|
628
|
+
const calculatedPremium = getNumber(event.target.value as string);
|
|
629
|
+
if (calculatedPremium) {
|
|
630
|
+
productConditionsForm.insurancePremiumPerMonthInDollar = dataStore.getNumberWithSpaces(productConditionsForm.insurancePremiumPerMonthInDollar);
|
|
631
|
+
productConditionsForm.insurancePremiumPerMonth = dataStore.getNumberWithSpaces(calculatedPremium * dataStore.currencies.usd);
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
const onInputSum = (event: Event) => {
|
|
637
|
+
if (event.target && 'value' in event.target && event.target.value) {
|
|
638
|
+
whichSum.value = 'requestedSumInsured';
|
|
639
|
+
const calculatedSumDollar = getNumber(event.target.value as string);
|
|
640
|
+
if (calculatedSumDollar) {
|
|
641
|
+
productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(productConditionsForm.requestedSumInsured);
|
|
642
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
643
|
+
if (typeof dataStore.currencies.usd === 'number') {
|
|
644
|
+
productConditionsForm.requestedSumInsuredInDollar = dataStore.getNumberWithSpaces(calculatedSumDollar / dataStore.currencies.usd);
|
|
645
|
+
} else {
|
|
646
|
+
dataStore.showToaster('error', dataStore.t('toaster.noCurrency'));
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
|
|
653
|
+
const onInputSumDollar = (event: Event) => {
|
|
654
|
+
if (event.target && 'value' in event.target && event.target.value && dataStore.currencies.usd) {
|
|
655
|
+
whichSum.value = 'requestedSumInsured';
|
|
656
|
+
const calculatedSum = getNumber(event.target.value as string);
|
|
657
|
+
if (calculatedSum) {
|
|
658
|
+
productConditionsForm.requestedSumInsuredInDollar = dataStore.getNumberWithSpaces(productConditionsForm.requestedSumInsuredInDollar);
|
|
659
|
+
productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(calculatedSum * dataStore.currencies.usd);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
const onClearSum = () => {
|
|
665
|
+
productConditionsForm.requestedSumInsuredInDollar = null;
|
|
666
|
+
};
|
|
667
|
+
|
|
668
|
+
const onClearSumDollar = () => {
|
|
669
|
+
productConditionsForm.requestedSumInsured = null;
|
|
670
|
+
};
|
|
671
|
+
|
|
672
|
+
const onClearPremium = () => {
|
|
673
|
+
productConditionsForm.insurancePremiumPerMonthInDollar = null;
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
const onClearPremiumDollar = () => {
|
|
677
|
+
productConditionsForm.insurancePremiumPerMonth = null;
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
const clearFields = () => {
|
|
681
|
+
productConditionsForm.coverPeriod = null;
|
|
682
|
+
productConditionsForm.birthDate = null;
|
|
683
|
+
productConditionsForm.gender = new Value();
|
|
684
|
+
productConditionsForm.paymentPeriod = new Value();
|
|
685
|
+
productConditionsForm.processIndexRate = new Value();
|
|
686
|
+
productConditionsForm.requestedSumInsured = null;
|
|
687
|
+
productConditionsForm.requestedSumInsuredInDollar = null;
|
|
688
|
+
productConditionsForm.insurancePremiumPerMonth = null;
|
|
689
|
+
productConditionsForm.insurancePremiumPerMonthInDollar = null;
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
const filterTermConditions = (term: AddCover) => {
|
|
693
|
+
if (term.coverTypeCode === 10) {
|
|
694
|
+
return !!formStore.insuredForm.find((member: Member) => member.iin === formStore.policyholderForm.iin) === false;
|
|
695
|
+
}
|
|
696
|
+
return true;
|
|
697
|
+
};
|
|
698
|
+
|
|
357
699
|
const submitForm = async () => {
|
|
358
700
|
vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
359
701
|
if (v.valid) {
|
|
360
702
|
if (whichSum.value === 'requestedSumInsured') {
|
|
361
703
|
productConditionsForm.insurancePremiumPerMonth = null;
|
|
704
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
705
|
+
productConditionsForm.insurancePremiumPerMonthInDollar = null;
|
|
706
|
+
}
|
|
362
707
|
}
|
|
363
708
|
if (whichSum.value === 'insurancePremiumPerMonth') {
|
|
364
709
|
productConditionsForm.requestedSumInsured = null;
|
|
710
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
711
|
+
productConditionsForm.requestedSumInsuredInDollar = null;
|
|
712
|
+
}
|
|
365
713
|
}
|
|
366
714
|
if (productConditionsForm.requestedSumInsured !== '' && productConditionsForm.requestedSumInsured != null) {
|
|
367
715
|
productConditionsForm.insurancePremiumPerMonth = null;
|
|
@@ -379,15 +727,17 @@ export default defineComponent({
|
|
|
379
727
|
|
|
380
728
|
if (isUnderwriterForm.value) {
|
|
381
729
|
type recalculationInfo = {
|
|
382
|
-
lifeMultiply: string | null;
|
|
383
|
-
lifeAdditive: string | null;
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
730
|
+
lifeMultiply: string | null | number;
|
|
731
|
+
lifeAdditive: string | null | number;
|
|
732
|
+
lifeMultiplyClient?: string | number | null;
|
|
733
|
+
lifeAdditiveClient?: string | number | null;
|
|
734
|
+
adbMultiply: string | null | number;
|
|
735
|
+
adbAdditive: string | null | number;
|
|
736
|
+
disabilityMultiply: string | null | number;
|
|
737
|
+
disabilityAdditive: string | null | number;
|
|
738
|
+
amount?: string | number | null;
|
|
739
|
+
premium?: string | number | null;
|
|
740
|
+
riskGroup?: string | string | number | null;
|
|
391
741
|
};
|
|
392
742
|
const recalculationData: recalculationInfo = (({ lifeMultiply, lifeAdditive, adbMultiply, adbAdditive, disabilityMultiply, disabilityAdditive }) => ({
|
|
393
743
|
lifeMultiply,
|
|
@@ -401,18 +751,31 @@ export default defineComponent({
|
|
|
401
751
|
// @ts-ignore
|
|
402
752
|
recalculationData[key] = formatProcents(recalculationData[key]);
|
|
403
753
|
});
|
|
754
|
+
recalculationData.lifeMultiplyClient = dataStore.isClientAnketaCondition
|
|
755
|
+
? formStore.productConditionsForm.lifeMultiplyClient === null
|
|
756
|
+
? null
|
|
757
|
+
: formatProcents(formStore.productConditionsForm.lifeMultiplyClient)
|
|
758
|
+
: null;
|
|
759
|
+
recalculationData.lifeAdditiveClient = dataStore.isClientAnketaCondition
|
|
760
|
+
? formStore.productConditionsForm.lifeAdditiveClient === null
|
|
761
|
+
? null
|
|
762
|
+
: formatProcents(formStore.productConditionsForm.lifeAdditiveClient)
|
|
763
|
+
: null;
|
|
404
764
|
recalculationData.amount = Number((productConditionsForm.requestedSumInsured as string)?.replace(/\s/g, ''));
|
|
405
765
|
recalculationData.premium = Number((productConditionsForm.insurancePremiumPerMonth as string)?.replace(/\s/g, ''));
|
|
406
766
|
recalculationData.riskGroup = productConditionsForm.riskGroup?.id ? productConditionsForm.riskGroup.id : 1;
|
|
407
767
|
isCalculating.value = true;
|
|
408
|
-
await dataStore.reCalculate(formStore.applicationData.processInstanceId, recalculationData, route.params.taskId, whichSum.value);
|
|
768
|
+
await dataStore.reCalculate(formStore.applicationData.processInstanceId, recalculationData, route.params.taskId as string, whichSum.value);
|
|
409
769
|
}
|
|
410
770
|
isCalculating.value = true;
|
|
411
771
|
if (props.isRecalculation) {
|
|
412
|
-
|
|
772
|
+
//@ts-ignore
|
|
773
|
+
await dataStore.calculateWithoutApplication(true, whichProduct.value);
|
|
774
|
+
additionalTerms.value = formStore.additionalInsuranceTermsWithout;
|
|
413
775
|
} else {
|
|
414
776
|
if (dataStore.isProcessEditable(formStore.applicationData.statusCode)) {
|
|
415
|
-
await dataStore.calculate(route.params.taskId);
|
|
777
|
+
await dataStore.calculate(route.params.taskId as string);
|
|
778
|
+
additionalTerms.value = formStore.additionalInsuranceTerms;
|
|
416
779
|
}
|
|
417
780
|
}
|
|
418
781
|
isCalculating.value = false;
|
|
@@ -440,8 +803,16 @@ export default defineComponent({
|
|
|
440
803
|
|
|
441
804
|
onMounted(async () => {
|
|
442
805
|
if (props.isRecalculation === true) {
|
|
443
|
-
if (
|
|
444
|
-
|
|
806
|
+
if (dataStore.isCalculator) {
|
|
807
|
+
clearFields();
|
|
808
|
+
}
|
|
809
|
+
if (
|
|
810
|
+
(dataStore.isCalculator || route.params.taskId === '0') &&
|
|
811
|
+
productConditionsForm.requestedSumInsured === null &&
|
|
812
|
+
productConditionsForm.insurancePremiumPerMonth === null
|
|
813
|
+
) {
|
|
814
|
+
// @ts-ignore
|
|
815
|
+
const defaultData = await dataStore.getDefaultCalculationData(true, whichProduct.value);
|
|
445
816
|
if (!defaultData) {
|
|
446
817
|
dataStore.showToaster('error', 'Отсутствуют базовые данные');
|
|
447
818
|
return;
|
|
@@ -463,35 +834,35 @@ export default defineComponent({
|
|
|
463
834
|
if (!!productConditionsForm.requestedSumInsured) {
|
|
464
835
|
whichSum.value = 'requestedSumInsured';
|
|
465
836
|
}
|
|
837
|
+
if (dataStore.isCalculator) {
|
|
838
|
+
dataStore.processCode = constants.products[whichProduct.value as keyof typeof constants.products];
|
|
839
|
+
await dataStore.getProcessPaymentPeriod();
|
|
840
|
+
}
|
|
841
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
842
|
+
const kazynaPaymentPeriod = dataStore.processPaymentPeriod.find(i => i.code === 'single');
|
|
843
|
+
if (kazynaPaymentPeriod) productConditionsForm.paymentPeriod = kazynaPaymentPeriod;
|
|
844
|
+
await dataStore.getCurrencies();
|
|
845
|
+
}
|
|
466
846
|
});
|
|
467
847
|
|
|
468
848
|
watch(
|
|
469
|
-
() => productConditionsForm.
|
|
849
|
+
() => productConditionsForm.amountOfInsurancePremium,
|
|
470
850
|
val => {
|
|
471
|
-
if (
|
|
472
|
-
if (val && whichSum.value != 'insurancePremiumPerMonth') {
|
|
473
|
-
whichSum.value = 'requestedSumInsured';
|
|
474
|
-
productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(val);
|
|
475
|
-
}
|
|
851
|
+
if (val) productConditionsForm.amountOfInsurancePremium = dataStore.getNumberWithSpaces(val);
|
|
476
852
|
},
|
|
477
853
|
);
|
|
478
854
|
watch(
|
|
479
|
-
() => productConditionsForm.
|
|
855
|
+
() => formStore.productConditionsForm.amountAnnuityPayments,
|
|
480
856
|
val => {
|
|
481
|
-
if (
|
|
482
|
-
if (val && whichSum.value != 'requestedSumInsured') {
|
|
483
|
-
whichSum.value = 'insurancePremiumPerMonth';
|
|
484
|
-
productConditionsForm.insurancePremiumPerMonth = dataStore.getNumberWithSpaces(val);
|
|
485
|
-
}
|
|
857
|
+
if (val) formStore.productConditionsForm.amountAnnuityPayments = dataStore.getNumberWithSpaces(val);
|
|
486
858
|
},
|
|
487
859
|
);
|
|
488
860
|
watch(
|
|
489
|
-
() => productConditionsForm.
|
|
861
|
+
() => formStore.productConditionsForm.typeAnnuityInsurance,
|
|
490
862
|
val => {
|
|
491
|
-
if (val) productConditionsForm.
|
|
863
|
+
if (val.code === 'Lifelong') formStore.productConditionsForm.termAnnuityPayments = null;
|
|
492
864
|
},
|
|
493
865
|
);
|
|
494
|
-
|
|
495
866
|
watch(
|
|
496
867
|
() => dataStore.panel.open,
|
|
497
868
|
() => {
|
|
@@ -508,6 +879,7 @@ export default defineComponent({
|
|
|
508
879
|
// State
|
|
509
880
|
formStore,
|
|
510
881
|
vForm,
|
|
882
|
+
whichProduct,
|
|
511
883
|
productConditionsForm,
|
|
512
884
|
additionalTerms,
|
|
513
885
|
isCalculating,
|
|
@@ -524,12 +896,27 @@ export default defineComponent({
|
|
|
524
896
|
// Computed
|
|
525
897
|
isTask,
|
|
526
898
|
isDisabled,
|
|
899
|
+
isTermsDisabled,
|
|
527
900
|
isUnderwriterForm,
|
|
528
901
|
insurancePremiumPerMonth,
|
|
529
902
|
requestedSumInsured,
|
|
530
903
|
isRecalculationDisabled,
|
|
531
904
|
isUnderwriterRole,
|
|
532
|
-
|
|
905
|
+
hasProcessIndexRate,
|
|
906
|
+
hasPaymentPeriod,
|
|
907
|
+
hasRequestedSumInsuredInDollar,
|
|
908
|
+
hasInsurancePremiumPerMonthInDollar,
|
|
909
|
+
hasCurrency,
|
|
910
|
+
hasAdbMultiply,
|
|
911
|
+
hasAdbAdditive,
|
|
912
|
+
hasRiskGroup,
|
|
913
|
+
hasCalculated,
|
|
914
|
+
hasAnnuityPayments,
|
|
915
|
+
currencySymbolsAddTerm,
|
|
916
|
+
amountAnnuityPayments,
|
|
917
|
+
requestedSumInsuredLabel,
|
|
918
|
+
isDisabledSum,
|
|
919
|
+
isDisabledSumDollar,
|
|
533
920
|
|
|
534
921
|
// Rules
|
|
535
922
|
coverPeriodRule,
|
|
@@ -542,6 +929,18 @@ export default defineComponent({
|
|
|
542
929
|
openTermPanel,
|
|
543
930
|
pickCalculation,
|
|
544
931
|
underwriterCalculate,
|
|
932
|
+
onInputInsurancePremiumPerMonth,
|
|
933
|
+
onInputInsurancePremiumPerMonthInDollar,
|
|
934
|
+
onInputSum,
|
|
935
|
+
onInputSumDollar,
|
|
936
|
+
toStatement,
|
|
937
|
+
onClearSum,
|
|
938
|
+
onClearSumDollar,
|
|
939
|
+
onClearPremium,
|
|
940
|
+
onClearPremiumDollar,
|
|
941
|
+
clearFields,
|
|
942
|
+
formatTermValue,
|
|
943
|
+
filterTermConditions,
|
|
545
944
|
};
|
|
546
945
|
},
|
|
547
946
|
});
|