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
@@ -9,6 +9,6 @@
<button class="btn-ok" shape="round" (click)="approveTask()">Aprovar</button>
<div class="solid"></div>
<button class="btn-cancel" shape="round" (click)="editTask()">Editar</button>
<button class="btn-delete" shape="round" (click)="deleteTask()">Rejeitar</button>
<button class="btn-delete" shape="round" (click)="rejeitar()">Rejeitar</button>
</div>
</ion-content>
@@ -35,44 +35,53 @@ export class EventActionsPopoverPage implements OnInit {
}
};
}
goBack(){
this.closePopover();
this.router.navigate(['/home/gabinete-digital/event-list']);
}
closePopover(){
this.popoverController.dismiss();
}
approveTask() {
let body = { "serialNumber": this.serialNumber, "action": "Aprovar" }
console.log(body);
try {
this.processes.PostTaskAction(body).toPromise()
this.router.navigate(['/home/gabinete-digital/event-list']);
this.modalController.dismiss(null);
this.toastService.successMessage()
this.toastService.successMessage();
this.goBack();
} catch (error) {
this.toastService.badRequest()
}
}
emendarTask() {
let body = { "serialNumber": this.serialNumber, "action": "Rejeitar" }
console.log(body);
try {
this.processes.PostTaskAction(body).toPromise()
this.router.navigate(['/home/gabinete-digital/event-list']);
this.modalController.dismiss(null);
this.toastService.successMessage()
this.processes.PostTaskAction(body).toPromise();
this.toastService.successMessage();
this.goBack();
} catch (error) {
this.toastService.badRequest()
}
}
deleteTask(){
async rejeitar(){
let body = { "serialNumber": this.serialNumber, "action": "Rejeitar" }
console.log(body);
try {
this.processes.PostTaskAction(body).toPromise();
await this.toastService.successMessage('Processo rejeitado');
this.goBack();
} catch (error) {
this.toastService.badRequest()
}
}
async editTask() {
console.log(this.serialNumber);
console.log(this.instanceId);