This commit is contained in:
tiago.kayaya
2021-07-13 12:05:17 +01:00
parent 40de613773
commit ae090ad82d
7 changed files with 99 additions and 70 deletions
@@ -23,7 +23,7 @@ export class EditEventPage implements OnInit {
validateFrom = false validateFrom = false
public endMinDate = new Date(new Date().getTime() + 15 * 60000); public endMinDate = new Date(new Date().getTime() + 15 * 60000);
public minDate = new Date().toISOString().slice(0,10) public minDate = new Date().toISOString().slice(0,10)
postEvent: Event; postEvent: Event;
isRecurring:string; isRecurring:string;
isEventEdited: boolean; isEventEdited: boolean;
@@ -45,7 +45,7 @@ export class EditEventPage implements OnInit {
taskParticipantsCc: any = []; taskParticipantsCc: any = [];
adding: "intervenient" | "CC" = "intervenient"; adding: "intervenient" | "CC" = "intervenient";
showAttendees = false; showAttendees = false;
@@ -94,9 +94,9 @@ export class EditEventPage implements OnInit {
else { else {
this.isRecurring = "Repete"; this.isRecurring = "Repete";
} }
this.getAttachments(this.postEvent.EventId); this.getAttachments(this.postEvent.EventId);
} }
ngOnInit() { ngOnInit() {
@@ -114,9 +114,9 @@ export class EditEventPage implements OnInit {
setTimeout(() => { setTimeout(() => {
this.selectedRecurringType = this.postEvent.EventRecurrence.Type.toString(); this.selectedRecurringType = this.postEvent.EventRecurrence.Type.toString();
}, 500); }, 500);
} }
close() { close() {
this.modalController.dismiss(); this.modalController.dismiss();
} }
@@ -168,17 +168,17 @@ export class EditEventPage implements OnInit {
IsRecurring: new FormControl(this.postEvent.IsRecurring, [ IsRecurring: new FormControl(this.postEvent.IsRecurring, [
Validators.required Validators.required
]), ]),
// participantes: new FormControl(this.taskParticipantsCc.concat(this.taskParticipants), [ // participantes: new FormControl(this.taskParticipantsCc.concat(this.taskParticipants), [
// Validators.required // Validators.required
// ]), // ]),
}) })
} }
save() { save() {
this.injectValidation() this.injectValidation()
this.runValidation() this.runValidation()
@@ -186,13 +186,13 @@ export class EditEventPage implements OnInit {
if(this.selectedRecurringType != '-1'){ if(this.selectedRecurringType != '-1'){
this.postEvent.EventRecurrence.Type = this.selectedRecurringType; this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
} }
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc) this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc)
try{ try{
console.log(this.postEvent); console.log(this.postEvent);
this.postEvent.EventRecurrence.Type = this.selectedRecurringType; this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
/* this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => { this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
if(this.initCalendarName != this.postEvent.CalendarName){ if(this.initCalendarName != this.postEvent.CalendarName){
let body = { let body = {
"EventId": this.postEvent.EventId, "EventId": this.postEvent.EventId,
@@ -205,7 +205,7 @@ export class EditEventPage implements OnInit {
}, error => { }, error => {
this.toastService.badRequest() this.toastService.badRequest()
}); */ });
this.isEventEdited = true; this.isEventEdited = true;
this.goBack(); this.goBack();
@@ -222,10 +222,10 @@ export class EditEventPage implements OnInit {
saveDocument() { saveDocument() {
this.loadedEventAttachments.forEach((e)=>{ this.loadedEventAttachments.forEach((e)=>{
const id: any = e.Id const id: any = e.Id
const remove = e['remove'] const remove = e['remove']
if ( id == 'add') { if ( id == 'add') {
//data.selected //data.selected
const DocumentToSave = { const DocumentToSave = {
@@ -270,7 +270,7 @@ export class EditEventPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then((data) => { modal.onDidDismiss().then((data) => {
if(data){ if(data){
data = data['data']; data = data['data'];
@@ -290,7 +290,7 @@ export class EditEventPage implements OnInit {
this.taskParticipants = data; this.taskParticipants = data;
this.postEvent.Attendees = data; this.postEvent.Attendees = data;
} }
setIntervenientCC(data){ setIntervenientCC(data){
this.taskParticipantsCc = data; this.taskParticipantsCc = data;
} }
@@ -310,25 +310,25 @@ export class EditEventPage implements OnInit {
this.taskParticipantsCc = taskParticipantsCc; this.taskParticipantsCc = taskParticipantsCc;
} }
getAttachments(eventId: string){ getAttachments(eventId: string){
this.attachmentsService.getAttachmentsById(eventId).subscribe(res=>{ this.attachmentsService.getAttachmentsById(eventId).subscribe(res=>{
this.loadedEventAttachments = res; this.loadedEventAttachments = res;
console.log('res', res); console.log('res', res);
}); });
} }
deleteAttachment(attachmentID: string, index) { deleteAttachment(attachmentID: string, index) {
const id: any = this.loadedEventAttachments[index].Id const id: any = this.loadedEventAttachments[index].Id
if(id == 'add') { if(id == 'add') {
this.loadedEventAttachments = this.loadedEventAttachments.filter((e,i)=> i!=index) this.loadedEventAttachments = this.loadedEventAttachments.filter((e,i)=> i!=index)
} else { } else {
this.loadedEventAttachments[index]['remove'] = true this.loadedEventAttachments[index]['remove'] = true
} }
} }
async getDoc() { async getDoc() {
@@ -368,4 +368,4 @@ export class EditEventPage implements OnInit {
}) })
} }
} }
@@ -14,7 +14,7 @@ import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discar
import { AuthService } from 'src/app/services/auth.service'; import { AuthService } from 'src/app/services/auth.service';
import { DespachoPage } from 'src/app/pages/gabinete-digital/despachos/despacho/despacho.page'; import { DespachoPage } from 'src/app/pages/gabinete-digital/despachos/despacho/despacho.page';
import { NavigationExtras, Router } from '@angular/router'; import { NavigationEnd, NavigationExtras, Router } from '@angular/router';
@Component({ @Component({
selector: 'app-despachos', selector: 'app-despachos',
@@ -51,14 +51,25 @@ export class DespachosPage implements OnInit {
private alertService: AlertService, private alertService: AlertService,
private authService: AuthService, private authService: AuthService,
private router: Router, private router: Router,
) { ) {
this.profile = 'mdgpr'; this.profile = 'mdgpr';
} }
ngOnInit() { ngOnInit() {
//Inicializar segment //Inicializar segment
this.segment = "despachos"; this.segment = "despachos";
this.LoadList(); const pathname = window.location.pathname;
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == pathname) {
this.refreshing();
}
});
}
async refreshing() {
setTimeout(() => {
this.LoadList();
}, 1500);
} }
segmentChanged(ev: any) { segmentChanged(ev: any) {
@@ -71,13 +82,13 @@ export class DespachosPage implements OnInit {
} }
async LoadList() { async LoadList() {
let result = await this.processes.GetTasksList("Despacho", false).toPromise(); let result = await this.processes.GetTasksList("Despacho", false).toPromise();
//let despachos = result.reverse().filter(data => data.activityInstanceName == "Despacho (Paralelo)"); //let despachos = result.reverse().filter(data => data.activityInstanceName == "Despacho (Paralelo)");
this.despachoList = new Array(); this.despachoList = new Array();
await result.forEach( (element, index) => { await result.forEach( (element, index) => {
let date = new Date(element.taskStartDate); let date = new Date(element.taskStartDate);
date.setMonth(date.getMonth() + 1); date.setMonth(date.getMonth() + 1);
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds(); let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
@@ -99,7 +110,7 @@ export class DespachosPage implements OnInit {
this.despachoList = this.sortArrayISODate(this.despachoList).reverse() this.despachoList = this.sortArrayISODate(this.despachoList).reverse()
this.despachoList.forEach( (element, index) => { this.despachoList.forEach( (element, index) => {
// let aplicationId = element.workflowInstanceDataFields.SourceSecFsID; // let aplicationId = element.workflowInstanceDataFields.SourceSecFsID;
let FolderID = element['FolderID']; let FolderID = element['FolderID'];
@@ -139,5 +150,5 @@ export class DespachosPage implements OnInit {
goToList() { goToList() {
this.router.navigate(['/home/gabinete-digital/despachos']); this.router.navigate(['/home/gabinete-digital/despachos']);
} }
} }
@@ -1,5 +1,5 @@
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
import { NavigationExtras, Router } from '@angular/router'; import { NavigationEnd, NavigationExtras, Router } from '@angular/router';
import { DailyWorkTask, tasksList } from '../../../models/dailyworktask.model'; import { DailyWorkTask, tasksList } 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 { formatDate } from '@angular/common';
@@ -18,10 +18,10 @@ export class DiplomasAssinarPage implements OnInit {
showLoader: boolean; showLoader: boolean;
totalDocs:any; totalDocs:any;
serialNumber:string; serialNumber:string;
@Input() profile:string; @Input() profile:string;
@Input() segment:string; @Input() segment:string;
constructor( constructor(
private processes:ProcessesService, private processes:ProcessesService,
private modalController: ModalController, private modalController: ModalController,
@@ -29,11 +29,16 @@ export class DiplomasAssinarPage implements OnInit {
private router: Router, private router: Router,
) { ) {
} }
ngOnInit() { ngOnInit() {
this.LoadList(); const pathname = window.location.pathname;
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == pathname) {
this.refreshing();
}
});
} }
goToDiploma(serialNumber:any){ goToDiploma(serialNumber:any){
let navigationExtras: NavigationExtras = { let navigationExtras: NavigationExtras = {
queryParams: { queryParams: {
@@ -42,16 +47,22 @@ export class DiplomasAssinarPage implements OnInit {
}; };
this.router.navigate(['/home/gabinete-digital/diplomas-assinar/diploma-assinar'], navigationExtras); this.router.navigate(['/home/gabinete-digital/diplomas-assinar/diploma-assinar'], navigationExtras);
} }
async refreshing() {
setTimeout(() => {
this.LoadList();
}, 1500);
}
doRefresh(event) { doRefresh(event) {
this.LoadList(); this.LoadList();
setTimeout(() => { setTimeout(() => {
event.target.complete(); event.target.complete();
}, 2000); }, 2000);
} }
async LoadList(){ async LoadList(){
let diplomas = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise(); let diplomas = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
this.diplomasList = new Array(); this.diplomasList = new Array();
let diplomasAssinar = diplomas.reverse().filter(data => data.activityInstanceName == "Assinar Diploma"); let diplomasAssinar = diplomas.reverse().filter(data => data.activityInstanceName == "Assinar Diploma");
@@ -94,7 +105,7 @@ export class DiplomasAssinarPage implements OnInit {
}); });
this.showLoader = false; this.showLoader = false;
} }
goBack() { goBack() {
this.router.navigate(['/home/gabinete-digital']); this.router.navigate(['/home/gabinete-digital']);
// window.history.back() // window.history.back()
@@ -33,19 +33,16 @@ export class ExpedientePage implements OnInit {
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'; this.profile = 'mdgpr';
} }
ngOnInit() { ngOnInit() {
this.LoadList();
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.LoadList(); this.refreshing();
} }
}); });
} }
@@ -83,6 +80,12 @@ export class ExpedientePage implements OnInit {
}); });
} }
async refreshing() {
setTimeout(() => {
this.LoadList();
}, 1500);
}
doRefresh(event) { doRefresh(event) {
this.LoadList(); this.LoadList();
setTimeout(() => { setTimeout(() => {
@@ -99,4 +102,3 @@ export class ExpedientePage implements OnInit {
} }
} }
@@ -33,16 +33,15 @@ export class ExpedientesPrPage implements OnInit {
private modalController: ModalController, private modalController: ModalController,
private alertService: AlertService, private alertService: AlertService,
private authService: AuthService, private authService: AuthService,
private router: Router, private router: Router,
) { ) {
this.loggeduser = authService.ValidatedUser; this.loggeduser = authService.ValidatedUser;
this.LoadList(); this.LoadList();
} }
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.refreshing(); this.refreshing();
@@ -78,7 +77,7 @@ export class ExpedientesPrPage implements OnInit {
console.log(this.taskslist); console.log(this.taskslist);
this.showLoader = false; this.showLoader = false;
}); });
break; break;
case 'PR': case 'PR':
this.processes.GetTasksList("Expediente do Presidente", false).subscribe(result => { this.processes.GetTasksList("Expediente do Presidente", false).subscribe(result => {
@@ -1,5 +1,5 @@
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router'; import { ActivatedRoute, NavigationEnd, NavigationExtras, Router } from '@angular/router';
import { CalendarComponent } from 'ionic2-calendar'; import { CalendarComponent } from 'ionic2-calendar';
import { DailyWorkTask, tasksList } from '../../../models/dailyworktask.model'; import { DailyWorkTask, tasksList } from '../../../models/dailyworktask.model';
@@ -24,7 +24,7 @@ export class PedidosPage implements OnInit {
taskslist:DailyWorkTask[]; taskslist:DailyWorkTask[];
parecerList:any[]; parecerList:any[];
fulltask:any; fulltask:any;
parecerListResult:tasksList[] = []; parecerListResult:tasksList[] = [];
deferimentoListResult:tasksList[] = []; deferimentoListResult:tasksList[] = [];
@@ -36,29 +36,30 @@ export class PedidosPage implements OnInit {
@Output() openExpedientDetail:EventEmitter<any> = new EventEmitter<any>(); @Output() openExpedientDetail:EventEmitter<any> = new EventEmitter<any>();
constructor( constructor(
private router: Router, private router: Router,
private processes:ProcessesService, private processes:ProcessesService,
private modalController: ModalController, private modalController: ModalController,
private alertService: AlertService, private alertService: AlertService,
private activatedRoute: ActivatedRoute, private activatedRoute: ActivatedRoute,
) { ) {
} //Inicializar segment
ngOnInit() {
//Inicializar segment
this.segment = 'parecer'; this.segment = 'parecer';
this.activatedRoute.queryParams.subscribe(params => { this.activatedRoute.queryParams.subscribe(params => {
if(params['deferimento'] == 'true') { if(params['deferimento'] == 'true') {
this.segment = 'deferimento'; this.segment = 'deferimento';
} else if (params['parecer'] == 'true') { } else if (params['parecer'] == 'true') {
this.segment = 'parecer'; this.segment = 'parecer';
} }
this.LoadList();
}); });
}
this.LoadList();
ngOnInit() {
const pathname = window.location.pathname;
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == pathname) {
this.refreshing();
}
});
} }
goBack() { goBack() {
@@ -123,15 +124,15 @@ export class PedidosPage implements OnInit {
} }
this.parecerList.push(task); this.parecerList.push(task);
}); });
} }
else if(this.segment == 'deferimento') { else if(this.segment == 'deferimento') {
this.taskType = "Pedido de Deferimento"; this.taskType = "Pedido de Deferimento";
this.processes.GetTasksList("Pedido de Deferimento", false).subscribe(result => { this.processes.GetTasksList("Pedido de Deferimento", false).subscribe(result => {
this.taskslist = result; this.taskslist = result;
console.log(result); console.log(result);
this.deferimentoList = new Array(); this.deferimentoList = new Array();
let res = result.reverse(); let res = result.reverse();
res.forEach(element => { res.forEach(element => {
@@ -153,11 +154,17 @@ export class PedidosPage implements OnInit {
} }
this.deferimentoList.push(task); this.deferimentoList.push(task);
}); });
}); });
} }
} }
refreshing() {
setTimeout(() => {
this.LoadList();
}, 1500);
}
doRefresh(event) { doRefresh(event) {
this.LoadList(); this.LoadList();
setTimeout(() => { setTimeout(() => {
@@ -167,4 +174,3 @@ export class PedidosPage implements OnInit {
} }
@@ -31,7 +31,7 @@ export class PendentesPage implements OnInit {
private alertService: AlertService, private alertService: AlertService,
private router: Router, private router: Router,
private activatedRoute: ActivatedRoute, private activatedRoute: ActivatedRoute,
) { ){
this.pendentesList = new Array(); this.pendentesList = new Array();
this.profile = 'mdgpr'; this.profile = 'mdgpr';
} }