diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 8a18893b1..43f62d57b 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -163,6 +163,10 @@ const routes = [ path: 'profile', loadChildren: () => import('./modals/profile/profile.module').then( m => m.ProfilePageModule) }, + { + path: 'all-processes', + loadChildren: () => import('./shared/gabinete-digital/all-processes/all-processes.module').then( m => m.AllProcessesPageModule) + }, diff --git a/src/app/pages/gabinete-digital/gabinete-digital.module.ts b/src/app/pages/gabinete-digital/gabinete-digital.module.ts index 6e76b7edb..8249a4664 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.module.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.module.ts @@ -34,6 +34,7 @@ import { DiplomasAssinarPageModule } from 'src/app/shared/gabinete-digital/diplo import { HeaderPageModule } from 'src/app/shared/header/header.module'; import { BtnModalDismissPageModule } from 'src/app/shared/btn-modal-dismiss/btn-modal-dismiss.module'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; +import { AllProcessesPageModule } from 'src/app/shared/gabinete-digital/all-processes/all-processes.module'; @NgModule({ imports: [ @@ -45,6 +46,7 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; // HeaderPageModule, EmptyContainerPageModule, + AllProcessesPageModule, EventsToApprovePageModule, ExpedientsPageModule, PedidosPageModule, diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index 4f83fb8f8..412c6f9c5 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -23,7 +23,7 @@
- + @@ -41,7 +41,7 @@
+ (click)="goToProcess(task.SerialNumber, task.WorkflowName, task.activityInstanceName)">
@@ -89,6 +89,15 @@
+
+
+ + +
+

Todas as tarefas

+

{{count_all_processes}}Documentos

+
+
@@ -218,6 +227,7 @@
+ diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.scss b/src/app/pages/gabinete-digital/gabinete-digital.page.scss index d34fda78c..9f1b854e8 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.scss +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.scss @@ -188,7 +188,14 @@ ion-segment-button{ margin: 0 auto; } .exp-card ion-icon{ - font-size: 48px; + font-size: 48px !important; + } + .exp-card fa-icon{ + font-size: 30px; + padding: 0 1px 0 1px; + margin: 6px; + //border: 1px solid #ccc; + color: #797979; } .exp-card-title{ font-size: 15px; diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts index 2ca2ed978..40a0d5488 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts @@ -57,6 +57,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck { count_ev_md=0; count_total_pending = 0; count_desp_pr_active = 0; + count_all_processes = 0; selectedElement = ""; @@ -65,6 +66,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck { showExpediente : false, } + showAllProcesses = false; showEventsToApprove = false; showEmptyContainer = false; showExpedients = false; @@ -125,12 +127,12 @@ export class GabineteDigitalPage implements OnInit, DoCheck { } ngDoCheck(): void { - if( window.innerWidth < 701) { + /* if( window.innerWidth < 701) { this.segmentVista = "listview"; } else{ this.segmentVista = "boxview"; - } + } */ } closeAllDesktopComponent(){ @@ -260,7 +262,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck { thedate.getMinutes(); } - viewProcessDetails(serialNumber:string, workflowName:string, activityName:string){ + goToProcess(serialNumber:string, workflowName:string, activityName:string){ if(workflowName == 'Despacho') { if(activityName == 'Tarefa de Despacho'){ this.router.navigate(['/home/gabinete-digital/despachos',serialNumber,'gabinete-digital']); @@ -305,15 +307,16 @@ export class GabineteDigitalPage implements OnInit, DoCheck { } checkUser(){ - this.selectedElement='Correspondence'; - switch(this.loggeduser.Profile){ + this.selectedElement='allProcessesTag'; + this.showAllProcesses = true; + /* switch(this.loggeduser.Profile){ case 'MDGPR': this.showExpedients = true; break; case 'PR': this.showExpedientesPr = true; break; - } + } */ } hideRefreshButton(){ @@ -332,6 +335,10 @@ export class GabineteDigitalPage implements OnInit, DoCheck { checkRoutes(){ this.closeAllDesktopComponents(); + if(this.router.url == '/home/gabinete-digital?processes=true'){ + this.openAllProcessesPage(); + this.selectedElement='allProcessesTag'; + } if(this.router.url == '/home/gabinete-digital?eventos=true'){ this.openEventsToApprovePage(); this.selectedElement='approval'; @@ -386,6 +393,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck { closeAllDesktopComponents() { this.showEmptyContainer = false; + this.showAllProcesses = false; this.showEventsToApprove = false; this.showExpedients = false; this.showPedidos = false; @@ -403,6 +411,9 @@ export class GabineteDigitalPage implements OnInit, DoCheck { this.showLoader = true; + let allPreocesses_ = await this.processesbackend.GetTasksList("", false).toPromise(); + this.count_all_processes = Object.keys(allPreocesses_).length; + let expedientes = await this.processesbackend.GetTasksList("Expediente", false).toPromise(); this.count_exp_dailywork = Object.keys(expedientes.filter(data => data.workflowInstanceDataFields.Status == "Active")).length; this.expedientegbstore.count = this.count_exp_dailywork; @@ -503,6 +514,19 @@ export class GabineteDigitalPage implements OnInit, DoCheck { return false; } + openAllProcessesPage() { + this.closeAllDesktopComponents(); + let navigationExtras: NavigationExtras = { queryParams: {"processes": true,}}; + if( window.innerWidth <= 801) { + this.router.navigate(['/home/gabinete-digital']); + } + else { + this.router.navigate(['/home/gabinete-digital'], navigationExtras); + this.showAllProcesses = true; + this.selectedElement="allProcessesTag"; + } + } + openEventsToApprovePage() { this.closeAllDesktopComponents(); let navigationExtras: NavigationExtras = { queryParams: {"eventos": true,}}; diff --git a/src/app/shared/gabinete-digital/all-processes/all-processes-routing.module.ts b/src/app/shared/gabinete-digital/all-processes/all-processes-routing.module.ts new file mode 100644 index 000000000..8433a831d --- /dev/null +++ b/src/app/shared/gabinete-digital/all-processes/all-processes-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { AllProcessesPage } from './all-processes.page'; + +const routes: Routes = [ + { + path: '', + component: AllProcessesPage + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class AllProcessesPageRoutingModule {} diff --git a/src/app/shared/gabinete-digital/all-processes/all-processes.module.ts b/src/app/shared/gabinete-digital/all-processes/all-processes.module.ts new file mode 100644 index 000000000..6d85dc1b2 --- /dev/null +++ b/src/app/shared/gabinete-digital/all-processes/all-processes.module.ts @@ -0,0 +1,21 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import { IonicModule } from '@ionic/angular'; + +import { AllProcessesPageRoutingModule } from './all-processes-routing.module'; + +import { AllProcessesPage } from './all-processes.page'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + AllProcessesPageRoutingModule + ], + exports: [AllProcessesPage], + declarations: [AllProcessesPage] +}) +export class AllProcessesPageModule {} diff --git a/src/app/shared/gabinete-digital/all-processes/all-processes.page.html b/src/app/shared/gabinete-digital/all-processes/all-processes.page.html new file mode 100644 index 000000000..31543277f --- /dev/null +++ b/src/app/shared/gabinete-digital/all-processes/all-processes.page.html @@ -0,0 +1,117 @@ + +
+
Todas as Tarefas
+
+ +
+
+
+ + + + + + + + +
+ + +
+ +
+ +
+
+
+
+ {{ task.Folio }} +
+
+ + +
+
+
+
+ {{task.Senders}} +
+
+
+
+ {{task.customDate}} +
+
+
+
+ + Agenda {{task.Agenda}} do Presidente da República + + + A sua agenda {{task.Agenda}} + +
+
+
+
+ {{task.activityInstanceName}} +
+
+ {{ task.CreateDate | date: 'dd-MM-yy' }} +
+
+
+
+
+
+
+
+ +
+ Lista vazia +
+ +
+ + + + + + + +

+

+

+
+
+ + + + + +

+

+

+
+
+
+
+ +
+ + +
+ + diff --git a/src/app/shared/gabinete-digital/all-processes/all-processes.page.scss b/src/app/shared/gabinete-digital/all-processes/all-processes.page.scss new file mode 100644 index 000000000..0cbc30bb6 --- /dev/null +++ b/src/app/shared/gabinete-digital/all-processes/all-processes.page.scss @@ -0,0 +1,166 @@ +@import '~src/function.scss'; +/* CONTENT */ +:host{ + //padding: 30px 20px 0 20px !important; + margin: 0; +} + +.title{ + padding: 30px 20px 0 20px !important; + font-family: Roboto; + font-size: 25px; + color:#000; + overflow: auto; + + .thetitle{ + width: fit-content; + float: left; + } + .theicon{ + width: fit-content; + float: right; + } + } + +.listview{ + width: 100%t; + padding: 0px 20px 15px 20px !important; + overflow: auto; +} + +ion-list{ + background: transparent; +} + +.item-wrapper{ + border-radius: 15px; + box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07); + border:1px solid #e9e9e9 !important; + background-color: #fff !important; + margin-bottom: 10px !important; + padding: 15px; + + .item{ + background-color: var(--white); + margin: 0 auto; + overflow: hidden; + + .item-top-detail{ + width: 100%; + float: left; + font-family: Roboto; + font-size: 12pt; + font-weight: 700; + color: #0d89d1; + padding-left: 3px; + + .item-subject{ + width: 84%; + float: left; + + ion-label{ + margin: 0 !important; + padding: 2.5px 10.5px 2.5px 10.5px; + } + } + + .item-icon{ + width: fit-content; + float: right; + /* font-size: 13px; */ + margin: 0 !important; + padding: 0 !important; + + ion-icon{ + font-size: 12pt; + color: #42b9fe; + float: left; + } + label{ + font-size: 10pt; + } + } + } + .item-middle-detail{ + font-size: 10pt; + width: 100%; + overflow: auto; + padding-left: 3px; + //border: 1px solid red; + margin: 0 !important; + + .item-remetente{ + //width: 200px; + font-family: Roboto; + /* font-size: 13px; */ + font-weight: normal; + color: #000000; + float: left; + /* border: 1px solid red; */ + + ion-label{ + padding: 2.5px 10.5px 2.5px 10.5px; + margin: 0 !important; + } + } + } + .item-middle-detail-extra{ + font-size: 10pt; + padding-left: 3px; + //border: 1px solid red; + + .item-middle-detail-extra-text{ + //border: 1px solid blue; + + ion-label{ + padding: 2.5px 10.5px 2.5px 10.5px; + margin: 0 !important; + } + } + } + .item-bottom-detail{ + font-size: 12pt; + width: 100%; + overflow: auto; + margin-top: 10px; + padding-bottom: 0 !important; + + .item-workflow{ + float: left; + margin: 0 !important; + align-self: flex-start; + + + .label{ + border-radius: 15px; + background: #ffb703; + /* font-size: 12px; */ + float: right; + padding: 2.5px 13.5px 2.5px 13.5px; + color: #fff; + } + } + .item-date{ + width: auto; + font-family: Roboto; + font-size: 10pt; + font-weight: normal; + font-stretch: normal; + font-style: normal; + line-height: normal; + letter-spacing: normal; + color: #797979; + text-align: right; + flex-grow: 1; + + ion-label{ + margin: 0 !important; + padding: 0 !important; + } + } + } + .item-middle-detail, .item-bottom-detail{ + margin-bottom: 5px; + } + } +} diff --git a/src/app/shared/gabinete-digital/all-processes/all-processes.page.spec.ts b/src/app/shared/gabinete-digital/all-processes/all-processes.page.spec.ts new file mode 100644 index 000000000..8f368f937 --- /dev/null +++ b/src/app/shared/gabinete-digital/all-processes/all-processes.page.spec.ts @@ -0,0 +1,24 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { AllProcessesPage } from './all-processes.page'; + +describe('AllProcessesPage', () => { + let component: AllProcessesPage; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ AllProcessesPage ], + imports: [IonicModule.forRoot()] + }).compileComponents(); + + fixture = TestBed.createComponent(AllProcessesPage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shared/gabinete-digital/all-processes/all-processes.page.ts b/src/app/shared/gabinete-digital/all-processes/all-processes.page.ts new file mode 100644 index 000000000..3ec5a2257 --- /dev/null +++ b/src/app/shared/gabinete-digital/all-processes/all-processes.page.ts @@ -0,0 +1,171 @@ +import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; +import { User } from 'src/app/models/user.model'; +import { AuthService } from 'src/app/services/auth.service'; +import { ProcessesService } from 'src/app/services/processes.service'; +import { removeDuplicate } from 'src/plugin/removeDuplicate.js'; + +@Component({ + selector: 'app-all-processes', + templateUrl: './all-processes.page.html', + styleUrls: ['./all-processes.page.scss'], +}) +export class AllProcessesPage implements OnInit { + + skeletonLoader = true; + allProcessesList:any[] = []; + loggeduser: User; + + constructor( + private processesService: ProcessesService, + private router: Router, + private authService: AuthService, + ) { + this.loggeduser = authService.ValidatedUser; + } + + ngOnInit() { + this.loadAllProcesses(); + } + + doRefresh() { + + setTimeout(() => { + this.loadAllProcesses(); + }, 1000); + } + + async loadAllProcesses(){ + let allProcessesList = await this.processesService.GetTasksList("", false).toPromise(); + console.log(allProcessesList); + + this.skeletonLoader = true; + + this.allProcessesList = []; + + allProcessesList.forEach(element => { + 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(); + + let task = { + "SerialNumber": element.serialNumber, + "Folio": element.workflowInstanceDataFields.Subject, + "Senders": element.workflowInstanceDataFields.Sender, + "CreateDate": taskDate, + "DocumentURL": element.workflowInstanceDataFields.ViewerRequest, + "Remetente": element.workflowInstanceDataFields.Remetente, + "DocumentsQty": element.totalDocuments, + "DocId": element.workflowInstanceDataFields.DispatchDocId, + "FolderID": element.workflowInstanceDataFields.FolderID, + "WorkflowName": element.workflowDisplayName, + "activityInstanceName": element.activityInstanceName, + "Status": element.workflowInstanceDataFields.Status, + "Agenda": element.workflowInstanceDataFields.Agenda, + "customDate": this.setFormatDate(new Date(element.workflowInstanceDataFields.StartDate), new Date(element.workflowInstanceDataFields.EndDate), element.workflowInstanceDataFields.IsAllDayEvent), + } + this.allProcessesList.push(task); + this.allProcessesList = removeDuplicate( this.allProcessesList) + this.allProcessesList = this.sortArrayISODate(this.allProcessesList).reverse(); + }); + //this.pendentesstore.reset(this.allProcessesList); + this.skeletonLoader = false; + + } + + sortArrayISODate(myArray: any){ + return myArray.sort(function(a, b) { + return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0); + }); + } + + setFormatDate(start:any, end:any, allday:boolean){ + let customDate; + /* start = new Date(); + end= new Date("2021-08-04T18:01:04.753Z"); */ + //end = new Date("2021-09-04T18:01:04.753Z"); + + const totalSeconds = Math.floor((end - (start))/1000);; + const totalMinutes = Math.floor(totalSeconds/60); + const totalHours = Math.floor(totalMinutes/60); + const totalDays = Math.floor(totalHours/24); + + const hours = totalHours - ( totalDays * 24 ); + const minutes = totalMinutes - ( totalDays * 24 * 60 ) - ( hours * 60 ); + const seconds = totalSeconds - ( totalDays * 24 * 60 * 60 ) - ( hours * 60 * 60 ) - ( minutes * 60 ); + + let diffDays = totalDays; + let diffMinutes = minutes; + + console.log(allday); + if(totalDays == 0){ + if(allday){ + customDate = this.getCustomDate(start)+", "+this.getCustomHours(start)+" (todo dia)"; + console.log(customDate); + return customDate; + } + else + { + //customDate = this.getCustomDate(start)+","+this.getCustomHours(start)+" ("+minutes+" mins)"; + customDate = this.getCustomDate(start)+", "+this.getCustomHours(start)+" | "+this.getCustomHours(end); + return customDate; + } + } + else{ + customDate = this.getCustomDate(start)+","+this.getCustomHours(start)+ + " (termina:"+ this.getCustomDate(end)+","+this.getCustomHours(end)+")"; + return customDate; + } + } + + getCustomDate(thedate: Date){ + return (thedate.getDay()+1) + "/" + + (thedate.getMonth()+1) + "/" + + thedate.getFullYear(); + } + getCustomHours(thedate: Date){ + return thedate.getHours() + ":" + + thedate.getMinutes(); + } + + goToProcess(serialNumber:string, workflowName:string, activityName:string){ + if(workflowName == 'Despacho') { + if(activityName == 'Tarefa de Despacho'){ + this.router.navigate(['/home/gabinete-digital/despachos',serialNumber,'gabinete-digital']); + } + } + else if(workflowName == 'Despacho do Presidente da República') { + if(activityName == 'Tarefa de Despacho'){ + this.router.navigate(['/home/gabinete-digital/despachos-pr',serialNumber,'gabinete-digital']); + } + else if(activityName == 'Revisar Diploma' || activityName == 'Assinar Diploma'){ + this.router.navigate(['/home/gabinete-digital/diplomas',serialNumber,'gabinete-digital']); + } + else if(activityName == 'Diploma Assinado'){ + this.router.navigate(['/home/gabinete-digital/diplomas-assinar',serialNumber,'gabinete-digital']); + } + } + else if(workflowName == 'Pedido de Parecer' || workflowName == 'Pedido de Deferimento') { + this.router.navigate(['/home/gabinete-digital/pedidos',serialNumber,'gabinete-digital']); + } + else if(workflowName == 'Expediente') { + this.router.navigate(['/home/gabinete-digital/expediente',serialNumber,'gabinete-digital']); + } + else if(workflowName == 'Expediente do Presidente' && this.loggeduser.Profile == 'PR') { + this.router.navigate(['/home/gabinete-digital/expedientes-pr',serialNumber,'gabinete-digital']); + } + else if (workflowName == "Pedido de Parecer do Presidente") { + this.router.navigate(['/home/gabinete-digital/pedidos',serialNumber,'gabinete-digital']); + } + /* else if (workflowName == "Expediente") { + this.router.navigate(['/home/gabinete-digital/pedidos',serialNumber,'gabinete-digital']); + } */ + else if(workflowName == 'Agenda Pessoal PR' || workflowName == 'Agenda Oficial PR' || workflowName == 'Agenda Oficial MDGPR' || workflowName == 'Agenda Pessoal MDGPR') { + this.router.navigate(['/home/gabinete-digital/event-list/approve-event',serialNumber, 'gabinete-digital']); + } + else { + console.log('cant find page for this task') + } + } + +} diff --git a/src/app/shared/gabinete-digital/despachos/despachos.page.html b/src/app/shared/gabinete-digital/despachos/despachos.page.html index c6496859d..6099d79b8 100644 --- a/src/app/shared/gabinete-digital/despachos/despachos.page.html +++ b/src/app/shared/gabinete-digital/despachos/despachos.page.html @@ -17,16 +17,16 @@ refreshingSpinner="circles" refreshingText="A actualizar..."> - + - +
- +
@@ -59,15 +59,15 @@
-
Lista vazia
- + @@ -94,6 +94,6 @@
- +