fix technicalCard null while loading kp

This commit is contained in:
Chika 2020-12-15 14:33:43 +03:00
parent effc67e433
commit d5b438609f

View File

@ -1795,22 +1795,29 @@ const reactionEffects: IReactionEffect[] = [
},
}),
calculationStore => ({
(calculationStore, calculationProcess) => ({
expression: () => {
const { leaseObjectType } = calculationStore.values;
return { leaseObjectType };
},
effect: () => {
if (calculationProcess.process !== Process.Default) {
return;
}
calculationStore.setValue('technicalCard', null);
},
}),
calculationStore => ({
(calculationStore, calculationProcess) => ({
expression: () => {
const { leasingPeriod } = calculationStore.values;
return leasingPeriod;
},
effect: () => {
if (calculationProcess.process !== Process.Default) {
return;
}
const { technicalCard: technicalCardId } = calculationStore.values;
const technicalCard = calculationStore.options.selectTechnicalCard?.find(