This commit is contained in:
Peter Maquiran
2021-07-17 12:57:09 +01:00
parent dac1a6dac9
commit 133e3ad122
2 changed files with 12 additions and 9 deletions
@@ -1,5 +1,5 @@
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
import { ActivatedRoute, NavigationEnd, NavigationExtras, Router } from '@angular/router';
import { ActivatedRoute, NavigationEnd, NavigationExtras, NavigationStart, Router } from '@angular/router';
import { CalendarComponent } from 'ionic2-calendar';
import { DailyWorkTask, tasksList } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service';
@@ -50,12 +50,15 @@ export class PedidosPage implements OnInit {
}
ngOnInit() {
const location = window.location
const pathname = location.pathname + location.search
this.LoadList();
this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && event.url.startsWith(pathname)) {
this.LoadList();
if(event instanceof NavigationStart && '/home/gabinete-digital/pedidos?parecer=true'.startsWith(event.url) ||
event instanceof NavigationStart && '/home/gabinete-digital/pedidos?deferimento=true'.startsWith(event.url)
) {
alert('resfresh')
this.refreshing()
}
});
}
@@ -76,7 +79,7 @@ export class PedidosPage implements OnInit {
this.router.navigate(['/home/gabinete-digital/pedidos'], navigationExtras);
this.LoadList();
// this.LoadList();
}
goToPedido(serialNumber:any){
@@ -54,8 +54,8 @@ export class PedidosPage implements OnInit {
this.router.events.forEach((event) => {
if(event instanceof NavigationStart && '/home/gabinete-digital?parecer=true'.startsWith(event.url) ||
event instanceof NavigationEnd && '/home/gabinete-digital?deferimento=true'.startsWith(event.url) ||
event instanceof NavigationEnd && '/home/gabinete-digital?pedidos=true'.startsWith(event.url)
event instanceof NavigationStart && '/home/gabinete-digital?deferimento=true'.startsWith(event.url) ||
event instanceof NavigationStart && '/home/gabinete-digital?pedidos=true'.startsWith(event.url)
) {
this.doRefresh()
}