show inn in selectDealerPerson
This commit is contained in:
parent
b967c76501
commit
aeb549be6b
@ -45,6 +45,7 @@ export const mainOptionsQuery = gql`
|
||||
name
|
||||
evo_broker_accountid
|
||||
evo_kpp
|
||||
evo_inn
|
||||
}
|
||||
selectDealerRewardCondition: evo_reward_conditions(
|
||||
evo_agent_accountid: $dealer_person_accountid
|
||||
|
||||
@ -567,7 +567,7 @@ export default [
|
||||
CrmService.crmgqlquery({
|
||||
query: gql`
|
||||
query($statecode: Int, $salonaccountid: Uuid!) {
|
||||
account: salon_providers(
|
||||
selectDealerPerson: salon_providers(
|
||||
statecode: $statecode
|
||||
salonaccountid: $salonaccountid
|
||||
) {
|
||||
@ -575,27 +575,27 @@ export default [
|
||||
name
|
||||
evo_broker_accountid
|
||||
evo_kpp
|
||||
evo_inn
|
||||
}
|
||||
}
|
||||
`,
|
||||
toOptions: ['account'],
|
||||
toOptions: ['selectDealerPerson'],
|
||||
variables: {
|
||||
salonaccountid: dealerId,
|
||||
statecode: 0,
|
||||
},
|
||||
}).then(({ entities }) => {
|
||||
// @ts-ignore
|
||||
const dealerPersons = entities.selectDealerPerson;
|
||||
if (
|
||||
entities.account &&
|
||||
Array.isArray(entities.account) &&
|
||||
entities.account.length > 0
|
||||
dealerPersons &&
|
||||
Array.isArray(dealerPersons) &&
|
||||
dealerPersons.length > 0
|
||||
) {
|
||||
calculationStore.setOptions(
|
||||
'selectDealerPerson',
|
||||
entities.account,
|
||||
);
|
||||
calculationStore.setOptions('selectDealerPerson', dealerPersons);
|
||||
calculationStore.setValue(
|
||||
'dealerPerson',
|
||||
entities.account[0].accountid,
|
||||
dealerPersons[0].accountid,
|
||||
);
|
||||
calculationStore.setStatus(
|
||||
'selectDealerPerson',
|
||||
|
||||
@ -7,7 +7,14 @@ const propsMap: TEntities<{
|
||||
getName?: (entity: TCRMEntity, targetName: string) => string | undefined;
|
||||
}> = {
|
||||
account: {
|
||||
getName: account => `${account.name} ${account.evo_kpp || ''}`,
|
||||
getName: (account, targetName) => {
|
||||
if (['selectDealerPerson'].includes(targetName)) {
|
||||
return `
|
||||
${account.name}
|
||||
${account.evo_inn || '-'} / ${account.evo_kpp || '-'}`;
|
||||
}
|
||||
return `${account.name} ${account.evo_kpp || ''}`;
|
||||
},
|
||||
value: 'accountid',
|
||||
},
|
||||
lead: {
|
||||
|
||||
Reference in New Issue
Block a user