hl-core 0.0.8-beta.4 → 0.0.8-beta.40
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 +117 -44
- 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 +77 -33
- package/components/Form/FormSection.vue +4 -1
- package/components/Form/FormToggle.vue +2 -3
- package/components/Form/ManagerAttachment.vue +197 -0
- 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 +51 -33
- 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 +533 -292
- package/components/Pages/ProductAgreement.vue +4 -2
- package/components/Pages/ProductConditions.vue +509 -99
- package/components/Panel/PanelHandler.vue +93 -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 +217 -97
- package/composables/constants.ts +26 -52
- package/composables/index.ts +80 -2
- package/composables/styles.ts +8 -3
- package/configs/i18n.ts +17 -0
- package/layouts/default.vue +6 -6
- package/locales/kz.json +585 -0
- package/locales/ru.json +587 -0
- package/nuxt.config.ts +9 -1
- package/package.json +41 -11
- package/pages/500.vue +2 -2
- package/pages/Token.vue +51 -0
- package/plugins/helperFunctionsPlugins.ts +3 -0
- package/plugins/storePlugin.ts +0 -1
- package/plugins/vuetifyPlugin.ts +8 -1
- package/store/data.store.ts +2649 -0
- package/store/form.store.ts +1 -1
- package/store/member.store.ts +164 -52
- package/store/{rules.js → rules.ts} +63 -25
- package/types/enum.ts +83 -0
- package/types/env.d.ts +10 -0
- package/types/index.ts +211 -7
- package/store/data.store.js +0 -2508
- package/store/messages.ts +0 -434
|
@@ -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') {
|
|
255
410
|
return false;
|
|
256
411
|
}
|
|
257
412
|
return true;
|
|
258
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') {
|
|
440
|
+
return false;
|
|
441
|
+
}
|
|
442
|
+
return true;
|
|
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;
|
|
@@ -295,7 +546,7 @@ export default defineComponent({
|
|
|
295
546
|
isPanelLoading.value = true;
|
|
296
547
|
newList = await asyncFunction(filterKey, formStore.productConditionsFormKey);
|
|
297
548
|
}
|
|
298
|
-
panelList.value = newList;
|
|
549
|
+
panelList.value = filterList(newList, key);
|
|
299
550
|
// @ts-ignore
|
|
300
551
|
panelValue.value = productConditionsForm[currentPanel.value];
|
|
301
552
|
isPanelLoading.value = false;
|
|
@@ -304,6 +555,15 @@ export default defineComponent({
|
|
|
304
555
|
}
|
|
305
556
|
};
|
|
306
557
|
|
|
558
|
+
const filterList = (list: Value[], key: string) => {
|
|
559
|
+
if (whichProduct.value === 'baiterek') {
|
|
560
|
+
if (dataStore.isManagerHalykBank()) {
|
|
561
|
+
if (key === 'paymentPeriod') return list.filter(i => i.code !== 'single');
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
return list;
|
|
565
|
+
};
|
|
566
|
+
|
|
307
567
|
const openTermPanel = async (title: string, asyncFunction: Function, questionId: string, index: number) => {
|
|
308
568
|
if (!isDisabled.value) {
|
|
309
569
|
searchQuery.value = '';
|
|
@@ -345,14 +605,111 @@ export default defineComponent({
|
|
|
345
605
|
await submitForm();
|
|
346
606
|
};
|
|
347
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
|
+
|
|
348
699
|
const submitForm = async () => {
|
|
349
700
|
vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
350
701
|
if (v.valid) {
|
|
351
702
|
if (whichSum.value === 'requestedSumInsured') {
|
|
352
703
|
productConditionsForm.insurancePremiumPerMonth = null;
|
|
704
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
705
|
+
productConditionsForm.insurancePremiumPerMonthInDollar = null;
|
|
706
|
+
}
|
|
353
707
|
}
|
|
354
708
|
if (whichSum.value === 'insurancePremiumPerMonth') {
|
|
355
709
|
productConditionsForm.requestedSumInsured = null;
|
|
710
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
711
|
+
productConditionsForm.requestedSumInsuredInDollar = null;
|
|
712
|
+
}
|
|
356
713
|
}
|
|
357
714
|
if (productConditionsForm.requestedSumInsured !== '' && productConditionsForm.requestedSumInsured != null) {
|
|
358
715
|
productConditionsForm.insurancePremiumPerMonth = null;
|
|
@@ -370,15 +727,17 @@ export default defineComponent({
|
|
|
370
727
|
|
|
371
728
|
if (isUnderwriterForm.value) {
|
|
372
729
|
type recalculationInfo = {
|
|
373
|
-
lifeMultiply: string | null;
|
|
374
|
-
lifeAdditive: string | null;
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
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;
|
|
382
741
|
};
|
|
383
742
|
const recalculationData: recalculationInfo = (({ lifeMultiply, lifeAdditive, adbMultiply, adbAdditive, disabilityMultiply, disabilityAdditive }) => ({
|
|
384
743
|
lifeMultiply,
|
|
@@ -392,18 +751,31 @@ export default defineComponent({
|
|
|
392
751
|
// @ts-ignore
|
|
393
752
|
recalculationData[key] = formatProcents(recalculationData[key]);
|
|
394
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;
|
|
395
764
|
recalculationData.amount = Number((productConditionsForm.requestedSumInsured as string)?.replace(/\s/g, ''));
|
|
396
765
|
recalculationData.premium = Number((productConditionsForm.insurancePremiumPerMonth as string)?.replace(/\s/g, ''));
|
|
397
766
|
recalculationData.riskGroup = productConditionsForm.riskGroup?.id ? productConditionsForm.riskGroup.id : 1;
|
|
398
767
|
isCalculating.value = true;
|
|
399
|
-
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);
|
|
400
769
|
}
|
|
401
770
|
isCalculating.value = true;
|
|
402
771
|
if (props.isRecalculation) {
|
|
403
|
-
|
|
772
|
+
//@ts-ignore
|
|
773
|
+
await dataStore.calculateWithoutApplication(true, whichProduct.value);
|
|
774
|
+
additionalTerms.value = formStore.additionalInsuranceTermsWithout;
|
|
404
775
|
} else {
|
|
405
776
|
if (dataStore.isProcessEditable(formStore.applicationData.statusCode)) {
|
|
406
|
-
await dataStore.calculate(route.params.taskId);
|
|
777
|
+
await dataStore.calculate(route.params.taskId as string);
|
|
778
|
+
additionalTerms.value = formStore.additionalInsuranceTerms;
|
|
407
779
|
}
|
|
408
780
|
}
|
|
409
781
|
isCalculating.value = false;
|
|
@@ -412,11 +784,11 @@ export default defineComponent({
|
|
|
412
784
|
if (errors) {
|
|
413
785
|
const errorText = errors.querySelector('.v-label.v-field-label');
|
|
414
786
|
if (errorText) {
|
|
415
|
-
dataStore.showToaster('error', dataStore.t('toaster.errorFormField'
|
|
787
|
+
dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorText.innerHTML?.replace(/[-<>!//.]/g, '') }));
|
|
416
788
|
} else {
|
|
417
789
|
const errorFieldText = errors.querySelector('.v-input__control');
|
|
418
790
|
if (errorFieldText) {
|
|
419
|
-
dataStore.showToaster('error', dataStore.t('toaster.errorFormField'
|
|
791
|
+
dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorFieldText.innerHTML?.replace(/[-<>!//.]/g, '') }));
|
|
420
792
|
}
|
|
421
793
|
}
|
|
422
794
|
errors.scrollIntoView({
|
|
@@ -431,8 +803,16 @@ export default defineComponent({
|
|
|
431
803
|
|
|
432
804
|
onMounted(async () => {
|
|
433
805
|
if (props.isRecalculation === true) {
|
|
434
|
-
if (
|
|
435
|
-
|
|
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);
|
|
436
816
|
if (!defaultData) {
|
|
437
817
|
dataStore.showToaster('error', 'Отсутствуют базовые данные');
|
|
438
818
|
return;
|
|
@@ -440,8 +820,10 @@ export default defineComponent({
|
|
|
440
820
|
formStore.additionalInsuranceTermsWithout = defaultData.addCovers;
|
|
441
821
|
productConditionsForm.requestedSumInsured = defaultData.amount;
|
|
442
822
|
productConditionsForm.insurancePremiumPerMonth = defaultData.premium;
|
|
443
|
-
|
|
444
|
-
|
|
823
|
+
const indexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
|
|
824
|
+
if (indexRate) productConditionsForm.processIndexRate = indexRate;
|
|
825
|
+
const paymendPeriod = dataStore.processPaymentPeriod.find(i => i.id == defaultData.paymentPeriodId);
|
|
826
|
+
if (paymendPeriod) productConditionsForm.paymentPeriod = paymendPeriod;
|
|
445
827
|
productConditionsForm.signDate = reformatDate(defaultData.signDate);
|
|
446
828
|
}
|
|
447
829
|
}
|
|
@@ -452,35 +834,35 @@ export default defineComponent({
|
|
|
452
834
|
if (!!productConditionsForm.requestedSumInsured) {
|
|
453
835
|
whichSum.value = 'requestedSumInsured';
|
|
454
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
|
+
}
|
|
455
846
|
});
|
|
456
847
|
|
|
457
848
|
watch(
|
|
458
|
-
() => productConditionsForm.
|
|
849
|
+
() => productConditionsForm.amountOfInsurancePremium,
|
|
459
850
|
val => {
|
|
460
|
-
if (
|
|
461
|
-
if (val && whichSum.value != 'insurancePremiumPerMonth') {
|
|
462
|
-
whichSum.value = 'requestedSumInsured';
|
|
463
|
-
productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(val);
|
|
464
|
-
}
|
|
851
|
+
if (val) productConditionsForm.amountOfInsurancePremium = dataStore.getNumberWithSpaces(val);
|
|
465
852
|
},
|
|
466
853
|
);
|
|
467
854
|
watch(
|
|
468
|
-
() => productConditionsForm.
|
|
855
|
+
() => formStore.productConditionsForm.amountAnnuityPayments,
|
|
469
856
|
val => {
|
|
470
|
-
if (
|
|
471
|
-
if (val && whichSum.value != 'requestedSumInsured') {
|
|
472
|
-
whichSum.value = 'insurancePremiumPerMonth';
|
|
473
|
-
productConditionsForm.insurancePremiumPerMonth = dataStore.getNumberWithSpaces(val);
|
|
474
|
-
}
|
|
857
|
+
if (val) formStore.productConditionsForm.amountAnnuityPayments = dataStore.getNumberWithSpaces(val);
|
|
475
858
|
},
|
|
476
859
|
);
|
|
477
860
|
watch(
|
|
478
|
-
() => productConditionsForm.
|
|
861
|
+
() => formStore.productConditionsForm.typeAnnuityInsurance,
|
|
479
862
|
val => {
|
|
480
|
-
if (val) productConditionsForm.
|
|
863
|
+
if (val.code === 'Lifelong') formStore.productConditionsForm.termAnnuityPayments = null;
|
|
481
864
|
},
|
|
482
865
|
);
|
|
483
|
-
|
|
484
866
|
watch(
|
|
485
867
|
() => dataStore.panel.open,
|
|
486
868
|
() => {
|
|
@@ -497,6 +879,7 @@ export default defineComponent({
|
|
|
497
879
|
// State
|
|
498
880
|
formStore,
|
|
499
881
|
vForm,
|
|
882
|
+
whichProduct,
|
|
500
883
|
productConditionsForm,
|
|
501
884
|
additionalTerms,
|
|
502
885
|
isCalculating,
|
|
@@ -513,12 +896,27 @@ export default defineComponent({
|
|
|
513
896
|
// Computed
|
|
514
897
|
isTask,
|
|
515
898
|
isDisabled,
|
|
899
|
+
isTermsDisabled,
|
|
516
900
|
isUnderwriterForm,
|
|
517
901
|
insurancePremiumPerMonth,
|
|
518
902
|
requestedSumInsured,
|
|
519
903
|
isRecalculationDisabled,
|
|
520
904
|
isUnderwriterRole,
|
|
521
|
-
|
|
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,
|
|
522
920
|
|
|
523
921
|
// Rules
|
|
524
922
|
coverPeriodRule,
|
|
@@ -531,6 +929,18 @@ export default defineComponent({
|
|
|
531
929
|
openTermPanel,
|
|
532
930
|
pickCalculation,
|
|
533
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,
|
|
534
944
|
};
|
|
535
945
|
},
|
|
536
946
|
});
|