hl-core 0.0.10-beta.23 → 0.0.10-beta.25
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 +38 -5
- package/components/Pages/Anketa.vue +1 -1
- package/components/Pages/Documents.vue +15 -8
- package/components/Pages/MemberForm.vue +57 -27
- package/components/Pages/ProductConditions.vue +153 -30
- package/components/Panel/PanelHandler.vue +32 -14
- package/composables/classes.ts +8 -0
- package/composables/constants.ts +17 -0
- package/composables/index.ts +6 -1
- package/locales/ru.json +6 -2
- package/package.json +1 -1
- package/store/data.store.ts +246 -60
- package/store/member.store.ts +15 -4
- package/types/enum.ts +2 -0
package/locales/ru.json
CHANGED
|
@@ -143,7 +143,8 @@
|
|
|
143
143
|
"duplicateClient": "В списке присутствуют повторяющиеся клиенты",
|
|
144
144
|
"notParsedDocument": "Не удалось получить данные",
|
|
145
145
|
"errorOsns": "По данному БИН на дату заключения заявления не найден договор ОСНС. Просим проверить БИН Страхователя.",
|
|
146
|
-
"needDigDoc": "Нужно получить цифровой документ {text}"
|
|
146
|
+
"needDigDoc": "Нужно получить цифровой документ {text}",
|
|
147
|
+
"notDigDoc": "Выданный документ не найден"
|
|
147
148
|
},
|
|
148
149
|
"notSignedContract": "Неподписанный Договор",
|
|
149
150
|
"Contract": "Договор страхования",
|
|
@@ -394,6 +395,7 @@
|
|
|
394
395
|
"insurancePremiumAmount": "Размер Страховой премии (страховой взнос) в тенге",
|
|
395
396
|
"insurancePremiumAmountInDollar": "Размер Страховой премии (страховой взнос) в долларах",
|
|
396
397
|
"dollarExchangeRateNBRK": "Курс доллара НБРК",
|
|
398
|
+
"exchangeRateSettlementDate": "Курс на дату расчета (USD/KZT)",
|
|
397
399
|
"contractDate": "Дата контракта",
|
|
398
400
|
"guaranteedTermAnnuityPayments": "Гарантированный срок аннуитетных выплат",
|
|
399
401
|
"guaranteedPeriod": "Укажите период гарантированного срока",
|
|
@@ -583,7 +585,9 @@
|
|
|
583
585
|
"signInProcessManager": "Договор будет подписан в течение минуты",
|
|
584
586
|
"transferRegNumber": "Номер и серия договора",
|
|
585
587
|
"contragentSelect": "Выбор контрагента",
|
|
586
|
-
"fileError": "Ошибка прикрепления файла"
|
|
588
|
+
"fileError": "Ошибка прикрепления файла",
|
|
589
|
+
"parentContractNextPay": "Возврат с учетом очередной выплаты",
|
|
590
|
+
"parentContractNextPayDate": "Очередная выплата по графику"
|
|
587
591
|
},
|
|
588
592
|
"agent": {
|
|
589
593
|
"currency": "Валюта",
|
package/package.json
CHANGED
package/store/data.store.ts
CHANGED
|
@@ -279,39 +279,75 @@ export const useDataStore = defineStore('data', {
|
|
|
279
279
|
if (!file.id) return;
|
|
280
280
|
try {
|
|
281
281
|
this.isLoading = true;
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
282
|
+
if (this.isPension) {
|
|
283
|
+
await this.api.file.getFileNew(file.id).then((response: any) => {
|
|
284
|
+
if (!['pdf', 'docx'].includes(fileType)) {
|
|
285
|
+
const blob = new Blob([response], { type: `image/${fileType}` });
|
|
286
|
+
const url = window.URL.createObjectURL(blob);
|
|
287
|
+
const link = document.createElement('a');
|
|
288
|
+
link.href = url;
|
|
289
|
+
if (mode === 'view') {
|
|
290
|
+
setTimeout(() => {
|
|
291
|
+
window.open(url, '_blank', `width=${screen.width},height=${screen.height},top=70`);
|
|
292
|
+
});
|
|
293
|
+
} else {
|
|
294
|
+
link.setAttribute('download', file.fileName!);
|
|
295
|
+
document.body.appendChild(link);
|
|
296
|
+
link.click();
|
|
297
|
+
}
|
|
292
298
|
} else {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
link.click();
|
|
296
|
-
}
|
|
297
|
-
} else {
|
|
298
|
-
const blob = new Blob([response], {
|
|
299
|
-
type: `application/${fileType}`,
|
|
300
|
-
});
|
|
301
|
-
const url = window.URL.createObjectURL(blob);
|
|
302
|
-
const link = document.createElement('a');
|
|
303
|
-
link.href = url;
|
|
304
|
-
if (mode === 'view') {
|
|
305
|
-
setTimeout(() => {
|
|
306
|
-
window.open(url, '_blank', `right=100`);
|
|
299
|
+
const blob = new Blob([response], {
|
|
300
|
+
type: `application/${fileType}`,
|
|
307
301
|
});
|
|
302
|
+
const url = window.URL.createObjectURL(blob);
|
|
303
|
+
const link = document.createElement('a');
|
|
304
|
+
link.href = url;
|
|
305
|
+
if (mode === 'view') {
|
|
306
|
+
setTimeout(() => {
|
|
307
|
+
window.open(url, '_blank', `right=100`);
|
|
308
|
+
});
|
|
309
|
+
} else {
|
|
310
|
+
link.setAttribute('download', file.fileName!);
|
|
311
|
+
document.body.appendChild(link);
|
|
312
|
+
link.click();
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
} else {
|
|
317
|
+
await this.api.file.getFile(file.id).then((response: any) => {
|
|
318
|
+
if (!['pdf', 'docx'].includes(fileType)) {
|
|
319
|
+
const blob = new Blob([response], { type: `image/${fileType}` });
|
|
320
|
+
const url = window.URL.createObjectURL(blob);
|
|
321
|
+
const link = document.createElement('a');
|
|
322
|
+
link.href = url;
|
|
323
|
+
if (mode === 'view') {
|
|
324
|
+
setTimeout(() => {
|
|
325
|
+
window.open(url, '_blank', `width=${screen.width},height=${screen.height},top=70`);
|
|
326
|
+
});
|
|
327
|
+
} else {
|
|
328
|
+
link.setAttribute('download', file.fileName!);
|
|
329
|
+
document.body.appendChild(link);
|
|
330
|
+
link.click();
|
|
331
|
+
}
|
|
308
332
|
} else {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
333
|
+
const blob = new Blob([response], {
|
|
334
|
+
type: `application/${fileType}`,
|
|
335
|
+
});
|
|
336
|
+
const url = window.URL.createObjectURL(blob);
|
|
337
|
+
const link = document.createElement('a');
|
|
338
|
+
link.href = url;
|
|
339
|
+
if (mode === 'view') {
|
|
340
|
+
setTimeout(() => {
|
|
341
|
+
window.open(url, '_blank', `right=100`);
|
|
342
|
+
});
|
|
343
|
+
} else {
|
|
344
|
+
link.setAttribute('download', file.fileName!);
|
|
345
|
+
document.body.appendChild(link);
|
|
346
|
+
link.click();
|
|
347
|
+
}
|
|
312
348
|
}
|
|
313
|
-
}
|
|
314
|
-
}
|
|
349
|
+
});
|
|
350
|
+
}
|
|
315
351
|
} catch (err) {
|
|
316
352
|
ErrorHandler(err);
|
|
317
353
|
} finally {
|
|
@@ -355,6 +391,7 @@ export const useDataStore = defineStore('data', {
|
|
|
355
391
|
lastName: '',
|
|
356
392
|
middleName: '',
|
|
357
393
|
iin: member.iin ? member.iin.replace(/-/g, '') : '',
|
|
394
|
+
birthDate: '',
|
|
358
395
|
};
|
|
359
396
|
const contragentResponse = await this.api.getContragent(queryData);
|
|
360
397
|
if (contragentResponse.totalItems > 0) {
|
|
@@ -376,11 +413,17 @@ export const useDataStore = defineStore('data', {
|
|
|
376
413
|
}
|
|
377
414
|
this.isLoading = false;
|
|
378
415
|
},
|
|
379
|
-
async getContragentById(id: number, whichForm: keyof typeof StoreMembers, load: boolean = true, whichIndex: number | null = null) {
|
|
416
|
+
async getContragentById(id: number, whichForm: keyof typeof StoreMembers | 'slaveInsuredForm', load: boolean = true, whichIndex: number | null = null) {
|
|
380
417
|
if (Number(id) === 0) return;
|
|
381
418
|
this.isLoading = load;
|
|
382
419
|
try {
|
|
383
|
-
const member =
|
|
420
|
+
const member =
|
|
421
|
+
this.isPension && whichForm === 'slaveInsuredForm'
|
|
422
|
+
? this.formStore.slaveInsuredForm
|
|
423
|
+
: whichIndex === null
|
|
424
|
+
? this.formStore[whichForm as Types.SingleMember]
|
|
425
|
+
: this.formStore[whichForm as Types.MultipleMember][whichIndex];
|
|
426
|
+
|
|
384
427
|
const contragentResponse = await this.api.getContragentById(id);
|
|
385
428
|
if (contragentResponse.totalItems > 0) {
|
|
386
429
|
await this.serializeContragentData(member, contragentResponse.items[0]);
|
|
@@ -854,6 +897,9 @@ export const useDataStore = defineStore('data', {
|
|
|
854
897
|
isIpdlCompliance: null,
|
|
855
898
|
isTerrorCompliance: null,
|
|
856
899
|
};
|
|
900
|
+
if (this.isPension && memberFromApplicaiton && memberFromApplicaiton.processInstanceId === this.formStore.applicationData.slave?.processInstanceId) {
|
|
901
|
+
data.processInstanceId = this.formStore.applicationData.slave.processInstanceId;
|
|
902
|
+
}
|
|
857
903
|
data.id = memberFromApplicaiton && memberFromApplicaiton.id ? memberFromApplicaiton.id : null;
|
|
858
904
|
if (whichMember === 'Client') {
|
|
859
905
|
data.isInsured = this.formStore.isPolicyholderInsured;
|
|
@@ -863,6 +909,12 @@ export const useDataStore = defineStore('data', {
|
|
|
863
909
|
data.jobName = member.jobPlace;
|
|
864
910
|
data.positionCode = member.positionCode;
|
|
865
911
|
data.familyStatusId = member.familyStatus.id;
|
|
912
|
+
if (this.isPension) {
|
|
913
|
+
data.id =
|
|
914
|
+
memberFromApplicaiton.processInstanceId === this.formStore.applicationData.processInstanceId
|
|
915
|
+
? this.formStore.applicationData.clientApp.id
|
|
916
|
+
: this.formStore.applicationData.slave.clientApp.id;
|
|
917
|
+
}
|
|
866
918
|
}
|
|
867
919
|
if (whichMember === 'Spokesman') {
|
|
868
920
|
if (!!memberFromApplicaiton && memberFromApplicaiton.iin !== data.iin) {
|
|
@@ -921,6 +973,12 @@ export const useDataStore = defineStore('data', {
|
|
|
921
973
|
data.familyStatusId = member.familyStatus.id;
|
|
922
974
|
data.relationId = member.relationDegree.ids;
|
|
923
975
|
data.relationName = member.relationDegree.nameRu;
|
|
976
|
+
if (this.isPension) {
|
|
977
|
+
data.id =
|
|
978
|
+
memberFromApplicaiton.processInstanceId === this.formStore.applicationData.processInstanceId
|
|
979
|
+
? this.formStore.applicationData.insuredApp[0].id
|
|
980
|
+
: this.formStore.applicationData.slave.insuredApp[0].id;
|
|
981
|
+
}
|
|
924
982
|
}
|
|
925
983
|
if (whichMember === 'Beneficiary') {
|
|
926
984
|
if (
|
|
@@ -965,10 +1023,20 @@ export const useDataStore = defineStore('data', {
|
|
|
965
1023
|
}
|
|
966
1024
|
}
|
|
967
1025
|
},
|
|
968
|
-
async setApplication(applicationData:
|
|
1026
|
+
async setApplication(applicationData: any, calculate: boolean = false) {
|
|
969
1027
|
try {
|
|
970
1028
|
this.isLoading = true;
|
|
971
1029
|
this.isButtonsLoading = true;
|
|
1030
|
+
if (this.isPension) {
|
|
1031
|
+
applicationData.transferContractCompany = '';
|
|
1032
|
+
if (applicationData.slave) {
|
|
1033
|
+
applicationData.slave.guaranteedPeriod = applicationData.slave.guaranteedPeriod ?? 0;
|
|
1034
|
+
applicationData.slave.transferContractCompany = '';
|
|
1035
|
+
}
|
|
1036
|
+
if (Number(this.formStore.applicationData.processCode) === 2) {
|
|
1037
|
+
applicationData.transferContractAmount = applicationData.parentContractAmount - applicationData.refundAmount;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
972
1040
|
await this.api.setApplication(applicationData);
|
|
973
1041
|
if (calculate) {
|
|
974
1042
|
await this.api.calculatePension(String(this.formStore.applicationData.processInstanceId));
|
|
@@ -1023,6 +1091,14 @@ export const useDataStore = defineStore('data', {
|
|
|
1023
1091
|
conditionsData.policyAppDto.amountInCurrency = getNumber(String(this.formStore.productConditionsForm.requestedSumInsuredInDollar));
|
|
1024
1092
|
conditionsData.policyAppDto.currencyExchangeRate = this.currencies.usd;
|
|
1025
1093
|
}
|
|
1094
|
+
if (this.isGons) {
|
|
1095
|
+
conditionsData.policyAppDto.premiumInCurrency =
|
|
1096
|
+
this.formStore.productConditionsForm.currency.code === 'KZT' ? null : getNumber(String(this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar));
|
|
1097
|
+
conditionsData.policyAppDto.amountInCurrency =
|
|
1098
|
+
this.formStore.productConditionsForm.currency.code === 'KZT' ? null : getNumber(String(this.formStore.productConditionsForm.requestedSumInsuredInDollar));
|
|
1099
|
+
conditionsData.policyAppDto.currencyExchangeRate = this.formStore.productConditionsForm.currency.code === 'KZT' ? null : this.currencies.usd;
|
|
1100
|
+
conditionsData.policyAppDto.currency = this.formStore.productConditionsForm.currency.code as string;
|
|
1101
|
+
}
|
|
1026
1102
|
if (this.isLiferenta) {
|
|
1027
1103
|
conditionsData.policyAppDto.guaranteedPaymentPeriod = this.formStore.productConditionsForm.guaranteedPeriod || 0;
|
|
1028
1104
|
conditionsData.policyAppDto.annuityTypeId = (this.formStore.productConditionsForm.typeAnnuityInsurance.id as string) ?? undefined;
|
|
@@ -1565,7 +1641,7 @@ export const useDataStore = defineStore('data', {
|
|
|
1565
1641
|
query.processCode = byOneProcess;
|
|
1566
1642
|
}
|
|
1567
1643
|
if (byOneProcess === 19 && !useEnv().isProduction) {
|
|
1568
|
-
query.processCodes = [19, 2];
|
|
1644
|
+
query.processCodes = [19, 2, 4];
|
|
1569
1645
|
delete query.processCode;
|
|
1570
1646
|
}
|
|
1571
1647
|
const taskList = await this.api.getTaskList(
|
|
@@ -1791,6 +1867,15 @@ export const useDataStore = defineStore('data', {
|
|
|
1791
1867
|
calculationData.amountInCurrency = getNumber(String(this.formStore.productConditionsForm.requestedSumInsuredInDollar));
|
|
1792
1868
|
calculationData.currencyExchangeRate = this.currencies.usd;
|
|
1793
1869
|
}
|
|
1870
|
+
if (this.isGons || product === 'gons') {
|
|
1871
|
+
calculationData.premiumInCurrency =
|
|
1872
|
+
this.formStore.productConditionsForm.currency.code === 'KZT' ? null : getNumber(String(this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar));
|
|
1873
|
+
calculationData.amountInCurrency =
|
|
1874
|
+
this.formStore.productConditionsForm.currency.code === 'KZT' ? null : getNumber(String(this.formStore.productConditionsForm.requestedSumInsuredInDollar));
|
|
1875
|
+
calculationData.currencyExchangeRate = this.formStore.productConditionsForm.currency.code === 'KZT' ? null : this.currencies.usd;
|
|
1876
|
+
|
|
1877
|
+
calculationData.currency = this.formStore.productConditionsForm.currency.code as string;
|
|
1878
|
+
}
|
|
1794
1879
|
if (this.isLiferenta || product === 'liferenta') {
|
|
1795
1880
|
calculationData.guaranteedPaymentPeriod = this.formStore.productConditionsForm.guaranteedPeriod || 0;
|
|
1796
1881
|
calculationData.annuityTypeId = (this.formStore.productConditionsForm.typeAnnuityInsurance.id as string) ?? undefined;
|
|
@@ -1809,10 +1894,15 @@ export const useDataStore = defineStore('data', {
|
|
|
1809
1894
|
calculationData.calcDate = formatDate(this.formStore.productConditionsForm.calcDate as string)!.toISOString();
|
|
1810
1895
|
}
|
|
1811
1896
|
const calculationResponse = await this.api.calculateWithoutApplication(calculationData, this.isCalculator ? product : undefined);
|
|
1812
|
-
if (calculationResponse.amount)
|
|
1813
|
-
|
|
1897
|
+
if (calculationResponse.amount)
|
|
1898
|
+
this.formStore.productConditionsForm.requestedSumInsured =
|
|
1899
|
+
this.isGons || product === 'gons' ? this.getNumberWithSpacesAfterComma(calculationResponse.amount) : this.getNumberWithSpaces(calculationResponse.amount);
|
|
1900
|
+
if (calculationResponse.premium)
|
|
1901
|
+
this.formStore.productConditionsForm.insurancePremiumPerMonth =
|
|
1902
|
+
this.isGons || product === 'gons' ? this.getNumberWithSpacesAfterComma(calculationResponse.premium) : this.getNumberWithSpaces(calculationResponse.premium);
|
|
1903
|
+
|
|
1814
1904
|
this.formStore.additionalInsuranceTermsWithout = calculationResponse.addCovers;
|
|
1815
|
-
if (this.isKazyna || product === 'halykkazyna') {
|
|
1905
|
+
if (this.isKazyna || product === 'halykkazyna' || this.isGons || product === 'gons') {
|
|
1816
1906
|
if (this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar != null) {
|
|
1817
1907
|
this.formStore.productConditionsForm.requestedSumInsuredInDollar = this.getNumberWithSpaces(calculationResponse.amountInCurrency);
|
|
1818
1908
|
} else {
|
|
@@ -1859,7 +1949,7 @@ export const useDataStore = defineStore('data', {
|
|
|
1859
1949
|
const applicationData = await this.api.getApplicationData(taskId);
|
|
1860
1950
|
this.formStore.applicationData = applicationData;
|
|
1861
1951
|
if (this.formStore.applicationData.addCoverDto) this.formStore.additionalInsuranceTerms = this.formStore.applicationData.addCoverDto;
|
|
1862
|
-
if (this.isKazyna && this.currencies.usd) {
|
|
1952
|
+
if ((this.isKazyna || this.isGons) && this.currencies.usd) {
|
|
1863
1953
|
if (this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar != null) {
|
|
1864
1954
|
this.formStore.productConditionsForm.requestedSumInsuredInDollar = this.getNumberWithSpaces(result.value / this.currencies.usd);
|
|
1865
1955
|
} else {
|
|
@@ -1867,11 +1957,15 @@ export const useDataStore = defineStore('data', {
|
|
|
1867
1957
|
}
|
|
1868
1958
|
}
|
|
1869
1959
|
if (this.formStore.productConditionsForm.insurancePremiumPerMonth != null) {
|
|
1870
|
-
this.formStore.productConditionsForm.requestedSumInsured = this.getNumberWithSpaces(result.value);
|
|
1871
|
-
this.formStore.productConditionsForm.insurancePremiumPerMonth = this.
|
|
1960
|
+
this.formStore.productConditionsForm.requestedSumInsured = this.isGons ? this.getNumberWithSpacesAfterComma(result.value) : this.getNumberWithSpaces(result.value);
|
|
1961
|
+
this.formStore.productConditionsForm.insurancePremiumPerMonth = this.isGons
|
|
1962
|
+
? this.getNumberWithSpacesAfterComma(applicationData.policyAppDto.premium)
|
|
1963
|
+
: this.getNumberWithSpaces(applicationData.policyAppDto.premium);
|
|
1872
1964
|
} else {
|
|
1873
|
-
this.formStore.productConditionsForm.insurancePremiumPerMonth = this.getNumberWithSpaces(result.value);
|
|
1874
|
-
this.formStore.productConditionsForm.requestedSumInsured = this.
|
|
1965
|
+
this.formStore.productConditionsForm.insurancePremiumPerMonth = this.isGons ? this.getNumberWithSpacesAfterComma(result.value) : this.getNumberWithSpaces(result.value);
|
|
1966
|
+
this.formStore.productConditionsForm.requestedSumInsured = this.isGons
|
|
1967
|
+
? this.getNumberWithSpacesAfterComma(applicationData.policyAppDto.amount)
|
|
1968
|
+
: this.getNumberWithSpaces(applicationData.policyAppDto.amount);
|
|
1875
1969
|
}
|
|
1876
1970
|
if (this.isLiferenta) {
|
|
1877
1971
|
this.formStore.productConditionsForm.amountAnnuityPayments = this.getNumberWithSpaces(applicationData.policyAppDto.annuityMonthPay);
|
|
@@ -1897,6 +1991,38 @@ export const useDataStore = defineStore('data', {
|
|
|
1897
1991
|
}
|
|
1898
1992
|
this.isLoading = false;
|
|
1899
1993
|
},
|
|
1994
|
+
async reCalculateRefund(insSum: number, insSumMain: number, guaranteedPeriod: number, isOppv: boolean, transferContractMonthCount: number) {
|
|
1995
|
+
this.isLoading = true;
|
|
1996
|
+
try {
|
|
1997
|
+
const data = {
|
|
1998
|
+
processInstanceId: this.formStore.applicationData.processInstanceId,
|
|
1999
|
+
insSum: insSum,
|
|
2000
|
+
insSumMain: insSumMain,
|
|
2001
|
+
guaranteedPeriod: guaranteedPeriod,
|
|
2002
|
+
isOppv: isOppv,
|
|
2003
|
+
transferContractMonthCount: transferContractMonthCount,
|
|
2004
|
+
};
|
|
2005
|
+
const response = await this.api.pensionannuityNew.reCalculateRefund(data);
|
|
2006
|
+
} catch (err) {
|
|
2007
|
+
ErrorHandler(err);
|
|
2008
|
+
}
|
|
2009
|
+
this.isLoading = false;
|
|
2010
|
+
},
|
|
2011
|
+
async calcParentContractSums(closeContractCompanyCode: string, closeContractCompanyName: string, isContractClosed: boolean) {
|
|
2012
|
+
this.isLoading = true;
|
|
2013
|
+
try {
|
|
2014
|
+
const data = {
|
|
2015
|
+
processInstanceId: this.formStore.applicationData.processInstanceId,
|
|
2016
|
+
closeContractCompanyCode: closeContractCompanyCode,
|
|
2017
|
+
closeContractCompanyName: closeContractCompanyName,
|
|
2018
|
+
isContractClosed: isContractClosed,
|
|
2019
|
+
};
|
|
2020
|
+
const response = await this.api.pensionannuityNew.calcParentContractSums(data);
|
|
2021
|
+
} catch (err) {
|
|
2022
|
+
ErrorHandler(err);
|
|
2023
|
+
}
|
|
2024
|
+
this.isLoading = false;
|
|
2025
|
+
},
|
|
1900
2026
|
async calculatePremium(data: any) {
|
|
1901
2027
|
this.isLoading = true;
|
|
1902
2028
|
try {
|
|
@@ -2005,6 +2131,7 @@ export const useDataStore = defineStore('data', {
|
|
|
2005
2131
|
|
|
2006
2132
|
const clientData = applicationData.clientApp;
|
|
2007
2133
|
const insuredData: any[] = applicationData.insuredApp;
|
|
2134
|
+
const slaveInsuredData: any = applicationData.slave?.insuredApp[0] ?? null;
|
|
2008
2135
|
const beneficiaryData: any[] = applicationData.beneficiaryApp;
|
|
2009
2136
|
const beneficialOwnerData: any[] = applicationData.beneficialOwnerApp;
|
|
2010
2137
|
const spokesmanData: any = applicationData.spokesmanApp;
|
|
@@ -2095,6 +2222,13 @@ export const useDataStore = defineStore('data', {
|
|
|
2095
2222
|
}
|
|
2096
2223
|
});
|
|
2097
2224
|
}
|
|
2225
|
+
if (slaveInsuredData) {
|
|
2226
|
+
allMembers.push({
|
|
2227
|
+
...slaveInsuredData,
|
|
2228
|
+
key: 'slaveInsuredForm',
|
|
2229
|
+
index: null,
|
|
2230
|
+
});
|
|
2231
|
+
}
|
|
2098
2232
|
if (beneficiaryData && beneficiaryData.length) {
|
|
2099
2233
|
beneficiaryData.forEach((member, index) => {
|
|
2100
2234
|
const inStore = this.formStore.beneficiaryForm.find(each => each.id == member.insisId);
|
|
@@ -2132,12 +2266,14 @@ export const useDataStore = defineStore('data', {
|
|
|
2132
2266
|
this.setMembersField(this.formStore.policyholderFormKey, 'clientApp');
|
|
2133
2267
|
if (insuredData && insuredData.length) {
|
|
2134
2268
|
insuredData.forEach((each, index) => {
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2269
|
+
if (each) {
|
|
2270
|
+
this.setMembersFieldIndex(this.formStore.insuredFormKey, 'insuredApp', index);
|
|
2271
|
+
const relationDegree = this.relations.find((i: Value) => i.ids == each.relationId);
|
|
2272
|
+
this.formStore.insuredForm[index].relationDegree = relationDegree ? relationDegree : new Value();
|
|
2273
|
+
}
|
|
2138
2274
|
});
|
|
2139
2275
|
}
|
|
2140
|
-
|
|
2276
|
+
if (slaveInsuredData) this.setMembersFieldSlave();
|
|
2141
2277
|
if (beneficiaryData && beneficiaryData.length) {
|
|
2142
2278
|
beneficiaryData.forEach((each, index) => {
|
|
2143
2279
|
this.setMembersFieldIndex(this.formStore.beneficiaryFormKey, 'beneficiaryApp', index);
|
|
@@ -2215,16 +2351,21 @@ export const useDataStore = defineStore('data', {
|
|
|
2215
2351
|
const paymentPeriod = this.processPaymentPeriod.find(item => item.id == applicationData.policyAppDto.paymentPeriodId);
|
|
2216
2352
|
this.formStore.productConditionsForm.paymentPeriod = paymentPeriod ? paymentPeriod : new Value();
|
|
2217
2353
|
|
|
2218
|
-
this.formStore.productConditionsForm.requestedSumInsured = this.
|
|
2219
|
-
applicationData.policyAppDto.amount === null ? null : applicationData.policyAppDto.amount
|
|
2220
|
-
|
|
2221
|
-
this.formStore.productConditionsForm.insurancePremiumPerMonth = this.
|
|
2222
|
-
applicationData.policyAppDto.premium === null ? null : applicationData.policyAppDto.premium
|
|
2223
|
-
|
|
2224
|
-
|
|
2354
|
+
this.formStore.productConditionsForm.requestedSumInsured = this.isGons
|
|
2355
|
+
? this.getNumberWithSpacesAfterComma(applicationData.policyAppDto.amount === null ? null : applicationData.policyAppDto.amount)
|
|
2356
|
+
: this.getNumberWithSpaces(applicationData.policyAppDto.amount === null ? null : applicationData.policyAppDto.amount);
|
|
2357
|
+
this.formStore.productConditionsForm.insurancePremiumPerMonth = this.isGons
|
|
2358
|
+
? this.getNumberWithSpacesAfterComma(applicationData.policyAppDto.premium === null ? null : applicationData.policyAppDto.premium)
|
|
2359
|
+
: this.getNumberWithSpaces(applicationData.policyAppDto.premium === null ? null : applicationData.policyAppDto.premium);
|
|
2360
|
+
|
|
2361
|
+
if (this.isKazyna || this.isGons) {
|
|
2225
2362
|
this.formStore.productConditionsForm.requestedSumInsuredInDollar = this.getNumberWithSpaces(applicationData.policyAppDto.amountInCurrency);
|
|
2226
2363
|
this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar = this.getNumberWithSpaces(applicationData.policyAppDto.premiumInCurrency);
|
|
2227
2364
|
}
|
|
2365
|
+
if (this.isGons) {
|
|
2366
|
+
const currency = constants.currencyList.find(item => item.code === applicationData.policyAppDto.currency);
|
|
2367
|
+
this.formStore.productConditionsForm.currency = currency ? currency : new Value();
|
|
2368
|
+
}
|
|
2228
2369
|
const riskGroup = this.riskGroup.find(item => {
|
|
2229
2370
|
if (applicationData.policyAppDto.riskGroup == 0) {
|
|
2230
2371
|
return true;
|
|
@@ -2402,6 +2543,34 @@ export const useDataStore = defineStore('data', {
|
|
|
2402
2543
|
this.formStore.applicationData.pensionApp.transferContractCompany = transferCompany ? transferCompany : new Value();
|
|
2403
2544
|
}
|
|
2404
2545
|
},
|
|
2546
|
+
setMembersFieldSlave() {
|
|
2547
|
+
this.formStore.slaveInsuredForm.familyStatus = this.findObject('familyStatuses', 'id', this.formStore.applicationData.slave['insuredApp'].familyStatusId);
|
|
2548
|
+
this.formStore.slaveInsuredForm.signOfIPDL = this.findObject(
|
|
2549
|
+
'ipdl',
|
|
2550
|
+
'nameRu',
|
|
2551
|
+
this.formStore.applicationData.slave.insuredApp[0].isIpdl === null ? null : this.formStore.applicationData.slave.insuredApp[0].isIpdl == true ? 'Да' : 'Нет',
|
|
2552
|
+
);
|
|
2553
|
+
if (!!this.formStore.applicationData.slave.insuredApp[0].profession) this.formStore.slaveInsuredForm.job = this.formStore.applicationData.slave.insuredApp[0].profession;
|
|
2554
|
+
if (!!this.formStore.applicationData.slave.insuredApp[0].position) this.formStore.slaveInsuredForm.jobPosition = this.formStore.applicationData.slave.insuredApp[0].position;
|
|
2555
|
+
if (!!this.formStore.applicationData.slave.insuredApp[0].jobName) this.formStore.slaveInsuredForm.jobPlace = this.formStore.applicationData.slave.insuredApp[0].jobName;
|
|
2556
|
+
if (!!this.formStore.applicationData.slave.insuredApp[0].positionCode)
|
|
2557
|
+
this.formStore.slaveInsuredForm.positionCode = this.formStore.applicationData.slave.insuredApp[0].positionCode;
|
|
2558
|
+
if (typeof this.formStore.applicationData.slave.insuredApp[0].isDisability === 'boolean')
|
|
2559
|
+
this.formStore.slaveInsuredForm.isDisability = this.formStore.applicationData.slave.insuredApp[0].isDisability;
|
|
2560
|
+
if (!!this.formStore.applicationData.slave.insuredApp[0].disabilityGroupId) {
|
|
2561
|
+
const disabilityGroup = this.disabilityGroups.find(i => i.id === this.formStore.applicationData.slave.insuredApp[0].disabilityGroupId);
|
|
2562
|
+
this.formStore.slaveInsuredForm.disabilityGroup = disabilityGroup ? disabilityGroup : new Value();
|
|
2563
|
+
}
|
|
2564
|
+
if (this.formStore.slaveInsuredForm.bankInfo) {
|
|
2565
|
+
this.formStore.slaveInsuredForm.bankInfo.iik = this.formStore.applicationData.slave.pensionApp.account;
|
|
2566
|
+
this.formStore.slaveInsuredForm.bankInfo.bik = this.formStore.applicationData.slave.pensionApp.bankBik;
|
|
2567
|
+
const bank = this.banks.find(i => i.ids === this.formStore.applicationData.slave.pensionApp.bankBin);
|
|
2568
|
+
const transferCompany = this.transferContractCompanies.find(i => i.nameRu === this.formStore.applicationData.slave.pensionApp.transferContractCompany);
|
|
2569
|
+
this.formStore.slaveInsuredForm.bankInfo.bankName = bank ? bank : new Value();
|
|
2570
|
+
this.formStore.slaveInsuredForm.bankInfo.bin = bank ? String(bank.ids) : '';
|
|
2571
|
+
this.formStore.applicationData.slave.pensionApp.transferContractCompany = transferCompany ? transferCompany : new Value();
|
|
2572
|
+
}
|
|
2573
|
+
},
|
|
2405
2574
|
setMembersFieldIndex(whichForm: Types.MultipleMember, whichMember: keyof typeof MemberAppCodes, index: number) {
|
|
2406
2575
|
if ('familyStatus' in this.formStore[whichForm][index]) {
|
|
2407
2576
|
this.formStore[whichForm][index].familyStatus = this.findObject('familyStatuses', 'id', this.formStore.applicationData[whichMember][index].familyStatusId);
|
|
@@ -2812,6 +2981,15 @@ export const useDataStore = defineStore('data', {
|
|
|
2812
2981
|
}
|
|
2813
2982
|
}
|
|
2814
2983
|
}
|
|
2984
|
+
} else if (applicationKey === 'slave') {
|
|
2985
|
+
if (this.formStore.slaveInsuredForm && this.formStore.applicationData.slave) {
|
|
2986
|
+
const localSlave = this.formStore.slaveInsuredForm;
|
|
2987
|
+
const applicationSlave = this.formStore.applicationData.slave.insuredApp[0];
|
|
2988
|
+
if ((localSlave.id === applicationSlave.insisId && applicationSlave.iin === localSlave.iin?.replace(/-/g, '')) === false) {
|
|
2989
|
+
this.showToaster('error', this.t('toaster.notSavedMember', { text: text }), 3000);
|
|
2990
|
+
return false;
|
|
2991
|
+
}
|
|
2992
|
+
}
|
|
2815
2993
|
} else {
|
|
2816
2994
|
if (this.formStore[localKey].some(i => i.iin !== null)) {
|
|
2817
2995
|
this.showToaster('error', this.t('toaster.notSavedMember', { text: text }), 3000);
|
|
@@ -2841,7 +3019,7 @@ export const useDataStore = defineStore('data', {
|
|
|
2841
3019
|
this.showToaster('error', this.t('toaster.notSavedMember', { text: 'страхователя' }), 3000);
|
|
2842
3020
|
return false;
|
|
2843
3021
|
}
|
|
2844
|
-
if (this.isInitiator() && this.isEfoParent && this.formStore.policyholderForm.iin && !policyholderDoc) {
|
|
3022
|
+
if (useEnv().isProduction && this.isInitiator() && this.isEfoParent && this.formStore.policyholderForm.iin && !policyholderDoc) {
|
|
2845
3023
|
this.showToaster('error', this.t('toaster.needDigDoc', { text: 'страхователя' }));
|
|
2846
3024
|
return false;
|
|
2847
3025
|
}
|
|
@@ -2857,6 +3035,9 @@ export const useDataStore = defineStore('data', {
|
|
|
2857
3035
|
}
|
|
2858
3036
|
}
|
|
2859
3037
|
}
|
|
3038
|
+
if (this.formStore.applicationData.slave && this.validateMultipleMembers(this.formStore.insuredFormKey, 'slave', 'застрахованных') === false) {
|
|
3039
|
+
return false;
|
|
3040
|
+
}
|
|
2860
3041
|
if (this.members.beneficiaryApp.has) {
|
|
2861
3042
|
if (this.validateMultipleMembers(this.formStore.beneficiaryFormKey, 'beneficiaryApp', 'выгодоприобретателей') === false) {
|
|
2862
3043
|
return false;
|
|
@@ -3697,27 +3878,32 @@ export const useDataStore = defineStore('data', {
|
|
|
3697
3878
|
|
|
3698
3879
|
return true;
|
|
3699
3880
|
},
|
|
3700
|
-
async
|
|
3881
|
+
async getOnlineAccess(iin: string, documentType: string) {
|
|
3701
3882
|
try {
|
|
3702
3883
|
const data = {
|
|
3703
3884
|
iinBin: iin.replaceAll('-', ''),
|
|
3704
3885
|
documentType: documentType,
|
|
3705
3886
|
};
|
|
3706
|
-
await this.api.externalServices.
|
|
3707
|
-
|
|
3887
|
+
const response = await this.api.externalServices.getOnlineAccess(data);
|
|
3888
|
+
if (response.code === 'PROFILE_DIGIDOCS_INTERNAL_ERROR') {
|
|
3889
|
+
this.showToaster('error', this.t('toaster.notDigDoc'), 3000);
|
|
3890
|
+
return false;
|
|
3891
|
+
} else {
|
|
3892
|
+
return true;
|
|
3893
|
+
}
|
|
3708
3894
|
} catch (err) {
|
|
3709
3895
|
ErrorHandler(err);
|
|
3710
3896
|
return null;
|
|
3711
3897
|
}
|
|
3712
3898
|
},
|
|
3713
|
-
async
|
|
3899
|
+
async getDigitalDocuments(iin: string, processInstanceId: string, code: string) {
|
|
3714
3900
|
try {
|
|
3715
3901
|
const data = {
|
|
3716
3902
|
iin: iin.replaceAll('-', ''),
|
|
3717
3903
|
processInstanceId: processInstanceId,
|
|
3718
3904
|
code: code.replace(/\s/g, ''),
|
|
3719
3905
|
};
|
|
3720
|
-
await this.api.externalServices.
|
|
3906
|
+
await this.api.externalServices.getDigitalDocuments(data);
|
|
3721
3907
|
return true;
|
|
3722
3908
|
} catch (err) {
|
|
3723
3909
|
ErrorHandler(err);
|
|
@@ -3801,7 +3987,7 @@ export const useDataStore = defineStore('data', {
|
|
|
3801
3987
|
}
|
|
3802
3988
|
},
|
|
3803
3989
|
hasBankSection(whichForm: keyof typeof StoreMembers) {
|
|
3804
|
-
if (!this.isPension) return false;
|
|
3990
|
+
if (!this.isPension || Number(this.formStore.applicationData.processCode) === 2) return false;
|
|
3805
3991
|
switch (whichForm) {
|
|
3806
3992
|
case 'beneficiaryForm':
|
|
3807
3993
|
return false;
|
|
@@ -3810,7 +3996,7 @@ export const useDataStore = defineStore('data', {
|
|
|
3810
3996
|
}
|
|
3811
3997
|
},
|
|
3812
3998
|
hasAdditionalDocumentsSection(whichForm: keyof typeof StoreMembers) {
|
|
3813
|
-
if (!this.isPension) return false;
|
|
3999
|
+
if (!this.isPension || Number(this.formStore.applicationData.processCode) === 2) return false;
|
|
3814
4000
|
switch (whichForm) {
|
|
3815
4001
|
case 'beneficiaryForm':
|
|
3816
4002
|
return false;
|
package/store/member.store.ts
CHANGED
|
@@ -62,7 +62,7 @@ export const useMemberStore = defineStore('members', {
|
|
|
62
62
|
}
|
|
63
63
|
return false;
|
|
64
64
|
},
|
|
65
|
-
getMemberFromStore(whichForm: keyof typeof StoreMembers, whichIndex?: number): Member | null {
|
|
65
|
+
getMemberFromStore(whichForm: keyof typeof StoreMembers | 'slaveInsuredForm', whichIndex?: number): Member | null {
|
|
66
66
|
switch (whichForm) {
|
|
67
67
|
case this.formStore.policyholderFormKey:
|
|
68
68
|
return this.formStore.policyholderForm;
|
|
@@ -70,6 +70,8 @@ export const useMemberStore = defineStore('members', {
|
|
|
70
70
|
return this.formStore.policyholdersRepresentativeForm;
|
|
71
71
|
case this.formStore.insuredFormKey:
|
|
72
72
|
return this.formStore.insuredForm[whichIndex!];
|
|
73
|
+
case 'slaveInsuredForm':
|
|
74
|
+
return this.formStore.slaveInsuredForm;
|
|
73
75
|
case this.formStore.beneficiaryFormKey:
|
|
74
76
|
return this.formStore.beneficiaryForm[whichIndex!];
|
|
75
77
|
case this.formStore.beneficialOwnerFormKey:
|
|
@@ -78,8 +80,11 @@ export const useMemberStore = defineStore('members', {
|
|
|
78
80
|
return null;
|
|
79
81
|
}
|
|
80
82
|
},
|
|
81
|
-
getMemberFromApplication(whichForm: keyof typeof StoreMembers, whichIndex?: number) {
|
|
82
|
-
const id =
|
|
83
|
+
getMemberFromApplication(whichForm: keyof typeof StoreMembers | 'slaveInsuredForm', whichIndex?: number) {
|
|
84
|
+
const id =
|
|
85
|
+
whichForm !== 'policyholderForm' && whichForm !== 'policyholdersRepresentativeForm' && whichForm !== 'slaveInsuredForm'
|
|
86
|
+
? this.formStore[whichForm][whichIndex!]?.id
|
|
87
|
+
: this.formStore[whichForm]?.id;
|
|
83
88
|
switch (whichForm) {
|
|
84
89
|
case this.formStore.policyholderFormKey:
|
|
85
90
|
return this.formStore.applicationData.clientApp;
|
|
@@ -89,6 +94,10 @@ export const useMemberStore = defineStore('members', {
|
|
|
89
94
|
const inStore = this.formStore.applicationData.insuredApp.find((member: any) => member.insisId === id);
|
|
90
95
|
return !!inStore ? inStore : false;
|
|
91
96
|
}
|
|
97
|
+
case 'slaveInsuredForm': {
|
|
98
|
+
const inStore = this.formStore.applicationData.slave.insuredApp[0];
|
|
99
|
+
return !!inStore ? inStore : false;
|
|
100
|
+
}
|
|
92
101
|
case this.formStore.beneficiaryFormKey: {
|
|
93
102
|
const inStore = this.formStore.applicationData.beneficiaryApp.find((member: any) => member.insisId === id);
|
|
94
103
|
return !!inStore ? inStore : false;
|
|
@@ -99,12 +108,14 @@ export const useMemberStore = defineStore('members', {
|
|
|
99
108
|
}
|
|
100
109
|
}
|
|
101
110
|
},
|
|
102
|
-
getMemberCode(whichForm: keyof typeof StoreMembers) {
|
|
111
|
+
getMemberCode(whichForm: keyof typeof StoreMembers | 'slaveInsuredForm') {
|
|
103
112
|
switch (whichForm) {
|
|
104
113
|
case this.formStore.policyholderFormKey:
|
|
105
114
|
return MemberCodes.Client;
|
|
106
115
|
case this.formStore.insuredFormKey:
|
|
107
116
|
return MemberCodes.Insured;
|
|
117
|
+
case 'slaveInsuredForm':
|
|
118
|
+
return MemberCodes.Insured;
|
|
108
119
|
case this.formStore.beneficiaryFormKey:
|
|
109
120
|
return MemberCodes.Beneficiary;
|
|
110
121
|
case this.formStore.beneficialOwnerFormKey:
|
package/types/enum.ts
CHANGED
|
@@ -103,6 +103,7 @@ export enum Roles {
|
|
|
103
103
|
DsoDirector = 'DsoDirector',
|
|
104
104
|
AccountantDirector = 'AccountantDirector',
|
|
105
105
|
ManagerAuletti = 'ManagerAuletti',
|
|
106
|
+
HeadOfDso = 'HeadOfDso',
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
export enum Statuses {
|
|
@@ -126,6 +127,7 @@ export enum Statuses {
|
|
|
126
127
|
ControllerDpForm = 'ControllerDpForm',
|
|
127
128
|
ActuaryForm = 'ActuaryForm',
|
|
128
129
|
DsoUsnsForm = 'DsoUsnsForm',
|
|
130
|
+
JuristForm = 'JuristForm',
|
|
129
131
|
AccountantForm = 'AccountantForm',
|
|
130
132
|
HeadManagerForm = 'HeadManagerForm',
|
|
131
133
|
}
|