hl-core 0.0.10-beta.3 → 0.0.10-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/base.api.ts +259 -190
- package/api/interceptors.ts +3 -5
- package/components/Complex/TextBlock.vue +2 -0
- package/components/Dialog/Dialog.vue +7 -1
- package/components/Dialog/FamilyDialog.vue +2 -0
- package/components/Form/DigitalDocument.vue +52 -0
- package/components/Form/DynamicForm.vue +1 -0
- package/components/Form/FormData.vue +1 -0
- package/components/Form/ManagerAttachment.vue +18 -8
- package/components/Form/ProductConditionsBlock.vue +12 -6
- package/components/Input/DynamicInput.vue +2 -0
- package/components/Input/FormInput.vue +2 -0
- package/components/Input/OtpInput.vue +25 -0
- package/components/Input/PanelInput.vue +1 -0
- package/components/Input/RoundedInput.vue +2 -0
- package/components/Input/RoundedSelect.vue +4 -0
- package/components/Input/SwitchInput.vue +2 -0
- package/components/Input/TextInput.vue +2 -0
- package/components/Layout/Drawer.vue +2 -0
- package/components/Pages/Anketa.vue +166 -167
- package/components/Pages/Auth.vue +2 -0
- package/components/Pages/ContragentForm.vue +2 -1
- package/components/Pages/Documents.vue +244 -6
- package/components/Pages/MemberForm.vue +276 -96
- package/components/Pages/ProductConditions.vue +275 -96
- package/components/Panel/PanelHandler.vue +236 -108
- package/components/Transitions/Animation.vue +2 -0
- package/components/Utilities/Chip.vue +3 -1
- package/components/Utilities/JsonViewer.vue +1 -2
- package/composables/classes.ts +117 -42
- package/composables/constants.ts +33 -0
- package/composables/fields.ts +6 -4
- package/composables/index.ts +243 -7
- package/composables/styles.ts +8 -24
- package/configs/pwa.ts +1 -7
- package/layouts/clear.vue +1 -1
- package/layouts/default.vue +1 -1
- package/layouts/full.vue +1 -1
- package/locales/ru.json +34 -10
- package/nuxt.config.ts +10 -13
- package/package.json +13 -12
- package/plugins/head.ts +2 -1
- package/store/data.store.ts +380 -389
- package/store/member.store.ts +3 -2
- package/store/rules.ts +19 -0
- package/tsconfig.json +3 -0
- package/types/enum.ts +19 -2
- package/types/env.d.ts +2 -2
- package/types/form.ts +71 -74
- package/types/index.ts +916 -873
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<section class="flex flex-col gap-4 px-[10px]">
|
|
3
|
-
<v-form ref="vForm" @submit="submitForm"
|
|
2
|
+
<section class="flex flex-col gap-4 px-[10px]" :class="[$styles.scrollPage]">
|
|
3
|
+
<v-form ref="vForm" @submit="submitForm">
|
|
4
4
|
<base-message-block
|
|
5
5
|
v-if="isCalculator"
|
|
6
6
|
class="mt-4"
|
|
@@ -36,7 +36,14 @@
|
|
|
36
36
|
<base-form-input v-model="formStore.policyholderForm.gender.nameRu" class="mb-4" :label="$dataStore.t('form.gender')" :readonly="true" />
|
|
37
37
|
</base-form-section>
|
|
38
38
|
<base-form-section
|
|
39
|
-
v-if="
|
|
39
|
+
v-if="
|
|
40
|
+
isUnderwriterRole &&
|
|
41
|
+
$dataStore.members.insuredApp.has === true &&
|
|
42
|
+
whichProduct !== 'lifebusiness' &&
|
|
43
|
+
whichProduct !== 'gns' &&
|
|
44
|
+
whichProduct !== 'pensionannuitynew' &&
|
|
45
|
+
whichProduct !== 'lifetrip'
|
|
46
|
+
"
|
|
40
47
|
:title="$dataStore.t('insuredForm')"
|
|
41
48
|
>
|
|
42
49
|
<div v-for="(insured, index) of formStore.insuredForm" :key="index">
|
|
@@ -49,7 +56,7 @@
|
|
|
49
56
|
</div>
|
|
50
57
|
</base-form-section>
|
|
51
58
|
<base-form-section
|
|
52
|
-
v-if="isUnderwriterRole && whichProduct !== 'lifebusiness' && whichProduct !== 'gns' && whichProduct !== 'pensionannuitynew'"
|
|
59
|
+
v-if="isUnderwriterRole && whichProduct !== 'lifebusiness' && whichProduct !== 'gns' && whichProduct !== 'pensionannuitynew' && whichProduct !== 'balam'"
|
|
53
60
|
:title="$dataStore.t('recalculationInfo')"
|
|
54
61
|
>
|
|
55
62
|
<base-form-input
|
|
@@ -145,14 +152,25 @@
|
|
|
145
152
|
@append="openPanel($dataStore.t('form.gender'), $dataStore.gender, 'gender')"
|
|
146
153
|
/>
|
|
147
154
|
</div>
|
|
155
|
+
<base-panel-input
|
|
156
|
+
v-if="hasCurrency"
|
|
157
|
+
v-model="productConditionsForm.currency"
|
|
158
|
+
:value="productConditionsForm.currency.nameRu"
|
|
159
|
+
:readonly="isDisabled"
|
|
160
|
+
:clearable="!isDisabled"
|
|
161
|
+
:label="$dataStore.t('agent.currency')"
|
|
162
|
+
:rules="$rules.objectRequired"
|
|
163
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
164
|
+
@append="openPanel($dataStore.t('agent.currency'), currencyListFiltered, 'currency')"
|
|
165
|
+
/>
|
|
148
166
|
<base-form-input
|
|
149
167
|
v-if="hasInsStartDate"
|
|
150
168
|
v-model="productConditionsForm.calcDate"
|
|
151
169
|
:maska="$maska.date"
|
|
152
|
-
:readonly="
|
|
153
|
-
:clearable="!
|
|
170
|
+
:readonly="isDisabledInsStartDate"
|
|
171
|
+
:clearable="!isDisabledInsStartDate"
|
|
154
172
|
:label="$dataStore.t('labels.insuranceStartDate')"
|
|
155
|
-
:rules="$rules.required"
|
|
173
|
+
:rules="formStore.lfb.add ? $rules.required : $rules.required.concat($rules.checkPastDate)"
|
|
156
174
|
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
157
175
|
/>
|
|
158
176
|
<base-form-input
|
|
@@ -178,8 +196,8 @@
|
|
|
178
196
|
v-if="hasPaymentPeriod"
|
|
179
197
|
v-model="productConditionsForm.paymentPeriod"
|
|
180
198
|
:value="productConditionsForm.paymentPeriod?.nameRu"
|
|
181
|
-
:readonly="
|
|
182
|
-
:clearable="!
|
|
199
|
+
:readonly="isDisabledPaymentPeriod"
|
|
200
|
+
:clearable="!isDisabledPaymentPeriod"
|
|
183
201
|
:rules="$rules.objectRequired"
|
|
184
202
|
:label="$dataStore.t('productConditionsForm.processPaymentPeriod')"
|
|
185
203
|
append-inner-icon="mdi mdi-chevron-right"
|
|
@@ -249,10 +267,10 @@
|
|
|
249
267
|
@onClear="onClearPremiumDollar"
|
|
250
268
|
/>
|
|
251
269
|
<base-form-input
|
|
252
|
-
v-if="
|
|
270
|
+
v-if="hasCurrencySymbols && $dataStore.currencies.usd"
|
|
253
271
|
v-model="$dataStore.currencies.usd"
|
|
254
272
|
:readonly="true"
|
|
255
|
-
:label="
|
|
273
|
+
:label="currencySymbolsLabel"
|
|
256
274
|
:suffix="$constants.currencySymbols.kzt"
|
|
257
275
|
/>
|
|
258
276
|
<base-form-input
|
|
@@ -289,11 +307,18 @@
|
|
|
289
307
|
:label="$dataStore.t('productConditionsForm.agencyPart')"
|
|
290
308
|
:readonly="isDisabledAgentCommission"
|
|
291
309
|
:clearable="!isDisabledAgentCommission"
|
|
292
|
-
:rules="$rules.required.concat($rules.numbers, $rules.agentCommission)"
|
|
310
|
+
:rules="formStore.lfb.add ? $rules.required : $rules.required.concat($rules.numbers, $rules.agentCommission)"
|
|
293
311
|
/>
|
|
294
312
|
</base-form-section>
|
|
295
313
|
<section v-if="whichProduct === 'pensionannuitynew'">
|
|
296
|
-
<base-
|
|
314
|
+
<base-animation>
|
|
315
|
+
<base-btn
|
|
316
|
+
v-if="formStore.applicationData.processCode === 19 && !isDisabled"
|
|
317
|
+
:text="$dataStore.t('buttons.copyToClient')"
|
|
318
|
+
class="mt-4 min-h-[60px]"
|
|
319
|
+
@click="copyRedirect"
|
|
320
|
+
/>
|
|
321
|
+
</base-animation>
|
|
297
322
|
<base-form-section :title="$dataStore.t('pension.compulsoryAmount&Prof')">
|
|
298
323
|
<base-form-input
|
|
299
324
|
v-model="pensionCalculationParams.compulsoryContractAmount"
|
|
@@ -334,48 +359,43 @@
|
|
|
334
359
|
:label="$dataStore.t('pension.ownFundsRaisAmount')"
|
|
335
360
|
/>
|
|
336
361
|
</base-form-section>
|
|
337
|
-
<base-form-section :title="$dataStore.t('pension.companyName')">
|
|
338
|
-
<base-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
:clearable="!isDisabled"
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
:
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
:maska="$maska.numbers"
|
|
375
|
-
:label="$dataStore.t('pension.transferContractAmount')"
|
|
376
|
-
:rules="pensionForm.transferContractCompany?.ids ? $rules.required : []"
|
|
377
|
-
/>
|
|
378
|
-
<base-form-toggle v-model="pensionForm.transferContractIsOppv" :disabled="isDisabled" :has-border="false" :title="$dataStore.t('pension.isOPPVTransfer')" />
|
|
362
|
+
<base-form-section v-if="formStore.applicationData.processCode !== 2 && !isDisabled" :title="$dataStore.t('pension.companyName')">
|
|
363
|
+
<base-btn :text="$dataStore.t('buttons.add')" size="sm" :btn="$styles.blueBtn" @click="addTransferContract" />
|
|
364
|
+
<section v-for="(contract, index) in transferContracts" class="py-2">
|
|
365
|
+
<base-panel-input
|
|
366
|
+
v-model="contract.transferContractCompany"
|
|
367
|
+
:value="contract.transferContractCompany?.nameRu"
|
|
368
|
+
:label="$dataStore.t('pension.transferContractCompany')"
|
|
369
|
+
:readonly="isDisabled"
|
|
370
|
+
:clearable="!isDisabled"
|
|
371
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
372
|
+
@append="
|
|
373
|
+
openPanel($dataStore.t('pension.transferContractCompany'), $dataStore.transferContractCompanies, 'transferContractCompany', $dataStore.getInsuranceCompanies)
|
|
374
|
+
"
|
|
375
|
+
@click="contractIndex = index"
|
|
376
|
+
/>
|
|
377
|
+
<base-form-input
|
|
378
|
+
v-model="contract.transferContractDate"
|
|
379
|
+
:maska="$maska.date"
|
|
380
|
+
:label="$dataStore.t('pension.contractDate')"
|
|
381
|
+
:readonly="isDisabled"
|
|
382
|
+
:clearable="!isDisabled"
|
|
383
|
+
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
384
|
+
/>
|
|
385
|
+
<base-form-input v-model="contract.transferContractNumber" :label="$dataStore.t('pension.globalId')" :readonly="isDisabled" :clearable="!isDisabled" />
|
|
386
|
+
<base-form-input v-model="contract.transferContractRegNumber" :label="$dataStore.t('pension.transferRegNumber')" :readonly="isDisabled" :clearable="!isDisabled" />
|
|
387
|
+
<base-form-input
|
|
388
|
+
v-model="contract.transferContractFirstPaymentDate"
|
|
389
|
+
:maska="$maska.date"
|
|
390
|
+
:label="$dataStore.t('pension.transferContractFirstPaymentDate')"
|
|
391
|
+
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
392
|
+
:readonly="isDisabled"
|
|
393
|
+
:clearable="!isDisabled"
|
|
394
|
+
/>
|
|
395
|
+
<base-form-input v-model="contract.transferContractAmount" :maska="$maska.numbers" :label="$dataStore.t('pension.transferContractAmount')" />
|
|
396
|
+
<base-form-toggle v-model="contract.transferContractIsOppv" :disabled="isDisabled" :has-border="false" :title="$dataStore.t('pension.isOPPVTransfer')" />
|
|
397
|
+
<base-btn :text="$dataStore.t('buttons.delete')" size="sm" :btn="$styles.whiteBtn" @click="removeTransferContract(index)" />
|
|
398
|
+
</section>
|
|
379
399
|
</base-form-section>
|
|
380
400
|
<base-form-section :title="$dataStore.t('pension.paymentTerms')">
|
|
381
401
|
<base-form-input
|
|
@@ -619,17 +639,46 @@
|
|
|
619
639
|
</div>
|
|
620
640
|
</base-form-section>
|
|
621
641
|
</v-form>
|
|
622
|
-
<base-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
642
|
+
<base-animation>
|
|
643
|
+
<base-btn
|
|
644
|
+
v-if="!$dataStore.isCalculator && isCalculator && hasCalculated"
|
|
645
|
+
:btn="$styles.greenLightBtn"
|
|
646
|
+
:text="$dataStore.t('buttons.toStatement')"
|
|
647
|
+
class="min-h-[60px]"
|
|
648
|
+
@click="toStatement"
|
|
649
|
+
/>
|
|
650
|
+
</base-animation>
|
|
651
|
+
<base-animation>
|
|
652
|
+
<base-btn
|
|
653
|
+
v-if="!isDisabled && $dataStore.isPension && isTask"
|
|
654
|
+
:text="$dataStore.t('buttons.save')"
|
|
655
|
+
:loading="$dataStore.isLoading"
|
|
656
|
+
class="min-h-[60px]"
|
|
657
|
+
type="submit"
|
|
658
|
+
@click="submitForm"
|
|
659
|
+
/>
|
|
660
|
+
</base-animation>
|
|
661
|
+
<base-animation>
|
|
662
|
+
<base-btn
|
|
663
|
+
v-if="$dataStore.isCalculator ? true : !isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter()) && !$dataStore.isPension"
|
|
664
|
+
:loading="isCalculating"
|
|
665
|
+
class="min-h-[60px]"
|
|
666
|
+
:text="$dataStore.t('buttons.calculate')"
|
|
667
|
+
@click="submitForm"
|
|
668
|
+
/>
|
|
669
|
+
</base-animation>
|
|
630
670
|
<div v-if="$dataStore.isTask() && $dataStore.isUnderwriter() && !isRecalculationDisabled" class="flex gap-3">
|
|
631
|
-
<base-
|
|
632
|
-
|
|
671
|
+
<base-animation>
|
|
672
|
+
<base-btn
|
|
673
|
+
v-if="hasCalcSum"
|
|
674
|
+
class="min-h-[60px]"
|
|
675
|
+
:text="$dataStore.t('buttons.calcSum')"
|
|
676
|
+
type="submit"
|
|
677
|
+
@click.prevent="underwriterCalculate('sum')"
|
|
678
|
+
:loading="isCalculating"
|
|
679
|
+
/>
|
|
680
|
+
</base-animation>
|
|
681
|
+
<base-btn class="min-h-[60px]" :text="$dataStore.t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
|
|
633
682
|
</div>
|
|
634
683
|
<Teleport v-if="isPanelOpen" to="#right-panel-actions">
|
|
635
684
|
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
@@ -695,7 +744,8 @@
|
|
|
695
744
|
</template>
|
|
696
745
|
|
|
697
746
|
<script lang="ts">
|
|
698
|
-
import { Member, Value, CountryValue, CalculatorForm } from '../../composables/classes';
|
|
747
|
+
import { Member, Value, CountryValue, CalculatorForm, TransferContract } from '../../composables/classes';
|
|
748
|
+
import type { Projects, AddCover, AddCoverAnswer } from '../../types';
|
|
699
749
|
|
|
700
750
|
export default defineComponent({
|
|
701
751
|
props: {
|
|
@@ -745,6 +795,9 @@ export default defineComponent({
|
|
|
745
795
|
const pensionForm = formStore.applicationData?.pensionApp ?? undefined;
|
|
746
796
|
const isEnpfSum = (formStore.applicationData?.isEnpfSum ?? false) && useEnv().isProduction;
|
|
747
797
|
|
|
798
|
+
const transferContracts = ref<TransferContract[]>([]);
|
|
799
|
+
const contractsValue = ref<Value[]>([]);
|
|
800
|
+
const contractIndex = ref<number>(0);
|
|
748
801
|
const isMultiplePanelOpen = ref<boolean>(false);
|
|
749
802
|
const multiplePanelValue = ref<CountryValue>(new CountryValue());
|
|
750
803
|
const multiplePanelList = ref<CountryValue[]>([]);
|
|
@@ -768,6 +821,9 @@ export default defineComponent({
|
|
|
768
821
|
if (whichProduct.value === 'gons') {
|
|
769
822
|
return true;
|
|
770
823
|
}
|
|
824
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
825
|
+
return true;
|
|
826
|
+
}
|
|
771
827
|
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && dataStore.isUnderwriter()) {
|
|
772
828
|
return false;
|
|
773
829
|
}
|
|
@@ -777,7 +833,9 @@ export default defineComponent({
|
|
|
777
833
|
const isTask = computed(() => (route.params.taskId === '0' && props.isCalculator === true) || dataStore.isTask() || fromIndexPage.value);
|
|
778
834
|
const isRecalculationDisabled = computed(() => formStore.isDisabled.recalculationForm || formStore.canBeClaimed === true);
|
|
779
835
|
const isUnderwriterRole = computed(() => dataStore.isUnderwriter() || dataStore.isAdmin() || dataStore.isSupport());
|
|
780
|
-
const insurancePremiumPerMonthRule = computed(() =>
|
|
836
|
+
const insurancePremiumPerMonthRule = computed(() =>
|
|
837
|
+
!!productConditionsForm.insurancePremiumPerMonth ? (whichProduct.value === 'gons' ? dataStore.rules.required : dataStore.rules.required.concat(dataStore.rules.sums)) : [],
|
|
838
|
+
);
|
|
781
839
|
const insurancePremiumPerMonthDisabled = computed(() => {
|
|
782
840
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
783
841
|
return true;
|
|
@@ -787,7 +845,9 @@ export default defineComponent({
|
|
|
787
845
|
}
|
|
788
846
|
return isDisabled.value;
|
|
789
847
|
});
|
|
790
|
-
const requestedSumInsuredRule = computed(() =>
|
|
848
|
+
const requestedSumInsuredRule = computed(() =>
|
|
849
|
+
!!productConditionsForm.requestedSumInsured ? (whichProduct.value === 'gons' ? dataStore.rules.required : dataStore.rules.required.concat(dataStore.rules.sums)) : [],
|
|
850
|
+
);
|
|
791
851
|
const fixInsSumRule = computed(() =>
|
|
792
852
|
!!productConditionsForm.fixInsSum
|
|
793
853
|
? dataStore.rules.required.concat(dataStore.rules.sums, dataStore.rules.fixInsSumLimit(getNumber(productConditionsForm.fixInsSum as string), minInsSum.value))
|
|
@@ -807,7 +867,8 @@ export default defineComponent({
|
|
|
807
867
|
whichProduct.value === 'liferenta' ||
|
|
808
868
|
whichProduct.value === 'lifebusiness' ||
|
|
809
869
|
whichProduct.value === 'amuletlife' ||
|
|
810
|
-
whichProduct.value === 'gns'
|
|
870
|
+
whichProduct.value === 'gns' ||
|
|
871
|
+
whichProduct.value === 'balam'
|
|
811
872
|
) {
|
|
812
873
|
return false;
|
|
813
874
|
}
|
|
@@ -817,6 +878,9 @@ export default defineComponent({
|
|
|
817
878
|
if (whichProduct.value === 'halykkazyna') {
|
|
818
879
|
return false;
|
|
819
880
|
}
|
|
881
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
882
|
+
return false;
|
|
883
|
+
}
|
|
820
884
|
return true;
|
|
821
885
|
});
|
|
822
886
|
const hasCoverPeriod = computed(() => {
|
|
@@ -829,18 +893,27 @@ export default defineComponent({
|
|
|
829
893
|
if (whichProduct.value === 'halykkazyna') {
|
|
830
894
|
return true;
|
|
831
895
|
}
|
|
896
|
+
if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
|
|
897
|
+
return true;
|
|
898
|
+
}
|
|
832
899
|
return false;
|
|
833
900
|
});
|
|
834
901
|
const hasInsurancePremiumPerMonthInDollar = computed(() => {
|
|
835
902
|
if (whichProduct.value === 'halykkazyna') {
|
|
836
903
|
return true;
|
|
837
904
|
}
|
|
905
|
+
if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
|
|
906
|
+
return true;
|
|
907
|
+
}
|
|
838
908
|
return false;
|
|
839
909
|
});
|
|
840
|
-
const
|
|
910
|
+
const hasCurrencySymbols = computed(() => {
|
|
841
911
|
if (whichProduct.value === 'halykkazyna') {
|
|
842
912
|
return true;
|
|
843
913
|
}
|
|
914
|
+
if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
|
|
915
|
+
return true;
|
|
916
|
+
}
|
|
844
917
|
return false;
|
|
845
918
|
});
|
|
846
919
|
const hasAdbMultiply = computed(() => {
|
|
@@ -926,6 +999,9 @@ export default defineComponent({
|
|
|
926
999
|
if (whichProduct.value === 'halykkazyna') {
|
|
927
1000
|
return dataStore.t('productConditionsForm.requestedSumInsuredInTenge');
|
|
928
1001
|
}
|
|
1002
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1003
|
+
return dataStore.t('productConditionsForm.amountRefunded');
|
|
1004
|
+
}
|
|
929
1005
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
930
1006
|
return dataStore.t('productConditionsForm.totalRequestedSumInsured');
|
|
931
1007
|
}
|
|
@@ -938,11 +1014,20 @@ export default defineComponent({
|
|
|
938
1014
|
return dataStore.t('productConditionsForm.coverPeriod');
|
|
939
1015
|
});
|
|
940
1016
|
const insurancePremiumPerMonthLabel = computed(() => {
|
|
1017
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1018
|
+
return dataStore.t('productConditionsForm.amountPaid');
|
|
1019
|
+
}
|
|
941
1020
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
942
1021
|
return dataStore.t('productConditionsForm.totalInsurancePremiumAmountWithCommission');
|
|
943
1022
|
}
|
|
944
1023
|
return dataStore.t('productConditionsForm.insurancePremiumAmount');
|
|
945
1024
|
});
|
|
1025
|
+
const currencySymbolsLabel = computed(() => {
|
|
1026
|
+
if (whichProduct.value === 'gons') {
|
|
1027
|
+
return dataStore.t('productConditionsForm.exchangeRateSettlementDate');
|
|
1028
|
+
}
|
|
1029
|
+
return dataStore.t('productConditionsForm.dollarExchangeRateNBRK');
|
|
1030
|
+
});
|
|
946
1031
|
const isDisabledFixInsSum = computed(() => {
|
|
947
1032
|
if (dataStore.isUnderwriter() && !isRecalculationDisabled.value) {
|
|
948
1033
|
return false;
|
|
@@ -990,11 +1075,20 @@ export default defineComponent({
|
|
|
990
1075
|
return true;
|
|
991
1076
|
});
|
|
992
1077
|
const isDisabledAgentCommission = computed(() => {
|
|
1078
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1079
|
+
return true;
|
|
1080
|
+
}
|
|
993
1081
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns' || dataStore.isUnderwriter()) {
|
|
994
1082
|
return false;
|
|
995
1083
|
}
|
|
996
1084
|
return isDisabled.value;
|
|
997
1085
|
});
|
|
1086
|
+
const isDisabledInsStartDate = computed(() => {
|
|
1087
|
+
if (formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1088
|
+
return true;
|
|
1089
|
+
}
|
|
1090
|
+
return isDisabled.value;
|
|
1091
|
+
});
|
|
998
1092
|
const hasCalcSum = computed(() => {
|
|
999
1093
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1000
1094
|
return false;
|
|
@@ -1002,7 +1096,7 @@ export default defineComponent({
|
|
|
1002
1096
|
return true;
|
|
1003
1097
|
});
|
|
1004
1098
|
const hasFixInsSum = computed(() => {
|
|
1005
|
-
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1099
|
+
if (!formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1006
1100
|
return true;
|
|
1007
1101
|
}
|
|
1008
1102
|
return false;
|
|
@@ -1037,6 +1131,24 @@ export default defineComponent({
|
|
|
1037
1131
|
}
|
|
1038
1132
|
return false;
|
|
1039
1133
|
});
|
|
1134
|
+
const hasCurrency = computed(() => {
|
|
1135
|
+
if (whichProduct.value === 'gons') {
|
|
1136
|
+
return true;
|
|
1137
|
+
}
|
|
1138
|
+
return false;
|
|
1139
|
+
});
|
|
1140
|
+
const isDisabledPaymentPeriod = computed(() => {
|
|
1141
|
+
if (whichProduct.value === 'gons' && productConditionsForm.currency.code === 'USD') {
|
|
1142
|
+
return true;
|
|
1143
|
+
}
|
|
1144
|
+
return isDisabled.value;
|
|
1145
|
+
});
|
|
1146
|
+
const currencyListFiltered = computed(() => {
|
|
1147
|
+
if (useEnv().isProduction) {
|
|
1148
|
+
return constants.currencyList.filter(i => i.code !== 'USD');
|
|
1149
|
+
}
|
|
1150
|
+
return constants.currencyList;
|
|
1151
|
+
});
|
|
1040
1152
|
|
|
1041
1153
|
const pensionCalculationParams = ref({
|
|
1042
1154
|
compulsoryContractAmount: pensionForm && pensionForm.compulsoryContractAmount && pensionForm.compulsoryContractAmount != 0 ? pensionForm.compulsoryContractAmount : null,
|
|
@@ -1045,15 +1157,19 @@ export default defineComponent({
|
|
|
1045
1157
|
compulsoryProfContractAmount:
|
|
1046
1158
|
pensionForm && pensionForm.compulsoryProfContractAmount && pensionForm.compulsoryProfContractAmount != 0 ? pensionForm.compulsoryProfContractAmount : null,
|
|
1047
1159
|
transferContractAmount: pensionForm && pensionForm.transferContractAmount && pensionForm.transferContractAmount != 0 ? pensionForm.transferContractAmount : null,
|
|
1160
|
+
transferContractCompany: pensionForm && pensionForm.transferContractCompany ? pensionForm.transferContractCompany : null,
|
|
1048
1161
|
});
|
|
1049
1162
|
|
|
1163
|
+
const contractsAmount = computed(() => transferContracts.value?.reduce((accumulator, currentValue) => accumulator + currentValue.transferContractAmount, 0));
|
|
1164
|
+
|
|
1050
1165
|
const pensionAmount = computed(() =>
|
|
1051
1166
|
pensionCalculationParams.value
|
|
1052
1167
|
? (Number(pensionCalculationParams.value.compulsoryContractAmount) ?? 0) +
|
|
1053
1168
|
(Number(pensionCalculationParams.value.voluntaryContractAmount) ?? 0) +
|
|
1054
1169
|
(Number(pensionCalculationParams.value.ownFundsRaisAmount) ?? 0) +
|
|
1055
1170
|
(Number(pensionCalculationParams.value.compulsoryProfContractAmount) ?? 0) +
|
|
1056
|
-
(Number(pensionCalculationParams.value.transferContractAmount) ?? 0)
|
|
1171
|
+
(Number(pensionCalculationParams.value.transferContractAmount) ?? 0) +
|
|
1172
|
+
Number(contractsAmount.value)
|
|
1057
1173
|
: 0,
|
|
1058
1174
|
);
|
|
1059
1175
|
|
|
@@ -1068,7 +1184,7 @@ export default defineComponent({
|
|
|
1068
1184
|
const toStatement = async () => {
|
|
1069
1185
|
const statementItem = dataStore.menuItems.find(i => i.id === 'statement');
|
|
1070
1186
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1071
|
-
await router.push({ name: 'taskId-NewApp', params: route.params, query: { tab: 'statement' } });
|
|
1187
|
+
await router.push({ name: 'taskId-NewApp', params: route.params, query: { tab: 'statement', add: 'false' } });
|
|
1072
1188
|
return;
|
|
1073
1189
|
}
|
|
1074
1190
|
if (whichProduct.value === 'gons') {
|
|
@@ -1099,8 +1215,12 @@ export default defineComponent({
|
|
|
1099
1215
|
// @ts-ignore
|
|
1100
1216
|
calculatorForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
1101
1217
|
} else if (whichProduct.value === 'pensionannuitynew') {
|
|
1102
|
-
|
|
1103
|
-
|
|
1218
|
+
if (currentPanel.value === 'transferContractCompany') {
|
|
1219
|
+
transferContracts.value[contractIndex.value].transferContractCompany = item;
|
|
1220
|
+
} else {
|
|
1221
|
+
// @ts-ignore
|
|
1222
|
+
pensionForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
1223
|
+
}
|
|
1104
1224
|
} else {
|
|
1105
1225
|
// @ts-ignore
|
|
1106
1226
|
productConditionsForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
@@ -1330,7 +1450,7 @@ export default defineComponent({
|
|
|
1330
1450
|
const calculatedPremiumDollar = getNumber(event.target.value as string);
|
|
1331
1451
|
if (calculatedPremiumDollar) {
|
|
1332
1452
|
productConditionsForm.insurancePremiumPerMonth = dataStore.getNumberWithSpaces(productConditionsForm.insurancePremiumPerMonth);
|
|
1333
|
-
if (whichProduct.value === 'halykkazyna') {
|
|
1453
|
+
if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
|
|
1334
1454
|
if (typeof dataStore.currencies.usd === 'number') {
|
|
1335
1455
|
productConditionsForm.insurancePremiumPerMonthInDollar = dataStore.getNumberWithSpaces(calculatedPremiumDollar / dataStore.currencies.usd);
|
|
1336
1456
|
} else {
|
|
@@ -1358,7 +1478,7 @@ export default defineComponent({
|
|
|
1358
1478
|
const calculatedSumDollar = getNumber(event.target.value as string);
|
|
1359
1479
|
if (calculatedSumDollar) {
|
|
1360
1480
|
productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(productConditionsForm.requestedSumInsured);
|
|
1361
|
-
if (whichProduct.value === 'halykkazyna') {
|
|
1481
|
+
if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
|
|
1362
1482
|
if (typeof dataStore.currencies.usd === 'number') {
|
|
1363
1483
|
productConditionsForm.requestedSumInsuredInDollar = dataStore.getNumberWithSpaces(calculatedSumDollar / dataStore.currencies.usd);
|
|
1364
1484
|
} else {
|
|
@@ -1424,7 +1544,7 @@ export default defineComponent({
|
|
|
1424
1544
|
};
|
|
1425
1545
|
|
|
1426
1546
|
const filterTermConditions = (term: AddCover) => {
|
|
1427
|
-
if (term.coverTypeCode === 10) {
|
|
1547
|
+
if (term.coverTypeCode === 10 && !props.isCalculator) {
|
|
1428
1548
|
return !!formStore.insuredForm.find((member: Member) => member.iin === formStore.policyholderForm.iin) === false;
|
|
1429
1549
|
}
|
|
1430
1550
|
return true;
|
|
@@ -1437,6 +1557,14 @@ export default defineComponent({
|
|
|
1437
1557
|
return term.coverTypeName;
|
|
1438
1558
|
};
|
|
1439
1559
|
|
|
1560
|
+
const addTransferContract = () => {
|
|
1561
|
+
transferContracts.value.push(new TransferContract());
|
|
1562
|
+
};
|
|
1563
|
+
|
|
1564
|
+
const removeTransferContract = (index: number) => {
|
|
1565
|
+
transferContracts.value.splice(index, 1);
|
|
1566
|
+
};
|
|
1567
|
+
|
|
1440
1568
|
const submitForm = async () => {
|
|
1441
1569
|
vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
1442
1570
|
if (v.valid) {
|
|
@@ -1444,9 +1572,12 @@ export default defineComponent({
|
|
|
1444
1572
|
if (calculatorForm.type.code === 'Single' && calculatorForm.startDate && calculatorForm.endDate) {
|
|
1445
1573
|
const formattedStartDate = formatDate(calculatorForm.startDate);
|
|
1446
1574
|
const formattedEndDate = formatDate(calculatorForm.endDate);
|
|
1447
|
-
if (formattedStartDate && formattedEndDate && formattedStartDate.getTime()
|
|
1575
|
+
if (formattedStartDate && formattedEndDate && formattedStartDate.getTime() >= formattedEndDate.getTime()) {
|
|
1448
1576
|
return dataStore.showToaster('error', dataStore.t('toaster.startMoreEnd'));
|
|
1449
1577
|
}
|
|
1578
|
+
if (calculatorForm.days !== productConditionsForm.getSingleTripDays()) {
|
|
1579
|
+
return dataStore.showToaster('error', dataStore.t('toaster.daysPickAgain'));
|
|
1580
|
+
}
|
|
1450
1581
|
}
|
|
1451
1582
|
if (dataStore.isTask()) {
|
|
1452
1583
|
await dataStore.calculatePrice(route.params.taskId as string);
|
|
@@ -1454,15 +1585,21 @@ export default defineComponent({
|
|
|
1454
1585
|
await dataStore.calculatePrice();
|
|
1455
1586
|
}
|
|
1456
1587
|
} else if (whichProduct.value === 'pensionannuitynew') {
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1588
|
+
const formatedContracts: Array<TransferContract> = [];
|
|
1589
|
+
if (transferContracts.value && transferContracts.value.length) {
|
|
1590
|
+
transferContracts.value.forEach((i, index) => {
|
|
1591
|
+
const formatedContractDate = formatDate(transferContracts.value[index].transferContractDate);
|
|
1592
|
+
const formatedFirstPaymentDate = formatDate(transferContracts.value[index].transferContractFirstPaymentDate);
|
|
1593
|
+
const formatedNameRu = String(transferContracts.value[index].transferContractCompany?.nameRu);
|
|
1594
|
+
formatedContracts.push({
|
|
1595
|
+
...transferContracts.value[index],
|
|
1596
|
+
transferContractDate: formatedContractDate?.toISOString() ?? '',
|
|
1597
|
+
transferContractFirstPaymentDate: formatedFirstPaymentDate?.toISOString() ?? '',
|
|
1598
|
+
// @ts-ignore
|
|
1599
|
+
transferContractCompany: formatedNameRu,
|
|
1600
|
+
id: transferContracts.value[index].id ?? null,
|
|
1601
|
+
});
|
|
1602
|
+
});
|
|
1466
1603
|
}
|
|
1467
1604
|
const data = {
|
|
1468
1605
|
...pensionForm,
|
|
@@ -1473,22 +1610,21 @@ export default defineComponent({
|
|
|
1473
1610
|
ownFundsRaisAmount: Number(pensionCalculationParams.value.ownFundsRaisAmount),
|
|
1474
1611
|
compulsoryProfContractAmount: Number(pensionCalculationParams.value.compulsoryProfContractAmount),
|
|
1475
1612
|
transferContractAmount: Number(pensionCalculationParams.value.transferContractAmount),
|
|
1613
|
+
transferContractCompany: pensionForm?.transferContractCompany?.nameRu ?? '',
|
|
1476
1614
|
}),
|
|
1477
|
-
|
|
1478
|
-
transferContractDate: transferContractDate.value ? formatDate(transferContractDate.value) : null,
|
|
1479
|
-
transferContractFirstPaymentDate: transferContractFirstPaymentDate.value ? formatDate(transferContractFirstPaymentDate.value) : null,
|
|
1615
|
+
transferContracts: formatedContracts,
|
|
1480
1616
|
};
|
|
1481
1617
|
await dataStore.setApplication(data, true);
|
|
1482
1618
|
} else {
|
|
1483
1619
|
if (whichSum.value === 'requestedSumInsured') {
|
|
1484
1620
|
productConditionsForm.insurancePremiumPerMonth = null;
|
|
1485
|
-
if (whichProduct.value === 'halykkazyna') {
|
|
1621
|
+
if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
|
|
1486
1622
|
productConditionsForm.insurancePremiumPerMonthInDollar = null;
|
|
1487
1623
|
}
|
|
1488
1624
|
}
|
|
1489
1625
|
if (whichSum.value === 'insurancePremiumPerMonth') {
|
|
1490
1626
|
productConditionsForm.requestedSumInsured = null;
|
|
1491
|
-
if (whichProduct.value === 'halykkazyna') {
|
|
1627
|
+
if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
|
|
1492
1628
|
productConditionsForm.requestedSumInsuredInDollar = null;
|
|
1493
1629
|
}
|
|
1494
1630
|
}
|
|
@@ -1602,6 +1738,10 @@ export default defineComponent({
|
|
|
1602
1738
|
if (dataStore.isCalculator) {
|
|
1603
1739
|
clearFields();
|
|
1604
1740
|
}
|
|
1741
|
+
if (whichProduct.value === 'gons') {
|
|
1742
|
+
formStore.isDisabled.productConditionsForm = false;
|
|
1743
|
+
dataStore.setFormsDisabled(false);
|
|
1744
|
+
}
|
|
1605
1745
|
if (whichProduct.value !== 'lifetrip' && whichProduct.value !== 'pensionannuitynew') {
|
|
1606
1746
|
if (
|
|
1607
1747
|
(dataStore.isCalculator || route.params.taskId === '0' || fromIndexPage.value) &&
|
|
@@ -1645,12 +1785,14 @@ export default defineComponent({
|
|
|
1645
1785
|
dataStore.processCode = constants.products[whichProduct.value as keyof typeof constants.products];
|
|
1646
1786
|
await dataStore.getProcessPaymentPeriod();
|
|
1647
1787
|
}
|
|
1788
|
+
if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
|
|
1789
|
+
await dataStore.getCurrencies();
|
|
1790
|
+
}
|
|
1648
1791
|
if (whichProduct.value === 'halykkazyna') {
|
|
1649
1792
|
const kazynaPaymentPeriod = dataStore.processPaymentPeriod.find(i => i.code === 'single');
|
|
1650
1793
|
if (kazynaPaymentPeriod) productConditionsForm.paymentPeriod = kazynaPaymentPeriod;
|
|
1651
|
-
await dataStore.getCurrencies();
|
|
1652
1794
|
}
|
|
1653
|
-
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
1795
|
+
if (!formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
1654
1796
|
productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(
|
|
1655
1797
|
formStore.lfb.clients.reduce((sum: number, i: any) => {
|
|
1656
1798
|
return sum + Number(i.insSum);
|
|
@@ -1663,6 +1805,14 @@ export default defineComponent({
|
|
|
1663
1805
|
transferContractDate.value = reformatDate(formStore.applicationData.pensionApp.transferContractDate);
|
|
1664
1806
|
transferContractFirstPaymentDate.value = reformatDate(formStore.applicationData.pensionApp.transferContractFirstPaymentDate);
|
|
1665
1807
|
maxDate.value = await dataStore.getVariableData(formStore.applicationData.processCode ?? 19);
|
|
1808
|
+
if (transferContracts.value && transferContracts.value.length) {
|
|
1809
|
+
transferContracts.value = pensionForm.transferContracts?.map((contract: TransferContract) => {
|
|
1810
|
+
contract.transferContractDate = reformatDate(contract.transferContractDate)!;
|
|
1811
|
+
contract.transferContractFirstPaymentDate = reformatDate(contract.transferContractFirstPaymentDate)!;
|
|
1812
|
+
contract.transferContractCompany = { nameRu: contract.transferContractCompany } as any;
|
|
1813
|
+
return contract;
|
|
1814
|
+
});
|
|
1815
|
+
}
|
|
1666
1816
|
}
|
|
1667
1817
|
});
|
|
1668
1818
|
|
|
@@ -1696,6 +1846,23 @@ export default defineComponent({
|
|
|
1696
1846
|
{ immediate: true },
|
|
1697
1847
|
);
|
|
1698
1848
|
|
|
1849
|
+
if (hasCurrency.value) {
|
|
1850
|
+
watch(
|
|
1851
|
+
() => productConditionsForm.currency,
|
|
1852
|
+
async val => {
|
|
1853
|
+
if (val.code === 'USD') {
|
|
1854
|
+
if (!dataStore.processPaymentPeriod.length) {
|
|
1855
|
+
await dataStore.getProcessPaymentPeriod();
|
|
1856
|
+
}
|
|
1857
|
+
const paymentPeriod = dataStore.processPaymentPeriod.find(item => item.nameRu === 'единовременно');
|
|
1858
|
+
if (paymentPeriod) {
|
|
1859
|
+
productConditionsForm.paymentPeriod = paymentPeriod;
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
},
|
|
1863
|
+
);
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1699
1866
|
if (hasInsStartDate.value) {
|
|
1700
1867
|
watch(
|
|
1701
1868
|
() => productConditionsForm.calcDate,
|
|
@@ -1729,6 +1896,8 @@ export default defineComponent({
|
|
|
1729
1896
|
async val => {
|
|
1730
1897
|
if (val?.length && val.every(option => option.id != 0) && calculatorForm.type?.nameRu != null) {
|
|
1731
1898
|
await dataStore.getTripInsuredAmount();
|
|
1899
|
+
} else {
|
|
1900
|
+
calculatorForm.amount = new Value();
|
|
1732
1901
|
}
|
|
1733
1902
|
},
|
|
1734
1903
|
{ deep: true },
|
|
@@ -1763,7 +1932,7 @@ export default defineComponent({
|
|
|
1763
1932
|
}
|
|
1764
1933
|
|
|
1765
1934
|
const copyRedirect = async () => {
|
|
1766
|
-
const url = await dataStore.api.getEnpfRedirectUrl(String(formStore.applicationData.processInstanceId));
|
|
1935
|
+
const url = await dataStore.api.pensionannuityNew.getEnpfRedirectUrl(String(formStore.applicationData.processInstanceId));
|
|
1767
1936
|
dataStore.copyToClipboard(url.redirectUrl);
|
|
1768
1937
|
};
|
|
1769
1938
|
|
|
@@ -1800,12 +1969,19 @@ export default defineComponent({
|
|
|
1800
1969
|
maxDate,
|
|
1801
1970
|
guaranteedPeriodList,
|
|
1802
1971
|
isEnpfSum,
|
|
1972
|
+
transferContracts,
|
|
1973
|
+
contractsValue,
|
|
1974
|
+
contractIndex,
|
|
1803
1975
|
|
|
1804
1976
|
// Computed
|
|
1805
1977
|
isTask,
|
|
1806
1978
|
isDisabled,
|
|
1807
1979
|
isTermsDisabled,
|
|
1808
1980
|
isUnderwriterForm,
|
|
1981
|
+
hasCurrencySymbols,
|
|
1982
|
+
currencyListFiltered,
|
|
1983
|
+
currencySymbolsLabel,
|
|
1984
|
+
isDisabledPaymentPeriod,
|
|
1809
1985
|
insurancePremiumPerMonthRule,
|
|
1810
1986
|
insurancePremiumPerMonthDisabled,
|
|
1811
1987
|
requestedSumInsuredRule,
|
|
@@ -1839,6 +2015,7 @@ export default defineComponent({
|
|
|
1839
2015
|
hasDefault,
|
|
1840
2016
|
isShownAdditionalTerms,
|
|
1841
2017
|
hasCalcSum,
|
|
2018
|
+
isDisabledInsStartDate,
|
|
1842
2019
|
isDisabledAgentCommission,
|
|
1843
2020
|
hasFixInsSum,
|
|
1844
2021
|
isDisabledFixInsSum,
|
|
@@ -1882,6 +2059,8 @@ export default defineComponent({
|
|
|
1882
2059
|
pickSubTermValue,
|
|
1883
2060
|
onInputFixInsSum,
|
|
1884
2061
|
copyRedirect,
|
|
2062
|
+
addTransferContract,
|
|
2063
|
+
removeTransferContract,
|
|
1885
2064
|
};
|
|
1886
2065
|
},
|
|
1887
2066
|
});
|