mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
save
This commit is contained in:
@@ -76,6 +76,10 @@ const routes: Routes = [
|
||||
path: 'edit-event',
|
||||
loadChildren: () => import('../pages/agenda/edit-event/edit-event.module').then( m => m.EditEventPageModule)
|
||||
},
|
||||
{
|
||||
path: 'emend-message-modal',
|
||||
loadChildren: () => import('../pages/agenda/emend-message-modal/emend-message-modal.module').then( m => m.EmendMessageModalPageModule)
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -11,12 +11,14 @@ export class EmendMessageModalPage implements OnInit {
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
) { }
|
||||
) {
|
||||
this.emendMessage = '';
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
close(){
|
||||
this.modalController.dismiss(this.emendMessage);
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
save(){
|
||||
this.modalController.dismiss(this.emendMessage);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { EventsService } from 'src/app/services/events.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { EventListPage } from './event-list/event-list.page';
|
||||
import { ExpedientePage } from './expediente/expediente.page';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-gabinete-digital',
|
||||
@@ -44,7 +44,8 @@ export class GabineteDigitalPage implements OnInit {
|
||||
private processesbackend:ProcessesService,
|
||||
private modalController: ModalController,
|
||||
private alertService: AlertService,
|
||||
private route: ActivatedRoute,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router,
|
||||
) {
|
||||
|
||||
window.onresize = (event) => {
|
||||
@@ -57,10 +58,23 @@ export class GabineteDigitalPage implements OnInit {
|
||||
|
||||
this.adjastModalHeight();
|
||||
|
||||
this.route.queryParams.subscribe(params => {
|
||||
/* this.activatedRoute.queryParams.subscribe(params => {
|
||||
if(params["show"]){
|
||||
this.openExpedientListPage();
|
||||
}
|
||||
}
|
||||
else if(params["events-to-approve"]){
|
||||
this.openEventsToApprovePage("MDGPR");
|
||||
}
|
||||
}); */
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(paramMap =>{
|
||||
if (paramMap.has("show")){
|
||||
this.openExpedientListPage();
|
||||
}
|
||||
else if(paramMap.has("events")){
|
||||
this.openEventsToApprovePage("MDGPR");
|
||||
this.LoadCounts();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
@@ -93,6 +107,15 @@ export class GabineteDigitalPage implements OnInit {
|
||||
ngOnInit() {
|
||||
//Initialize profile as mdgpr
|
||||
this.profile = "MDGPR";
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
||||
this.LoadCounts();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
this.LoadCounts();
|
||||
/* this.eventService.getAllMdEvents.subscribe(res=>{
|
||||
console.log(res);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { NavigationExtras, Router } from '@angular/router';
|
||||
import { MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { Event } from 'src/app/models/event.model';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
@@ -136,6 +136,8 @@ export class ApproveEventComponent implements OnInit {
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then(res => {
|
||||
console.log(res.data);
|
||||
|
||||
if(res.data !== ''){
|
||||
let body = { "serialNumber": serialNumber,
|
||||
"action": "Emendar",
|
||||
@@ -145,8 +147,9 @@ export class ApproveEventComponent implements OnInit {
|
||||
}
|
||||
console.log(body);
|
||||
this.processes.PostTaskAction(body);
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
//this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.alertService.presentAlert('Operação realizada com sucesso!');
|
||||
this.goToEventsToApprove();
|
||||
}
|
||||
else{
|
||||
this.alertService.presentAlert('Operação cancelada!');
|
||||
@@ -154,4 +157,13 @@ export class ApproveEventComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
goToEventsToApprove(){
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"events": true,
|
||||
}
|
||||
};
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ export class NewEventPage implements OnInit {
|
||||
Body: this.eventBody,
|
||||
Location: '',
|
||||
CalendarId: '',
|
||||
CalendarName: this.selectedSegment,
|
||||
CalendarName: '',
|
||||
StartDate: selectedStartdDate,
|
||||
EndDate: new Date(selectedEndDate),
|
||||
EventType: 'Reunião',
|
||||
|
||||
Reference in New Issue
Block a user