hl-core 0.0.10-beta.25 → 0.0.10-beta.26
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 +0 -33
- package/components/Pages/MemberForm.vue +28 -58
- package/components/Pages/ProductConditions.vue +31 -152
- package/components/Panel/PanelHandler.vue +12 -30
- package/components/Utilities/Chip.vue +1 -1
- package/composables/classes.ts +0 -8
- package/composables/constants.ts +0 -17
- package/composables/index.ts +0 -1
- package/locales/ru.json +1 -4
- package/package.json +1 -1
- package/store/data.store.ts +56 -237
- package/store/member.store.ts +4 -15
- package/types/enum.ts +0 -1
package/store/data.store.ts
CHANGED
|
@@ -279,75 +279,39 @@ 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
|
-
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
|
-
}
|
|
298
|
-
} else {
|
|
299
|
-
const blob = new Blob([response], {
|
|
300
|
-
type: `application/${fileType}`,
|
|
282
|
+
await this.api.file.getFile(file.id).then((response: any) => {
|
|
283
|
+
if (!['pdf', 'docx'].includes(fileType)) {
|
|
284
|
+
const blob = new Blob([response], { type: `image/${fileType}` });
|
|
285
|
+
const url = window.URL.createObjectURL(blob);
|
|
286
|
+
const link = document.createElement('a');
|
|
287
|
+
link.href = url;
|
|
288
|
+
if (mode === 'view') {
|
|
289
|
+
setTimeout(() => {
|
|
290
|
+
window.open(url, '_blank', `width=${screen.width},height=${screen.height},top=70`);
|
|
301
291
|
});
|
|
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
|
-
}
|
|
332
292
|
} else {
|
|
333
|
-
|
|
334
|
-
|
|
293
|
+
link.setAttribute('download', file.fileName!);
|
|
294
|
+
document.body.appendChild(link);
|
|
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`);
|
|
335
307
|
});
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
link
|
|
339
|
-
|
|
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
|
-
}
|
|
308
|
+
} else {
|
|
309
|
+
link.setAttribute('download', file.fileName!);
|
|
310
|
+
document.body.appendChild(link);
|
|
311
|
+
link.click();
|
|
348
312
|
}
|
|
349
|
-
}
|
|
350
|
-
}
|
|
313
|
+
}
|
|
314
|
+
});
|
|
351
315
|
} catch (err) {
|
|
352
316
|
ErrorHandler(err);
|
|
353
317
|
} finally {
|
|
@@ -391,7 +355,6 @@ export const useDataStore = defineStore('data', {
|
|
|
391
355
|
lastName: '',
|
|
392
356
|
middleName: '',
|
|
393
357
|
iin: member.iin ? member.iin.replace(/-/g, '') : '',
|
|
394
|
-
birthDate: '',
|
|
395
358
|
};
|
|
396
359
|
const contragentResponse = await this.api.getContragent(queryData);
|
|
397
360
|
if (contragentResponse.totalItems > 0) {
|
|
@@ -413,17 +376,11 @@ export const useDataStore = defineStore('data', {
|
|
|
413
376
|
}
|
|
414
377
|
this.isLoading = false;
|
|
415
378
|
},
|
|
416
|
-
async getContragentById(id: number, whichForm: keyof typeof StoreMembers
|
|
379
|
+
async getContragentById(id: number, whichForm: keyof typeof StoreMembers, load: boolean = true, whichIndex: number | null = null) {
|
|
417
380
|
if (Number(id) === 0) return;
|
|
418
381
|
this.isLoading = load;
|
|
419
382
|
try {
|
|
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
|
-
|
|
383
|
+
const member = whichIndex === null ? this.formStore[whichForm as Types.SingleMember] : this.formStore[whichForm as Types.MultipleMember][whichIndex];
|
|
427
384
|
const contragentResponse = await this.api.getContragentById(id);
|
|
428
385
|
if (contragentResponse.totalItems > 0) {
|
|
429
386
|
await this.serializeContragentData(member, contragentResponse.items[0]);
|
|
@@ -897,9 +854,6 @@ export const useDataStore = defineStore('data', {
|
|
|
897
854
|
isIpdlCompliance: null,
|
|
898
855
|
isTerrorCompliance: null,
|
|
899
856
|
};
|
|
900
|
-
if (this.isPension && memberFromApplicaiton && memberFromApplicaiton.processInstanceId === this.formStore.applicationData.slave?.processInstanceId) {
|
|
901
|
-
data.processInstanceId = this.formStore.applicationData.slave.processInstanceId;
|
|
902
|
-
}
|
|
903
857
|
data.id = memberFromApplicaiton && memberFromApplicaiton.id ? memberFromApplicaiton.id : null;
|
|
904
858
|
if (whichMember === 'Client') {
|
|
905
859
|
data.isInsured = this.formStore.isPolicyholderInsured;
|
|
@@ -909,12 +863,6 @@ export const useDataStore = defineStore('data', {
|
|
|
909
863
|
data.jobName = member.jobPlace;
|
|
910
864
|
data.positionCode = member.positionCode;
|
|
911
865
|
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
|
-
}
|
|
918
866
|
}
|
|
919
867
|
if (whichMember === 'Spokesman') {
|
|
920
868
|
if (!!memberFromApplicaiton && memberFromApplicaiton.iin !== data.iin) {
|
|
@@ -973,12 +921,6 @@ export const useDataStore = defineStore('data', {
|
|
|
973
921
|
data.familyStatusId = member.familyStatus.id;
|
|
974
922
|
data.relationId = member.relationDegree.ids;
|
|
975
923
|
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
|
-
}
|
|
982
924
|
}
|
|
983
925
|
if (whichMember === 'Beneficiary') {
|
|
984
926
|
if (
|
|
@@ -1023,20 +965,10 @@ export const useDataStore = defineStore('data', {
|
|
|
1023
965
|
}
|
|
1024
966
|
}
|
|
1025
967
|
},
|
|
1026
|
-
async setApplication(applicationData:
|
|
968
|
+
async setApplication(applicationData: object, calculate: boolean = false) {
|
|
1027
969
|
try {
|
|
1028
970
|
this.isLoading = true;
|
|
1029
971
|
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
|
-
}
|
|
1040
972
|
await this.api.setApplication(applicationData);
|
|
1041
973
|
if (calculate) {
|
|
1042
974
|
await this.api.calculatePension(String(this.formStore.applicationData.processInstanceId));
|
|
@@ -1091,14 +1023,6 @@ export const useDataStore = defineStore('data', {
|
|
|
1091
1023
|
conditionsData.policyAppDto.amountInCurrency = getNumber(String(this.formStore.productConditionsForm.requestedSumInsuredInDollar));
|
|
1092
1024
|
conditionsData.policyAppDto.currencyExchangeRate = this.currencies.usd;
|
|
1093
1025
|
}
|
|
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
|
-
}
|
|
1102
1026
|
if (this.isLiferenta) {
|
|
1103
1027
|
conditionsData.policyAppDto.guaranteedPaymentPeriod = this.formStore.productConditionsForm.guaranteedPeriod || 0;
|
|
1104
1028
|
conditionsData.policyAppDto.annuityTypeId = (this.formStore.productConditionsForm.typeAnnuityInsurance.id as string) ?? undefined;
|
|
@@ -1641,7 +1565,7 @@ export const useDataStore = defineStore('data', {
|
|
|
1641
1565
|
query.processCode = byOneProcess;
|
|
1642
1566
|
}
|
|
1643
1567
|
if (byOneProcess === 19 && !useEnv().isProduction) {
|
|
1644
|
-
query.processCodes = [19, 2
|
|
1568
|
+
query.processCodes = [19, 2];
|
|
1645
1569
|
delete query.processCode;
|
|
1646
1570
|
}
|
|
1647
1571
|
const taskList = await this.api.getTaskList(
|
|
@@ -1867,15 +1791,6 @@ export const useDataStore = defineStore('data', {
|
|
|
1867
1791
|
calculationData.amountInCurrency = getNumber(String(this.formStore.productConditionsForm.requestedSumInsuredInDollar));
|
|
1868
1792
|
calculationData.currencyExchangeRate = this.currencies.usd;
|
|
1869
1793
|
}
|
|
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
|
-
}
|
|
1879
1794
|
if (this.isLiferenta || product === 'liferenta') {
|
|
1880
1795
|
calculationData.guaranteedPaymentPeriod = this.formStore.productConditionsForm.guaranteedPeriod || 0;
|
|
1881
1796
|
calculationData.annuityTypeId = (this.formStore.productConditionsForm.typeAnnuityInsurance.id as string) ?? undefined;
|
|
@@ -1894,15 +1809,10 @@ export const useDataStore = defineStore('data', {
|
|
|
1894
1809
|
calculationData.calcDate = formatDate(this.formStore.productConditionsForm.calcDate as string)!.toISOString();
|
|
1895
1810
|
}
|
|
1896
1811
|
const calculationResponse = await this.api.calculateWithoutApplication(calculationData, this.isCalculator ? product : undefined);
|
|
1897
|
-
if (calculationResponse.amount)
|
|
1898
|
-
|
|
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
|
-
|
|
1812
|
+
if (calculationResponse.amount) this.formStore.productConditionsForm.requestedSumInsured = this.getNumberWithSpaces(calculationResponse.amount);
|
|
1813
|
+
if (calculationResponse.premium) this.formStore.productConditionsForm.insurancePremiumPerMonth = this.getNumberWithSpaces(calculationResponse.premium);
|
|
1904
1814
|
this.formStore.additionalInsuranceTermsWithout = calculationResponse.addCovers;
|
|
1905
|
-
if (this.isKazyna || product === 'halykkazyna'
|
|
1815
|
+
if (this.isKazyna || product === 'halykkazyna') {
|
|
1906
1816
|
if (this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar != null) {
|
|
1907
1817
|
this.formStore.productConditionsForm.requestedSumInsuredInDollar = this.getNumberWithSpaces(calculationResponse.amountInCurrency);
|
|
1908
1818
|
} else {
|
|
@@ -1949,7 +1859,7 @@ export const useDataStore = defineStore('data', {
|
|
|
1949
1859
|
const applicationData = await this.api.getApplicationData(taskId);
|
|
1950
1860
|
this.formStore.applicationData = applicationData;
|
|
1951
1861
|
if (this.formStore.applicationData.addCoverDto) this.formStore.additionalInsuranceTerms = this.formStore.applicationData.addCoverDto;
|
|
1952
|
-
if (
|
|
1862
|
+
if (this.isKazyna && this.currencies.usd) {
|
|
1953
1863
|
if (this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar != null) {
|
|
1954
1864
|
this.formStore.productConditionsForm.requestedSumInsuredInDollar = this.getNumberWithSpaces(result.value / this.currencies.usd);
|
|
1955
1865
|
} else {
|
|
@@ -1957,15 +1867,11 @@ export const useDataStore = defineStore('data', {
|
|
|
1957
1867
|
}
|
|
1958
1868
|
}
|
|
1959
1869
|
if (this.formStore.productConditionsForm.insurancePremiumPerMonth != null) {
|
|
1960
|
-
this.formStore.productConditionsForm.requestedSumInsured = this.
|
|
1961
|
-
this.formStore.productConditionsForm.insurancePremiumPerMonth = this.
|
|
1962
|
-
? this.getNumberWithSpacesAfterComma(applicationData.policyAppDto.premium)
|
|
1963
|
-
: this.getNumberWithSpaces(applicationData.policyAppDto.premium);
|
|
1870
|
+
this.formStore.productConditionsForm.requestedSumInsured = this.getNumberWithSpaces(result.value);
|
|
1871
|
+
this.formStore.productConditionsForm.insurancePremiumPerMonth = this.getNumberWithSpaces(applicationData.policyAppDto.premium);
|
|
1964
1872
|
} else {
|
|
1965
|
-
this.formStore.productConditionsForm.insurancePremiumPerMonth = this.
|
|
1966
|
-
this.formStore.productConditionsForm.requestedSumInsured = this.
|
|
1967
|
-
? this.getNumberWithSpacesAfterComma(applicationData.policyAppDto.amount)
|
|
1968
|
-
: this.getNumberWithSpaces(applicationData.policyAppDto.amount);
|
|
1873
|
+
this.formStore.productConditionsForm.insurancePremiumPerMonth = this.getNumberWithSpaces(result.value);
|
|
1874
|
+
this.formStore.productConditionsForm.requestedSumInsured = this.getNumberWithSpaces(applicationData.policyAppDto.amount);
|
|
1969
1875
|
}
|
|
1970
1876
|
if (this.isLiferenta) {
|
|
1971
1877
|
this.formStore.productConditionsForm.amountAnnuityPayments = this.getNumberWithSpaces(applicationData.policyAppDto.annuityMonthPay);
|
|
@@ -1991,38 +1897,6 @@ export const useDataStore = defineStore('data', {
|
|
|
1991
1897
|
}
|
|
1992
1898
|
this.isLoading = false;
|
|
1993
1899
|
},
|
|
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
|
-
},
|
|
2026
1900
|
async calculatePremium(data: any) {
|
|
2027
1901
|
this.isLoading = true;
|
|
2028
1902
|
try {
|
|
@@ -2131,7 +2005,6 @@ export const useDataStore = defineStore('data', {
|
|
|
2131
2005
|
|
|
2132
2006
|
const clientData = applicationData.clientApp;
|
|
2133
2007
|
const insuredData: any[] = applicationData.insuredApp;
|
|
2134
|
-
const slaveInsuredData: any = applicationData.slave?.insuredApp[0] ?? null;
|
|
2135
2008
|
const beneficiaryData: any[] = applicationData.beneficiaryApp;
|
|
2136
2009
|
const beneficialOwnerData: any[] = applicationData.beneficialOwnerApp;
|
|
2137
2010
|
const spokesmanData: any = applicationData.spokesmanApp;
|
|
@@ -2222,13 +2095,6 @@ export const useDataStore = defineStore('data', {
|
|
|
2222
2095
|
}
|
|
2223
2096
|
});
|
|
2224
2097
|
}
|
|
2225
|
-
if (slaveInsuredData) {
|
|
2226
|
-
allMembers.push({
|
|
2227
|
-
...slaveInsuredData,
|
|
2228
|
-
key: 'slaveInsuredForm',
|
|
2229
|
-
index: null,
|
|
2230
|
-
});
|
|
2231
|
-
}
|
|
2232
2098
|
if (beneficiaryData && beneficiaryData.length) {
|
|
2233
2099
|
beneficiaryData.forEach((member, index) => {
|
|
2234
2100
|
const inStore = this.formStore.beneficiaryForm.find(each => each.id == member.insisId);
|
|
@@ -2266,14 +2132,12 @@ export const useDataStore = defineStore('data', {
|
|
|
2266
2132
|
this.setMembersField(this.formStore.policyholderFormKey, 'clientApp');
|
|
2267
2133
|
if (insuredData && insuredData.length) {
|
|
2268
2134
|
insuredData.forEach((each, index) => {
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
this.formStore.insuredForm[index].relationDegree = relationDegree ? relationDegree : new Value();
|
|
2273
|
-
}
|
|
2135
|
+
this.setMembersFieldIndex(this.formStore.insuredFormKey, 'insuredApp', index);
|
|
2136
|
+
const relationDegree = this.relations.find((i: Value) => i.ids == each.relationId);
|
|
2137
|
+
this.formStore.insuredForm[index].relationDegree = relationDegree ? relationDegree : new Value();
|
|
2274
2138
|
});
|
|
2275
2139
|
}
|
|
2276
|
-
|
|
2140
|
+
|
|
2277
2141
|
if (beneficiaryData && beneficiaryData.length) {
|
|
2278
2142
|
beneficiaryData.forEach((each, index) => {
|
|
2279
2143
|
this.setMembersFieldIndex(this.formStore.beneficiaryFormKey, 'beneficiaryApp', index);
|
|
@@ -2351,21 +2215,16 @@ export const useDataStore = defineStore('data', {
|
|
|
2351
2215
|
const paymentPeriod = this.processPaymentPeriod.find(item => item.id == applicationData.policyAppDto.paymentPeriodId);
|
|
2352
2216
|
this.formStore.productConditionsForm.paymentPeriod = paymentPeriod ? paymentPeriod : new Value();
|
|
2353
2217
|
|
|
2354
|
-
this.formStore.productConditionsForm.requestedSumInsured = this.
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
this.formStore.productConditionsForm.insurancePremiumPerMonth = this.
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
if (this.isKazyna || this.isGons) {
|
|
2218
|
+
this.formStore.productConditionsForm.requestedSumInsured = this.getNumberWithSpaces(
|
|
2219
|
+
applicationData.policyAppDto.amount === null ? null : applicationData.policyAppDto.amount,
|
|
2220
|
+
);
|
|
2221
|
+
this.formStore.productConditionsForm.insurancePremiumPerMonth = this.getNumberWithSpaces(
|
|
2222
|
+
applicationData.policyAppDto.premium === null ? null : applicationData.policyAppDto.premium,
|
|
2223
|
+
);
|
|
2224
|
+
if (this.isKazyna) {
|
|
2362
2225
|
this.formStore.productConditionsForm.requestedSumInsuredInDollar = this.getNumberWithSpaces(applicationData.policyAppDto.amountInCurrency);
|
|
2363
2226
|
this.formStore.productConditionsForm.insurancePremiumPerMonthInDollar = this.getNumberWithSpaces(applicationData.policyAppDto.premiumInCurrency);
|
|
2364
2227
|
}
|
|
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
|
-
}
|
|
2369
2228
|
const riskGroup = this.riskGroup.find(item => {
|
|
2370
2229
|
if (applicationData.policyAppDto.riskGroup == 0) {
|
|
2371
2230
|
return true;
|
|
@@ -2543,34 +2402,6 @@ export const useDataStore = defineStore('data', {
|
|
|
2543
2402
|
this.formStore.applicationData.pensionApp.transferContractCompany = transferCompany ? transferCompany : new Value();
|
|
2544
2403
|
}
|
|
2545
2404
|
},
|
|
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
|
-
},
|
|
2574
2405
|
setMembersFieldIndex(whichForm: Types.MultipleMember, whichMember: keyof typeof MemberAppCodes, index: number) {
|
|
2575
2406
|
if ('familyStatus' in this.formStore[whichForm][index]) {
|
|
2576
2407
|
this.formStore[whichForm][index].familyStatus = this.findObject('familyStatuses', 'id', this.formStore.applicationData[whichMember][index].familyStatusId);
|
|
@@ -2684,7 +2515,7 @@ export const useDataStore = defineStore('data', {
|
|
|
2684
2515
|
ErrorHandler(err);
|
|
2685
2516
|
}
|
|
2686
2517
|
},
|
|
2687
|
-
async nclayerSign(groupId: string, signType: number, isXml: boolean = false) {
|
|
2518
|
+
async nclayerSign(groupId: string, signType: number, isXml: boolean = false, processInstanceId?: string) {
|
|
2688
2519
|
try {
|
|
2689
2520
|
const ncaLayerClient = new NCALayerClient();
|
|
2690
2521
|
await ncaLayerClient.connect();
|
|
@@ -2694,7 +2525,7 @@ export const useDataStore = defineStore('data', {
|
|
|
2694
2525
|
if (isXml) {
|
|
2695
2526
|
const signedAgreement = await ncaLayerClient.signXml(storageType, document, 'SIGNATURE', '');
|
|
2696
2527
|
const data = new FormData();
|
|
2697
|
-
data.append('processInstanceId', String(this.formStore.applicationData.processInstanceId));
|
|
2528
|
+
data.append('processInstanceId', processInstanceId ?? String(this.formStore.applicationData.processInstanceId));
|
|
2698
2529
|
data.append('xmlData', signedAgreement);
|
|
2699
2530
|
data.append('name', 'PAEnpf_Agreement');
|
|
2700
2531
|
data.append('format', 'xml');
|
|
@@ -2981,15 +2812,6 @@ export const useDataStore = defineStore('data', {
|
|
|
2981
2812
|
}
|
|
2982
2813
|
}
|
|
2983
2814
|
}
|
|
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
|
-
}
|
|
2993
2815
|
} else {
|
|
2994
2816
|
if (this.formStore[localKey].some(i => i.iin !== null)) {
|
|
2995
2817
|
this.showToaster('error', this.t('toaster.notSavedMember', { text: text }), 3000);
|
|
@@ -3035,9 +2857,6 @@ export const useDataStore = defineStore('data', {
|
|
|
3035
2857
|
}
|
|
3036
2858
|
}
|
|
3037
2859
|
}
|
|
3038
|
-
if (this.formStore.applicationData.slave && this.validateMultipleMembers(this.formStore.insuredFormKey, 'slave', 'застрахованных') === false) {
|
|
3039
|
-
return false;
|
|
3040
|
-
}
|
|
3041
2860
|
if (this.members.beneficiaryApp.has) {
|
|
3042
2861
|
if (this.validateMultipleMembers(this.formStore.beneficiaryFormKey, 'beneficiaryApp', 'выгодоприобретателей') === false) {
|
|
3043
2862
|
return false;
|
|
@@ -3987,7 +3806,7 @@ export const useDataStore = defineStore('data', {
|
|
|
3987
3806
|
}
|
|
3988
3807
|
},
|
|
3989
3808
|
hasBankSection(whichForm: keyof typeof StoreMembers) {
|
|
3990
|
-
if (!this.isPension
|
|
3809
|
+
if (!this.isPension) return false;
|
|
3991
3810
|
switch (whichForm) {
|
|
3992
3811
|
case 'beneficiaryForm':
|
|
3993
3812
|
return false;
|
|
@@ -3996,7 +3815,7 @@ export const useDataStore = defineStore('data', {
|
|
|
3996
3815
|
}
|
|
3997
3816
|
},
|
|
3998
3817
|
hasAdditionalDocumentsSection(whichForm: keyof typeof StoreMembers) {
|
|
3999
|
-
if (!this.isPension
|
|
3818
|
+
if (!this.isPension) return false;
|
|
4000
3819
|
switch (whichForm) {
|
|
4001
3820
|
case 'beneficiaryForm':
|
|
4002
3821
|
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
|
|
65
|
+
getMemberFromStore(whichForm: keyof typeof StoreMembers, whichIndex?: number): Member | null {
|
|
66
66
|
switch (whichForm) {
|
|
67
67
|
case this.formStore.policyholderFormKey:
|
|
68
68
|
return this.formStore.policyholderForm;
|
|
@@ -70,8 +70,6 @@ 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;
|
|
75
73
|
case this.formStore.beneficiaryFormKey:
|
|
76
74
|
return this.formStore.beneficiaryForm[whichIndex!];
|
|
77
75
|
case this.formStore.beneficialOwnerFormKey:
|
|
@@ -80,11 +78,8 @@ export const useMemberStore = defineStore('members', {
|
|
|
80
78
|
return null;
|
|
81
79
|
}
|
|
82
80
|
},
|
|
83
|
-
getMemberFromApplication(whichForm: keyof typeof StoreMembers
|
|
84
|
-
const id =
|
|
85
|
-
whichForm !== 'policyholderForm' && whichForm !== 'policyholdersRepresentativeForm' && whichForm !== 'slaveInsuredForm'
|
|
86
|
-
? this.formStore[whichForm][whichIndex!]?.id
|
|
87
|
-
: this.formStore[whichForm]?.id;
|
|
81
|
+
getMemberFromApplication(whichForm: keyof typeof StoreMembers, whichIndex?: number) {
|
|
82
|
+
const id = whichForm !== 'policyholderForm' && whichForm !== 'policyholdersRepresentativeForm' ? this.formStore[whichForm][whichIndex!].id : this.formStore[whichForm].id;
|
|
88
83
|
switch (whichForm) {
|
|
89
84
|
case this.formStore.policyholderFormKey:
|
|
90
85
|
return this.formStore.applicationData.clientApp;
|
|
@@ -94,10 +89,6 @@ export const useMemberStore = defineStore('members', {
|
|
|
94
89
|
const inStore = this.formStore.applicationData.insuredApp.find((member: any) => member.insisId === id);
|
|
95
90
|
return !!inStore ? inStore : false;
|
|
96
91
|
}
|
|
97
|
-
case 'slaveInsuredForm': {
|
|
98
|
-
const inStore = this.formStore.applicationData.slave.insuredApp[0];
|
|
99
|
-
return !!inStore ? inStore : false;
|
|
100
|
-
}
|
|
101
92
|
case this.formStore.beneficiaryFormKey: {
|
|
102
93
|
const inStore = this.formStore.applicationData.beneficiaryApp.find((member: any) => member.insisId === id);
|
|
103
94
|
return !!inStore ? inStore : false;
|
|
@@ -108,14 +99,12 @@ export const useMemberStore = defineStore('members', {
|
|
|
108
99
|
}
|
|
109
100
|
}
|
|
110
101
|
},
|
|
111
|
-
getMemberCode(whichForm: keyof typeof StoreMembers
|
|
102
|
+
getMemberCode(whichForm: keyof typeof StoreMembers) {
|
|
112
103
|
switch (whichForm) {
|
|
113
104
|
case this.formStore.policyholderFormKey:
|
|
114
105
|
return MemberCodes.Client;
|
|
115
106
|
case this.formStore.insuredFormKey:
|
|
116
107
|
return MemberCodes.Insured;
|
|
117
|
-
case 'slaveInsuredForm':
|
|
118
|
-
return MemberCodes.Insured;
|
|
119
108
|
case this.formStore.beneficiaryFormKey:
|
|
120
109
|
return MemberCodes.Beneficiary;
|
|
121
110
|
case this.formStore.beneficialOwnerFormKey:
|
package/types/enum.ts
CHANGED