fix error if no dealer broker id
This commit is contained in:
parent
c3c93d3109
commit
627aa6171f
@ -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);
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user