merge release/calc-67_pltype-nsib-insurer

This commit is contained in:
vchikalkin 2021-04-20 15:04:34 +03:00 committed by Chika
parent 598b59d7c1
commit c347afd306
2 changed files with 40 additions and 11 deletions

View File

@ -1,9 +1,9 @@
import { elementsValues } from 'client/Containers/Calculation/lib/elements/values';
import valuesConstants from 'core/constants/values';
import { shiftRight } from 'core/tools/array';
import { TElements } from 'core/types/Calculation/Store/elements';
import { isEqual } from 'lodash';
import { isEqual, isNil } from 'lodash';
import CalculationStore from '../../..';
import valuesConstants from 'core/constants/values';
const { PERIODS_NUMBER } = valuesConstants;
const VALIDATIONS = {
@ -29,7 +29,14 @@ const elementsValidations: TElements<any> = {
selectTarif: VALIDATIONS.IS_NULL,
// selectRate: VALIDATIONS.IS_NULL,
selectRegistration: VALIDATIONS.IS_NULL,
selectLeaseObjectCategory: VALIDATIONS.IS_NULL,
selectLeaseObjectCategory: valueName => {
return (
!CalculationStore.values[valueName] &&
!['6', '9', '10'].includes(
CalculationStore.getOption('selectLeaseObjectType')?.evo_id || '',
)
);
},
// selectSeasonType: valueName =>
// CalculationStore.getValue('graphType') === 100000003 &&
// VALIDATIONS.IS_NULL(valueName),
@ -74,24 +81,36 @@ const validateInsuranceTable = () => {
x => x.policyType?.value === 'ОСАГО',
);
const condition =
!CalculationStore.tables.tableInsurance.rows[kaskoRowIndex].insuranceCompany
?.value ||
!CalculationStore.tables.tableInsurance.rows[osagoRowIndex].insuranceCompany
?.value;
CalculationStore.setTableRows(
'tableInsurance',
0,
)([
{
insuranceCompany: {
validation: !condition,
validation: !isNil(
CalculationStore.tables.tableInsurance.rows[osagoRowIndex]
.insuranceCompany?.value,
),
},
insured: {
validation: !isNil(
CalculationStore.tables.tableInsurance.rows[osagoRowIndex].insured
?.value,
),
},
},
{
insuranceCompany: {
validation: !condition,
validation: !isNil(
CalculationStore.tables.tableInsurance.rows[kaskoRowIndex]
.insuranceCompany?.value,
),
},
insured: {
validation: !isNil(
CalculationStore.tables.tableInsurance.rows[kaskoRowIndex].insured
?.value,
),
},
},
]);

View File

@ -1625,6 +1625,16 @@ const reactionEffects: IReactionEffect[] = [
}
break;
}
case '6':
case '9':
case '10': {
calculationStore.setValue('leaseObjectCategory', null);
calculationStore.setStatus(
'selectLeaseObjectCategory',
ElementStatus.Disabled,
);
break;
}
case '3':
case '7': {