diff --git a/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts b/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts index cb7fb30..37448af 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts +++ b/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts @@ -4,7 +4,7 @@ import { resetIns } from 'client/Containers/Calculation/Components/ELT/lib/reset import { numberElementsProps } from 'client/Containers/Calculation/Elements/props/common'; import { getTitle, - getValueName + getValueName, } from 'client/Containers/Calculation/Elements/tools'; import { ElementsNames } from 'client/Containers/Calculation/types/elements'; import { openNotification } from 'client/Elements/Notification'; @@ -14,7 +14,7 @@ import { mainOptionsForQuoteQuery, quoteQuery, secondaryOptionsForQuoteQuery, - singleOptionsForQuoteQuery + singleOptionsForQuoteQuery, } from 'core/services/CrmService/graphql/query/quote'; import { TOptionizedEntity } from 'core/services/CrmService/types/common'; import { @@ -23,7 +23,7 @@ import { IEvoGraph, IEvoRewardCondition, IEvoTown, - IQuote + IQuote, } from 'core/services/CrmService/types/entities'; import { currentISODate } from 'core/tools/date'; import { NIL } from 'core/tools/uuid'; @@ -601,9 +601,24 @@ const loadKpReaction: IReactionEffect = calculationStore => ({ // regionRegistration if (objectRegistration === 100000001) { regionRegistration = quote.evo_regionid; - calculationStore.setFilter('selectRegionRegistration', regions => - regions.filter(x => x.evo_businessunit_evolution === true), - ); + + const filter = regions => + regions.filter(x => x.evo_businessunit_evolution === true); + + calculationStore.setFilter('selectRegionRegistration', filter); + + /** + * TODO: Для нового калькулятора: + * костыль: скидываем значение поля selectRegionRegistration + * после фильтрации чтобы не ставилось значение из КП которого нет в отфильтрованном списке + */ + if ( + !calculationStore + .getOptions('selectRegionRegistration', undefined, true) + ?.find(x => x.value === regionRegistration) + ) { + regionRegistration = null; + } calculationStore.setStatus( 'selectRegionRegistration', ElementStatus.Default,