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