hl-core 0.0.10-beta.20 → 0.0.10-beta.21
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 +140 -134
- package/components/Dialog/Dialog.vue +5 -1
- package/components/Form/ManagerAttachment.vue +1 -4
- package/components/Input/RoundedSelect.vue +2 -0
- package/components/Pages/Anketa.vue +164 -166
- package/components/Pages/Documents.vue +1 -1
- package/components/Pages/MemberForm.vue +166 -28
- package/components/Pages/ProductConditions.vue +143 -72
- package/components/Panel/PanelHandler.vue +223 -104
- package/composables/classes.ts +28 -0
- package/composables/styles.ts +3 -8
- package/locales/ru.json +8 -2
- package/package.json +1 -1
- package/store/data.store.ts +110 -102
- package/types/enum.ts +12 -0
- package/types/index.ts +42 -0
|
@@ -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"
|
|
@@ -300,7 +300,14 @@
|
|
|
300
300
|
/>
|
|
301
301
|
</base-form-section>
|
|
302
302
|
<section v-if="whichProduct === 'pensionannuitynew'">
|
|
303
|
-
<base-
|
|
303
|
+
<base-animation>
|
|
304
|
+
<base-btn
|
|
305
|
+
v-if="formStore.applicationData.processCode === 19 && !isDisabled"
|
|
306
|
+
:text="$dataStore.t('buttons.copyToClient')"
|
|
307
|
+
class="mt-4 min-h-[60px]"
|
|
308
|
+
@click="copyRedirect"
|
|
309
|
+
/>
|
|
310
|
+
</base-animation>
|
|
304
311
|
<base-form-section :title="$dataStore.t('pension.compulsoryAmount&Prof')">
|
|
305
312
|
<base-form-input
|
|
306
313
|
v-model="pensionCalculationParams.compulsoryContractAmount"
|
|
@@ -341,48 +348,43 @@
|
|
|
341
348
|
:label="$dataStore.t('pension.ownFundsRaisAmount')"
|
|
342
349
|
/>
|
|
343
350
|
</base-form-section>
|
|
344
|
-
<base-form-section :title="$dataStore.t('pension.companyName')">
|
|
345
|
-
<base-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
:clearable="!isDisabled"
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
:
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
:maska="$maska.numbers"
|
|
382
|
-
:label="$dataStore.t('pension.transferContractAmount')"
|
|
383
|
-
:rules="pensionForm.transferContractCompany?.ids ? $rules.required : []"
|
|
384
|
-
/>
|
|
385
|
-
<base-form-toggle v-model="pensionForm.transferContractIsOppv" :disabled="isDisabled" :has-border="false" :title="$dataStore.t('pension.isOPPVTransfer')" />
|
|
351
|
+
<base-form-section v-if="formStore.applicationData.processCode !== 2" :title="$dataStore.t('pension.companyName')">
|
|
352
|
+
<base-btn :text="$dataStore.t('buttons.add')" size="sm" :btn="$styles.blueBtn" @click="addTransferContract" />
|
|
353
|
+
<section v-for="(contract, index) in transferContracts" class="py-2">
|
|
354
|
+
<base-panel-input
|
|
355
|
+
v-model="contract.transferContractCompany"
|
|
356
|
+
:value="contract.transferContractCompany?.nameRu"
|
|
357
|
+
:label="$dataStore.t('pension.transferContractCompany')"
|
|
358
|
+
:readonly="isDisabled"
|
|
359
|
+
:clearable="!isDisabled"
|
|
360
|
+
append-inner-icon="mdi mdi-chevron-right"
|
|
361
|
+
@append="
|
|
362
|
+
openPanel($dataStore.t('pension.transferContractCompany'), $dataStore.transferContractCompanies, 'transferContractCompany', $dataStore.getInsuranceCompanies)
|
|
363
|
+
"
|
|
364
|
+
@click="contractIndex = index"
|
|
365
|
+
/>
|
|
366
|
+
<base-form-input
|
|
367
|
+
v-model="contract.transferContractDate"
|
|
368
|
+
:maska="$maska.date"
|
|
369
|
+
:label="$dataStore.t('pension.contractDate')"
|
|
370
|
+
:readonly="isDisabled"
|
|
371
|
+
:clearable="!isDisabled"
|
|
372
|
+
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
373
|
+
/>
|
|
374
|
+
<base-form-input v-model="contract.transferContractNumber" :label="$dataStore.t('pension.globalId')" :readonly="isDisabled" :clearable="!isDisabled" />
|
|
375
|
+
<base-form-input v-model="contract.transferContractRegNumber" :label="$dataStore.t('pension.transferRegNumber')" :readonly="isDisabled" :clearable="!isDisabled" />
|
|
376
|
+
<base-form-input
|
|
377
|
+
v-model="contract.transferContractFirstPaymentDate"
|
|
378
|
+
:maska="$maska.date"
|
|
379
|
+
:label="$dataStore.t('pension.transferContractFirstPaymentDate')"
|
|
380
|
+
append-inner-icon="mdi mdi-calendar-blank-outline"
|
|
381
|
+
:readonly="isDisabled"
|
|
382
|
+
:clearable="!isDisabled"
|
|
383
|
+
/>
|
|
384
|
+
<base-form-input v-model="contract.transferContractAmount" :maska="$maska.numbers" :label="$dataStore.t('pension.transferContractAmount')" />
|
|
385
|
+
<base-form-toggle v-model="contract.transferContractIsOppv" :disabled="isDisabled" :has-border="false" :title="$dataStore.t('pension.isOPPVTransfer')" />
|
|
386
|
+
<base-btn :text="$dataStore.t('buttons.delete')" size="sm" :btn="$styles.whiteBtn" @click="removeTransferContract(index)" />
|
|
387
|
+
</section>
|
|
386
388
|
</base-form-section>
|
|
387
389
|
<base-form-section :title="$dataStore.t('pension.paymentTerms')">
|
|
388
390
|
<base-form-input
|
|
@@ -626,17 +628,46 @@
|
|
|
626
628
|
</div>
|
|
627
629
|
</base-form-section>
|
|
628
630
|
</v-form>
|
|
629
|
-
<base-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
631
|
+
<base-animation>
|
|
632
|
+
<base-btn
|
|
633
|
+
v-if="!$dataStore.isCalculator && isCalculator && hasCalculated"
|
|
634
|
+
:btn="$styles.greenLightBtn"
|
|
635
|
+
:text="$dataStore.t('buttons.toStatement')"
|
|
636
|
+
class="min-h-[60px]"
|
|
637
|
+
@click="toStatement"
|
|
638
|
+
/>
|
|
639
|
+
</base-animation>
|
|
640
|
+
<base-animation>
|
|
641
|
+
<base-btn
|
|
642
|
+
v-if="!isDisabled && $dataStore.isPension && isTask"
|
|
643
|
+
:text="$dataStore.t('buttons.save')"
|
|
644
|
+
:loading="$dataStore.isLoading"
|
|
645
|
+
class="min-h-[60px]"
|
|
646
|
+
type="submit"
|
|
647
|
+
@click="submitForm"
|
|
648
|
+
/>
|
|
649
|
+
</base-animation>
|
|
650
|
+
<base-animation>
|
|
651
|
+
<base-btn
|
|
652
|
+
v-if="$dataStore.isCalculator ? true : !isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter()) && !$dataStore.isPension"
|
|
653
|
+
:loading="isCalculating"
|
|
654
|
+
class="min-h-[60px]"
|
|
655
|
+
:text="$dataStore.t('buttons.calculate')"
|
|
656
|
+
@click="submitForm"
|
|
657
|
+
/>
|
|
658
|
+
</base-animation>
|
|
637
659
|
<div v-if="$dataStore.isTask() && $dataStore.isUnderwriter() && !isRecalculationDisabled" class="flex gap-3">
|
|
638
|
-
<base-
|
|
639
|
-
|
|
660
|
+
<base-animation>
|
|
661
|
+
<base-btn
|
|
662
|
+
v-if="hasCalcSum"
|
|
663
|
+
class="min-h-[60px]"
|
|
664
|
+
:text="$dataStore.t('buttons.calcSum')"
|
|
665
|
+
type="submit"
|
|
666
|
+
@click.prevent="underwriterCalculate('sum')"
|
|
667
|
+
:loading="isCalculating"
|
|
668
|
+
/>
|
|
669
|
+
</base-animation>
|
|
670
|
+
<base-btn class="min-h-[60px]" :text="$dataStore.t('buttons.calcPremium')" type="submit" @click.prevent="underwriterCalculate('premium')" :loading="isCalculating" />
|
|
640
671
|
</div>
|
|
641
672
|
<Teleport v-if="isPanelOpen" to="#right-panel-actions">
|
|
642
673
|
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
@@ -702,7 +733,7 @@
|
|
|
702
733
|
</template>
|
|
703
734
|
|
|
704
735
|
<script lang="ts">
|
|
705
|
-
import { Member, Value, CountryValue, CalculatorForm } from '../../composables/classes';
|
|
736
|
+
import { Member, Value, CountryValue, CalculatorForm, TransferContract } from '../../composables/classes';
|
|
706
737
|
import type { Projects, AddCover, AddCoverAnswer } from '../../types';
|
|
707
738
|
|
|
708
739
|
export default defineComponent({
|
|
@@ -753,6 +784,9 @@ export default defineComponent({
|
|
|
753
784
|
const pensionForm = formStore.applicationData?.pensionApp ?? undefined;
|
|
754
785
|
const isEnpfSum = (formStore.applicationData?.isEnpfSum ?? false) && useEnv().isProduction;
|
|
755
786
|
|
|
787
|
+
const transferContracts = ref<TransferContract[]>([]);
|
|
788
|
+
const contractsValue = ref<Value[]>([]);
|
|
789
|
+
const contractIndex = ref<number>(0);
|
|
756
790
|
const isMultiplePanelOpen = ref<boolean>(false);
|
|
757
791
|
const multiplePanelValue = ref<CountryValue>(new CountryValue());
|
|
758
792
|
const multiplePanelList = ref<CountryValue[]>([]);
|
|
@@ -1053,15 +1087,19 @@ export default defineComponent({
|
|
|
1053
1087
|
compulsoryProfContractAmount:
|
|
1054
1088
|
pensionForm && pensionForm.compulsoryProfContractAmount && pensionForm.compulsoryProfContractAmount != 0 ? pensionForm.compulsoryProfContractAmount : null,
|
|
1055
1089
|
transferContractAmount: pensionForm && pensionForm.transferContractAmount && pensionForm.transferContractAmount != 0 ? pensionForm.transferContractAmount : null,
|
|
1090
|
+
transferContractCompany: pensionForm && pensionForm.transferContractCompany ? pensionForm.transferContractCompany : null,
|
|
1056
1091
|
});
|
|
1057
1092
|
|
|
1093
|
+
const contractsAmount = computed(() => transferContracts.value?.reduce((accumulator, currentValue) => accumulator + currentValue.transferContractAmount, 0));
|
|
1094
|
+
|
|
1058
1095
|
const pensionAmount = computed(() =>
|
|
1059
1096
|
pensionCalculationParams.value
|
|
1060
1097
|
? (Number(pensionCalculationParams.value.compulsoryContractAmount) ?? 0) +
|
|
1061
1098
|
(Number(pensionCalculationParams.value.voluntaryContractAmount) ?? 0) +
|
|
1062
1099
|
(Number(pensionCalculationParams.value.ownFundsRaisAmount) ?? 0) +
|
|
1063
1100
|
(Number(pensionCalculationParams.value.compulsoryProfContractAmount) ?? 0) +
|
|
1064
|
-
(Number(pensionCalculationParams.value.transferContractAmount) ?? 0)
|
|
1101
|
+
(Number(pensionCalculationParams.value.transferContractAmount) ?? 0) +
|
|
1102
|
+
Number(contractsAmount.value)
|
|
1065
1103
|
: 0,
|
|
1066
1104
|
);
|
|
1067
1105
|
|
|
@@ -1107,8 +1145,12 @@ export default defineComponent({
|
|
|
1107
1145
|
// @ts-ignore
|
|
1108
1146
|
calculatorForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
1109
1147
|
} else if (whichProduct.value === 'pensionannuitynew') {
|
|
1110
|
-
|
|
1111
|
-
|
|
1148
|
+
if (currentPanel.value === 'transferContractCompany') {
|
|
1149
|
+
transferContracts.value[contractIndex.value].transferContractCompany = item;
|
|
1150
|
+
} else {
|
|
1151
|
+
// @ts-ignore
|
|
1152
|
+
pensionForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
1153
|
+
}
|
|
1112
1154
|
} else {
|
|
1113
1155
|
// @ts-ignore
|
|
1114
1156
|
productConditionsForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
|
|
@@ -1445,6 +1487,14 @@ export default defineComponent({
|
|
|
1445
1487
|
return term.coverTypeName;
|
|
1446
1488
|
};
|
|
1447
1489
|
|
|
1490
|
+
const addTransferContract = () => {
|
|
1491
|
+
transferContracts.value.push(new TransferContract());
|
|
1492
|
+
};
|
|
1493
|
+
|
|
1494
|
+
const removeTransferContract = (index: number) => {
|
|
1495
|
+
transferContracts.value.splice(index, 1);
|
|
1496
|
+
};
|
|
1497
|
+
|
|
1448
1498
|
const submitForm = async () => {
|
|
1449
1499
|
vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
1450
1500
|
if (v.valid) {
|
|
@@ -1455,6 +1505,9 @@ export default defineComponent({
|
|
|
1455
1505
|
if (formattedStartDate && formattedEndDate && formattedStartDate.getTime() >= formattedEndDate.getTime()) {
|
|
1456
1506
|
return dataStore.showToaster('error', dataStore.t('toaster.startMoreEnd'));
|
|
1457
1507
|
}
|
|
1508
|
+
if (calculatorForm.days !== productConditionsForm.getSingleTripDays()) {
|
|
1509
|
+
return dataStore.showToaster('error', dataStore.t('toaster.daysPickAgain'));
|
|
1510
|
+
}
|
|
1458
1511
|
}
|
|
1459
1512
|
if (dataStore.isTask()) {
|
|
1460
1513
|
await dataStore.calculatePrice(route.params.taskId as string);
|
|
@@ -1462,15 +1515,21 @@ export default defineComponent({
|
|
|
1462
1515
|
await dataStore.calculatePrice();
|
|
1463
1516
|
}
|
|
1464
1517
|
} else if (whichProduct.value === 'pensionannuitynew') {
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1518
|
+
const formatedContracts: Array<TransferContract> = [];
|
|
1519
|
+
if (transferContracts.value && transferContracts.value.length) {
|
|
1520
|
+
transferContracts.value.forEach((i, index) => {
|
|
1521
|
+
const formatedContractDate = formatDate(transferContracts.value[index].transferContractDate);
|
|
1522
|
+
const formatedFirstPaymentDate = formatDate(transferContracts.value[index].transferContractFirstPaymentDate);
|
|
1523
|
+
const formatedNameRu = String(transferContracts.value[index].transferContractCompany?.nameRu);
|
|
1524
|
+
formatedContracts.push({
|
|
1525
|
+
...transferContracts.value[index],
|
|
1526
|
+
transferContractDate: formatedContractDate?.toISOString() ?? '',
|
|
1527
|
+
transferContractFirstPaymentDate: formatedFirstPaymentDate?.toISOString() ?? '',
|
|
1528
|
+
// @ts-ignore
|
|
1529
|
+
transferContractCompany: formatedNameRu,
|
|
1530
|
+
id: transferContracts.value[index].id ?? null,
|
|
1531
|
+
});
|
|
1532
|
+
});
|
|
1474
1533
|
}
|
|
1475
1534
|
const data = {
|
|
1476
1535
|
...pensionForm,
|
|
@@ -1481,10 +1540,9 @@ export default defineComponent({
|
|
|
1481
1540
|
ownFundsRaisAmount: Number(pensionCalculationParams.value.ownFundsRaisAmount),
|
|
1482
1541
|
compulsoryProfContractAmount: Number(pensionCalculationParams.value.compulsoryProfContractAmount),
|
|
1483
1542
|
transferContractAmount: Number(pensionCalculationParams.value.transferContractAmount),
|
|
1543
|
+
transferContractCompany: pensionForm?.transferContractCompany?.nameRu ?? '',
|
|
1484
1544
|
}),
|
|
1485
|
-
|
|
1486
|
-
transferContractDate: transferContractDate.value ? formatDate(transferContractDate.value) : null,
|
|
1487
|
-
transferContractFirstPaymentDate: transferContractFirstPaymentDate.value ? formatDate(transferContractFirstPaymentDate.value) : null,
|
|
1545
|
+
transferContracts: formatedContracts,
|
|
1488
1546
|
};
|
|
1489
1547
|
await dataStore.setApplication(data, true);
|
|
1490
1548
|
} else {
|
|
@@ -1671,6 +1729,14 @@ export default defineComponent({
|
|
|
1671
1729
|
transferContractDate.value = reformatDate(formStore.applicationData.pensionApp.transferContractDate);
|
|
1672
1730
|
transferContractFirstPaymentDate.value = reformatDate(formStore.applicationData.pensionApp.transferContractFirstPaymentDate);
|
|
1673
1731
|
maxDate.value = await dataStore.getVariableData(formStore.applicationData.processCode ?? 19);
|
|
1732
|
+
if (transferContracts.value && transferContracts.value.length) {
|
|
1733
|
+
transferContracts.value = pensionForm.transferContracts?.map((contract: TransferContract) => {
|
|
1734
|
+
contract.transferContractDate = reformatDate(contract.transferContractDate)!;
|
|
1735
|
+
contract.transferContractFirstPaymentDate = reformatDate(contract.transferContractFirstPaymentDate)!;
|
|
1736
|
+
contract.transferContractCompany = { nameRu: contract.transferContractCompany } as any;
|
|
1737
|
+
return contract;
|
|
1738
|
+
});
|
|
1739
|
+
}
|
|
1674
1740
|
}
|
|
1675
1741
|
});
|
|
1676
1742
|
|
|
@@ -1771,7 +1837,7 @@ export default defineComponent({
|
|
|
1771
1837
|
}
|
|
1772
1838
|
|
|
1773
1839
|
const copyRedirect = async () => {
|
|
1774
|
-
const url = await dataStore.api.getEnpfRedirectUrl(String(formStore.applicationData.processInstanceId));
|
|
1840
|
+
const url = await dataStore.api.pensionannuityNew.getEnpfRedirectUrl(String(formStore.applicationData.processInstanceId));
|
|
1775
1841
|
dataStore.copyToClipboard(url.redirectUrl);
|
|
1776
1842
|
};
|
|
1777
1843
|
|
|
@@ -1808,6 +1874,9 @@ export default defineComponent({
|
|
|
1808
1874
|
maxDate,
|
|
1809
1875
|
guaranteedPeriodList,
|
|
1810
1876
|
isEnpfSum,
|
|
1877
|
+
transferContracts,
|
|
1878
|
+
contractsValue,
|
|
1879
|
+
contractIndex,
|
|
1811
1880
|
|
|
1812
1881
|
// Computed
|
|
1813
1882
|
isTask,
|
|
@@ -1890,6 +1959,8 @@ export default defineComponent({
|
|
|
1890
1959
|
pickSubTermValue,
|
|
1891
1960
|
onInputFixInsSum,
|
|
1892
1961
|
copyRedirect,
|
|
1962
|
+
addTransferContract,
|
|
1963
|
+
removeTransferContract,
|
|
1893
1964
|
};
|
|
1894
1965
|
},
|
|
1895
1966
|
});
|