diff --git a/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts b/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts index fb119b4..577df7e 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts +++ b/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts @@ -2,6 +2,7 @@ import { message } from 'antd'; import { elementsValues } from 'client/Containers/Calculation/lib/elements/values'; +import { openNotification } from 'client/Elements/Notification'; import CrmService from 'client/services/CrmService'; import { calculationProcess } from 'client/stores/CalculationStore'; import initialValues from 'client/stores/CalculationStore/config/initialValues'; @@ -83,6 +84,7 @@ const loadKpReaction: IReactionEffect = calculationStore => ({ currentDate, dealer_person_accountid: quote.evo_dealer_person_accountid || NIL, dealer_broker_accountid: quote.evo_dealer_broker_accountid || NIL, + hasDealerBroker: quote.evo_dealer_broker_accountid ? true : false, ind_agent_accountid: quote.evo_agent_accountid || NIL, double_agent_accountid: quote.evo_double_agent_accountid || NIL, broker_accountid: quote.evo_broker_accountid || NIL, @@ -232,7 +234,15 @@ const loadKpReaction: IReactionEffect = calculationStore => ({ content: `КП ${quote?.evo_quotename || ''} загружено!`, }); } - }) + }) + .catch(err => { + openNotification({ + type: 'error', + title: `Ошибка во время загрузки КП `, + description: `${err}`, + })(); + throw err; + }) .finally(() => { calculationStore.setStatus('selectQuote', ElementStatus.Default); calculationStore.setStatus('btnCalculate', ElementStatus.Default); diff --git a/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/optionsQuery.js b/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/optionsQuery.js index 636dc2a..fb5661f 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/optionsQuery.js +++ b/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/optionsQuery.js @@ -9,6 +9,7 @@ export default gql` $currentDate: DateTime $dealer_person_accountid: Uuid! $dealer_broker_accountid: Uuid! + $hasDealerBroker: Boolean! $ind_agent_accountid: Uuid! $double_agent_accountid: Uuid! $broker_accountid: Uuid! @@ -53,7 +54,8 @@ export default gql` evo_reward_summ evo_reduce_reward } - selectDealerBroker: account(accountid: $dealer_broker_accountid) { + selectDealerBroker: account(accountid: $dealer_broker_accountid) + @include(if: $hasDealerBroker) { accountid name } diff --git a/src/core/types/Entities/crmEntities.ts b/src/core/types/Entities/crmEntities.ts index 767419f..ed88da4 100644 --- a/src/core/types/Entities/crmEntities.ts +++ b/src/core/types/Entities/crmEntities.ts @@ -58,8 +58,9 @@ export interface IQuote { evo_object_count?: number; evo_osago_accountid?: string; evo_kasko_accountid?: string; - evo_osago_payer?: number; evo_kasko_payer?: number; + evo_kasko_price?: number; + evo_osago_payer?: number; evo_osago_price?: number; evo_dgo_price?: number; evo_ns_price?: number;