Merge branch 'development'
This commit is contained in:
commit
072be2405a
@ -63,8 +63,6 @@ export default function ($calculation: ICalculationStore) {
|
||||
} else {
|
||||
const { evo_sale_without_nds } = product;
|
||||
if (evo_sale_without_nds) {
|
||||
$calculation.setStatus('cbxLeaseObjectUsed', ElementStatus.Disabled);
|
||||
|
||||
$calculation.setStatus(
|
||||
'tbxSupplierDiscountRub',
|
||||
ElementStatus.Disabled,
|
||||
@ -84,8 +82,6 @@ export default function ($calculation: ICalculationStore) {
|
||||
|
||||
$calculation.setStatus('selectImportProgram', ElementStatus.Disabled);
|
||||
} else {
|
||||
$calculation.setStatus('cbxLeaseObjectUsed', ElementStatus.Default);
|
||||
|
||||
$calculation.setStatus(
|
||||
'tbxSupplierDiscountRub',
|
||||
ElementStatus.Default,
|
||||
@ -240,6 +236,7 @@ export default function ($calculation: ICalculationStore) {
|
||||
fireImmediately: true,
|
||||
},
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => {
|
||||
const { mileage, leaseObjectUsed } = $calculation.values;
|
||||
@ -258,4 +255,78 @@ export default function ($calculation: ICalculationStore) {
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => {
|
||||
const { leaseObjectUsed } = $calculation.values;
|
||||
return leaseObjectUsed;
|
||||
},
|
||||
leaseObjectUsed => {
|
||||
if (leaseObjectUsed === true) {
|
||||
$calculation.setValues({
|
||||
subsidy: null,
|
||||
});
|
||||
$calculation.setStatuses({
|
||||
selectSubsidy: ElementStatus.Disabled,
|
||||
});
|
||||
} else {
|
||||
$calculation.setStatuses({
|
||||
selectSubsidy: ElementStatus.Default,
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
fireImmediately: true,
|
||||
},
|
||||
);
|
||||
|
||||
/**
|
||||
* @description
|
||||
* реакция на ПЛ БУ, Субсидию и Продукт
|
||||
* если ПЛ БУ = Да или Субсидия содержит данные или в Продукте БУбезНДС = Да,
|
||||
* то поле Срок поставки = 100 000 000 и закрыто для редактирования, иначе открыто для редактирования
|
||||
*/
|
||||
reaction(
|
||||
() => {
|
||||
const { leaseObjectUsed } = $calculation.values;
|
||||
const sudsidy = $calculation.getOption('selectSubsidy');
|
||||
const product = $calculation.getOption('selectProduct');
|
||||
|
||||
return {
|
||||
leaseObjectUsed,
|
||||
sudsidy,
|
||||
product,
|
||||
};
|
||||
},
|
||||
({ leaseObjectUsed, sudsidy, product }) => {
|
||||
if (leaseObjectUsed || sudsidy || product?.evo_sale_without_nds) {
|
||||
$calculation.setValue('deliveryTime', 100_000_000);
|
||||
$calculation.setStatus('radioDeliveryTime', ElementStatus.Disabled);
|
||||
} else {
|
||||
$calculation.setStatus('radioDeliveryTime', ElementStatus.Default);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => {
|
||||
return $calculation.getOption('selectSubsidy');
|
||||
},
|
||||
subsidy => {
|
||||
if (subsidy) {
|
||||
$calculation.setValues({
|
||||
leaseObjectCount: 1,
|
||||
leaseObjectUsed: false,
|
||||
});
|
||||
}
|
||||
$calculation.setStatuses({
|
||||
tbxLeaseObjectCount: subsidy
|
||||
? ElementStatus.Disabled
|
||||
: ElementStatus.Default,
|
||||
cbxLeaseObjectUsed: subsidy
|
||||
? ElementStatus.Disabled
|
||||
: ElementStatus.Default,
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -920,33 +920,6 @@ const reactionEffects: IReactionEffect[] = [
|
||||
},
|
||||
}),
|
||||
|
||||
calculationStore => ({
|
||||
expression: () => {
|
||||
const { leaseObjectUsed } = calculationStore.values;
|
||||
return leaseObjectUsed;
|
||||
},
|
||||
effect: leaseObjectUsed => {
|
||||
if (leaseObjectUsed === true) {
|
||||
calculationStore.setValues({
|
||||
deliveryTime: 100000000,
|
||||
subsidy: null,
|
||||
});
|
||||
calculationStore.setStatuses({
|
||||
radioDeliveryTime: ElementStatus.Disabled,
|
||||
selectSubsidy: ElementStatus.Disabled,
|
||||
});
|
||||
} else {
|
||||
calculationStore.setStatuses({
|
||||
radioDeliveryTime: ElementStatus.Default,
|
||||
selectSubsidy: ElementStatus.Default,
|
||||
});
|
||||
}
|
||||
},
|
||||
options: {
|
||||
fireImmediately: true,
|
||||
},
|
||||
}),
|
||||
|
||||
calculationStore => ({
|
||||
expression: () => {
|
||||
const { leaseObjectCategory } = calculationStore.values;
|
||||
@ -1472,32 +1445,6 @@ const reactionEffects: IReactionEffect[] = [
|
||||
calculationStore.setValue('rate', rates[0].evo_id);
|
||||
},
|
||||
}),
|
||||
|
||||
calculationStore => ({
|
||||
expression: () => {
|
||||
return calculationStore.getOption('selectSubsidy');
|
||||
},
|
||||
effect: subsidy => {
|
||||
if (subsidy) {
|
||||
calculationStore.setValues({
|
||||
leaseObjectCount: 1,
|
||||
leaseObjectUsed: false,
|
||||
deliveryTime: 100000000,
|
||||
});
|
||||
}
|
||||
calculationStore.setStatuses({
|
||||
tbxLeaseObjectCount: subsidy
|
||||
? ElementStatus.Disabled
|
||||
: ElementStatus.Default,
|
||||
cbxLeaseObjectUsed: subsidy
|
||||
? ElementStatus.Disabled
|
||||
: ElementStatus.Default,
|
||||
radioDeliveryTime: subsidy
|
||||
? ElementStatus.Disabled
|
||||
: ElementStatus.Default,
|
||||
});
|
||||
},
|
||||
}),
|
||||
];
|
||||
|
||||
export default reactionEffects;
|
||||
|
||||
Reference in New Issue
Block a user