hl-core 0.0.8-beta.1 → 0.0.8-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/index.ts +26 -12
- package/api/interceptors.ts +1 -1
- package/components/Form/FormBlock.vue +52 -27
- package/components/Form/ManagerAttachment.vue +196 -0
- package/components/Form/ProductConditionsBlock.vue +8 -4
- package/components/Input/Datepicker.vue +41 -0
- package/components/Input/FormInput.vue +15 -3
- package/components/Layout/SettingsPanel.vue +1 -1
- package/components/Menu/MenuNav.vue +1 -1
- package/components/Pages/Anketa.vue +13 -5
- package/components/Pages/Documents.vue +1 -1
- package/components/Pages/MemberForm.vue +106 -11
- package/components/Pages/ProductConditions.vue +316 -17
- package/components/Panel/PanelHandler.vue +13 -11
- package/composables/classes.ts +72 -22
- package/composables/constants.ts +7 -1
- package/composables/styles.ts +5 -0
- package/configs/i18n.ts +19 -0
- package/locales/en.json +403 -0
- package/locales/kz.json +403 -0
- package/locales/ru.json +403 -0
- package/nuxt.config.ts +12 -0
- package/package.json +9 -3
- package/pages/500.vue +1 -1
- package/plugins/helperFunctionsPlugins.ts +5 -0
- package/plugins/storePlugin.ts +0 -1
- package/plugins/vuetifyPlugin.ts +5 -0
- package/store/data.store.js +294 -487
- package/store/member.store.ts +95 -5
- package/store/rules.js +27 -12
- package/types/index.ts +14 -0
- package/store/messages.ts +0 -433
|
@@ -13,6 +13,66 @@
|
|
|
13
13
|
subtitle="Если несовершеннолетний не достиг возраста 14 лет - законному представителю в соответствии с законодательством Республики Казахстан"
|
|
14
14
|
></base-form-text-section>
|
|
15
15
|
</base-form-section>
|
|
16
|
+
<base-form-section v-if="isUnderwriterRole" :title="$t('recalculationInfo')">
|
|
17
|
+
<base-form-input
|
|
18
|
+
v-model="productConditionsForm.lifeMultiply"
|
|
19
|
+
:maska="$maska.numbers"
|
|
20
|
+
:clearable="isRecalculationDisabled === false"
|
|
21
|
+
:label="$t('percent') + `Life Multiply`"
|
|
22
|
+
:readonly="isRecalculationDisabled"
|
|
23
|
+
:rules="$dataStore.rules.recalculationMultiply"
|
|
24
|
+
></base-form-input>
|
|
25
|
+
<base-form-input
|
|
26
|
+
v-model="productConditionsForm.lifeAdditive"
|
|
27
|
+
:maska="$maska.numbers"
|
|
28
|
+
:clearable="isRecalculationDisabled === false"
|
|
29
|
+
:label="$t('percent') + `Life Additive`"
|
|
30
|
+
:readonly="isRecalculationDisabled"
|
|
31
|
+
:rules="$dataStore.rules.recalculationAdditive"
|
|
32
|
+
></base-form-input>
|
|
33
|
+
<base-form-input
|
|
34
|
+
v-model="productConditionsForm.adbMultiply"
|
|
35
|
+
:maska="$maska.numbers"
|
|
36
|
+
:clearable="isRecalculationDisabled === false"
|
|
37
|
+
:label="$t('percent') + `Adb Multiply`"
|
|
38
|
+
:readonly="isRecalculationDisabled"
|
|
39
|
+
:rules="$dataStore.rules.recalculationMultiply"
|
|
40
|
+
></base-form-input>
|
|
41
|
+
<base-form-input
|
|
42
|
+
v-model="productConditionsForm.adbAdditive"
|
|
43
|
+
:maska="$maska.numbers"
|
|
44
|
+
:clearable="isRecalculationDisabled === false"
|
|
45
|
+
:label="$t('percent') + `Adb Additive`"
|
|
46
|
+
:readonly="isRecalculationDisabled"
|
|
47
|
+
:rules="$dataStore.rules.recalculationAdditive"
|
|
48
|
+
></base-form-input>
|
|
49
|
+
<base-form-input
|
|
50
|
+
v-model="productConditionsForm.disabilityMultiply"
|
|
51
|
+
:maska="$maska.numbers"
|
|
52
|
+
:clearable="isRecalculationDisabled === false"
|
|
53
|
+
:label="$t('percent') + `Disability Multiply`"
|
|
54
|
+
:readonly="isRecalculationDisabled"
|
|
55
|
+
:rules="$dataStore.rules.recalculationMultiply"
|
|
56
|
+
></base-form-input>
|
|
57
|
+
<base-form-input
|
|
58
|
+
v-model="productConditionsForm.disabilityAdditive"
|
|
59
|
+
:maska="$maska.numbers"
|
|
60
|
+
:clearable="isRecalculationDisabled === false"
|
|
61
|
+
:label="$t('percent') + `Disability Additive`"
|
|
62
|
+
:readonly="isRecalculationDisabled"
|
|
63
|
+
:rules="$dataStore.rules.recalculationAdditive"
|
|
64
|
+
>
|
|
65
|
+
</base-form-input>
|
|
66
|
+
<base-panel-input
|
|
67
|
+
v-model="productConditionsForm.riskGroup"
|
|
68
|
+
:value="productConditionsForm.riskGroup.nameRu"
|
|
69
|
+
:label="$t('productConditionsForm.riskGroup')"
|
|
70
|
+
:clearable="isRecalculationDisabled === false"
|
|
71
|
+
:readonly="isRecalculationDisabled"
|
|
72
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
73
|
+
@append="openPanel($t('productConditionsForm.riskGroup'), $dataStore.riskGroup, 'riskGroup')"
|
|
74
|
+
></base-panel-input>
|
|
75
|
+
</base-form-section>
|
|
16
76
|
<base-form-section :title="$t('generalConditions')">
|
|
17
77
|
<div v-if="isRecalculation && $route.params.taskId === '0'">
|
|
18
78
|
<base-form-input
|
|
@@ -48,10 +108,11 @@
|
|
|
48
108
|
:maska="$maska.numbers"
|
|
49
109
|
:readonly="isDisabled"
|
|
50
110
|
:clearable="!isDisabled"
|
|
51
|
-
:rules="
|
|
52
|
-
:label="$t('productConditionsForm.coverPeriodFrom3to20')"
|
|
111
|
+
:rules="coverPeriodRule"
|
|
112
|
+
:label="$t($dataStore.isGons ? 'productConditionsForm.coverPeriodFrom3to20' : 'productConditionsForm.coverPeriod')"
|
|
53
113
|
></base-form-input>
|
|
54
114
|
<base-panel-input
|
|
115
|
+
v-if="hasPaymentPeriod"
|
|
55
116
|
v-model="productConditionsForm.paymentPeriod"
|
|
56
117
|
:value="productConditionsForm.paymentPeriod.nameRu"
|
|
57
118
|
:readonly="isDisabled"
|
|
@@ -61,12 +122,34 @@
|
|
|
61
122
|
append-inner-icon="mdi mdi-chevron-right"
|
|
62
123
|
@append="openPanel($t('productConditionsForm.processPaymentPeriod'), $dataStore.processPaymentPeriod, 'paymentPeriod', $dataStore.getProcessPaymentPeriod)"
|
|
63
124
|
></base-panel-input>
|
|
125
|
+
<base-panel-input
|
|
126
|
+
v-if="hasProcessIndexRate"
|
|
127
|
+
v-model="productConditionsForm.processIndexRate"
|
|
128
|
+
:value="productConditionsForm.processIndexRate.nameRu"
|
|
129
|
+
:readonly="isDisabled"
|
|
130
|
+
:clearable="!isDisabled"
|
|
131
|
+
:rules="$rules.objectRequired"
|
|
132
|
+
:label="$t('productConditionsForm.processIndexRate')"
|
|
133
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
134
|
+
@append="openPanel($t('productConditionsForm.processIndexRate'), $dataStore.processIndexRate, 'processIndexRate', $dataStore.getProcessIndexRate)"
|
|
135
|
+
></base-panel-input>
|
|
64
136
|
<base-form-input
|
|
65
137
|
v-model="productConditionsForm.requestedSumInsured"
|
|
66
138
|
:readonly="isDisabled"
|
|
67
139
|
:clearable="!isDisabled"
|
|
68
140
|
:rules="requestedSumInsured"
|
|
69
141
|
:label="$t('productConditionsForm.requestedSumInsured')"
|
|
142
|
+
@input="onInputSum"
|
|
143
|
+
></base-form-input>
|
|
144
|
+
<base-form-input
|
|
145
|
+
v-if="hasRequestedSumInsuredInDollar"
|
|
146
|
+
v-model="productConditionsForm.requestedSumInsuredInDollar"
|
|
147
|
+
:readonly="isDisabled"
|
|
148
|
+
:clearable="!isDisabled"
|
|
149
|
+
:rules="requestedSumInsured"
|
|
150
|
+
:label="$t('productConditionsForm.requestedSumInsuredInDollar')"
|
|
151
|
+
:suffix="$constants.currencySymbols.usd"
|
|
152
|
+
@input="onInputSumDollar"
|
|
70
153
|
></base-form-input>
|
|
71
154
|
<base-form-input
|
|
72
155
|
v-model="productConditionsForm.insurancePremiumPerMonth"
|
|
@@ -74,7 +157,39 @@
|
|
|
74
157
|
:clearable="!isDisabled"
|
|
75
158
|
:rules="insurancePremiumPerMonth"
|
|
76
159
|
:label="$t('productConditionsForm.insurancePremiumAmount')"
|
|
160
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
161
|
+
@input="onInputInsurancePremiumPerMonth"
|
|
77
162
|
></base-form-input>
|
|
163
|
+
<base-form-input
|
|
164
|
+
v-if="hasInsurancePremiumPerMonthInDollar"
|
|
165
|
+
v-model="productConditionsForm.insurancePremiumPerMonthInDollar"
|
|
166
|
+
:readonly="isDisabled"
|
|
167
|
+
:clearable="!isDisabled"
|
|
168
|
+
:rules="insurancePremiumPerMonth"
|
|
169
|
+
:label="$t('productConditionsForm.insurancePremiumAmountInDollar')"
|
|
170
|
+
:suffix="constants.currencySymbols.usd"
|
|
171
|
+
@input="onInputInsurancePremiumPerMonthInDollar"
|
|
172
|
+
></base-form-input>
|
|
173
|
+
<base-form-input
|
|
174
|
+
v-if="hasCurrency && $dataStore.currencies.usd"
|
|
175
|
+
v-model="$dataStore.currencies.usd"
|
|
176
|
+
:readonly="true"
|
|
177
|
+
:label="$t('productConditionsForm.dollarExchangeRateNBRK')"
|
|
178
|
+
:suffix="$constants.currencySymbols.kzt"
|
|
179
|
+
></base-form-input>
|
|
180
|
+
</base-form-section>
|
|
181
|
+
<base-form-section v-if="additionalTerms && additionalTerms.length" :title="$t('productConditionsForm.additional')">
|
|
182
|
+
<div v-for="(term, index) of additionalTerms" :key="index">
|
|
183
|
+
<base-panel-input
|
|
184
|
+
v-model="additionalTerms[index]"
|
|
185
|
+
:value="term.coverSumName"
|
|
186
|
+
:readonly="isDisabled"
|
|
187
|
+
:clearable="!isDisabled"
|
|
188
|
+
:label="term.coverTypeName"
|
|
189
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
190
|
+
@append="openTermPanel(term.coverTypeName, $dataStore.getAdditionalInsuranceTermsAnswers, term.coverTypeId, index)"
|
|
191
|
+
></base-panel-input>
|
|
192
|
+
</div>
|
|
78
193
|
</base-form-section>
|
|
79
194
|
</v-form>
|
|
80
195
|
<base-btn
|
|
@@ -83,6 +198,10 @@
|
|
|
83
198
|
:text="$t('buttons.calculate')"
|
|
84
199
|
@click="submitForm"
|
|
85
200
|
></base-btn>
|
|
201
|
+
<div v-if="$dataStore.isTask() && $dataStore.isUnderwriter() && !isRecalculationDisabled" class="flex gap-3">
|
|
202
|
+
<base-btn :text="$t('buttons.calcSum')" type="submit" @click.prevent="underwriterCalculate('sum')" :loading="isCalculating" />
|
|
203
|
+
<base-btn :text="$t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
|
|
204
|
+
</div>
|
|
86
205
|
<Teleport v-if="isPanelOpen" to="#panel-actions">
|
|
87
206
|
<div :class="[$libStyles.scrollPage]" class="flex flex-col items-center">
|
|
88
207
|
<base-rounded-input v-model="searchQuery" :label="$t('labels.search')" class="w-full p-2" :hide-details="true"></base-rounded-input>
|
|
@@ -91,7 +210,7 @@
|
|
|
91
210
|
<base-panel-select-item
|
|
92
211
|
v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
|
|
93
212
|
:key="index"
|
|
94
|
-
:text="item.nameRu as string"
|
|
213
|
+
:text="(item.nameRu as string)"
|
|
95
214
|
:selected="item.nameRu === panelValue.nameRu"
|
|
96
215
|
@click="pickPanelValue(item)"
|
|
97
216
|
></base-panel-select-item>
|
|
@@ -99,6 +218,21 @@
|
|
|
99
218
|
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50"></base-loader>
|
|
100
219
|
</div>
|
|
101
220
|
</Teleport>
|
|
221
|
+
<Teleport v-if="isTermsPanelOpen" to="#panel-actions">
|
|
222
|
+
<div :class="[$libStyles.scrollPage]" class="flex flex-col items-center">
|
|
223
|
+
<base-rounded-input v-model="searchQuery" :label="$t('labels.search')" class="w-full p-2" :hide-details="true"></base-rounded-input>
|
|
224
|
+
<div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
225
|
+
<base-panel-select-item
|
|
226
|
+
v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
|
|
227
|
+
:key="index"
|
|
228
|
+
:text="(item.nameRu as string)"
|
|
229
|
+
:selected="item.nameRu === termValue?.coverSumName"
|
|
230
|
+
@click="pickTermValue(item)"
|
|
231
|
+
></base-panel-select-item>
|
|
232
|
+
</div>
|
|
233
|
+
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50"></base-loader>
|
|
234
|
+
</div>
|
|
235
|
+
</Teleport>
|
|
102
236
|
</section>
|
|
103
237
|
</template>
|
|
104
238
|
|
|
@@ -123,13 +257,17 @@ export default defineComponent({
|
|
|
123
257
|
const isCalculating = ref<boolean>(false);
|
|
124
258
|
const isPanelLoading = ref<boolean>(false);
|
|
125
259
|
const isPanelOpen = ref<boolean>(false);
|
|
260
|
+
const isTermsPanelOpen = ref<boolean>(false);
|
|
126
261
|
const panelValue = ref<Value>(new Value());
|
|
262
|
+
const termValue = ref<AddCover>();
|
|
127
263
|
const panelList = ref<Value[]>([]);
|
|
128
264
|
const productConditionsForm = formStore.productConditionsForm;
|
|
129
265
|
const currentPanel = ref<keyof typeof productConditionsForm>();
|
|
266
|
+
const currentIndex = ref<number>();
|
|
130
267
|
const searchQuery = ref<string>('');
|
|
131
268
|
const whichSum = ref<'insurancePremiumPerMonth' | 'requestedSumInsured' | ''>('');
|
|
132
269
|
|
|
270
|
+
const additionalTerms = ref<AddCover[]>([]);
|
|
133
271
|
const isUnderwriterForm = computed(() => {
|
|
134
272
|
if (route.params.taskId === '0 ' || props.isRecalculation === true) {
|
|
135
273
|
return false;
|
|
@@ -139,25 +277,73 @@ export default defineComponent({
|
|
|
139
277
|
});
|
|
140
278
|
const isDisabled = computed(() => !memberStore.isStatementEditible(formStore.productConditionsFormKey));
|
|
141
279
|
const isTask = computed(() => (route.params.taskId === '0' && props.isRecalculation === true) || dataStore.isTask());
|
|
280
|
+
const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm);
|
|
281
|
+
const isUnderwriterRole = computed(() => dataStore.isUnderwriter() || dataStore.isAdmin() || dataStore.isSupport());
|
|
142
282
|
const insurancePremiumPerMonth = computed(() => (!!productConditionsForm.insurancePremiumPerMonth ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
143
283
|
const requestedSumInsured = computed(() => (!!productConditionsForm.requestedSumInsured ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
|
|
284
|
+
const hasProcessIndexRate = computed(() => {
|
|
285
|
+
if (dataStore.isGons || dataStore.isKazyna) {
|
|
286
|
+
return false;
|
|
287
|
+
}
|
|
288
|
+
return true;
|
|
289
|
+
});
|
|
290
|
+
const hasPaymentPeriod = computed(() => {
|
|
291
|
+
if (dataStore.isKazyna) {
|
|
292
|
+
return false;
|
|
293
|
+
}
|
|
294
|
+
return true;
|
|
295
|
+
});
|
|
296
|
+
const hasRequestedSumInsuredInDollar = computed(() => {
|
|
297
|
+
if (dataStore.isKazyna) {
|
|
298
|
+
return true;
|
|
299
|
+
}
|
|
300
|
+
return false;
|
|
301
|
+
});
|
|
302
|
+
const hasInsurancePremiumPerMonthInDollar = computed(() => {
|
|
303
|
+
if (dataStore.isKazyna) {
|
|
304
|
+
return true;
|
|
305
|
+
}
|
|
306
|
+
return false;
|
|
307
|
+
});
|
|
308
|
+
const hasCurrency = computed(() => {
|
|
309
|
+
if (dataStore.isKazyna) {
|
|
310
|
+
return true;
|
|
311
|
+
}
|
|
312
|
+
return false;
|
|
313
|
+
});
|
|
314
|
+
const coverPeriodRule = computed(() => {
|
|
315
|
+
const baseCondition = dataStore.rules.required.concat(dataStore.rules.numbers);
|
|
316
|
+
if (dataStore.isGons) {
|
|
317
|
+
return baseCondition.concat(dataStore.rules.coverPeriodFrom3to20);
|
|
318
|
+
}
|
|
319
|
+
if (dataStore.isKazyna) {
|
|
320
|
+
return baseCondition.concat(dataStore.rules.coverPeriodFrom2to20);
|
|
321
|
+
}
|
|
322
|
+
return baseCondition;
|
|
323
|
+
});
|
|
144
324
|
|
|
145
325
|
const pickPanelValue = (item: Value) => {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
326
|
+
dataStore.panel.open = false;
|
|
327
|
+
isPanelOpen.value = false;
|
|
328
|
+
if (!currentPanel.value) return;
|
|
329
|
+
// @ts-ignore
|
|
330
|
+
productConditionsForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
const pickTermValue = (item: Value) => {
|
|
334
|
+
dataStore.panel.open = false;
|
|
335
|
+
isTermsPanelOpen.value = false;
|
|
336
|
+
if (typeof currentIndex.value !== 'number') return;
|
|
337
|
+
additionalTerms.value[currentIndex.value].coverSumId = item.id as string;
|
|
338
|
+
additionalTerms.value[currentIndex.value].coverSumName = item.nameRu as string;
|
|
154
339
|
};
|
|
155
340
|
|
|
156
341
|
const openPanel = async (title: string, list: Value[], key: string, asyncFunction?: Function, filterKey?: string) => {
|
|
157
|
-
if (!isDisabled.value) {
|
|
342
|
+
if (!isDisabled.value || (key === 'riskGroup' && !isRecalculationDisabled.value)) {
|
|
158
343
|
searchQuery.value = '';
|
|
159
344
|
currentPanel.value = key as keyof typeof productConditionsForm;
|
|
160
345
|
isPanelOpen.value = true;
|
|
346
|
+
isTermsPanelOpen.value = false;
|
|
161
347
|
dataStore.panelAction = null;
|
|
162
348
|
dataStore.panel.open = true;
|
|
163
349
|
dataStore.panel.title = title;
|
|
@@ -167,7 +353,7 @@ export default defineComponent({
|
|
|
167
353
|
isPanelLoading.value = true;
|
|
168
354
|
newList = await asyncFunction(filterKey, formStore.productConditionsFormKey);
|
|
169
355
|
}
|
|
170
|
-
panelList.value = newList;
|
|
356
|
+
panelList.value = filterList(newList, key);
|
|
171
357
|
// @ts-ignore
|
|
172
358
|
panelValue.value = productConditionsForm[currentPanel.value];
|
|
173
359
|
isPanelLoading.value = false;
|
|
@@ -176,12 +362,96 @@ export default defineComponent({
|
|
|
176
362
|
}
|
|
177
363
|
};
|
|
178
364
|
|
|
365
|
+
const filterList = (list: Value[], key: string) => {
|
|
366
|
+
if (dataStore.isBaiterek) {
|
|
367
|
+
if (dataStore.isManagerHalykBank()) {
|
|
368
|
+
if (key === 'paymentPeriod') return list.filter(i => i.code !== 'single');
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return list;
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
const openTermPanel = async (title: string, asyncFunction: Function, questionId: string, index: number) => {
|
|
375
|
+
if (!isDisabled.value) {
|
|
376
|
+
searchQuery.value = '';
|
|
377
|
+
currentIndex.value = index;
|
|
378
|
+
isPanelOpen.value = false;
|
|
379
|
+
isTermsPanelOpen.value = true;
|
|
380
|
+
dataStore.panelAction = null;
|
|
381
|
+
dataStore.panel.open = true;
|
|
382
|
+
dataStore.panel.title = title;
|
|
383
|
+
|
|
384
|
+
let newList;
|
|
385
|
+
if (asyncFunction) {
|
|
386
|
+
isPanelLoading.value = true;
|
|
387
|
+
newList = await asyncFunction(questionId);
|
|
388
|
+
}
|
|
389
|
+
panelList.value = newList;
|
|
390
|
+
// @ts-ignore
|
|
391
|
+
termValue.value = additionalTerms.value[index];
|
|
392
|
+
isPanelLoading.value = false;
|
|
393
|
+
} else {
|
|
394
|
+
dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
const underwriterCalculate = async (type: 'sum' | 'premium') => {
|
|
399
|
+
if (!type) return;
|
|
400
|
+
if (type === 'sum') {
|
|
401
|
+
whichSum.value = 'insurancePremiumPerMonth';
|
|
402
|
+
}
|
|
403
|
+
if (type === 'premium') {
|
|
404
|
+
whichSum.value = 'requestedSumInsured';
|
|
405
|
+
}
|
|
406
|
+
await submitForm();
|
|
407
|
+
};
|
|
408
|
+
|
|
179
409
|
const pickCalculation = async (type: 'insurancePremiumPerMonth' | 'requestedSumInsured') => {
|
|
180
410
|
if (!type) return false;
|
|
181
411
|
whichSum.value = type;
|
|
182
412
|
await submitForm();
|
|
183
413
|
};
|
|
184
414
|
|
|
415
|
+
const onInputInsurancePremiumPerMonth = (event: Event) => {
|
|
416
|
+
if (event.target && 'value' in event.target && event.target.value && dataStore.currencies.usd) {
|
|
417
|
+
const calculatedPremiumDollar = getNumber(event.target.value as string);
|
|
418
|
+
if (calculatedPremiumDollar) {
|
|
419
|
+
productConditionsForm.insurancePremiumPerMonth = dataStore.getNumberWithSpaces(productConditionsForm.insurancePremiumPerMonth);
|
|
420
|
+
productConditionsForm.insurancePremiumPerMonthInDollar = dataStore.getNumberWithSpaces(calculatedPremiumDollar / dataStore.currencies.usd);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
const onInputInsurancePremiumPerMonthInDollar = (event: Event) => {
|
|
426
|
+
if (event.target && 'value' in event.target && event.target.value && dataStore.currencies.usd) {
|
|
427
|
+
const calculatedPremium = getNumber(event.target.value as string);
|
|
428
|
+
if (calculatedPremium) {
|
|
429
|
+
productConditionsForm.insurancePremiumPerMonthInDollar = dataStore.getNumberWithSpaces(productConditionsForm.insurancePremiumPerMonthInDollar);
|
|
430
|
+
productConditionsForm.insurancePremiumPerMonth = dataStore.getNumberWithSpaces(calculatedPremium * dataStore.currencies.usd);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
const onInputSum = (event: Event) => {
|
|
436
|
+
if (event.target && 'value' in event.target && event.target.value && dataStore.currencies.usd) {
|
|
437
|
+
const calculatedSumDollar = getNumber(event.target.value as string);
|
|
438
|
+
if (calculatedSumDollar) {
|
|
439
|
+
productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(productConditionsForm.requestedSumInsured);
|
|
440
|
+
productConditionsForm.requestedSumInsuredInDollar = dataStore.getNumberWithSpaces(calculatedSumDollar / dataStore.currencies.usd);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
const onInputSumDollar = (event: Event) => {
|
|
446
|
+
if (event.target && 'value' in event.target && event.target.value && dataStore.currencies.usd) {
|
|
447
|
+
const calculatedSum = getNumber(event.target.value as string);
|
|
448
|
+
if (calculatedSum) {
|
|
449
|
+
productConditionsForm.requestedSumInsuredInDollar = dataStore.getNumberWithSpaces(productConditionsForm.requestedSumInsuredInDollar);
|
|
450
|
+
productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(calculatedSum * dataStore.currencies.usd);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
|
|
185
455
|
const submitForm = async () => {
|
|
186
456
|
vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
187
457
|
if (v.valid) {
|
|
@@ -249,11 +519,11 @@ export default defineComponent({
|
|
|
249
519
|
if (errors) {
|
|
250
520
|
const errorText = errors.querySelector('.v-label.v-field-label');
|
|
251
521
|
if (errorText) {
|
|
252
|
-
dataStore.showToaster('error', dataStore.t('toaster.errorFormField'
|
|
522
|
+
dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorText.innerHTML?.replace(/[-<>!//.]/g, '') }));
|
|
253
523
|
} else {
|
|
254
524
|
const errorFieldText = errors.querySelector('.v-input__control');
|
|
255
525
|
if (errorFieldText) {
|
|
256
|
-
dataStore.showToaster('error', dataStore.t('toaster.errorFormField'
|
|
526
|
+
dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorFieldText.innerHTML?.replace(/[-<>!//.]/g, '') }));
|
|
257
527
|
}
|
|
258
528
|
}
|
|
259
529
|
errors.scrollIntoView({
|
|
@@ -277,17 +547,25 @@ export default defineComponent({
|
|
|
277
547
|
formStore.additionalInsuranceTermsWithout = defaultData.addCovers;
|
|
278
548
|
productConditionsForm.requestedSumInsured = defaultData.amount;
|
|
279
549
|
productConditionsForm.insurancePremiumPerMonth = defaultData.premium;
|
|
280
|
-
|
|
281
|
-
|
|
550
|
+
const indexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
|
|
551
|
+
if (indexRate) productConditionsForm.processIndexRate = indexRate;
|
|
552
|
+
const paymendPeriod = dataStore.processPaymentPeriod.find(i => i.id == defaultData.paymentPeriodId);
|
|
553
|
+
if (paymendPeriod) productConditionsForm.paymentPeriod = paymendPeriod;
|
|
282
554
|
productConditionsForm.signDate = reformatDate(defaultData.signDate);
|
|
283
555
|
}
|
|
284
556
|
}
|
|
557
|
+
additionalTerms.value = props.isRecalculation ? formStore.additionalInsuranceTermsWithout : formStore.additionalInsuranceTerms;
|
|
285
558
|
if (!!productConditionsForm.insurancePremiumPerMonth) {
|
|
286
559
|
whichSum.value = 'insurancePremiumPerMonth';
|
|
287
560
|
}
|
|
288
561
|
if (!!productConditionsForm.requestedSumInsured) {
|
|
289
562
|
whichSum.value = 'requestedSumInsured';
|
|
290
563
|
}
|
|
564
|
+
if (dataStore.isKazyna) {
|
|
565
|
+
const kazynaPaymentPeriod = dataStore.processPaymentPeriod.find(i => i.code === 'single');
|
|
566
|
+
if (kazynaPaymentPeriod) productConditionsForm.paymentPeriod = kazynaPaymentPeriod;
|
|
567
|
+
await dataStore.getCurrencies();
|
|
568
|
+
}
|
|
291
569
|
});
|
|
292
570
|
|
|
293
571
|
watch(
|
|
@@ -322,6 +600,7 @@ export default defineComponent({
|
|
|
322
600
|
() => {
|
|
323
601
|
if (dataStore.panel.open === false) {
|
|
324
602
|
isPanelOpen.value = false;
|
|
603
|
+
isTermsPanelOpen.value = false;
|
|
325
604
|
dataStore.panelAction = null;
|
|
326
605
|
}
|
|
327
606
|
},
|
|
@@ -333,10 +612,13 @@ export default defineComponent({
|
|
|
333
612
|
formStore,
|
|
334
613
|
vForm,
|
|
335
614
|
productConditionsForm,
|
|
615
|
+
additionalTerms,
|
|
336
616
|
isCalculating,
|
|
337
617
|
isPanelLoading,
|
|
338
618
|
isPanelOpen,
|
|
619
|
+
isTermsPanelOpen,
|
|
339
620
|
panelValue,
|
|
621
|
+
termValue,
|
|
340
622
|
panelList,
|
|
341
623
|
searchQuery,
|
|
342
624
|
whichSum,
|
|
@@ -348,12 +630,29 @@ export default defineComponent({
|
|
|
348
630
|
isUnderwriterForm,
|
|
349
631
|
insurancePremiumPerMonth,
|
|
350
632
|
requestedSumInsured,
|
|
633
|
+
isRecalculationDisabled,
|
|
634
|
+
isUnderwriterRole,
|
|
635
|
+
hasProcessIndexRate,
|
|
636
|
+
hasPaymentPeriod,
|
|
637
|
+
hasRequestedSumInsuredInDollar,
|
|
638
|
+
hasInsurancePremiumPerMonthInDollar,
|
|
639
|
+
hasCurrency,
|
|
640
|
+
|
|
641
|
+
// Rules
|
|
642
|
+
coverPeriodRule,
|
|
351
643
|
|
|
352
644
|
// Functions
|
|
353
645
|
submitForm,
|
|
354
646
|
pickPanelValue,
|
|
647
|
+
pickTermValue,
|
|
355
648
|
openPanel,
|
|
649
|
+
openTermPanel,
|
|
356
650
|
pickCalculation,
|
|
651
|
+
underwriterCalculate,
|
|
652
|
+
onInputInsurancePremiumPerMonth,
|
|
653
|
+
onInputInsurancePremiumPerMonthInDollar,
|
|
654
|
+
onInputSum,
|
|
655
|
+
onInputSumDollar,
|
|
357
656
|
};
|
|
358
657
|
},
|
|
359
658
|
});
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
<v-form ref="vForm">
|
|
78
78
|
<base-rounded-input
|
|
79
79
|
v-model="phoneNumber"
|
|
80
|
-
|
|
80
|
+
:maska="$maska.phone"
|
|
81
81
|
:rules="$rules.required.concat($rules.phoneFormat)"
|
|
82
82
|
:label="$t('form.phoneNumber')"
|
|
83
83
|
placeholder="+7 7"
|
|
@@ -104,16 +104,6 @@ export default defineComponent({
|
|
|
104
104
|
const phoneNumber = ref<string | null>(formStore.policyholderForm.phoneNumber ?? '');
|
|
105
105
|
const selectedClient = ref<SignUrlType>();
|
|
106
106
|
|
|
107
|
-
watch(
|
|
108
|
-
() => dataStore.panelAction,
|
|
109
|
-
val => {
|
|
110
|
-
if (!!val) {
|
|
111
|
-
dataStore.panel.title = buttonText.value!;
|
|
112
|
-
dataStore.panel.open = true;
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
);
|
|
116
|
-
|
|
117
107
|
const openSmsPanel = (signInfo: SignUrlType) => {
|
|
118
108
|
if (signInfo) {
|
|
119
109
|
isSendNumberOpen.value = true;
|
|
@@ -138,8 +128,10 @@ export default defineComponent({
|
|
|
138
128
|
switch (dataStore.panelAction) {
|
|
139
129
|
case constants.actions.pay:
|
|
140
130
|
await dataStore.sendSMS('PayUrl', phoneNumber.value, formStore.epayLink);
|
|
131
|
+
break;
|
|
141
132
|
case constants.actions.sign:
|
|
142
133
|
await dataStore.sendSMS('SignUrl', phoneNumber.value, selectedClient.value?.uri);
|
|
134
|
+
break;
|
|
143
135
|
default:
|
|
144
136
|
await handleTask();
|
|
145
137
|
}
|
|
@@ -170,6 +162,16 @@ export default defineComponent({
|
|
|
170
162
|
}
|
|
171
163
|
});
|
|
172
164
|
|
|
165
|
+
watch(
|
|
166
|
+
() => dataStore.panelAction,
|
|
167
|
+
val => {
|
|
168
|
+
if (!!val) {
|
|
169
|
+
dataStore.panel.title = buttonText.value!;
|
|
170
|
+
dataStore.panel.open = true;
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
{ immediate: true },
|
|
174
|
+
);
|
|
173
175
|
const sendingActions = computed(
|
|
174
176
|
() => dataStore.panelAction === constants.actions.reject || dataStore.panelAction === constants.actions.return || dataStore.panelAction === constants.actions.rejectclient,
|
|
175
177
|
);
|