effects: for leaseobjectcategory
This commit is contained in:
parent
4a9b062f41
commit
786ef011ff
@ -76,6 +76,47 @@ const autorunEffects: IAutorunEffect[] = [
|
||||
}
|
||||
}
|
||||
},
|
||||
calculationStore => () => {
|
||||
const {
|
||||
leaseObjectCategory,
|
||||
maxMass,
|
||||
withTrailer,
|
||||
tonnage,
|
||||
} = calculationStore.values;
|
||||
if (leaseObjectCategory === 100000002) {
|
||||
if (!maxMass) {
|
||||
calculationStore.setValidation('tbxMaxMass', false);
|
||||
} else {
|
||||
calculationStore.setValidation('tbxMaxMass', true);
|
||||
}
|
||||
if (!tonnage) {
|
||||
calculationStore.setValidation('tbxTonnage', false);
|
||||
} else {
|
||||
calculationStore.setValidation('tbxTonnage', true);
|
||||
}
|
||||
if (!withTrailer) {
|
||||
calculationStore.setValidation('selectWithTrailer', false);
|
||||
} else {
|
||||
calculationStore.setValidation('selectWithTrailer', true);
|
||||
}
|
||||
} else {
|
||||
calculationStore.setValidation('tbxMaxMass', true);
|
||||
calculationStore.setValidation('tbxTonnage', true);
|
||||
calculationStore.setValidation('selectWithTrailer', true);
|
||||
}
|
||||
},
|
||||
calculationStore => () => {
|
||||
const { leaseObjectCategory, countSeats } = calculationStore.values;
|
||||
if (leaseObjectCategory === 100000003) {
|
||||
if (!countSeats) {
|
||||
calculationStore.setValidation('tbxCountSeats', false);
|
||||
} else {
|
||||
calculationStore.setValidation('tbxCountSeats', true);
|
||||
}
|
||||
} else {
|
||||
calculationStore.setValidation('tbxCountSeats', true);
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
export default autorunEffects;
|
||||
|
||||
@ -151,10 +151,10 @@ const initialOptions: TElements<IBaseOption[]> = {
|
||||
],
|
||||
|
||||
selectWithTrailer: [
|
||||
{
|
||||
name: 'пусто',
|
||||
value: 100000000,
|
||||
},
|
||||
// {
|
||||
// name: 'пусто',
|
||||
// value: 100000000,
|
||||
// },
|
||||
{
|
||||
name: 'Да',
|
||||
value: 100000001,
|
||||
|
||||
@ -29,7 +29,7 @@ const initialValues: TValues<TValue> = {
|
||||
configuration: null,
|
||||
deliveryTime: 100000000,
|
||||
leaseObjectCount: 1,
|
||||
withTrailer: 100000000,
|
||||
withTrailer: null,
|
||||
leaseObjectUsed: false,
|
||||
maxMass: 0,
|
||||
countSeats: 0,
|
||||
|
||||
Reference in New Issue
Block a user