hotFix: saveSign
This commit is contained in:
parent
bfbe8302b6
commit
578bcd3cce
|
@ -1,6 +1,6 @@
|
|||
import './index';
|
||||
|
||||
fdescribe('component vnRoleCard', () => {
|
||||
describe('component vnRoleCard', () => {
|
||||
let controller;
|
||||
let $httpBackend;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import './index';
|
||||
|
||||
fdescribe('component vnRoleDescriptor', () => {
|
||||
describe('component vnRoleDescriptor', () => {
|
||||
let controller;
|
||||
let $httpBackend;
|
||||
|
||||
|
|
|
@ -72,24 +72,25 @@ module.exports = Self => {
|
|||
|
||||
async function createGestDoc(id) {
|
||||
const ticket = await models.Ticket.findById(id,
|
||||
{include: [
|
||||
{
|
||||
relation: 'warehouse',
|
||||
scope: {
|
||||
fields: ['id']
|
||||
{
|
||||
include: [
|
||||
{
|
||||
relation: 'warehouse',
|
||||
scope: {
|
||||
fields: ['id']
|
||||
}
|
||||
}, {
|
||||
relation: 'client',
|
||||
scope: {
|
||||
fields: ['name']
|
||||
}
|
||||
}, {
|
||||
relation: 'route',
|
||||
scope: {
|
||||
fields: ['id']
|
||||
}
|
||||
}
|
||||
}, {
|
||||
relation: 'client',
|
||||
scope: {
|
||||
fields: ['name']
|
||||
}
|
||||
}, {
|
||||
relation: 'route',
|
||||
scope: {
|
||||
fields: ['id']
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}, myOptions);
|
||||
const dmsType = await models.DmsType.findOne({where: {code: 'Ticket'}, fields: ['id']}, myOptions);
|
||||
const ctxUploadFile = Object.assign({}, ctx);
|
||||
|
@ -125,7 +126,7 @@ module.exports = Self => {
|
|||
if (await gestDocExists(ticketId))
|
||||
throw new UserError('Ticket is already signed');
|
||||
|
||||
if (location) setLocation(ticketId);
|
||||
if (location) await setLocation(ticketId);
|
||||
if (!gestDocCreated) await createGestDoc(ticketId);
|
||||
await models.TicketDms.create({ticketFk: ticketId, dmsFk: dms[0].id}, myOptions);
|
||||
const ticket = await models.Ticket.findById(ticketId, null, myOptions);
|
||||
|
@ -135,7 +136,7 @@ module.exports = Self => {
|
|||
where: {
|
||||
code: 'DELIVERED'
|
||||
}
|
||||
}, options);
|
||||
}, myOptions);
|
||||
|
||||
await models.Ticket.state(ctx, {
|
||||
ticketFk: ticketId,
|
||||
|
|
Loading…
Reference in New Issue