diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index 167438fc8..c555eedb5 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -253,7 +253,7 @@ export class CreateProcessPage implements OnInit { try { await this.processes.postDespatcho(this.postData).toPromise(); - this.FinalizarDespacho(loader, 'Despacho criado'); + await this.FinalizarDespacho(loader, 'Despacho criado'); } catch (error) { this.toastService.badRequest('Processo não efectuado'); } @@ -272,7 +272,7 @@ export class CreateProcessPage implements OnInit { try { await this.processes.postParecer(this.postData).toPromise(); - this.FinalizarParecer(loader, 'Pedido de Parecer enviado'); + await this.FinalizarParecer(loader, 'Pedido de Parecer enviado'); } catch (error) { this.toastService.badRequest('Processo não efectuado'); @@ -292,7 +292,7 @@ export class CreateProcessPage implements OnInit { try { await this.processes.postDeferimento(this.postData).toPromise(); - this.FinalizarDeferimento(loader, 'Pedido de deferimento enviado'); + await this.FinalizarDeferimento(loader, 'Pedido de deferimento enviado'); } catch (error) { this.toastService.badRequest('Processo não efectuado'); @@ -305,47 +305,47 @@ export class CreateProcessPage implements OnInit { case 'PR': switch (this.taskType) { - case '0': - this.postData = { - DistributionType: "Paralelo", - CountryCode: 'AO', - Priority: this.postData.Priority, - UserEmail: this.loggeduser.Email, - UsersSelected: attendees, - DispatchFolder: this.dispatchFolder, - } - console.log('this.postData', this.postData, this.taskType); + case '0': + this.postData = { + DistributionType: "Paralelo", + CountryCode: 'AO', + Priority: this.postData.Priority, + UserEmail: this.loggeduser.Email, + UsersSelected: attendees, + DispatchFolder: this.dispatchFolder, + } + console.log('this.postData', this.postData, this.taskType); - try { - await this.processes.postDespatcho(this.postData).toPromise(); - await this.executado(loader, 'Despacho criado'); - } catch (error) { - this.toastService.badRequest('Processo não efectuado'); - } + try { + await this.processes.postDespatcho(this.postData).toPromise(); + await this.executado(loader, 'Despacho criado'); + } catch (error) { + this.toastService.badRequest('Processo não efectuado'); + } - break; - case '1': - this.postData = { - DistributionType: "Paralelo", - CountryCode: 'AO', - Priority: this.postData.Priority, - UserEmail: this.loggeduser.Email, - UsersSelected: attendees, - DispatchFolder: this.dispatchFolder, - } - console.log(this.postData); + break; + case '1': + this.postData = { + DistributionType: "Paralelo", + CountryCode: 'AO', + Priority: this.postData.Priority, + UserEmail: this.loggeduser.Email, + UsersSelected: attendees, + DispatchFolder: this.dispatchFolder, + } + console.log(this.postData); - try { - await this.processes.postParecer(this.postData).toPromise(); - await this.executado(loader); - this.toastService.successMessage('Pedido de Parecer criado'); - } - catch (error) { - this.toastService.badRequest('Processo não efectuado'); - } + try { + await this.processes.postParecer(this.postData).toPromise(); + await this.executado(loader); + this.toastService.successMessage('Pedido de Parecer criado'); + } + catch (error) { + this.toastService.badRequest('Processo não efectuado'); + } - break; - case '2': + break; + case '2': this.postData = { DistributionType: "Paralelo", CountryCode: 'AO', diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts index 9f0a81cf1..c817d588d 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -355,11 +355,13 @@ export class DespachoPage implements OnInit { cssClass: classs, }); await modal.present(); - modal.onDidDismiss().then(res=>{ + modal.onDidDismiss().then( async (res)=>{ console.log(res['data']); + if(res['data']=='openDiscart'){ - this.distartExpedientModal(); + await this.distartExpedientModal(); } + this.goBack(); }); } diff --git a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts index 00fa65f84..bdf854254 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts +++ b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts @@ -481,7 +481,7 @@ export class PedidoPage implements OnInit { this.router.navigate(['/home/gabinete-digital'], navigationExtras); } } - else{ + else { if (window.innerWidth <= 800) { this.router.navigate(['/home/gabinete-digital/pedidos']); }