This commit is contained in:
tiago.kayaya
2021-07-13 15:12:35 +01:00
parent bd7ad3555a
commit 2f6e034747
2 changed files with 21 additions and 35 deletions
@@ -1,13 +1,8 @@
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { NavigationEnd, NavigationExtras, Router } from '@angular/router'; import { NavigationEnd, Router } from '@angular/router';
import { CalendarComponent } from 'ionic2-calendar';
import { DailyWorkTask } from '../../../models/dailyworktask.model'; import { DailyWorkTask } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { formatDate } from '@angular/common';
import { LoadingService } from 'src/app/services/loading.service';
import { ModalController } from '@ionic/angular'; import { ModalController } from '@ionic/angular';
import { ExpedienteDetailPage } from 'src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page';
import { AlertService } from 'src/app/services/alert.service'; import { AlertService } from 'src/app/services/alert.service';
@Component({ @Component({
@@ -21,21 +16,15 @@ export class ExpedientePage implements OnInit {
showLoader: boolean; showLoader: boolean;
//profile:string; //profile:string;
@ViewChild(CalendarComponent) myCal: CalendarComponent;
taskslist:DailyWorkTask[]; taskslist:DailyWorkTask[];
serialNumber:string; serialNumber:string;
@Input() profile:string;
@Output() openExpedientDetail:EventEmitter<any> = new EventEmitter<any>();
constructor( constructor(
private processes:ProcessesService, private processes:ProcessesService,
private modalController: ModalController, private modalController: ModalController,
private alertService: AlertService, private alertService: AlertService,
private router: Router, private router: Router,
) { ) {
this.profile = 'mdgpr';
} }
ngOnInit() { ngOnInit() {
@@ -47,11 +36,6 @@ export class ExpedientePage implements OnInit {
}); });
} }
openExpedientDetailPage(data){
console.log(data);
this.openExpedientDetail.emit(data);
}
LoadList(){ LoadList(){
this.showLoader = true; this.showLoader = true;
this.processes.GetTasksList("Expediente", false).subscribe(result => { this.processes.GetTasksList("Expediente", false).subscribe(result => {
@@ -20,17 +20,17 @@ import { EventsToApprovePage } from 'src/app/shared/gabinete-digital/events-to-a
}) })
export class GabineteDigitalPage implements OnInit { export class GabineteDigitalPage implements OnInit {
segment:string; segment:string;
showLoader: boolean; showLoader: boolean;
public profile:string; public profile:string;
count_exp_dailywork=0; count_exp_dailywork=0;
count_exp_pr =0 count_exp_pr =0
count_desp_dailywork=0; count_desp_dailywork=0;
count_desp_pending=0; count_desp_pending=0;
count_par_dailywork=0; count_par_dailywork=0;
count_par_pending=0; count_par_pending=0;
count_def_dailywork=0; count_def_dailywork=0;
count_def_pending=0; count_def_pending=0;
count_exp_pp : string; count_exp_pp : string;
@@ -49,7 +49,7 @@ export class GabineteDigitalPage implements OnInit {
desktopComponent: any = { desktopComponent: any = {
showEventList: false, showEventList: false,
showExpediente : false showExpediente : false,
} }
showEventsToApprove = false; showEventsToApprove = false;
@@ -63,7 +63,7 @@ export class GabineteDigitalPage implements OnInit {
showDiplomas = false; showDiplomas = false;
showDiplomasAssinar = false; showDiplomasAssinar = false;
showExpedientDetail = false; showExpedientDetail = false;
showSignedDiploma = false showSignedDiploma = false;
emptyTextDescription = 'Sem opção selecionada'; emptyTextDescription = 'Sem opção selecionada';
serialNumber:string; serialNumber:string;
@@ -96,7 +96,7 @@ export class GabineteDigitalPage implements OnInit {
} }
}; };
this.checkRoutes(); this.checkRoutes();
} }
closeAllDesktopComponent(){ closeAllDesktopComponent(){
@@ -111,7 +111,7 @@ export class GabineteDigitalPage implements OnInit {
ngOnInit() { ngOnInit() {
const pathname = window.location.pathname const pathname = window.location.pathname
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == pathname) { if(event instanceof NavigationEnd && event.url == pathname) {
this.checkRoutes(); this.checkRoutes();
this.LoadCounts(); this.LoadCounts();
@@ -120,11 +120,12 @@ export class GabineteDigitalPage implements OnInit {
// console.log('not') // console.log('not')
} }
}); });
this.hideRefreshButton(); this.hideRefreshButton();
} }
checkUser(){ checkUser(){
this.selectedElement='Correspondence';
switch(this.loggeduser.Profile){ switch(this.loggeduser.Profile){
case 'MDGPR': case 'MDGPR':
this.showExpedients = true; this.showExpedients = true;
@@ -150,6 +151,7 @@ export class GabineteDigitalPage implements OnInit {
} }
checkRoutes(){ checkRoutes(){
this.closeAllDesktopComponents();
if(this.router.url == '/home/gabinete-digital?eventos=true'){ if(this.router.url == '/home/gabinete-digital?eventos=true'){
this.openEventsToApprovePage(); this.openEventsToApprovePage();
this.selectedElement='approval'; this.selectedElement='approval';
@@ -252,7 +254,7 @@ export class GabineteDigitalPage implements OnInit {
this.count_de_pr = Object.keys(despachosPr).length; this.count_de_pr = Object.keys(despachosPr).length;
break; break;
} }
let diplomasValidar = despachospr.filter(data => data.activityInstanceName == "Revisar Diploma"); let diplomasValidar = despachospr.filter(data => data.activityInstanceName == "Revisar Diploma");
this.count_dip_pv = Object.keys(diplomasValidar).length; this.count_dip_pv = Object.keys(diplomasValidar).length;
@@ -263,14 +265,14 @@ export class GabineteDigitalPage implements OnInit {
this.count_dip_as_pr = Object.keys(diplomasAssinados).length; this.count_dip_as_pr = Object.keys(diplomasAssinados).length;
this.processesbackend.GetToApprovedEvents('PR','true').subscribe(res=>{ this.processesbackend.GetToApprovedEvents('PR','true').subscribe(res=>{
this.count_ev_pr = res; this.count_ev_pr = res;
}); });
this.processesbackend.GetToApprovedEvents('MDGPR','true').subscribe(res=>{ this.processesbackend.GetToApprovedEvents('MDGPR','true').subscribe(res=>{
this.count_ev_md = res; this.count_ev_md = res;
}); });
this.showLoader = false; this.showLoader = false;
this.count_exp_pp = "-"; this.count_exp_pp = "-";
this.count_exp_pd = "-"; this.count_exp_pd = "-";
this.count_dip_apr = "-"; this.count_dip_apr = "-";
@@ -279,7 +281,7 @@ export class GabineteDigitalPage implements OnInit {
doRefresh(event) { doRefresh(event) {
console.log(event); console.log(event);
this.closeAllDesktopComponents(); this.closeAllDesktopComponents();
/* switch(this.loggeduser.Profile){ /* switch(this.loggeduser.Profile){
case 'MDGPR': case 'MDGPR':
@@ -302,7 +304,7 @@ export class GabineteDigitalPage implements OnInit {
} }
else{ else{
console.log('null'); console.log('null');
} }
} }
@@ -358,7 +360,7 @@ export class GabineteDigitalPage implements OnInit {
} }
break; break;
} }
} }
openPedidosPage(segment:string) { openPedidosPage(segment:string) {
@@ -394,7 +396,7 @@ export class GabineteDigitalPage implements OnInit {
this.showDespachos = true; this.showDespachos = true;
} }
} }
openDespachosPrPage(segment?:string) { openDespachosPrPage(segment?:string) {
this.closeAllDesktopComponents(); this.closeAllDesktopComponents();
if( window.innerWidth <= 801){ if( window.innerWidth <= 801){