mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
save
This commit is contained in:
@@ -83,10 +83,10 @@ export class ApproveEventPage implements OnInit {
|
||||
console.log(body);
|
||||
|
||||
try {
|
||||
//await this.processes.PostTaskAction(body).toPromise()
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
//this.successMessage()
|
||||
this.toastService.successMessage('Evento rejeitado!');
|
||||
//this.goBack();
|
||||
this.toastService.successMessage('Evento aprovado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
@@ -111,7 +111,6 @@ export class ApproveEventPage implements OnInit {
|
||||
async rejectTask(serialNumber:string){
|
||||
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||
console.log(body);
|
||||
|
||||
try {
|
||||
this.processes.PostTaskAction(body).toPromise();
|
||||
//await this.successMessage('Processo rejeitado');
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<ion-toolbar>
|
||||
<ion-segment [(ngModel)]="segment">
|
||||
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
|
||||
<ion-segment-button value="MDGPR">
|
||||
Seu calendário
|
||||
</ion-segment-button>
|
||||
|
||||
@@ -37,36 +37,42 @@ export class EventsToApprovePage implements OnInit {
|
||||
ngOnInit() {
|
||||
this.segment = this.loggeduser.Profile;
|
||||
this.LoadToApproveEvents();
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
||||
this.doRefresh();
|
||||
this.LoadToApproveEvents();
|
||||
}
|
||||
});
|
||||
|
||||
window.onresize = (event) => {
|
||||
// if not mobile remove all component
|
||||
if( window.innerWidth <= 1024){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
LoadToApproveEvents() {
|
||||
segmentChanged(ev: any) {
|
||||
this.LoadToApproveEvents();
|
||||
}
|
||||
|
||||
async LoadToApproveEvents() {
|
||||
this.showLoader = true;
|
||||
|
||||
let prEvents = await this.processes.GetToApprovedEvents('PR','false').toPromise();
|
||||
this.eventsPRList = prEvents;
|
||||
console.log(this.eventsPRList);
|
||||
|
||||
this.processes.GetToApprovedEvents('PR','false').subscribe(res=>{
|
||||
/* this.processes.GetToApprovedEvents('PR','false').subscribe(res=>{
|
||||
this.showLoader = false;
|
||||
this.eventsPRList = res;
|
||||
|
||||
console.log('this.eventsPRList', this.eventsPRList)
|
||||
});
|
||||
this.processes.GetToApprovedEvents('MDGPR','false').subscribe(res=>{
|
||||
}); */
|
||||
let mdEvents = await this.processes.GetToApprovedEvents('MDGPR','false').toPromise();
|
||||
this.eventsMDGPRList = mdEvents;
|
||||
console.log(this.eventsMDGPRList);
|
||||
/* this.processes.GetToApprovedEvents('MDGPR','false').subscribe(res=>{
|
||||
this.showLoader = false;
|
||||
this.eventsMDGPRList = res;
|
||||
|
||||
console.log('this.eventsMDGPRList', this.eventsMDGPRList)
|
||||
});
|
||||
}); */
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
goToEventDetail(eventToAprove){
|
||||
@@ -121,11 +127,7 @@ export class EventsToApprovePage implements OnInit {
|
||||
|
||||
doRefresh() {
|
||||
console.log('Refresh Events');
|
||||
|
||||
this.LoadToApproveEvents();
|
||||
console.log('refresh');
|
||||
setTimeout(() => {
|
||||
}, 2000);
|
||||
}
|
||||
close(){
|
||||
this.modalController.dismiss(null);
|
||||
|
||||
Reference in New Issue
Block a user