This commit is contained in:
tiago.kayaya
2021-06-17 16:12:56 +01:00
parent 4b067e2517
commit 0c32592894
16 changed files with 94 additions and 75 deletions
+27 -7
View File
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { NavigationExtras, Router } from '@angular/router';
import { AlertController, AnimationController, ModalController, NavParams } from '@ionic/angular';
import { Event } from 'src/app/models/event.model'
import { EventBody } from 'src/app/models/eventbody.model';
@@ -78,6 +78,19 @@ export class ForwardPage implements OnInit {
cancelTask() {
this.modalController.dismiss(null);
}
goBack() {
this.modalController.dismiss(null);
if (window.innerWidth <= 800) {
this.router.navigate(['/home/gabinete-digital/pedidos']);
} else {
let navigationExtras: NavigationExtras = {
queryParams: {
"pedidos": true,
}
}
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
}
async assignar(note:string, documents:any) {
let body = {
@@ -112,11 +125,17 @@ export class ForwardPage implements OnInit {
this.toastService.badRequest("Selecione apenas um destinatário");
}
else {
let attendees: any = this.taskParticipants.concat(this.taskParticipantsCc);
attendees = attendees.map(function(val) {
return {
UserEmail: val.EmailAddress,
UserType: val.IsRequired?"I": "CC"
};
});
let body = {
"usersSelected": this.taskParticipants,
"distributionType": "paralelo",
"priority": 0,
"countryCode": "string",
"usersSelected": attendees,
"serialNumber": this.task.SerialNumber,
"action": "Reencaminhar",
"actionTypeId": 98,
@@ -127,9 +146,10 @@ export class ForwardPage implements OnInit {
"AttachmentList" :docs,
}
console.log(body);
this.processes.DelegateTask(body).subscribe(res=>{
this.processes.CompleteParecerPrTask(body).subscribe(res=>{
console.log(res);
this.toastService.successMessage('Processo delegado')
this.toastService.successMessage('Processo delegado');
this.goBack();
},
(error)=>{
this.toastService.badRequest("Processo não delegado")