loadKP: поправили selectRegionRegistration
This commit is contained in:
parent
9ec32586f2
commit
7a3315df83
@ -4,7 +4,7 @@ import { resetIns } from 'client/Containers/Calculation/Components/ELT/lib/reset
|
|||||||
import { numberElementsProps } from 'client/Containers/Calculation/Elements/props/common';
|
import { numberElementsProps } from 'client/Containers/Calculation/Elements/props/common';
|
||||||
import {
|
import {
|
||||||
getTitle,
|
getTitle,
|
||||||
getValueName
|
getValueName,
|
||||||
} from 'client/Containers/Calculation/Elements/tools';
|
} from 'client/Containers/Calculation/Elements/tools';
|
||||||
import { ElementsNames } from 'client/Containers/Calculation/types/elements';
|
import { ElementsNames } from 'client/Containers/Calculation/types/elements';
|
||||||
import { openNotification } from 'client/Elements/Notification';
|
import { openNotification } from 'client/Elements/Notification';
|
||||||
@ -14,7 +14,7 @@ import {
|
|||||||
mainOptionsForQuoteQuery,
|
mainOptionsForQuoteQuery,
|
||||||
quoteQuery,
|
quoteQuery,
|
||||||
secondaryOptionsForQuoteQuery,
|
secondaryOptionsForQuoteQuery,
|
||||||
singleOptionsForQuoteQuery
|
singleOptionsForQuoteQuery,
|
||||||
} from 'core/services/CrmService/graphql/query/quote';
|
} from 'core/services/CrmService/graphql/query/quote';
|
||||||
import { TOptionizedEntity } from 'core/services/CrmService/types/common';
|
import { TOptionizedEntity } from 'core/services/CrmService/types/common';
|
||||||
import {
|
import {
|
||||||
@ -23,7 +23,7 @@ import {
|
|||||||
IEvoGraph,
|
IEvoGraph,
|
||||||
IEvoRewardCondition,
|
IEvoRewardCondition,
|
||||||
IEvoTown,
|
IEvoTown,
|
||||||
IQuote
|
IQuote,
|
||||||
} from 'core/services/CrmService/types/entities';
|
} from 'core/services/CrmService/types/entities';
|
||||||
import { currentISODate } from 'core/tools/date';
|
import { currentISODate } from 'core/tools/date';
|
||||||
import { NIL } from 'core/tools/uuid';
|
import { NIL } from 'core/tools/uuid';
|
||||||
@ -601,9 +601,24 @@ const loadKpReaction: IReactionEffect = calculationStore => ({
|
|||||||
// regionRegistration
|
// regionRegistration
|
||||||
if (objectRegistration === 100000001) {
|
if (objectRegistration === 100000001) {
|
||||||
regionRegistration = quote.evo_regionid;
|
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(
|
calculationStore.setStatus(
|
||||||
'selectRegionRegistration',
|
'selectRegionRegistration',
|
||||||
ElementStatus.Default,
|
ElementStatus.Default,
|
||||||
|
|||||||
Reference in New Issue
Block a user