mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
improve
This commit is contained in:
@@ -131,13 +131,22 @@ export class TaskService {
|
||||
updateAllProcess = () => {
|
||||
this.AllProcess = this.sortArrayISODate(this.despachoprstore.list.concat(this.deplomasStore.diplomasAssinadoList as any).concat(this.deplomasStore.diplomasParaAssinarList as any).concat(this.deplomasStore.DiplomaGerarList as any).concat(this.deplomasStore.diplomasReviewList)
|
||||
.concat(this.eventoaprovacaostore.contactList as any).concat(this.expedientegbstore.list as any).concat(this.despachoStore.list as any).concat(this.pedidosstore.listparecer as any).concat(this.pedidosstore.listdeferimento as any)
|
||||
.concat(this.pendentesstore.list as any)).reverse()
|
||||
.concat(this.pendentesstore.list as any))
|
||||
|
||||
}
|
||||
|
||||
sortArrayISODate(myArray: any): any[] {
|
||||
|
||||
return myArray.sort((a,b) => Date.parse(b.CreateDate || b.taskStartDate || b.TaskStartDate) - Date.parse(a.CreateDate || a.taskStartDate || a.TaskStartDate))
|
||||
return myArray.sort((a,b) => Date.parse(b.TaskReceiveDate || b.taskReceiveDate || b.taskStartDate || b.TaskStartDate) - Date.parse(a.TaskReceiveDate || a.taskReceiveDate || a.taskStartDate || a.TaskStartDate))
|
||||
}
|
||||
|
||||
reorderList(orderBy: string, list) {
|
||||
|
||||
if(orderBy == 'recent') {
|
||||
return this.sortArrayISODate(list).reverse();
|
||||
} else {
|
||||
return this.sortArrayISODate(list)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -200,6 +209,8 @@ export class TaskService {
|
||||
});
|
||||
|
||||
expedientes = expedientes.map((element) => this.expedienteTaskPipe.transform(element));
|
||||
|
||||
expedientes = this.sortArrayISODate(expedientes).reverse()
|
||||
|
||||
this.expedientegbstore.reset(expedientes);
|
||||
} catch (error) {
|
||||
@@ -254,34 +265,37 @@ export class TaskService {
|
||||
|
||||
async loadEventosParaAprovacao() {
|
||||
|
||||
try {
|
||||
for(let calendar of this.eventService.calendarNamesAry) {
|
||||
if(calendar == 'Meu calendario') {
|
||||
// color
|
||||
let genericEvents = await this.processesbackend.GetTasksList('Agendar Evento', false).toPromise();
|
||||
let eventsList
|
||||
try {
|
||||
eventsList = this.sortService.sortArrayByDate(genericEvents).reverse();
|
||||
} catch (error) {
|
||||
eventsList = [];
|
||||
// PR dont have event to approve
|
||||
if(this.SessionStore.user.Profile != 'PR') {
|
||||
try {
|
||||
for(let calendar of this.eventService.calendarNamesAry) {
|
||||
if(calendar == 'Meu calendario') {
|
||||
// color
|
||||
let genericEvents = await this.processesbackend.GetTasksList('Agendar Evento', false).toPromise();
|
||||
let eventsList
|
||||
try {
|
||||
eventsList = this.sortService.sortArrayByDate(genericEvents).reverse();
|
||||
} catch (error) {
|
||||
eventsList = [];
|
||||
}
|
||||
|
||||
this.eventoaprovacaostore.save(calendar, eventsList)
|
||||
|
||||
} else {
|
||||
let allEvents = await this.processesbackend.eventsToApprove(calendar.OwnerUserId, 'againete page').toPromise()
|
||||
let eventsList
|
||||
try {
|
||||
eventsList = this.sortService.sortArrayByDate(allEvents).reverse();
|
||||
} catch(error) {
|
||||
eventsList = []
|
||||
}
|
||||
|
||||
this.eventoaprovacaostore.save(calendar.OwnerUserId, eventsList)
|
||||
}
|
||||
|
||||
this.eventoaprovacaostore.save(calendar, eventsList)
|
||||
|
||||
} else {
|
||||
let allEvents = await this.processesbackend.eventsToApprove(calendar.OwnerUserId, 'againete page').toPromise()
|
||||
let eventsList
|
||||
try {
|
||||
eventsList = this.sortService.sortArrayByDate(allEvents).reverse();
|
||||
} catch(error) {
|
||||
eventsList = []
|
||||
}
|
||||
|
||||
this.eventoaprovacaostore.save(calendar.OwnerUserId, eventsList)
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -321,7 +335,7 @@ export class TaskService {
|
||||
diplomasList.push(task);
|
||||
});
|
||||
|
||||
diplomasList = this.sortService.sortDate(diplomasList, 'CreateDate')
|
||||
diplomasList = this.sortService.sortDate(diplomasList, 'CreateDate').reverse()
|
||||
this.deplomasStore.resetDiplomaGerar(diplomasList);
|
||||
|
||||
|
||||
@@ -343,10 +357,12 @@ export class TaskService {
|
||||
let diplomasAssinar: any = depachoAPI.filter(data => data.activityInstanceName == "Assinar Diploma");
|
||||
diplomasAssinar = diplomasAssinar.map((element) => this.expedienteTaskPipe.transform(element))
|
||||
this.sortService.sortDate(diplomasAssinar, 'CreateDate')
|
||||
diplomasAssinar = this.sortService.sortArrayISODate(diplomasAssinar)
|
||||
this.deplomasStore.resetDiplomasParaAssinar(diplomasAssinar)
|
||||
|
||||
let diplomasAssinados: any = depachoAPI.filter(data => data.activityInstanceName == "Diploma Assinado");
|
||||
diplomasAssinados = diplomasAssinados.map((element) => this.expedienteTaskPipe.transform(element))
|
||||
diplomasAssinados = this.sortService.sortArrayISODate(diplomasAssinados)
|
||||
this.deplomasStore.resetDiplomasAssinadoList(diplomasAssinados)
|
||||
} catch (error) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user