hide options | new autorun effect

This commit is contained in:
Chika 2020-11-26 17:41:40 +03:00
parent a1a8b070f4
commit 78268a7009
4 changed files with 19 additions and 9 deletions

View File

@ -110,6 +110,16 @@ const autorunEffects: IAutorunEffect[] = [
calculationStore.setValidation('tbxCountSeats', true);
}
},
calculationStore => () => {
const { requirementTelematic } = calculationStore.values;
if (requirementTelematic) {
const tracker = calculationStore.options.selectTracker?.find(x =>
x.evo_controls_program?.includes(requirementTelematic),
);
if (tracker)
calculationStore.setValue('tracker', tracker.evo_addproduct_typeid);
}
},
];
export default autorunEffects;

View File

@ -6,7 +6,6 @@ import { shift, shiftRight } from 'core/tools/array';
import { IReactionEffect } from 'core/types/Calculation/Store/effect';
import { ITableCell, TableProps } from 'core/types/Calculation/Store/tables';
import { Status } from 'core/types/statuses';
import { last } from 'lodash';
import { toJS } from 'mobx';
import { calcPrice, calculatePerc, calculateRub } from './lib/tools';

View File

@ -302,14 +302,14 @@ const initialOptions: TElements<IBaseOption[]> = {
name: 'START+',
value: 100000001,
},
{
name: 'COMFORT',
value: 100000002,
},
{
name: 'COMFORT+',
value: 100000003,
},
// {
// name: 'COMFORT',
// value: 100000002,
// },
// {
// name: 'COMFORT+',
// value: 100000003,
// },
],
};

View File

@ -37,6 +37,7 @@ const initialStatuses: TElements<Status> = {
btnCreateLead: Status.Disabled,
selectRegistration: Status.Disabled,
selectTracker: Status.Disabled,
};
export default initialStatuses;