This commit is contained in:
Peter Maquiran
2021-07-16 19:32:13 +01:00
parent c028e4e6f5
commit 050f84bc8e
13 changed files with 49 additions and 48 deletions
@@ -318,7 +318,7 @@ export class CreateProcessPage implements OnInit {
try { try {
await this.processes.postDespatcho(this.postData).toPromise(); await this.processes.postDespatcho(this.postData).toPromise();
this.executado(loader, 'Despacho criado'); await this.executado(loader, 'Despacho criado');
} catch (error) { } catch (error) {
this.toastService.badRequest('Processo não efectuado'); this.toastService.badRequest('Processo não efectuado');
} }
@@ -337,7 +337,7 @@ export class CreateProcessPage implements OnInit {
try { try {
await this.processes.postParecer(this.postData).toPromise(); await this.processes.postParecer(this.postData).toPromise();
this.executado(loader); await this.executado(loader);
this.toastService.successMessage('Pedido de Parecer criado'); this.toastService.successMessage('Pedido de Parecer criado');
} }
catch (error) { catch (error) {
@@ -358,7 +358,7 @@ export class CreateProcessPage implements OnInit {
try { try {
await this.processes.postDeferimento(this.postData).toPromise(); await this.processes.postDeferimento(this.postData).toPromise();
this.executado(loader); await this.executado(loader);
this.toastService.successMessage('Pedido de Deferimento criado'); this.toastService.successMessage('Pedido de Deferimento criado');
} }
catch (error) { catch (error) {
@@ -56,13 +56,13 @@ export class EventActionsPopoverPage implements OnInit {
this.popoverController.dismiss(); this.popoverController.dismiss();
} }
approveTask() { async approveTask() {
let body = { "serialNumber": this.serialNumber, "action": "Aprovar" } let body = { "serialNumber": this.serialNumber, "action": "Aprovar" }
console.log(body); console.log(body);
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
this.processes.PostTaskAction(body).toPromise() await this.processes.PostTaskAction(body).toPromise()
this.toastService.successMessage(); this.toastService.successMessage();
this.goBack(); this.goBack();
@@ -127,7 +127,7 @@ export class EventActionsPopoverPage implements OnInit {
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
this.processes.PostTaskAction(body).toPromise(); await this.processes.PostTaskAction(body).toPromise();
await this.toastService.successMessage('Processo rejeitado'); await this.toastService.successMessage('Processo rejeitado');
this.goBack(); this.goBack();
} catch (error) { } catch (error) {
@@ -335,7 +335,7 @@ export class DespachoPrPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then(res => { modal.onDidDismiss().then( async (res) => {
console.log(res); console.log(res);
if(res.data){ if(res.data){
@@ -354,19 +354,19 @@ export class DespachoPrPage implements OnInit {
} }
if(actionName == 'Executado'){ if(actionName == 'Executado'){
this.executado(res.data.note, docs); await this.executado(res.data.note, docs);
} }
else if(actionName == 'Arquivar'){ else if(actionName == 'Arquivar'){
this.arquivar(res.data.note, docs); await this.arquivar(res.data.note, docs);
} }
else if(actionName == 'Gerar Diploma'){ else if(actionName == 'Gerar Diploma'){
this.generateDiploma(res.data.note, docs); await this.generateDiploma(res.data.note, docs);
} }
else if(actionName == 'Concluido'){ else if(actionName == 'Concluido'){
this.concluir(res.data.note, docs); await this.concluir(res.data.note, docs);
} }
else if(actionName == 'Reexecução'){ else if(actionName == 'Reexecução'){
this.reexecutar(res.data.note, docs); await this.reexecutar(res.data.note, docs);
} }
this.goBack(); this.goBack();
} }
@@ -306,7 +306,7 @@ export class DespachoPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then(res => { modal.onDidDismiss().then( async (res) => {
if(res.data){ if(res.data){
const DocumentToSave = res.data.documents.map((e) => { const DocumentToSave = res.data.documents.map((e) => {
@@ -323,14 +323,14 @@ export class DespachoPage implements OnInit {
if(actionName == 'Executado'){ if(actionName == 'Executado'){
this.executado(res.data.note, docs); await this.executado(res.data.note, docs);
} }
else if(actionName == 'Arquivar'){ else if(actionName == 'Arquivar'){
this.arquivar(res.data.note, docs); await this.arquivar(res.data.note, docs);
this.goBack(); this.goBack();
} }
else if(actionName == 'Reexecução'){ else if(actionName == 'Reexecução'){
this.reexecute(res.data.note, docs); await this.reexecute(res.data.note, docs);
this.goBack(); this.goBack();
} }
} }
@@ -253,7 +253,7 @@ export class DiplomaPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then(res => { modal.onDidDismiss().then(async (res) => {
if(res.data){ if(res.data){
@@ -271,15 +271,15 @@ export class DiplomaPage implements OnInit {
if(actionName == 'Solicitar assinatura'){ if(actionName == 'Solicitar assinatura'){
this.askSignature(res.data.note, docs); await this.askSignature(res.data.note, docs);
this.goBack(); this.goBack();
} }
else if(actionName == 'Solicitar alteração'){ else if(actionName == 'Solicitar alteração'){
this.askToChange(res.data.note, docs); await this.askToChange(res.data.note, docs);
this.goBack(); this.goBack();
} }
else if(actionName == 'Concluir diploma'){ else if(actionName == 'Concluir diploma'){
this.finish(res.data.note, docs); await this.finish(res.data.note, docs);
this.goBack(); this.goBack();
} }
} }
@@ -177,7 +177,7 @@ export class ApproveEventPage implements OnInit {
console.log(body); console.log(body);
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
this.processes.PostTaskAction(body).toPromise(); await this.processes.PostTaskAction(body).toPromise();
await this.toastService.successMessage('Processo rejeitado'); await this.toastService.successMessage('Processo rejeitado');
this.goBack(); this.goBack();
} catch (error) { } catch (error) {
@@ -22,6 +22,7 @@ import { User } from 'src/app/models/user.model';
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { ForwardPage } from 'src/app/modals/forward/forward.page'; import { ForwardPage } from 'src/app/modals/forward/forward.page';
import { async } from '@angular/core/testing';
@Component({ @Component({
selector: 'app-pedido', selector: 'app-pedido',
@@ -437,8 +438,8 @@ export class PedidoPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then(res => { modal.onDidDismiss().then( async (res) => {
const DocumentToSave = res.data.documents.map((e) => { const DocumentToSave = await res.data.documents.map( async (e) => {
return { return {
ApplicationId: e.ApplicationType, ApplicationId: e.ApplicationType,
SourceId: e.Id, SourceId: e.Id,
@@ -451,15 +452,15 @@ export class PedidoPage implements OnInit {
if(res.data){ if(res.data){
if(actionName == 'Solicitar Reapreciação') { if(actionName == 'Solicitar Reapreciação') {
this.repreciar(res.data.note, docs); await this.repreciar(res.data.note, docs);
this.goBack(); this.goBack();
} }
else if(actionName == 'Arquivar'){ else if(actionName == 'Arquivar'){
this.arquivar(res.data.note, docs); await this.arquivar(res.data.note, docs);
this.goBack(); this.goBack();
} }
else if(actionName == 'Assignar'){ else if(actionName == 'Assignar'){
this.assignar(res.data.note, docs); await this.assignar(res.data.note, docs);
} }
} }
}); });
@@ -55,7 +55,7 @@ export class DeplomaOptionsPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then(res => { modal.onDidDismiss().then(async (res) => {
if(res.data){ if(res.data){
@@ -73,11 +73,11 @@ export class DeplomaOptionsPage implements OnInit {
if(actionName == 'Solicitar assinatura'){ if(actionName == 'Solicitar assinatura'){
this.askSignature(res.data.note, docs); await this.askSignature(res.data.note, docs);
this.goBack(); this.goBack();
} }
else if(actionName == 'Solicitar alteração'){ else if(actionName == 'Solicitar alteração'){
this.askToChange(res.data.note, docs); await this.askToChange(res.data.note, docs);
this.goBack(); this.goBack();
} }
} }
@@ -178,7 +178,7 @@ export class DespachosOptionsPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then(res => { modal.onDidDismiss().then(async (res) => {
console.log(res); console.log(res);
if(res.data) { if(res.data) {
@@ -195,19 +195,19 @@ export class DespachosOptionsPage implements OnInit {
} }
if(actionName == 'Executado'){ if(actionName == 'Executado'){
this.executado(res.data.note, docs); await this.executado(res.data.note, docs);
} }
else if(actionName == 'Arquivar'){ else if(actionName == 'Arquivar'){
this.arquivar(res.data.note, docs); await this.arquivar(res.data.note, docs);
} }
else if(actionName == 'Gerar Diploma'){ else if(actionName == 'Gerar Diploma'){
this.generateDiploma(res.data.note, docs); await this.generateDiploma(res.data.note, docs);
} }
else if(actionName == 'Concluido'){ else if(actionName == 'Concluido'){
//this.concluir(res.data.note, docs); //this.concluir(res.data.note, docs);
} }
else if(actionName == 'Reexecução'){ else if(actionName == 'Reexecução'){
this.reexecutar(res.data.note, docs); await this.reexecutar(res.data.note, docs);
} }
this.goBack(); this.goBack();
} }
@@ -211,7 +211,7 @@ export class DespachosPrOptionsPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then(res => { modal.onDidDismiss().then(async (res) => {
console.log(res); console.log(res);
if(res.data){ if(res.data){
@@ -230,19 +230,19 @@ export class DespachosPrOptionsPage implements OnInit {
} }
if(actionName == 'Executado'){ if(actionName == 'Executado'){
this.executado(res.data.note, docs); await this.executado(res.data.note, docs);
} }
else if(actionName == 'Arquivar'){ else if(actionName == 'Arquivar'){
this.arquivar(res.data.note, docs); await this.arquivar(res.data.note, docs);
} }
else if(actionName == 'Gerar Diploma'){ else if(actionName == 'Gerar Diploma'){
this.generateDiploma(res.data.note, docs); await this.generateDiploma(res.data.note, docs);
} }
else if(actionName == 'Concluido'){ else if(actionName == 'Concluido'){
//this.concluir(res.data.note, docs); //this.concluir(res.data.note, docs);
} }
else if(actionName == 'Reexecução'){ else if(actionName == 'Reexecução'){
this.reexecutar(res.data.note, docs); await this.reexecutar(res.data.note, docs);
} }
this.goBack(); this.goBack();
} }
@@ -90,7 +90,7 @@ export class OptsExpedientePrPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then(res => { modal.onDidDismiss().then(async (res) => {
console.log(res); console.log(res);
if(res.data){ if(res.data){
const DocumentToSave = res.data.documents.map((e) => { const DocumentToSave = res.data.documents.map((e) => {
@@ -106,10 +106,10 @@ export class OptsExpedientePrPage implements OnInit {
} }
if(actionName == 'Aprovar'){ if(actionName == 'Aprovar'){
this.approve(res.data.note, docs); await this.approve(res.data.note, docs);
} }
else if(actionName == 'Revisão'){ else if(actionName == 'Revisão'){
this.sendToReview(res.data.note, docs); await this.sendToReview(res.data.note, docs);
} }
this.goBack(); this.goBack();
} }
@@ -199,7 +199,7 @@ export class RequestOptionsPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then(res => { modal.onDidDismiss().then(async (res) => {
const DocumentToSave = res.data.documents.map((e) => { const DocumentToSave = res.data.documents.map((e) => {
@@ -218,10 +218,10 @@ export class RequestOptionsPage implements OnInit {
if(res.data){ if(res.data){
if(actionName == 'Solicitar Reapreciação') { if(actionName == 'Solicitar Reapreciação') {
this.repreciar(res.data.note, docs); await this.repreciar(res.data.note, docs);
} }
else if(actionName == 'Arquivar'){ else if(actionName == 'Arquivar'){
this.arquivar(res.data.note, docs); await this.arquivar(res.data.note, docs);
} }
} }
}); });