insuranceTables: пусть пока так будет

This commit is contained in:
vchikalkin 2022-09-23 16:01:06 +03:00
parent e8919c7550
commit a800ad4b99

View File

@ -158,12 +158,60 @@ export default [
calculationStore.tables.tableInsurance.options?.insuranceCompany?.find(
x => x.name?.includes('ПРОЧИЕ'),
);
const insuranceOtherFilter = singleValueFilter(
otherInsuranceCompany?.value,
);
calculationStore.setTableRow('tableInsurance', rows =>
rows.findIndex(x => x?.key === 'kasko'),
)({
insuranceCompany: {
value: otherInsuranceCompany?.value,
status: ElementStatus.Disabled,
filter: insuranceOtherFilter,
},
insCost: {
value: 0,
status: ElementStatus.Disabled,
},
insTerm: {
value: 100_000_000,
status: ElementStatus.Disabled,
},
insured: {
value: 100_000_000,
status: ElementStatus.Disabled,
},
});
calculationStore.setTableRow('tableInsurance', rows =>
rows.findIndex(x => x?.key === 'dgo'),
)({
insuranceCompany: {
value: otherInsuranceCompany?.value,
status: ElementStatus.Disabled,
filter: insuranceOtherFilter,
},
insCost: {
value: 0,
status: ElementStatus.Disabled,
},
insTerm: {
value: 100_000_000,
status: ElementStatus.Disabled,
},
insured: {
value: 100_000_000,
status: ElementStatus.Disabled,
},
});
calculationStore.setTableRow('tableInsurance', rows =>
rows.findIndex(x => x?.key === 'ns'),
)({
insuranceCompany: {
value: otherInsuranceCompany?.value,
status: ElementStatus.Disabled,
filter: insuranceOtherFilter,
},
insCost: {
value: 0,
@ -179,6 +227,24 @@ export default [
},
});
} else if (leasingPeriod) {
calculationStore.setTableRow('tableInsurance', rows =>
rows.findIndex(x => x?.key === 'kasko'),
)({
insuranceCompany: { filter: insuranceKaskoDefaultFilter },
});
calculationStore.setTableRow('tableInsurance', rows =>
rows.findIndex(x => x?.key === 'dgo'),
)({
insuranceCompany: { filter: insuranceKaskoDefaultFilter },
});
calculationStore.setTableRow('tableInsurance', rows =>
rows.findIndex(x => x?.key === 'ns'),
)({
insuranceCompany: { filter: insuranceKaskoDefaultFilter },
});
if (leasingPeriod < 12) {
calculationStore.setTableRow('tableInsurance', rows =>
rows.findIndex(x => x?.key === 'osago'),