KP message
This commit is contained in:
parent
7daa330aef
commit
222e49e30c
@ -1,4 +1,5 @@
|
||||
// @ts-nocheck
|
||||
import { toJS } from 'mobx';
|
||||
import { gql } from '@apollo/client';
|
||||
import { message } from 'antd';
|
||||
import { openNotification } from 'client/Elements/Notification';
|
||||
@ -167,15 +168,15 @@ const actions: TAction = {
|
||||
preparedPayments,
|
||||
} = calculationRes;
|
||||
|
||||
const domainName = (await getUser()).FullName;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
console.log('values', values);
|
||||
console.log('calculationRes', calculationRes);
|
||||
console.log('columns', columns);
|
||||
console.log('postValues', postValues);
|
||||
console.log('domainName', domainName);
|
||||
}
|
||||
|
||||
const domainName = await getUser().FullName;
|
||||
|
||||
CalculationService.crmgqlmutaion({
|
||||
mutation: gql`
|
||||
mutation CreateOffer(
|
||||
@ -196,13 +197,14 @@ const actions: TAction = {
|
||||
calculationValues: $values
|
||||
}
|
||||
) {
|
||||
createdon
|
||||
offerprintform
|
||||
evo_quotename
|
||||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: {
|
||||
values,
|
||||
values: toJS(values),
|
||||
columns,
|
||||
postValues,
|
||||
preparedValues,
|
||||
@ -210,14 +212,15 @@ const actions: TAction = {
|
||||
domainName,
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
.then(({ entities: { quote } }) => {
|
||||
message.success({
|
||||
content: 'КП создано!',
|
||||
content: `КП ${quote.evo_quotename} создано!`,
|
||||
duration: 5,
|
||||
style: {
|
||||
marginTop: '7vh',
|
||||
},
|
||||
});
|
||||
if (quote.offerprintform) window.open(quote.offerprintform, '_blank');
|
||||
})
|
||||
.catch(err => {
|
||||
throw err;
|
||||
|
||||
@ -51,7 +51,8 @@ export interface IQuote {
|
||||
statecode?: number;
|
||||
evo_statuscodeid?: string;
|
||||
evo_statuscode?: IEvoStatusCode;
|
||||
|
||||
evo_quotename?: string;
|
||||
offerprintform?: string;
|
||||
}
|
||||
|
||||
export interface ITransactionCurrency {
|
||||
|
||||
Reference in New Issue
Block a user