mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
save
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
<!-- Aside left -->
|
<!-- Aside left -->
|
||||||
<div class="aside-wrapper d-flex flex-column width-md-40 flex-grow-1">
|
<div class="aside-wrapper d-flex flex-column width-md-40 flex-grow-1">
|
||||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
<ion-progress-bar type="indeterminate" *ngIf="getloadKeys.length >= 1"></ion-progress-bar>
|
||||||
<div class="title-container">
|
<div class="title-container">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<ion-label>Gabinete Digital</ion-label>
|
<ion-label>Gabinete Digital</ion-label>
|
||||||
@@ -148,7 +148,6 @@
|
|||||||
<p class="text-center exp-card-title ">Todas as tarefas</p>
|
<p class="text-center exp-card-title ">Todas as tarefas</p>
|
||||||
<p class="text-center exp-card-content"> {{ getAllProcessCount }} <span class="title1">Documentos</span></p>
|
<p class="text-center exp-card-content"> {{ getAllProcessCount }} <span class="title1">Documentos</span></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="p.userPermission([p.permissionList.Gabinete.aprove_event])" (click)="openEventsToApprovePage();selectedElement='approval'" [class.active]="selectedElement == 'approval'" class="box-hover exp-card d-flex flex-column">
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.aprove_event])" (click)="openEventsToApprovePage();selectedElement='approval'" [class.active]="selectedElement == 'approval'" class="box-hover exp-card d-flex flex-column">
|
||||||
<div class="d-flex justify-center">
|
<div class="d-flex justify-center">
|
||||||
<ion-icon src="assets/images/icons-agenda.svg"></ion-icon>
|
<ion-icon src="assets/images/icons-agenda.svg"></ion-icon>
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import { DataService } from 'src/app/services/data.service';
|
|||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
|
import { async } from '@angular/core/testing';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -47,7 +48,7 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
|
|
||||||
segment: string;
|
segment: string;
|
||||||
segmentVista: string;
|
segmentVista: string;
|
||||||
showLoader: boolean;
|
showLoader: boolean = false
|
||||||
public profile: string;
|
public profile: string;
|
||||||
|
|
||||||
allProcessesList: any = new Array();
|
allProcessesList: any = new Array();
|
||||||
@@ -149,6 +150,8 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
public p: PermissionService
|
public p: PermissionService
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
window.onresize = (event) => {
|
window.onresize = (event) => {
|
||||||
// if not mobile remove all component
|
// if not mobile remove all component
|
||||||
@@ -252,7 +255,6 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
this.storage.get('GabineteProcess').then((allprocess: any[]) => {
|
this.storage.get('GabineteProcess').then((allprocess: any[]) => {
|
||||||
|
|
||||||
if(allprocess.forEach) {
|
|
||||||
allprocess.forEach(element => {
|
allprocess.forEach(element => {
|
||||||
let date = new Date(element.taskStartDate);
|
let date = new Date(element.taskStartDate);
|
||||||
date.setMonth(date.getMonth() + 1);
|
date.setMonth(date.getMonth() + 1);
|
||||||
@@ -280,12 +282,9 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
this.allProcessesList = this.sortService.sortDate(this.allProcessesList, 'CreateDate')
|
this.allProcessesList = this.sortService.sortDate(this.allProcessesList, 'CreateDate')
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.sqliteservice.getAllProcess().then((allprocess: any[]) => {
|
this.sqliteservice.getAllProcess().then((allprocess: any[]) => {
|
||||||
if(allprocess.forEach) {
|
|
||||||
allprocess.forEach(element => {
|
allprocess.forEach(element => {
|
||||||
let date = new Date(element.taskStartDate);
|
let date = new Date(element.taskStartDate);
|
||||||
date.setMonth(date.getMonth() + 1);
|
date.setMonth(date.getMonth() + 1);
|
||||||
@@ -315,8 +314,6 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
this.allProcessesList = this.sortService.sortDate(this.allProcessesList, 'CreateDate')
|
this.allProcessesList = this.sortService.sortDate(this.allProcessesList, 'CreateDate')
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -369,6 +366,9 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
return thedate.getHours() + ":" +
|
return thedate.getHours() + ":" +
|
||||||
thedate.getMinutes();
|
thedate.getMinutes();
|
||||||
}
|
}
|
||||||
|
goto(url) {
|
||||||
|
this.router.navigate([url])
|
||||||
|
}
|
||||||
|
|
||||||
goToProcess(serialNumber: string, workflowName: string, activityName: string) {
|
goToProcess(serialNumber: string, workflowName: string, activityName: string) {
|
||||||
|
|
||||||
@@ -389,7 +389,7 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
else if (activityName == 'Diploma Assinado') {
|
else if (activityName == 'Diploma Assinado') {
|
||||||
this.router.navigate(['/home/gabinete-digital/diplomas-assinar', serialNumber, 'gabinete-digital']);
|
this.router.navigate(['/home/gabinete-digital/diplomas-assinar', serialNumber, 'gabinete-digital']);
|
||||||
} else {
|
} else {
|
||||||
// alert('bug!')
|
alert('bug!')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (workflowName == 'Pedido de Parecer' || workflowName == 'Pedido de Deferimento') {
|
else if (workflowName == 'Pedido de Parecer' || workflowName == 'Pedido de Deferimento') {
|
||||||
@@ -535,41 +535,67 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
return this.AllProcess.length
|
return this.AllProcess.length
|
||||||
}
|
}
|
||||||
|
|
||||||
async LoadCounts() {
|
loadProcess = {}
|
||||||
|
|
||||||
let expedientes;
|
get getloadKeys() {
|
||||||
this.showLoader = true
|
return Object.keys(this.loadProcess)
|
||||||
|
|
||||||
try {
|
|
||||||
expedientes = await this.processesbackend.GetTaskListExpediente(false).toPromise()
|
|
||||||
this.loadCount = true;
|
|
||||||
this.showLoader = false;
|
|
||||||
} catch(error) {
|
|
||||||
this.showLoader = false
|
|
||||||
this.loadCount = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
expedientes = (expedientes || [] ).filter(data => data.workflowInstanceDataFields.Status == "Active")
|
async LoadCounts() {
|
||||||
|
|
||||||
|
(async () =>{
|
||||||
|
if(!this.loadProcess['expedientes']) {
|
||||||
|
try {
|
||||||
|
this.loadProcess['expedientes'] = true
|
||||||
|
let expedientes: any = await this.processesbackend.GetTaskListExpediente(false).toPromise();
|
||||||
|
expedientes = expedientes.filter(data => data.workflowInstanceDataFields.Status == "Active")
|
||||||
expedientes = expedientes.filter((item) => {
|
expedientes = expedientes.filter((item) => {
|
||||||
return item.activityInstanceName != 'Retificar Expediente'
|
return item.activityInstanceName != 'Retificar Expediente'
|
||||||
});
|
});
|
||||||
|
|
||||||
expedientes = expedientes.map((element) => this.expedienteTaskPipe.transform(element));
|
expedientes = expedientes.map((element) => this.expedienteTaskPipe.transform(element));
|
||||||
|
|
||||||
this.expedientegbstore.count = expedientes.length;
|
this.expedientegbstore.count = expedientes.length;
|
||||||
this.expedientegbstore.reset(expedientes);
|
this.expedientegbstore.reset(expedientes);
|
||||||
|
|
||||||
|
delete this.loadProcess['expedientes']
|
||||||
|
this.loadCount = true
|
||||||
|
} catch(error) {
|
||||||
|
this.loadCount = true
|
||||||
|
delete this.loadProcess['expedientes']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
(async () =>{
|
||||||
|
|
||||||
|
if(!this.loadProcess['despachos']) {
|
||||||
|
try {
|
||||||
|
this.loadProcess['despachos'] = true
|
||||||
|
|
||||||
let despachos = await this.despachoRule.getList({ updateStore: true })
|
let despachos = await this.despachoRule.getList({ updateStore: true })
|
||||||
if (despachos) {
|
if (despachos) {
|
||||||
this.despachoStore.reset(despachos)
|
this.despachoStore.reset(despachos)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete this.loadProcess['despachos']
|
||||||
|
} catch(error) {
|
||||||
|
delete this.loadProcess['despachos']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let pareceres = await this.processesbackend.GetTasksList("Pedido de Parecer", false).toPromise();
|
|
||||||
let pareceresPr = await this.processesbackend.GetTasksList("Pedido de Parecer do Presidente", false).toPromise();
|
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
(async()=>{
|
||||||
|
|
||||||
|
if(!this.loadProcess['parecerespareceresPr']) {
|
||||||
|
try {
|
||||||
|
this.loadProcess['parecerespareceresPr'] = true
|
||||||
|
|
||||||
|
let pareceres, pareceresPr;
|
||||||
|
pareceres = await this.processesbackend.GetTasksList("Pedido de Parecer", false).toPromise();
|
||||||
|
pareceresPr = await this.processesbackend.GetTasksList("Pedido de Parecer do Presidente", false).toPromise();
|
||||||
let allParecer = pareceres.concat(pareceresPr);
|
let allParecer = pareceres.concat(pareceresPr);
|
||||||
|
|
||||||
this.count_par_dailywork = Object.keys(allParecer.filter(data => data.workflowInstanceDataFields.Status == "Active")).length;
|
this.count_par_dailywork = Object.keys(allParecer.filter(data => data.workflowInstanceDataFields.Status == "Active")).length;
|
||||||
@@ -590,6 +616,20 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
delete this.loadProcess['parecerespareceresPr']
|
||||||
|
} catch(error) {
|
||||||
|
delete this.loadProcess['parecerespareceresPr']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
(async()=>{
|
||||||
|
if(!this.loadProcess['deferimentos']) {
|
||||||
|
try {
|
||||||
|
this.loadProcess['deferimentos'] = true
|
||||||
|
|
||||||
let deferimentos = await this.processesbackend.GetTasksList("Pedido de Deferimento", false).toPromise();
|
let deferimentos = await this.processesbackend.GetTasksList("Pedido de Deferimento", false).toPromise();
|
||||||
this.count_def_dailywork = Object.keys(deferimentos.filter(data => data.workflowInstanceDataFields.Status == "Active")).length;
|
this.count_def_dailywork = Object.keys(deferimentos.filter(data => data.workflowInstanceDataFields.Status == "Active")).length;
|
||||||
this.pedidosstore.countdeferimento = this.count_def_dailywork;
|
this.pedidosstore.countdeferimento = this.count_def_dailywork;
|
||||||
@@ -609,18 +649,53 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
delete this.loadProcess['deferimentos']
|
||||||
|
} catch(error) {
|
||||||
|
delete this.loadProcess['deferimentos']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let pendentes = await this.processesbackend.GetPendingTasks(false).toPromise();
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
(async()=>{
|
||||||
|
if(!this.loadProcess['despachos']) {
|
||||||
|
try {
|
||||||
|
this.loadProcess['despachos'] = true
|
||||||
|
|
||||||
|
let despachos = await this.despachoRule.getList({ updateStore: true })
|
||||||
|
if (despachos) {
|
||||||
|
this.despachoStore.reset(despachos)
|
||||||
|
}
|
||||||
|
|
||||||
|
delete this.loadProcess['despachos']
|
||||||
|
} catch(error) {
|
||||||
|
delete this.loadProcess['despachos']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
(async()=>{
|
||||||
|
let pendentes
|
||||||
|
try {
|
||||||
|
pendentes = await this.processesbackend.GetPendingTasks(false).toPromise();
|
||||||
this.count_total_pending = Object.keys(pendentes).length;
|
this.count_total_pending = Object.keys(pendentes).length;
|
||||||
this.pendentesstore.count = this.count_total_pending;
|
this.pendentesstore.count = this.count_total_pending;
|
||||||
|
|
||||||
pendentes = pendentes.map((element)=> this.customTaskPipe.transform(element))
|
pendentes = pendentes.map((element)=> this.customTaskPipe.transform(element))
|
||||||
|
|
||||||
this.pendentesstore.reset(pendentes);
|
this.pendentesstore.reset(pendentes);
|
||||||
|
} catch (error) {
|
||||||
|
}
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
(async()=>{
|
||||||
|
if(!this.loadProcess['despachosPr']) {
|
||||||
|
try {
|
||||||
let depachoAPI: any = await this.processesbackend.GetTasksList("Despacho do Presidente da República", false).toPromise();
|
let depachoAPI: any = await this.processesbackend.GetTasksList("Despacho do Presidente da República", false).toPromise();
|
||||||
|
|
||||||
|
|
||||||
if(this.loggeduser.Profile != 'PR') {
|
if(this.loggeduser.Profile != 'PR') {
|
||||||
|
|
||||||
let depacho = depachoAPI.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
let depacho = depachoAPI.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||||
@@ -634,24 +709,6 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
let depacho = depachoAPI.filter(data => data.activityInstanceName == "Concluir Despacho").filter(data => data.workflowInstanceDataFields.Status == "Active")
|
let depacho = depachoAPI.filter(data => data.activityInstanceName == "Concluir Despacho").filter(data => data.workflowInstanceDataFields.Status == "Active")
|
||||||
depacho = depacho.map((e)=> this.customTaskPipe.transform(e))
|
depacho = depacho.map((e)=> this.customTaskPipe.transform(e))
|
||||||
this.despachoprstore.reset(depacho)
|
this.despachoprstore.reset(depacho)
|
||||||
}
|
|
||||||
|
|
||||||
let mdEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial MDGPR', false).toPromise();
|
|
||||||
let mdEventsPessoal = await this.processesbackend.GetTasksList('Agenda Pessoal MDGPR', false).toPromise();
|
|
||||||
let eventsMDGPRList = mdEventsOficial.concat(mdEventsPessoal);
|
|
||||||
|
|
||||||
eventsMDGPRList = eventsMDGPRList.filter((item) => item.activityInstanceName != 'Editar Evento')
|
|
||||||
|
|
||||||
this.eventoaprovacaostore.countMd = eventsMDGPRList.length
|
|
||||||
this.eventoaprovacaostore.resetmd(eventsMDGPRList);
|
|
||||||
|
|
||||||
let prEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial PR', false).toPromise();
|
|
||||||
let prEventsPessoal = await this.processesbackend.GetTasksList('Agenda Pessoal PR', false).toPromise();
|
|
||||||
let eventsPRList = prEventsOficial.concat(prEventsPessoal);
|
|
||||||
eventsPRList = eventsPRList.filter((item) => item.activityInstanceName != 'Editar Evento')
|
|
||||||
|
|
||||||
this.eventoaprovacaostore.countPr = eventsPRList.length
|
|
||||||
this.eventoaprovacaostore.resetpr(eventsPRList);
|
|
||||||
|
|
||||||
let diplomasValidar = depachoAPI.filter(data => data.activityInstanceName == "Revisar Diploma");
|
let diplomasValidar = depachoAPI.filter(data => data.activityInstanceName == "Revisar Diploma");
|
||||||
this.count_dip_pv = Object.keys(diplomasValidar).length;
|
this.count_dip_pv = Object.keys(diplomasValidar).length;
|
||||||
@@ -687,25 +744,77 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
|
|
||||||
let diplomasAssinados = depachoAPI.filter(data => data.activityInstanceName == "Diploma Assinado");
|
let diplomasAssinados = depachoAPI.filter(data => data.activityInstanceName == "Diploma Assinado");
|
||||||
this.deplomasStore.resetDiplomasAssinadoList(diplomasAssinados)
|
this.deplomasStore.resetDiplomasAssinadoList(diplomasAssinados)
|
||||||
|
}
|
||||||
|
|
||||||
|
delete this.loadProcess['despachosPr']
|
||||||
|
} catch(error) {
|
||||||
|
delete this.loadProcess['despachosPr']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
(async()=>{
|
||||||
|
if(!this.loadProcess['EventosMD']) {
|
||||||
|
try {
|
||||||
|
this.loadProcess['EventosMD'] = true
|
||||||
|
|
||||||
|
let mdEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial MDGPR', false).toPromise();
|
||||||
|
let mdEventsPessoal = await this.processesbackend.GetTasksList('Agenda Pessoal MDGPR', false).toPromise();
|
||||||
|
let eventsMDGPRList = mdEventsOficial.concat(mdEventsPessoal);
|
||||||
|
|
||||||
|
eventsMDGPRList = eventsMDGPRList.filter((item) => item.activityInstanceName != 'Editar Evento')
|
||||||
|
|
||||||
|
this.eventoaprovacaostore.countMd = eventsMDGPRList.length
|
||||||
|
this.eventoaprovacaostore.resetmd(eventsMDGPRList);
|
||||||
|
|
||||||
|
|
||||||
|
delete this.loadProcess['EventosMD']
|
||||||
|
} catch(error) {
|
||||||
|
delete this.loadProcess['EventosMD']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
(async()=>{
|
||||||
|
if(!this.loadProcess['EventosPR']) {
|
||||||
|
try {
|
||||||
|
this.loadProcess['EventosPR'] = true
|
||||||
|
|
||||||
|
let prEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial PR', false).toPromise();
|
||||||
|
let prEventsPessoal = await this.processesbackend.GetTasksList('Agenda Pessoal PR', false).toPromise();
|
||||||
|
let eventsPRList = prEventsOficial.concat(prEventsPessoal);
|
||||||
|
eventsPRList = eventsPRList.filter((item) => item.activityInstanceName != 'Editar Evento')
|
||||||
|
|
||||||
|
this.eventoaprovacaostore.countPr = eventsPRList.length
|
||||||
|
this.eventoaprovacaostore.resetpr(eventsPRList);
|
||||||
|
|
||||||
|
delete this.loadProcess['EventosPR']
|
||||||
|
} catch(error) {
|
||||||
|
delete this.loadProcess['EventosPR']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
(async()=>{
|
||||||
this.processesbackend.GetToApprovedEvents('Agenda', 'true').subscribe(res => {
|
this.processesbackend.GetToApprovedEvents('Agenda', 'true').subscribe(res => {
|
||||||
this.count_ev_apr = res;
|
this.count_ev_apr = res;
|
||||||
|
}, (error) =>{
|
||||||
|
console.error(error)
|
||||||
});
|
});
|
||||||
|
})();
|
||||||
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 = "-";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.loadCount = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
doRefresh(event) {
|
doRefresh(event) {
|
||||||
|
|
||||||
|
|
||||||
this.LoadCounts();
|
this.LoadCounts();
|
||||||
|
|
||||||
if (event) {
|
if (event) {
|
||||||
|
|||||||
@@ -181,7 +181,6 @@ export class AuthService {
|
|||||||
|
|
||||||
if (event.type === HttpEventType.DownloadProgress) {
|
if (event.type === HttpEventType.DownloadProgress) {
|
||||||
//this.downloadProgess = Math.round((100 * event.loaded) / event.total);
|
//this.downloadProgess = Math.round((100 * event.loaded) / event.total);
|
||||||
//
|
|
||||||
return true
|
return true
|
||||||
} else if (event.type === HttpEventType.Response) {
|
} else if (event.type === HttpEventType.Response) {
|
||||||
downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
|
downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
|
||||||
|
|||||||
Reference in New Issue
Block a user