hl-core 0.0.10-beta.36 → 0.0.10-beta.37
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<section class="flex flex-col gap-4 px-[10px]" :class="[$styles.scrollPage]">
|
|
2
|
+
<section v-if="!isLoading" class="flex flex-col gap-4 px-[10px]" :class="[$styles.scrollPage]">
|
|
3
3
|
<v-form ref="vForm" @submit="submitForm">
|
|
4
4
|
<base-message-block
|
|
5
5
|
v-if="isCalculator"
|
|
@@ -526,7 +526,7 @@
|
|
|
526
526
|
:readonly="isDisabled || formStore.applicationData.processCode !== 25"
|
|
527
527
|
:label="$dataStore.t('pension.pensionAmount')"
|
|
528
528
|
/>
|
|
529
|
-
<base-form-input :value="
|
|
529
|
+
<base-form-input :value="$dataStore.getNumberWithSpaces(pensionForm.payment)" :active="true" readonly :label="$dataStore.t('pension.pensionPayment')" />
|
|
530
530
|
</base-form-section>
|
|
531
531
|
</section>
|
|
532
532
|
<base-form-section v-if="hasAnnuityPayments" :title="$dataStore.t('calculationAnnuityPayments')">
|
|
@@ -843,6 +843,7 @@
|
|
|
843
843
|
</div>
|
|
844
844
|
</Teleport>
|
|
845
845
|
</section>
|
|
846
|
+
<div v-if="isLoading" class="w-full h-[80dvh] flex items-center justify-center"><base-loader :size="50" /></div>
|
|
846
847
|
</template>
|
|
847
848
|
|
|
848
849
|
<script lang="ts">
|
|
@@ -882,6 +883,7 @@ export default defineComponent({
|
|
|
882
883
|
const isPanelLoading = ref<boolean>(false);
|
|
883
884
|
const isPanelOpen = ref<boolean>(false);
|
|
884
885
|
const isTermsPanelOpen = ref<boolean>(false);
|
|
886
|
+
const isLoading = ref<boolean>(false);
|
|
885
887
|
const panelValue = ref<Value>(new Value());
|
|
886
888
|
const termValue = ref<AddCover>();
|
|
887
889
|
const subTermValue = ref<string>('');
|
|
@@ -1320,7 +1322,6 @@ export default defineComponent({
|
|
|
1320
1322
|
const totalInsPremium = computed(() =>
|
|
1321
1323
|
dataStore.getNumberWithSpaces(formatSpacedNumber(formStore.pensionApp?.amount) + formatSpacedNumber(formStore.pensionApp.slave?.amount)),
|
|
1322
1324
|
);
|
|
1323
|
-
const pensionPayment = computed(() => dataStore.getNumberWithSpaces(pensionForm.value.payment));
|
|
1324
1325
|
|
|
1325
1326
|
const getContragent = async () => {
|
|
1326
1327
|
const data = await dataStore.api.getContragentById(
|
|
@@ -1920,7 +1921,6 @@ export default defineComponent({
|
|
|
1920
1921
|
await dataStore.setApplication(data, true);
|
|
1921
1922
|
}
|
|
1922
1923
|
await dataStore.getApplicationData(String(route.params.taskId), false, false, false, true);
|
|
1923
|
-
pensionForm.value.payment = formStore.applicationData.pensionApp?.payment ?? 0;
|
|
1924
1924
|
dateOfBegin.value = reformatDate(formStore.applicationData.pensionApp.dateOfBegin);
|
|
1925
1925
|
} else {
|
|
1926
1926
|
if (whichSum.value === 'requestedSumInsured') {
|
|
@@ -1997,7 +1997,9 @@ export default defineComponent({
|
|
|
1997
1997
|
recalculationData.riskGroup = productConditionsForm.riskGroup?.id ? productConditionsForm.riskGroup.id : 1;
|
|
1998
1998
|
isCalculating.value = true;
|
|
1999
1999
|
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
2000
|
-
|
|
2000
|
+
const setApplicationData = dataStore.getConditionsData();
|
|
2001
|
+
const hasSetApplication = await dataStore.setApplication(setApplicationData);
|
|
2002
|
+
if (hasSetApplication) await dataStore.calculate(route.params.taskId as string);
|
|
2001
2003
|
additionalTerms.value = formStore.additionalInsuranceTerms;
|
|
2002
2004
|
} else {
|
|
2003
2005
|
await dataStore.reCalculate(formStore.applicationData.processInstanceId, recalculationData, route.params.taskId as string, whichSum.value);
|
|
@@ -2058,92 +2060,99 @@ export default defineComponent({
|
|
|
2058
2060
|
};
|
|
2059
2061
|
|
|
2060
2062
|
onMounted(async () => {
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
+
try {
|
|
2064
|
+
if (hasContragentData.value) await getContragent();
|
|
2065
|
+
if (props.isCalculator === true) {
|
|
2066
|
+
isLoading.value = true;
|
|
2067
|
+
if (dataStore.isCalculator) {
|
|
2068
|
+
clearFields();
|
|
2069
|
+
}
|
|
2070
|
+
if (whichProduct.value === 'gons') {
|
|
2071
|
+
formStore.isDisabled.productConditionsForm = false;
|
|
2072
|
+
dataStore.setFormsDisabled(false);
|
|
2073
|
+
}
|
|
2074
|
+
if (whichProduct.value !== 'lifetrip' && whichProduct.value !== 'pensionannuitynew') {
|
|
2075
|
+
if (
|
|
2076
|
+
(dataStore.isCalculator || route.params.taskId === '0' || fromIndexPage.value) &&
|
|
2077
|
+
productConditionsForm.requestedSumInsured === null &&
|
|
2078
|
+
productConditionsForm.insurancePremiumPerMonth === null
|
|
2079
|
+
) {
|
|
2080
|
+
// @ts-ignore
|
|
2081
|
+
const defaultData = await dataStore.getDefaultCalculationData(true, whichProduct.value);
|
|
2082
|
+
if (!defaultData) {
|
|
2083
|
+
dataStore.showToaster('error', 'Отсутствуют базовые данные');
|
|
2084
|
+
return;
|
|
2085
|
+
}
|
|
2086
|
+
formStore.additionalInsuranceTermsWithout = defaultData.addCovers;
|
|
2087
|
+
productConditionsForm.requestedSumInsured = defaultData.amount;
|
|
2088
|
+
productConditionsForm.insurancePremiumPerMonth = defaultData.premium;
|
|
2089
|
+
const indexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
|
|
2090
|
+
if (indexRate) productConditionsForm.processIndexRate = indexRate;
|
|
2091
|
+
const paymendPeriod = dataStore.processPaymentPeriod.find(i => i.id === defaultData.paymentPeriodId);
|
|
2092
|
+
if (paymendPeriod) productConditionsForm.paymentPeriod = paymendPeriod;
|
|
2093
|
+
if (defaultData.signDate) {
|
|
2094
|
+
productConditionsForm.signDate = reformatDate(defaultData.signDate);
|
|
2095
|
+
}
|
|
2096
|
+
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
2097
|
+
productConditionsForm.coverPeriod = defaultData.insTermInMonth ?? null;
|
|
2098
|
+
productConditionsForm.insurancePremiumPerMonth = null;
|
|
2099
|
+
}
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
additionalTerms.value = props.isCalculator ? formStore.additionalInsuranceTermsWithout : formStore.additionalInsuranceTerms;
|
|
2104
|
+
if (!!productConditionsForm.insurancePremiumPerMonth) {
|
|
2105
|
+
whichSum.value = 'insurancePremiumPerMonth';
|
|
2106
|
+
}
|
|
2107
|
+
if (!!productConditionsForm.requestedSumInsured) {
|
|
2108
|
+
whichSum.value = 'requestedSumInsured';
|
|
2109
|
+
}
|
|
2110
|
+
if ((whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') && !productConditionsForm.requestedSumInsured) {
|
|
2111
|
+
whichSum.value = 'requestedSumInsured';
|
|
2112
|
+
}
|
|
2063
2113
|
if (dataStore.isCalculator) {
|
|
2064
|
-
|
|
2114
|
+
dataStore.processCode = constants.products[whichProduct.value as keyof typeof constants.products];
|
|
2115
|
+
await dataStore.getProcessPaymentPeriod();
|
|
2065
2116
|
}
|
|
2066
|
-
if (whichProduct.value === 'gons') {
|
|
2067
|
-
|
|
2068
|
-
dataStore.setFormsDisabled(false);
|
|
2117
|
+
if (whichProduct.value === 'halykkazyna' || whichProduct.value === 'gons') {
|
|
2118
|
+
await dataStore.getCurrencies();
|
|
2069
2119
|
}
|
|
2070
|
-
if (whichProduct.value
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
productConditionsForm.requestedSumInsured === null &&
|
|
2074
|
-
productConditionsForm.insurancePremiumPerMonth === null
|
|
2075
|
-
) {
|
|
2076
|
-
// @ts-ignore
|
|
2077
|
-
const defaultData = await dataStore.getDefaultCalculationData(true, whichProduct.value);
|
|
2078
|
-
if (!defaultData) {
|
|
2079
|
-
dataStore.showToaster('error', 'Отсутствуют базовые данные');
|
|
2080
|
-
return;
|
|
2081
|
-
}
|
|
2082
|
-
formStore.additionalInsuranceTermsWithout = defaultData.addCovers;
|
|
2083
|
-
productConditionsForm.requestedSumInsured = defaultData.amount;
|
|
2084
|
-
productConditionsForm.insurancePremiumPerMonth = defaultData.premium;
|
|
2085
|
-
const indexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
|
|
2086
|
-
if (indexRate) productConditionsForm.processIndexRate = indexRate;
|
|
2087
|
-
const paymendPeriod = dataStore.processPaymentPeriod.find(i => i.id === defaultData.paymentPeriodId);
|
|
2088
|
-
if (paymendPeriod) productConditionsForm.paymentPeriod = paymendPeriod;
|
|
2089
|
-
if (defaultData.signDate) {
|
|
2090
|
-
productConditionsForm.signDate = reformatDate(defaultData.signDate);
|
|
2091
|
-
}
|
|
2092
|
-
if (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns') {
|
|
2093
|
-
productConditionsForm.coverPeriod = defaultData.insTermInMonth ?? null;
|
|
2094
|
-
productConditionsForm.insurancePremiumPerMonth = null;
|
|
2095
|
-
}
|
|
2096
|
-
}
|
|
2120
|
+
if (whichProduct.value === 'halykkazyna') {
|
|
2121
|
+
const kazynaPaymentPeriod = dataStore.processPaymentPeriod.find(i => i.code === 'single');
|
|
2122
|
+
if (kazynaPaymentPeriod) productConditionsForm.paymentPeriod = kazynaPaymentPeriod;
|
|
2097
2123
|
}
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
return sum + Number(i.insSum);
|
|
2124
|
-
}, 0),
|
|
2125
|
-
);
|
|
2126
|
-
}
|
|
2127
|
-
if (whichProduct.value === 'pensionannuitynew') {
|
|
2128
|
-
contractDate.value = reformatDate(pensionForm.value.contractDate ?? '');
|
|
2129
|
-
dateOfBegin.value = reformatDate(pensionForm.value.dateOfBegin);
|
|
2130
|
-
transferContractDate.value = reformatDate(pensionForm.value.transferContractDate);
|
|
2131
|
-
transferContractFirstPaymentDate.value = reformatDate(pensionForm.value.transferContractFirstPaymentDate ?? '');
|
|
2132
|
-
maxDate.value = await dataStore.getVariableData(formStore.applicationData.processCode ?? 19);
|
|
2133
|
-
if (!transferContracts.value.length && pensionForm.value.transferContracts && pensionForm.value.transferContracts.length) {
|
|
2134
|
-
pensionForm.value.transferContracts.forEach((contract: TransferContract) => {
|
|
2135
|
-
transferContracts.value.push({
|
|
2136
|
-
...contract,
|
|
2137
|
-
transferContractDate: constants.regex.isoDate.test(contract.transferContractDate) ? reformatDate(contract.transferContractDate)! : contract.transferContractDate,
|
|
2138
|
-
transferContractFirstPaymentDate: constants.regex.isoDate.test(contract.transferContractFirstPaymentDate)
|
|
2139
|
-
? reformatDate(contract.transferContractFirstPaymentDate)!
|
|
2140
|
-
: contract.transferContractFirstPaymentDate,
|
|
2141
|
-
transferContractCompany:
|
|
2142
|
-
typeof contract.transferContractCompany === 'string' ? ({ nameRu: contract.transferContractCompany } as any) : contract.transferContractCompany,
|
|
2143
|
-
transferContractAmount: dataStore.getNumberWithSpaces(contract.transferContractAmount) ?? '',
|
|
2124
|
+
if (!formStore.lfb.add && (whichProduct.value === 'lifebusiness' || whichProduct.value === 'gns')) {
|
|
2125
|
+
productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(
|
|
2126
|
+
formStore.lfb.clients.reduce((sum: number, i: any) => {
|
|
2127
|
+
return sum + Number(i.insSum);
|
|
2128
|
+
}, 0),
|
|
2129
|
+
);
|
|
2130
|
+
}
|
|
2131
|
+
if (whichProduct.value === 'pensionannuitynew') {
|
|
2132
|
+
contractDate.value = reformatDate(pensionForm.value.contractDate ?? '');
|
|
2133
|
+
dateOfBegin.value = reformatDate(pensionForm.value.dateOfBegin);
|
|
2134
|
+
transferContractDate.value = reformatDate(pensionForm.value.transferContractDate);
|
|
2135
|
+
transferContractFirstPaymentDate.value = reformatDate(pensionForm.value.transferContractFirstPaymentDate ?? '');
|
|
2136
|
+
maxDate.value = await dataStore.getVariableData(formStore.applicationData.processCode ?? 19);
|
|
2137
|
+
if (!transferContracts.value.length && pensionForm.value.transferContracts && pensionForm.value.transferContracts.length) {
|
|
2138
|
+
pensionForm.value.transferContracts.forEach((contract: TransferContract) => {
|
|
2139
|
+
transferContracts.value.push({
|
|
2140
|
+
...contract,
|
|
2141
|
+
transferContractDate: constants.regex.isoDate.test(contract.transferContractDate) ? reformatDate(contract.transferContractDate)! : contract.transferContractDate,
|
|
2142
|
+
transferContractFirstPaymentDate: constants.regex.isoDate.test(contract.transferContractFirstPaymentDate)
|
|
2143
|
+
? reformatDate(contract.transferContractFirstPaymentDate)!
|
|
2144
|
+
: contract.transferContractFirstPaymentDate,
|
|
2145
|
+
transferContractCompany:
|
|
2146
|
+
typeof contract.transferContractCompany === 'string' ? ({ nameRu: contract.transferContractCompany } as any) : contract.transferContractCompany,
|
|
2147
|
+
transferContractAmount: dataStore.getNumberWithSpaces(contract.transferContractAmount) ?? '',
|
|
2148
|
+
});
|
|
2144
2149
|
});
|
|
2145
|
-
}
|
|
2150
|
+
}
|
|
2146
2151
|
}
|
|
2152
|
+
} catch (err) {
|
|
2153
|
+
console.log(err);
|
|
2154
|
+
} finally {
|
|
2155
|
+
isLoading.value = false;
|
|
2147
2156
|
}
|
|
2148
2157
|
});
|
|
2149
2158
|
|
|
@@ -2310,6 +2319,7 @@ export default defineComponent({
|
|
|
2310
2319
|
// State
|
|
2311
2320
|
formStore,
|
|
2312
2321
|
vForm,
|
|
2322
|
+
isLoading,
|
|
2313
2323
|
whichProduct,
|
|
2314
2324
|
productConditionsForm,
|
|
2315
2325
|
additionalTerms,
|
|
@@ -2350,7 +2360,6 @@ export default defineComponent({
|
|
|
2350
2360
|
// Computed
|
|
2351
2361
|
isTask,
|
|
2352
2362
|
isDisabled,
|
|
2353
|
-
pensionPayment,
|
|
2354
2363
|
disabilityGroup,
|
|
2355
2364
|
totalInsPremium,
|
|
2356
2365
|
isTermsDisabled,
|
|
@@ -895,7 +895,7 @@ export default defineComponent({
|
|
|
895
895
|
for (let sign of signOptions.value.signIds) {
|
|
896
896
|
const response = await dataStore.nclayerSign(sign.id, signType, file[0].fileType === 43);
|
|
897
897
|
if (response === null) {
|
|
898
|
-
dataStore.showToaster('error', 'Ошибка при
|
|
898
|
+
dataStore.showToaster('error', 'Ошибка при подключении к приложению «NCALayer». Убедитесь, что запустили приложение «NCALayer»', 10000);
|
|
899
899
|
break;
|
|
900
900
|
}
|
|
901
901
|
if (!response) break;
|