This commit is contained in:
Peter Maquiran
2022-06-03 16:53:50 +01:00
parent 7430bf7fe1
commit ee370f7e2e
29 changed files with 175 additions and 404 deletions
@@ -16,6 +16,7 @@ import { RouteService } from 'src/app/services/route.service';
export class EventActionsPopoverPage implements OnInit {
serialNumber:string;
instanceId: string;
activityInstanceName: string
constructor(
private navParams: NavParams,
@@ -27,7 +28,8 @@ export class EventActionsPopoverPage implements OnInit {
public ThemeService: ThemeService) {
this.serialNumber = this.navParams.get('serialNumber');
this.instanceId = this.navParams.get('InstanceId');
}
this.activityInstanceName = this.navParams.get('InstanceId');
}
ngOnInit() {
window.onresize = (event) => {
@@ -67,6 +69,26 @@ export class EventActionsPopoverPage implements OnInit {
}
async ReenviarTask() {
let body = { "serialNumber": this.serialNumber, "action": "Reenviar" }
const loader = this.toastService.loading()
try {
await this.processes.PostTaskAction(body).toPromise()
this.toastService.successMessage();
this.goBack();
} catch (error) {
this.toastService.badRequest()
}
finally {
loader.remove()
}
}
async emendarTask() {
this.closePopover();
@@ -107,25 +129,24 @@ export class EventActionsPopoverPage implements OnInit {
}
}
else{
//this.alertService.presentAlert('Operação cancelada!');
}
});
}
async rejeitar(){
async rejeitar() {
let body = { "serialNumber": this.serialNumber, "action": "Rejeitar" }
const loader = this.toastService.loading()
const loader = this.toastService.loading();
try {
await this.processes.PostTaskAction(body).toPromise();
await this.toastService.successMessage('Processo rejeitado');
this.goBack();
} catch (error) {
this.toastService.badRequest()
this.toastService.badRequest();
}
finally {
loader.remove()
loader.remove();
}
@@ -148,6 +169,6 @@ export class EventActionsPopoverPage implements OnInit {
modal.onDidDismiss().then(res => {
});
}
}
}