disable tableInsurance reaction while loading kp

This commit is contained in:
vchikalkin 2021-04-20 15:24:20 +03:00 committed by Chika
parent aceea7c3f6
commit 1d1c4129fa
2 changed files with 9 additions and 14 deletions

View File

@ -88,29 +88,21 @@ const validateInsuranceTable = () => {
{
insuranceCompany: {
validation: !isNil(
CalculationStore.tables.tableInsurance.rows[osagoRowIndex]
.insuranceCompany?.value,
tableInsurance.rows[osagoRowIndex].insuranceCompany?.value,
),
},
insured: {
validation: !isNil(
CalculationStore.tables.tableInsurance.rows[osagoRowIndex].insured
?.value,
),
validation: !isNil(tableInsurance.rows[osagoRowIndex].insured?.value),
},
},
{
insuranceCompany: {
validation: !isNil(
CalculationStore.tables.tableInsurance.rows[kaskoRowIndex]
.insuranceCompany?.value,
tableInsurance.rows[kaskoRowIndex].insuranceCompany?.value,
),
},
insured: {
validation: !isNil(
CalculationStore.tables.tableInsurance.rows[kaskoRowIndex].insured
?.value,
),
validation: !isNil(tableInsurance.rows[kaskoRowIndex].insured?.value),
},
},
]);

View File

@ -2,7 +2,7 @@
import { openNotification } from 'client/Elements/Notification';
import {
insuranceOsagoDefaultFilter,
singleValueFilter
singleValueFilter,
} from 'core/constants/stores/Calculation/filters';
import valuesConstants from 'core/constants/values';
import { shift, shiftRight } from 'core/tools/array';
@ -748,12 +748,15 @@ export default [
},
}),
calculationStore => ({
(calculationStore, calculationProcess) => ({
expression: () => {
const { leaseObjectCategory } = calculationStore.values;
return leaseObjectCategory;
},
effect: (nextLeaseObjectCategory, prevLeaseObjectCategory) => {
if (calculationProcess.process === Process.LoadKp) {
return;
}
const nextIsTrailer = nextLeaseObjectCategory === 100000004;
const prevIsTrailer = prevLeaseObjectCategory === 100000004;