diff --git a/src/client/stores/CalculationStore/Effects/reactions/tablesReactions.ts b/src/client/stores/CalculationStore/Effects/reactions/tablesReactions.ts index e07a5bd..24821f5 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/tablesReactions.ts +++ b/src/client/stores/CalculationStore/Effects/reactions/tablesReactions.ts @@ -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'),