This commit is contained in:
Peter Maquiran
2021-08-05 13:41:41 +01:00
119 changed files with 1994 additions and 456 deletions
+11 -1
View File
@@ -47,6 +47,11 @@ import { NgxMatMomentModule } from '@angular-material-components/moment-adapter'
import { MatButtonModule } from '@angular/material/button';
import { HttpClient } from '@angular/common/http';
import { FontAwesomeModule, FaIconLibrary } from '@fortawesome/angular-fontawesome';
import { fas } from '@fortawesome/free-solid-svg-icons'
import { far } from '@fortawesome/free-regular-svg-icons'
import { fab } from '@fortawesome/free-brands-svg-icons'
@NgModule({
declarations: [AppComponent],
entryComponents: [],
@@ -60,6 +65,7 @@ import { HttpClient } from '@angular/common/http';
IonicModule.forRoot({animated: false}),
IonicStorageModule.forRoot(),
AppRoutingModule,
FontAwesomeModule,
HttpClientModule,
// NgbModule,
NoopAnimationsModule,
@@ -96,4 +102,8 @@ import { HttpClient } from '@angular/common/http';
bootstrap: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule {}
export class AppModule {
constructor(library: FaIconLibrary) {
library.addIconPacks(fas, fab, far);
}
}
+13
View File
@@ -191,6 +191,19 @@ const routes: Routes = [
},
]
},
{
path: 'despachos-pr',
children: [
{
path: '',
loadChildren: ()=> import('../pages/gabinete-digital/despachos-pr/despachos-pr.module').then(m => m.DespachosPrPageModule),
},
{
path:':SerialNumber/:caller',
loadChildren: ()=> import('../pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.module').then(m => m.DespachoPrPageModule),
},
]
},
{
path: 'pedidos',
children: [
+33 -31
View File
@@ -8,12 +8,13 @@ import { Event } from '../models/event.model';
import { ProcessesService } from '../services/processes.service';
import { NotificationsService } from '../services/notifications.service';
import { ModalController, AlertController, AnimationController, Platform } from '@ionic/angular';
import { NavigationExtras,Router,ActivatedRoute } from '@angular/router';
import { NavigationExtras, Router, ActivatedRoute } from '@angular/router';
import { ToastService } from '../services/toast.service';
import { ToDayEventStorage } from '../store/to-day-event-storage.service';
import { DocumentCounterService } from 'src/app/OtherService/document-counter.service'
import { PermissionService } from '../OtherService/permission.service';
// import * as Sentry from "@sentry/browser";
// import { Integrations } from "@sentry/tracing";
@@ -85,47 +86,48 @@ export class HomePage implements OnInit {
}
ngOnInit() {
console.log('Active route ',this.router.url)
if(this.platform.is('desktop') || this.platform.is('mobileweb')) {
console.log('Active route ', this.router.url)
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
console.log('Notifications not supported')
} else {
/* this.mobilefirstConnect();
this.notificatinsservice.onReceviNotification(); */
this.mobilefirstConnect();
this.notificatinsservice.getAndpostToken2();
this.notificatinsservice.onReceviNotification();
}
}
mobilefirstConnect() {
//try {
window['WLAuthorizationManager'].obtainAccessToken("").then( (token) => {
console.log('MobileFirst Server connect: Success ' + token);
window['WLAuthorizationManager'].obtainAccessToken("").then((token) => {
var resourceRequest = new WLResourceRequest("/adapters/javaAdapter/resource/greet/",
WLResourceRequest.GET
);
console.log('MobileFirst Server connect: Success ' + token);
resourceRequest.setQueryParameter("name", "world");
resourceRequest.send().then(
(response) => {
// Will display "Hello world" in an alert dialog.
console.log("Connect with JavaAdapter Success: " + response.responseText);
//this.MFPushNotification();
},
(error) => {
alert("Connect with JavaAdapter Failure: " + JSON.stringify(error));
}
);
}, (error) => {
console.log('MobileFirst Server connect: failure ' + error.responseText);
console.log(JSON.stringify(error))
/* this.zone.run(() => {
alert("Bummer...");
alert("Failed to connect to MobileFirst Server");
}); */
});
//} catch {}
var resourceRequest = new WLResourceRequest("/adapters/javaAdapter/resource/greet/",
WLResourceRequest.GET
);
resourceRequest.setQueryParameter("name", "world");
resourceRequest.send().then(
(response) => {
// Will display "Hello world" in an alert dialog.
console.log("Connect with JavaAdapter Success: " + response.responseText);
//this.MFPushNotification();
},
(error) => {
alert("Connect with JavaAdapter Failure: " + JSON.stringify(error));
}
);
}, (error) => {
console.log('MobileFirst Server connect: failure ' + error.responseText);
console.log(JSON.stringify(error))
/* this.zone.run(() => {
alert("Bummer...");
alert("Failed to connect to MobileFirst Server");
}); */
});
}
+13 -23
View File
@@ -19,7 +19,7 @@
<div class="d-flex mt-10 width-100">
<ion-buttons slot="start" class="buttonSize" >
<button (click)="logout()" class="btn-delete" fill="clear" style="background:#ffe0e0;" >
<button (click)="logout()" class="btn-delete" fill="clear" >
<ion-label style="color:#d30a0a;">Terminar sessão</ion-label>
</button>
<button (click)="editProfile()" class="btn-cancel" fill="clear" color="#fff" >
@@ -30,39 +30,29 @@
<div class="line"></div>
</div>
<div class="notifications-content">
<ion-label>2 novas notificações</ion-label>
<ion-label>{{notificationdata.length}} novas notificações</ion-label>
<ion-list>
<div class="item cursor-pointer ion-no-padding ion-no-margin" lines="none">
<div class="item cursor-pointer ion-no-padding ion-no-margin" lines="none"
*ngFor = "let item of notificationdata; let i = index"
(click)="notificatinsRoutes(item.Service,item.Object,item.IdObject,item.FolderId)"
>
<div class="item-content width-100">
<div class="notification-item">
<img class="notification-icon" slot="end" src="assets/images/icons-default-agenda.svg" >
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'agenda'" src="assets/images/icons-default-agenda.svg" >
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'gabinete-digital'" src="assets/images/icons-correspondencias.svg" >
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'accoes'" src="assets/images/icons-nav-actions.svg" >
</div>
<div class="approve-event-time">
<p>08:00</p>
<p>09:00</p>
<p>{{item.dateInit}}</p>
<p>{{item.dateEnd}}</p>
</div>
<div class="approve-event-detail">
<p>Luanda | Palácio Presidencial</p>
<h3>Almoço de Família</h3>
<p>{{item.Location}}</p>
<h3>{{item.alert}}</h3>
</div>
<div class="notification-label"></div>
</div>
</div>
<div class="item cursor-pointer ion-no-padding ion-no-margin" lines="none">
<div class="item-content width-100">
<div class="notification-item">
<img class="notification-icon" slot="end" src="assets/images/icons-correspondencias.svg" >
</div>
<div class="approve-event-time">
<p>28-07-21</p>
<p>09:00</p>
</div>
<div class="approve-event-detail">
<h3>Relatório FMI</h3>
<p>Luanda | Palácio Presidencial</p>
</div>
</div>
</div>
</ion-list>
+2
View File
@@ -45,9 +45,11 @@
}
.btn-delete{
background:#ffe0e0 !important;
width: 40% !important;
margin-left: 0 !important;
}
.btn-cancel{
width: 40% !important;
margin-right: 0 !important;
+100 -9
View File
@@ -1,12 +1,17 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
///<reference path="../../../../plugins/cordova-plugin-mfp/typings/worklight.d.ts" />
///<reference path="../../../../plugins/cordova-plugin-mfp-jsonstore/typings/jsonstore.d.ts" />
import { Component, OnInit,NgZone } from '@angular/core';
import { Router,NavigationExtras } from '@angular/router';
import { AnimationController, ModalController } from '@ionic/angular';
import { User } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service';
import { ToastService } from 'src/app/services/toast.service';
import { FingerprintPage } from 'src/app/shared/fingerprint/fingerprint.page';
import { PinPage } from 'src/app/shared/pin/pin.page';
import { LocalstoreService } from 'src/app/store/localstore.service';
import { EditProfilePage } from './edit-profile/edit-profile.page';
import { JsonStore } from '../../services/jsonStore.service';
import { StorageService } from '../../services/storage.service';
@Component({
selector: 'app-profile',
@@ -17,13 +22,18 @@ export class ProfilePage implements OnInit {
loggeduser: User;
userLoginPreference = ''
notificationdata: any[];
DataArray: Array<Object> = [];
constructor(private modalController:ModalController,
constructor(private modalController: ModalController,
private authService: AuthService,
private animationController: AnimationController,
private router: Router,
private localstoreService: LocalstoreService
) {
private localstoreService: LocalstoreService,
private jsonstore: JsonStore,
private storageservice: StorageService,
private zone: NgZone,
) {
this.loggeduser = authService.ValidatedUser;
@@ -32,19 +42,100 @@ export class ProfilePage implements OnInit {
this.checkState()
}
ngOnInit() {}
ngOnInit() {
this.storageservice.get("Notifications").then((value) => {
var data = JSON.parse(value);
data.forEach(element => {
console.log("ARaaAA", element)
var payload = JSON.parse(element.payload)
let notificationObject = {
alert: element.alert,
Service: payload.Service,
Object: payload.Object,
IdObject: payload.IdObject,
FolderId: payload.FolderId,
desc: payload.desc,
dateInit: payload.dateInit,
dateEnd: payload.dateEnd,
Location: payload.Location,
TypeAgenda: payload.TypeAgenda,
Status: payload.Status
}
this.DataArray.push(notificationObject)
});
this.notificationdata = this.DataArray
console.log("Notificaaa", this.notificationdata)
})
console.log("Notificaaa", this.notificationdata)
}
close() {
this.modalController.dismiss();
}
notImplemented(){}
notImplemented() { }
notificatinsRoutes = (Service,Object,IdObject,FolderId) => {
if (Service === "agenda") {
this.zone.run(() => this.router.navigate(['/home/agenda', IdObject, 'agenda']));
}
else if (Service === "gabinete-digital" && Object === "expediente") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente',IdObject,'gabinete-digital']));
}
else if (Service === "gabinete-digital" && Object === "event-list") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'gabinete-digital']));
}else if (Service === "gabinete-digital" && Object === "despachos") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos',IdObject,'gabinete-digital'],{replaceUrl: true}));
}
else if (Service === "gabinete-digital" && Object === "parecer") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos',IdObject,'gabinete-digital']));
}
else if (Service === "gabinete-digital" && Object === "deferimento") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos',IdObject,'gabinete-digital']));
}
else if (Service === "gabinete-digital" && Object === "despachos-pr") {
let navigationExtras: NavigationExtras = {
queryParams: {
"serialNumber": IdObject,
}
};
this.zone.run(() =>this.router.navigate(['/home/gabinete-digital/despachos-pr/despacho-pr'], navigationExtras));
}
else if (Service === "accoes" && Object === "accao") {
this.zone.run(() => this.router.navigate(['/home/publications',IdObject]));
}
else if (Service === "accoes" && Object === "publicacao") {
this.zone.run(() => this.router.navigate(['/home/publications/view-publications',FolderId,IdObject]));
}
else if (Service === "gabinete-digital" && Object === "diplomas") {
this.zone.run(() =>this.router.navigate(['/home/gabinete-digital/diplomas', IdObject, 'gabinete-digital']));
}
else if (Service === "gabinete-digital" && Object === "diplomas-assinar") {
let navigationExtras: NavigationExtras = {
queryParams: {
"serialNumber": IdObject,
}
};
this.zone.run(() =>this.router.navigate(['/home/gabinete-digital/diplomas-assinar/diploma-assinar'], navigationExtras));
}
else if (Service === "gabinete-digital" && Object === "expedientes-pr") {
this.zone.run(() =>this.router.navigate(['/home/gabinete-digital/expedientes-pr',IdObject,'gabinete-digital']));
}
}
logout() {
//const loader = this.toastService.loading();
// clear local storage
window.localStorage.clear();
setTimeout(()=>{
setTimeout(() => {
window.location.pathname = '/'
location.reload();
}, 1000)
@@ -58,7 +149,7 @@ export class ProfilePage implements OnInit {
if (userData.hasOwnProperty('loginPreference')) {
this.userLoginPreference = userData.loginPreference
} else {
this.userLoginPreference = ''
this.userLoginPreference = ''
}
}
+2 -2
View File
@@ -26,7 +26,7 @@ export enum Sources
export class EventAttachment {
Id?: string; // id do evento
ParentId: string;
ParentId?: string;
Source: string;
SourceId: string;
Link?: string;
@@ -34,4 +34,4 @@ export class EventAttachment {
ApplicationId: string;
SourceTitle: string;
}
}
@@ -131,15 +131,15 @@ export class ViewEventPage implements OnInit {
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */
loader.remove()
}, (error)=>{
if(error.status == 0) {
this.toastService.badRequest('não é possível vizualizar este event no modo offline')
this.toastService.badRequest('Não é possível visualizar este evento no modo offline')
} else {
this.toastService.badRequest('Este evento já não existe na sua agenda')
}
}
loader.remove()
this.modalController.dismiss('Eevent not Foud');
this.modalController.dismiss('Eevento não Encontrado');
this.location.back();
});
}
@@ -163,7 +163,7 @@ export class ViewEventPage implements OnInit {
async OpenDeleteEventModal() {
const modal = await this.modalController.create({
component: EliminateEventPage,
componentProps: {
+1 -1
View File
@@ -10,7 +10,7 @@
</ion-refresher>
<div class="main-content d-flex height-100">
<!-- Aside left -->
<div class="aside-wrapper d-flex flex-column pt-25 flex-grow-1">
<div class="aside-wrapper d-flex flex-column flex-grow-1">
<!-- <p class="text-center mt-0 aside-title px-20">Chat</p> -->
<div class="title-content">
<div class="div-title">
+2 -1
View File
@@ -10,6 +10,7 @@ import { EventsPage } from './events.page';
// import { SharedModule } from 'src/app/shared/shared.module';
import { HeaderNoSearchPageModule } from 'src/app/shared/headers/header-no-search/header-no-search.module';
import { HeaderPageModule } from 'src/app/shared/header/header.module';
@NgModule({
imports: [
@@ -17,7 +18,7 @@ import { HeaderNoSearchPageModule } from 'src/app/shared/headers/header-no-searc
FormsModule,
IonicModule,
EventsPageRoutingModule,
HeaderNoSearchPageModule,
HeaderPageModule,
],
declarations: [EventsPage],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
+2 -3
View File
@@ -1,8 +1,8 @@
<ion-header class="ion-no-border ">
<app-header-no-search></app-header-no-search>
<app-header></app-header>
</ion-header>
<ion-header class="ion-no-border text-white">
<ion-header class="ion-no-border text-white">
<ion-label>
<p class="time ion-text-center">{{customDate}}</p>
</ion-label>
@@ -10,7 +10,6 @@
<p *ngIf="totalEvent==1" class="event-number p-small ion-text-center"> <strong>{{totalEvent}}</strong> evento agendado para hoje</p>
<p *ngIf="totalEvent!=1"class="event-number p-small ion-text-center"> <strong>{{totalEvent}}</strong> eventos agendados para hoje</p>
</ion-label>
<div class="next-meeting">
<div class="meeting-time">{{currentHoursMinutes | date: 'HH:mm'}}</div>
<div *ngIf="currentEvent" class="meeting-description"> "{{currentEvent}}"</div>
+8
View File
@@ -62,6 +62,7 @@ export class EventsPage implements OnInit {
taskslist:DailyWorkTask[] = [];
expedientList:any;
hideSearchBtn: boolean=false;
// shared data
toDayEventStorage = ToDayEventStorage
@@ -109,6 +110,13 @@ export class EventsPage implements OnInit {
this.LoadList();
}
});
this.hideSearch();
}
hideSearch(){
if(this.router.url == '/home/events'){
this.hideSearchBtn = true;
}
}
doRefresh(event) {
@@ -22,6 +22,7 @@ import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.p
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
import { DespachosPrOptionsPage } from 'src/app/shared/popover/despachos-pr-options/despachos-pr-options.page';
import { ToastService } from 'src/app/services/toast.service';
import { Location } from '@angular/common'
@Component({
selector: 'app-despacho-pr',
@@ -39,6 +40,7 @@ export class DespachoPrPage implements OnInit {
fulltask: any;
eventsList: Event[];
serialnumber: string;
caller: string;
profile: string;
intervenientes: any;
cc: any = [];
@@ -55,11 +57,15 @@ export class DespachoPrPage implements OnInit {
public popoverController: PopoverController,
private activatedRoute: ActivatedRoute,
private animationController: AnimationController,
private toastService: ToastService,) {
this.activatedRoute.queryParams.subscribe(params => {
if(params["serialNumber"]) {
this.serialnumber = params["serialNumber"];
console.log(params["serialNumber"]);
private toastService: ToastService,
private location: Location,
) {
this.activatedRoute.paramMap.subscribe(params => {
if(params["params"].SerialNumber) {
this.serialnumber = params["params"].SerialNumber;
}
if(params["params"].caller) {
this.caller = params["params"].caller;
}
});
}
@@ -85,17 +91,7 @@ export class DespachoPrPage implements OnInit {
}
goBack() {
if (window.innerWidth <= 800) {
this.router.navigate(['/home/gabinete-digital/despachos-pr']);
} else {
let navigationExtras: NavigationExtras = {
queryParams: {
"despachospr": true,
}
};
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
this.location.back();
}
@@ -144,7 +140,7 @@ export class DespachoPrPage implements OnInit {
window.history.back();
} finally {
if(error.status == 0) {
this.toastService.badRequest('Não é possível vizualizar este processo no modo offline')
this.toastService.badRequest('Não é possível visualizar este processo no modo offline')
} else {
this.toastService.badRequest('Processo não encontrado')
}
@@ -342,7 +338,7 @@ export class DespachoPrPage implements OnInit {
if( window.innerWidth <= 800){
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop'
classs = 'add-note-modal'
}
const modal = await this.modalController.create({
component: AddNotePage,
@@ -90,12 +90,7 @@ export class DespachosPrPage implements OnInit {
}
goToDespachoPr(serialNumber:any){
let navigationExtras: NavigationExtras = {
queryParams: {
"serialNumber": serialNumber,
}
};
this.router.navigate(['/home/gabinete-digital/despachos-pr/despacho-pr'], navigationExtras);
this.router.navigate(['/home/gabinete-digital/despachos-pr',serialNumber,'gabinete-digital']);
}
notImplemented(){
@@ -51,7 +51,7 @@ export class DespachoPage implements OnInit {
private toastService: ToastService,
private despachoService: DespachoService,
private location: Location
) {
this.activatedRoute.paramMap.subscribe(params => {
if(params["params"].SerialNumber) {
@@ -137,6 +137,7 @@ export class DespachoPage implements OnInit {
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
this.processes.GetTaskParticipants(this.task.FolderId).subscribe(users=>{
this.intervenientes = users.filter(user=>{
return user.Type == 'I';
});
@@ -152,7 +153,7 @@ export class DespachoPage implements OnInit {
window.history.back();
} finally {
if(error.status == 0) {
this.toastService.badRequest('Não é possível vizualizar este processo no modo offline')
this.toastService.badRequest('Não é possível visualizar este processo no modo offline')
} else {
this.toastService.badRequest('Processo não encontrado')
}
@@ -233,7 +234,7 @@ export class DespachoPage implements OnInit {
loader.remove()
}
}
async reencaminhar(note:string, documents:any) {
@@ -12,6 +12,7 @@ import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.p
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
import { DeplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deploma-options.page';
import { ToastService } from 'src/app/services/toast.service';
import { Location } from '@angular/common'
@Component({
selector: 'app-diploma-assinar',
@@ -29,7 +30,8 @@ export class DiplomaAssinarPage implements OnInit {
intervenientes: any;
cc: any = [];
attachments:any;
customDate: any
customDate: any;
caller:string;
constructor(
private processes: ProcessesService,
@@ -39,12 +41,15 @@ export class DiplomaAssinarPage implements OnInit {
private activatedRoute: ActivatedRoute,
private router: Router,
private animationController: AnimationController,
private toastService: ToastService
private toastService: ToastService,
private location: Location,
) {
this.activatedRoute.queryParams.subscribe(params => {
if(params["serialNumber"]) {
this.serialnumber = params["serialNumber"];
console.log(params["serialNumber"]);
this.activatedRoute.paramMap.subscribe(params => {
if(params["params"].SerialNumber) {
this.serialnumber = params["params"].SerialNumber;
}
if(params["params"].caller) {
this.caller = params["params"].caller;
}
});
@@ -56,17 +61,7 @@ export class DiplomaAssinarPage implements OnInit {
}
goBack() {
if (window.innerWidth <= 800) {
this.router.navigate(['/home/gabinete-digital/diplomas-assinar']);
} else {
let navigationExtras: NavigationExtras = {
queryParams: {
"diplomasassinar": true,
}
}
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
this.location.back();
}
async openOptions(taskAction?: any) {
@@ -129,7 +124,7 @@ export class DiplomaAssinarPage implements OnInit {
window.history.back();
} finally {
if(error.status == 0) {
this.toastService.badRequest('Não é possível vizualizar este processo no modo offline')
this.toastService.badRequest('Não é possível visualizar este processo no modo offline')
} else {
this.toastService.badRequest('Processo não encontrado')
}
@@ -48,15 +48,10 @@ export class DiplomasAssinarPage implements OnInit {
});
}
goToDiploma(serialNumber:any){
let navigationExtras: NavigationExtras = {
queryParams: {
"serialNumber": serialNumber,
}
};
this.router.navigate(['/home/gabinete-digital/diplomas-assinar/diploma-assinar'], navigationExtras);
this.router.navigate(['/home/gabinete-digital/diplomas-assinar',serialNumber,'gabinete-digital']);
}
async refreshing() {
@@ -66,7 +61,7 @@ export class DiplomasAssinarPage implements OnInit {
}
doRefresh(event) {
setTimeout(() => {
this.LoadList();
}, 1000);
@@ -123,7 +118,7 @@ export class DiplomasAssinarPage implements OnInit {
this.skeletonLoader = false
this.showLoader = false;
}
goBack() {
@@ -12,6 +12,7 @@ import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.p
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
import { DeplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deploma-options.page';
import { ToastService } from 'src/app/services/toast.service';
import { Location } from '@angular/common';
@Component({
selector: 'app-diploma',
@@ -42,10 +43,11 @@ export class DiplomaPage implements OnInit {
private router: Router,
private animationController: AnimationController,
private toastService: ToastService,
) {
private location: Location,
) {
this.activatedRoute.paramMap.subscribe(params => {
console.log(params["params"]);
if(params["params"].SerialNumber) {
this.serialNumber = params["params"].SerialNumber;
}
@@ -63,10 +65,11 @@ export class DiplomaPage implements OnInit {
}
goBack() {
if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){
this.location.back();
/* if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){
if (window.innerWidth < 801) {
this.router.navigate(['/home/gabinete-digital/pendentes']);
}
}
else {
let navigationExtras: NavigationExtras = {
queryParams: {
@@ -87,7 +90,7 @@ export class DiplomaPage implements OnInit {
}
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
}
} */
}
async openOptions(taskAction?: any) {
@@ -134,7 +137,7 @@ export class DiplomaPage implements OnInit {
});
this.cc = users.filter(user=>{
return user.Type == 'CC';
});
});
});
this.getDocumentDetails(this.task.FolderId, '361');
@@ -145,7 +148,7 @@ export class DiplomaPage implements OnInit {
window.history.back();
} finally {
if(error.status == 0) {
this.toastService.badRequest('Não é possível vizualizar este processo no modo offline')
this.toastService.badRequest('Não é possível visualizar este processo no modo offline')
} else {
this.toastService.badRequest('Processo não encontrado')
}
@@ -161,7 +164,7 @@ export class DiplomaPage implements OnInit {
browser.show();
});
}
getDocumentDetails(forlderId:string, applicationId:string) {
this.processes.GetDocumentDetails(forlderId,applicationId).subscribe(res=>{
this.attachments = res.Documents;
@@ -171,8 +174,8 @@ export class DiplomaPage implements OnInit {
}
async askSignature(note:string, documents:any){
let body = {
"serialNumber": this.serialNumber,
let body = {
"serialNumber": this.serialNumber,
"action": "Aprovar",
"ActionTypeId": 99999840,
"dataFields": {
@@ -185,11 +188,11 @@ export class DiplomaPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService.successMessage(false, ()=>{
this.close();
})
} catch (error) {
this.toastService.badRequest()
}
@@ -199,8 +202,8 @@ export class DiplomaPage implements OnInit {
}
async askToChange(note:string, documents:any){
let body = {
"serialNumber": this.serialNumber,
let body = {
"serialNumber": this.serialNumber,
"action": "Retificar",
"ActionTypeId": 99999841,
"dataFields": {
@@ -223,9 +226,9 @@ export class DiplomaPage implements OnInit {
}
async finish(note:string, documents:any){
let body = {
"serialNumber": this.serialNumber,
let body = {
"serialNumber": this.serialNumber,
"action": "Concluir",
"ActionTypeId": 95,
"dataFields": {
@@ -257,7 +260,7 @@ export class DiplomaPage implements OnInit {
if( window.innerWidth <= 800){
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop'
classs = 'add-note-modal'
}
const modal = await this.modalController.create({
component: AddNotePage,
@@ -266,20 +269,20 @@ export class DiplomaPage implements OnInit {
cssClass: classs,
backdropDismiss: true
});
await modal.present();
modal.onDidDismiss().then(async (res) => {
if(res.data){
const DocumentToSave = res.data.documents.map((e) => {
return {
ApplicationId: e.ApplicationType,
SourceId: e.Id,
}
});
let docs = {
ProcessInstanceID: "",
Attachments: DocumentToSave,
@@ -10,6 +10,7 @@ import { EventActionsPopoverPage } from 'src/app/pages/agenda/event-actions-popo
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { EditEventToApproveComponent } from 'src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page';
import { ToastService } from 'src/app/services/toast.service';
import { Location } from '@angular/common';
@Component({
selector: 'app-approve-event',
@@ -47,6 +48,7 @@ export class ApproveEventPage implements OnInit {
private iab: InAppBrowser,
private animationController: AnimationController,
private toastService: ToastService,
private location: Location,
) {
this.activatedRoute.paramMap.subscribe(params => {
console.log(params["params"]);
@@ -64,7 +66,7 @@ export class ApproveEventPage implements OnInit {
toDateString(e) {
return new Date(e).toDateString()
}
ngOnInit() {
console.log(this.serialNumber);
console.log(this.caller);
@@ -73,7 +75,8 @@ export class ApproveEventPage implements OnInit {
}
goBack() {
let navigationExtras: NavigationExtras = {
this.location.back();
/* let navigationExtras: NavigationExtras = {
queryParams: {
"eventos": true,
}
@@ -82,7 +85,7 @@ export class ApproveEventPage implements OnInit {
this.router.navigate(['/home',this.caller, 'event-list']);
} else {
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
} */
}
@@ -34,9 +34,9 @@
</ion-refresher>
<div class="main-content d-flex height-100" >
<div class="content d-flex flex-column">
<div class="content height-100 d-flex flex-column">
<div [ngSwitch]="segment">
<ion-list *ngSwitchCase="'MDGPR'">
<ion-list class="width-100 height-100" *ngSwitchCase="'MDGPR'">
<div *ngIf="eventaprovacaostore.listmd" class="overflow-y-auto height-100">
<ion-item-sliding>
<ion-item class="Rectangle cursor-pointer" lines="none"
@@ -57,6 +57,7 @@
</ion-item-sliding>
</div>
</ion-list>
<ion-label></ion-label>
<ion-list *ngSwitchCase="'PR'">
<div *ngIf="eventaprovacaostore.listpr" class="overflow-y-auto height-100">
@@ -79,6 +80,27 @@
</div>
</ion-list>
</div>
<div class="height-100" [ngSwitch]="segment">
<div *ngSwitchCase="'MDGPR'" class="d-flex height-100 align-center justify-content-center" >
<div
*ngIf="!skeletonLoader && eventaprovacaostore.listmd.length == 0"
class="empty-list d-flex height-100 align-center justify-content-center"
>
<span>Lista vazia</span>
</div>
</div>
<div *ngSwitchCase="'PR'" class="d-flex height-100 align-center justify-content-center">
<div
*ngIf="!skeletonLoader && eventaprovacaostore.listpr.length == 0"
class="empty-list d-flex height-100 align-center justify-content-center"
>
<span>Lista vazia</span>
</div>
</div>
</div>
</div>
</div>
</ion-content>
@@ -119,3 +119,7 @@ ion-item-sliding{
margin: 0;
padding: 0;
}
.test{
color: #000 !important;
border: 1px solid red !important;
}
@@ -75,6 +75,8 @@ export class EventListPage implements OnInit {
let mdEventsOficial = await this.processes.GetTasksList('Agenda Oficial MDGPR', false).toPromise();
let mdEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal MDGPR', false).toPromise();
this.eventsMDGPRList = mdEventsOficial.concat(mdEventsPessoal);
console.log(this.eventsMDGPRList);
this.eventaprovacaostore.resetmd(this.eventsMDGPRList);
}
else if(this.segment == 'PR'){
@@ -13,6 +13,7 @@ import { momentG } from 'src/plugin/momentG'
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page';
import { ToastService } from 'src/app/services/toast.service';
import { Location } from '@angular/common';
@Component({
selector: 'app-expediente-detail',
@@ -48,6 +49,7 @@ export class ExpedienteDetailPage implements OnInit {
public popoverController: PopoverController,
private activatedRoute: ActivatedRoute,
private toastService: ToastService,
private location: Location,
) {
this.activatedRoute.paramMap.subscribe(params => {
if(params["params"].SerialNumber) {
@@ -73,7 +75,8 @@ export class ExpedienteDetailPage implements OnInit {
}
goBack() {
if(this.task.Status == "Pending" && this.caller != 'events'){
this.location.back();
/* if(this.task.Status == "Pending" && this.caller != 'events'){
if (window.innerWidth <= 800) {
this.router.navigate(['/home/gabinete-digital/pendentes']);
}
@@ -108,7 +111,7 @@ export class ExpedienteDetailPage implements OnInit {
}
});
}
} */
}
sendExpedienteToPending() {
@@ -168,7 +171,7 @@ export class ExpedienteDetailPage implements OnInit {
window.history.back();
} finally {
if(error.status == 0) {
this.toastService.badRequest('Não é possível vizualizar este processo no modo offline')
this.toastService.badRequest('Não é possível visualizar este processo no modo offline')
} else {
this.toastService.badRequest('Processo não encontrado')
}
@@ -61,29 +61,35 @@
</div>
</div>
<div class="bottom-content width-100">
<h5>Documentos Anexados</h5>
<ion-list>
<h5>Documentos Anexados</h5>
<ion-item class="ion-no-margin ion-no-padding cursor-pointer">
<ion-item *ngFor="let attachment of attachments; let i = index"
class="ion-no-margin ion-no-padding cursor-pointer">
<ion-label
(click)="viewDocument()">
<p class="attach-title-item">{{ task.Folio }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p><span class="span-left">{{task.Remetente}}</span><span class="span-right">{{ task.CreateDate | date: 'dd/MM/yy' }}</span></p>
<p class="attach-title-item">{{attachment.Description}}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p>
<span class="span-left">{{attachment.Stakeholders}}</span>
<span *ngIf="!attachment.Stakeholders" class="span-left">Rementente indefinido</span>
<span class="span-right">{{ attachment.CreateDate | date: 'dd/MM/yy' }}</span>
</p>
</ion-label>
</ion-item>
</ion-list>
</div>
<div *ngIf="eventsList">
<h3 class="h3-event-title">Eventos Associados</h3>
<ion-list>
<div *ngIf="eventsList">
<ion-item-sliding>
<ion-item
class="Rectangle" lines="none"
<ion-item
class="Rectangle" lines="none"
*ngFor="let event of eventsList"
(click)="viewEventDetail(event.EventId)"
>
<!-- [routerLink]="['/home/events', event.EventId, 'events']" -->
<div class="content-{{profile}}-{{event.CalendarName}} width-100 ">
<div class="approve-event-time">
<p>{{event.StartDate | date: 'HH:mm'}}</p>
@@ -100,6 +106,7 @@
</div>
</ion-list>
</div>
</div>
</div>
@@ -112,6 +119,7 @@
<div hidden class="solid"></div>
<button hidden class="btn-cancel" shape="round" >Delegar</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<button (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documento <br />(Gestão Documental)</button>
</div>
<div *ngIf="loggeduser.Profile =='PR' " class="buttons">
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-ok" shape="round" >Marcar para Despacho</button>
@@ -22,6 +22,10 @@ import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.p
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
import { OptsExpedientePrPage } from 'src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page';
import { ToastService } from 'src/app/services/toast.service';
import { SearchPage } from 'src/app/pages/search/search.page';
import { Attachment } from 'src/app/models/attachment.model';
import { SearchDocument } from 'src/app/models/search-document';
import { Location } from '@angular/common';
@Component({
selector: 'app-expediente-pr',
@@ -44,11 +48,12 @@ export class ExpedientePrPage implements OnInit {
cc: any = [];
loggeduser: User;
documents:SearchDocument[] = [];
attachments:any;
constructor(
private processes: ProcessesService,
private iab: InAppBrowser,
private attachments: AttachmentsService,
private events: EventsService,
private menu: MenuController,
private router: Router,
@@ -58,6 +63,8 @@ export class ExpedientePrPage implements OnInit {
private userAuth: AuthService,
private animationController: AnimationController,
private toastService: ToastService,
private attachmentsService: AttachmentsService,
private location: Location,
) {
this.loggeduser = userAuth.ValidatedUser;
@@ -81,10 +88,14 @@ export class ExpedientePrPage implements OnInit {
}
/* this.serialnumber = paramMap.get('SerialNumber'); */
this.LoadTaskDetail(this.serialnumber);
this.LoadRelatedEvents(this.serialnumber);
//this.LoadRelatedEvents(this.serialnumber);
//this.getAttachments(this.serialnumber);
});
this.LoadTaskDetail(this.serialnumber);
this.LoadRelatedEvents(this.serialnumber);
this.getAttachments(this.serialnumber);
//this.LoadRelatedEvents(this.serialnumber);
}
toDateString(e) {
@@ -96,7 +107,8 @@ export class ExpedientePrPage implements OnInit {
}
goBack() {
if(this.task.Status == "Pending" && this.caller != 'events'){
this.location.back();
/* if(this.task.Status == "Pending" && this.caller != 'events'){
if (window.innerWidth <= 800) {
this.router.navigate(['/home/gabinete-digital/pendentes']);
}
@@ -130,7 +142,7 @@ export class ExpedientePrPage implements OnInit {
break;
}
});
}
} */
}
sendExpedienteToPending(){
@@ -168,10 +180,7 @@ export class ExpedientePrPage implements OnInit {
"Status": res.workflowInstanceDataFields.Status,
}
console.log('task', this.task);
this.fulltask = res;
console.log('GetTask', res);
let thedate = new Date(this.task.CreateDate);
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
@@ -195,7 +204,7 @@ export class ExpedientePrPage implements OnInit {
window.history.back();
} finally {
if(error.status == 0) {
this.toastService.badRequest('Não é possível vizualizar este processo no modo offline')
this.toastService.badRequest('Não é possível visualizar este processo no modo offline')
} else {
this.toastService.badRequest('Processo não encontrado')
}
@@ -203,9 +212,18 @@ export class ExpedientePrPage implements OnInit {
});
}
getAttachments(serialNumber){
console.log(serialNumber);
this.attachmentsService.getAttachmentsBySerial(serialNumber).subscribe(res=>{
this.attachments = res;
console.log('res', res);
});
}
async LoadRelatedEvents(serial: string) {
if (this.eventsList == null) {
this.attachments.getAttachmentsBySerial(serial).subscribe(res => {
this.attachmentsService.getAttachmentsBySerial(serial).subscribe(res => {
console.log(res);
res.forEach(att => {
if (this.eventsList == null) {
@@ -230,6 +248,48 @@ export class ExpedientePrPage implements OnInit {
});
}
attachDocument(){
this.getDoc();
}
async getDoc() {
const modal = await this.modalController.create({
component: SearchPage,
cssClass: 'modal-width-100-width-background modal',
componentProps: {
type: 'AccoesPresidenciais & ArquivoDespachoElect',
showSearchInput: true,
select: true
}
});
await modal.present();
modal.onDidDismiss().then((res)=>{
if(res){
const data = res.data;
this.documents.push(data.selected);
console.log( this.documents);
this.documents.forEach(element =>{
let body = {
"Source": "1",
"SourceId": element.Id,
"SourceTitle": element.Assunto,
"SerialNumber": this.task.SerialNumber,
"ApplicationId": element.ApplicationType
}
this.attachmentsService.setEventAttachmentById(body).subscribe((res)=>{
this.getAttachments(this.task.SerialNumber);
});
})
}
});
}
removeAttachment(index: number){
this.documents = this.documents.filter( (e, i) => index != i);
}
openMenu() {
this.menu.open();
this.modalController.dismiss();
@@ -291,7 +351,7 @@ export class ExpedientePrPage implements OnInit {
if( window.innerWidth < 801){
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop'
classs = 'add-note-modal'
}
const modal = await this.modalController.create({
component: AddNotePage,
@@ -40,12 +40,12 @@ export class ExpedientesPrPage implements OnInit {
this.loggeduser = authService.ValidatedUser;
}
ngOnInit() {
const location = window.location
const pathname = location.pathname + location.search
this.LoadList();
this.router.events.forEach((event) => {
@@ -82,7 +82,7 @@ export class ExpedientesPrPage implements OnInit {
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocumentsQty": element.totalDocuments,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
"Status": element.workflowInstanceDataFields.Status,
@@ -33,13 +33,14 @@ import { ExpedientesPrPageModule } from 'src/app/shared/gabinete-digital/expedie
import { DiplomasAssinarPageModule } from 'src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.module';
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';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
FontAwesomeModule,
GabineteDigitalPageRoutingModule,
//
HeaderPageModule,
@@ -8,140 +8,210 @@
</ion-refresher-content>
</ion-refresher>
<div class="main-content d-flex height-100 ">
<div class="main-content d-flex height-100">
<!-- 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>
<div class="title-container">
<ion-label class="title">Gabinete Digital</ion-label>
<div class="title">
<ion-label>Gabinete Digital</ion-label>
</div>
<button *ngIf="hideRefreshBtn" class="btn-no-color btn-refresh" (click)="doRefresh($event)">
<ion-icon class="title-icon" name="reload-circle"></ion-icon>
</button>
<div *ngIf="!hideRefreshBtn" class="title-icons">
<ion-segment [(ngModel)]="segmentVista" (ionChange)="onSegmentVistaChange()">
<ion-segment-button value="listview" class="ion-segment-button-no-border">
<fa-icon icon="stream"></fa-icon>
</ion-segment-button>
<ion-segment-button value="boxview" class="ion-segment-button-no-border">
<fa-icon icon="th-large"></fa-icon>
</ion-segment-button>
</ion-segment>
</div>
</div>
<div [ngSwitch]="segmentVista" class="height-100">
<!-- This is the list view -->
<div class="aside overflow-y-auto d-flex flex-wrap width-100">
<div (click)="openEventsToApprovePage();selectedElement='approval'" [class.active]="selectedElement == 'approval'" class="exp-card d-flex flex-column" *ngIf="loggeduser.Profile == 'MDGPR'" >
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-agenda.svg"></ion-icon>
<div *ngSwitchCase="'listview'" class="height-100">
<ion-item-sliding class="overflow-y-auto height-100">
<div class="listview">
<ion-list *ngIf="allProcessesList">
<div
class="item-wrapper ion-no-padding cursor-pointer"
*ngFor = "let task of allProcessesList"
(click)="viewProcessDetails(task.SerialNumber, task.WorkflowName, task.activityInstanceName)">
<div class="item width-100">
<div class="item-top-detail">
<div class="item-subject">
<ion-label>{{ task.Folio }}</ion-label>
</div>
<div *ngIf="task.DocumentsQty != 0" class="item-icon">
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
<label>{{task.DocumentsQty}}</label>
</div>
</div>
<div class="item-middle-detail">
<div class="item-remetente">
<ion-label>{{task.Senders}}</ion-label>
</div>
</div>
<div *ngIf="task.Agenda" class="item-middle-detail">
<div class="item-remetente">
<ion-label>{{task.customDate}}</ion-label>
</div>
</div>
<div *ngIf="task.Agenda" class="item-middle-detail-extra">
<div class="item-middle-detail-extra-text">
<ion-label *ngIf=" task.WorkflowName == 'Agenda Oficial PR' || task.WorkflowName == 'Agenda Pessoal PR'">
Agenda {{task.Agenda}} do Presidente da República
</ion-label>
<ion-label *ngIf=" task.WorkflowName == 'Agenda Oficial MDGPR' || task.WorkflowName == 'Agenda Pessoal MDGPR'">
A sua agenda {{task.Agenda}}
</ion-label>
</div>
</div>
<div class="item-bottom-detail d-flex align-items-center">
<div class="item-workflow">
<span class="label">{{task.activityInstanceName}}</span>
</div>
<div class="item-date">
<ion-label>{{ task.CreateDate | date: 'dd-MM-yy' }}</ion-label>
</div>
</div>
</div>
</div>
</ion-list>
</div>
<p class="text-center exp-card-title ">Eventos para Aprovação</p>
<p class="text-center exp-card-content">{{eventoaprovacaostore.count}} <span class="title1">Documentos</span></p>
</ion-item-sliding>
</div>
<div [class.active]="selectedElement == 'Correspondence'" (click)="openExpedientListPage(); selectedElement='Correspondence'" class="exp-card d-flex flex-column justify-center" *ngIf="loggeduser.Profile == 'MDGPR'">
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-correspondencia.svg"></ion-icon>
</div>
<p class="text-center exp-card-title ">Correspondencia</p>
<p class="text-center exp-card-content">{{expedientegbstore.count}} <span class="title1">Documentos</span></p>
</div>
<!-- <div [class.active]="selectedElement == 'Pending'" (click)="openPendentesPage(); selectedElement='Pending'" class="exp-card d-flex flex-column justify-center" > -->
<div [class.active]="selectedElementF('Pending')" (click)="openPendentesPage(); selectedElement='Pending'" class="exp-card d-flex flex-column justify-center" >
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-expediente-pendente.svg"></ion-icon>
</div>
<p *ngIf="loggeduser.Profile == 'MDGPR'" class="text-center exp-card-title ">Pendentes</p>
<p *ngIf="loggeduser.Profile == 'PR'" class="text-center exp-card-title ">Meus Pendentes</p>
<p class="text-center exp-card-content"><span class="number">{{pendentesstore.count}} </span> <span class="title1">Documentos</span></p>
</div>
<div [class.active]="selectedElement == 'Dispatches'" class="exp-card d-flex flex-column justify-center" (click)="openDespachosPage(); selectedElement='Dispatches'" *ngIf="loggeduser.Profile == 'MDGPR'">
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-despachos-presidente.svg"></ion-icon>
</div>
<p class="text-center exp-card-title ">Despachos</p>
<p class="text-center exp-card-content">{{despachoStore.count}} <span class="title1">Documentos</span> </p>
</div>
<div (click)="openPedidosPage('parecer'); selectedElement='RequestsForOpinion'" [class.active]="selectedElement == 'RequestsForOpinion'" class="exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-expediente-parecer.svg"></ion-icon>
</div>
<p *ngIf="loggeduser.Profile == 'MDGPR'" class="text-center exp-card-title ">Pedidos de Parecer</p>
<p *ngIf="loggeduser.Profile == 'PR'" class="text-center exp-card-title ">Pedidos de Parecer solicitados por mim</p>
<p class="text-center exp-card-content">{{pedidosstore.countparecer}} <span class="title1">Documentos</span></p>
</div>
<div (click)="openPedidosPage('deferimento'); selectedElement = 'RequestForApproval'" [class.active]="selectedElement == 'RequestForApproval'" class="exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-expediente-deferimento.svg"></ion-icon>
</div>
<p class="text-center exp-card-title ">Pedidos de Deferimento</p>
<p class="text-center exp-card-content">{{pedidosstore.countdeferimento}} <span class="title1">Documentos</span></p>
</div>
<div *ngIf="loggeduser.Profile == 'PR'" (click)="openExpedientesPrPage(); selectedElement = 'Expediente Presidente'" [class.active]="selectedElement == 'Expediente Presidente'" class="exp-card d-md-flex flex-column justify-center white-background">
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-expediente-presidente.svg"></ion-icon>
</div>
<p class="exp-card-title " *ngIf="loggeduser.Profile == 'MDGPR'">Expediente Presidente</p>
<p class="exp-card-title " *ngIf="loggeduser.Profile == 'PR'">Expediente</p>
<p class="text-center exp-card-content"><span class="number">{{expedienteprstore.count}} </span> <span class="title1">Documentos</span></p>
</div>
<div *ngIf="loggeduser.Profile == 'PR'" (click)="openDespachosPrPage(); selectedElement='DispatchesPr'" [class.active]="selectedElement == 'DispatchesPr'" class="exp-card d-md-flex flex-column justify-center" >
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-despachos-presidente.svg"></ion-icon>
</div>
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'MDGPR'">Despacho do Presidente da República</p>
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'PR'">Despachos criados por mim</p>
<p class="text-center exp-card-content">{{ despachoprstore.count }} <span class="title1">Documentos</span> </p>
</div>
<div *ngIf="p.userRole(['MDGPR'])" (click)="openExpedientesPrPage(); selectedElement='ExpedientesPr'" [class.active]="selectedElement == 'ExpedientesPr'" class="exp-card-long justify-center width-100 white-background">
<div class="center-div">
<div class="exp-card-icon">
<ion-icon src="assets/images/icons-expediente-presidente.svg"></ion-icon>
</div>
<div class="exp-card-text">
<p class="exp-card-title " *ngIf="loggeduser.Profile == mdgpr">Expediente Presidente</p>
<p class="exp-card-title " *ngIf="loggeduser.Profile == pr">Expediente</p>
<p class="exp-card-content"><span class="number">{{expedienteprstore.count}} </span> <span class="title1">Documentos</span> </p>
<!-- This is the box view -->
<div *ngSwitchCase="'boxview'" class="aside overflow-y-auto d-flex flex-wrap width-100 height-100">
<div (click)="openEventsToApprovePage();selectedElement='approval'" [class.active]="selectedElement == 'approval'" class="exp-card d-flex flex-column" *ngIf="loggeduser.Profile == 'MDGPR'" >
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-agenda.svg"></ion-icon>
</div>
<p class="text-center exp-card-title ">Eventos para Aprovação</p>
<p class="text-center exp-card-content">{{eventoaprovacaostore.count}} <span class="title1">Documentos</span></p>
</div>
</div>
<div *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openDespachosPrPage(); selectedElement='showDespachosPr'" [class.active]="selectedElement == 'showDespachosPr'" class="exp-card-long width-100" >
<div class="center-div">
<div class="exp-card-icon">
<div [class.active]="selectedElement == 'Correspondence'" (click)="openExpedientListPage(); selectedElement='Correspondence'" class="exp-card d-flex flex-column justify-center" *ngIf="loggeduser.Profile == 'MDGPR'">
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-correspondencia.svg"></ion-icon>
</div>
<p class="text-center exp-card-title ">Correspondencia</p>
<p class="text-center exp-card-content">{{expedientegbstore.count}} <span class="title1">Documentos</span></p>
</div>
<!-- <div [class.active]="selectedElement == 'Pending'" (click)="openPendentesPage(); selectedElement='Pending'" class="exp-card d-flex flex-column justify-center" > -->
<div [class.active]="selectedElementF('Pending')" (click)="openPendentesPage(); selectedElement='Pending'" class="exp-card d-flex flex-column justify-center" >
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-expediente-pendente.svg"></ion-icon>
</div>
<p *ngIf="loggeduser.Profile == 'MDGPR'" class="text-center exp-card-title ">Pendentes</p>
<p *ngIf="loggeduser.Profile == 'PR'" class="text-center exp-card-title ">Meus Pendentes</p>
<p class="text-center exp-card-content"><span class="number">{{pendentesstore.count}} </span> <span class="title1">Documentos</span></p>
</div>
<div [class.active]="selectedElement == 'Dispatches'" class="exp-card d-flex flex-column justify-center" (click)="openDespachosPage(); selectedElement='Dispatches'" *ngIf="loggeduser.Profile == 'MDGPR'">
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-despachos-presidente.svg"></ion-icon>
</div>
<div class="exp-card-text">
<p class="exp-card-title">Despacho do Presidente da República</p>
<p class="text-center exp-card-content">{{ despachoprstore.count }} <span class="title1">Documentos</span> </p>
<p class="text-center exp-card-title ">Despachos</p>
<p class="text-center exp-card-content">{{despachoStore.count}} <span class="title1">Documentos</span> </p>
</div>
<div (click)="openPedidosPage('parecer'); selectedElement='RequestsForOpinion'" [class.active]="selectedElement == 'RequestsForOpinion'" class="exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-expediente-parecer.svg"></ion-icon>
</div>
<p *ngIf="loggeduser.Profile == 'MDGPR'" class="text-center exp-card-title ">Pedidos de Parecer</p>
<p *ngIf="loggeduser.Profile == 'PR'" class="text-center exp-card-title ">Pedidos de Parecer solicitados por mim</p>
<p class="text-center exp-card-content">{{pedidosstore.countparecer}} <span class="title1">Documentos</span></p>
</div>
<div (click)="openPedidosPage('deferimento'); selectedElement = 'RequestForApproval'" [class.active]="selectedElement == 'RequestForApproval'" class="exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-expediente-deferimento.svg"></ion-icon>
</div>
<p class="text-center exp-card-title ">Pedidos de Deferimento</p>
<p class="text-center exp-card-content">{{pedidosstore.countdeferimento}} <span class="title1">Documentos</span></p>
</div>
<div *ngIf="loggeduser.Profile == 'PR'" (click)="openExpedientesPrPage(); selectedElement = 'Expediente Presidente'" [class.active]="selectedElement == 'Expediente Presidente'" class="exp-card d-md-flex flex-column justify-center white-background">
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-expediente-presidente.svg"></ion-icon>
</div>
<p class="exp-card-title " *ngIf="loggeduser.Profile == 'MDGPR'">Expediente Presidente</p>
<p class="exp-card-title " *ngIf="loggeduser.Profile == 'PR'">Expediente</p>
<p class="text-center exp-card-content"><span class="number">{{expedienteprstore.count}} </span> <span class="title1">Documentos</span></p>
</div>
<div *ngIf="loggeduser.Profile == 'PR'" (click)="openDespachosPrPage(); selectedElement='DispatchesPr'" [class.active]="selectedElement == 'DispatchesPr'" class="exp-card d-md-flex flex-column justify-center" >
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-despachos-presidente.svg"></ion-icon>
</div>
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'MDGPR'">Despacho do Presidente da República</p>
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'PR'">Despachos criados por mim</p>
<p class="text-center exp-card-content">{{ despachoprstore.count }} <span class="title1">Documentos</span> </p>
</div>
<div *ngIf="p.userRole(['MDGPR'])" (click)="openExpedientesPrPage(); selectedElement='ExpedientesPr'" [class.active]="selectedElement == 'ExpedientesPr'" class="exp-card-long justify-center width-100 white-background">
<div class="center-div">
<div class="exp-card-icon">
<ion-icon src="assets/images/icons-expediente-presidente.svg"></ion-icon>
</div>
<div class="exp-card-text">
<p class="exp-card-title " *ngIf="loggeduser.Profile == mdgpr">Expediente Presidente</p>
<p class="exp-card-title " *ngIf="loggeduser.Profile == pr">Expediente</p>
<p class="exp-card-content"><span class="number">{{expedienteprstore.count}} </span> <span class="title1">Documentos</span> </p>
</div>
</div>
</div>
</div>
<div *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openDiplomasPage('validar'); selectedElement='DiplomasPorValidar'" [class.active]="selectedElement == 'DiplomasPorValidar'" class="exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-expediente-diploma.svg"></ion-icon>
<div *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openDespachosPrPage(); selectedElement='showDespachosPr'" [class.active]="selectedElement == 'showDespachosPr'" class="exp-card-long width-100" >
<div class="center-div">
<div class="exp-card-icon">
<ion-icon src="assets/images/icons-despachos-presidente.svg"></ion-icon>
</div>
<div class="exp-card-text">
<p class="exp-card-title">Despacho do Presidente da República</p>
<p class="text-center exp-card-content">{{ despachoprstore.count }} <span class="title1">Documentos</span> </p>
</div>
</div>
</div>
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'MDGPR' ">Diplomas por Validar</p>
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'PR'">Diplomas por Assinar</p>
<p class="text-center exp-card-content">{{count_dip_pv}} <span class="title1">Documentos</span> </p>
</div>
<div *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openDiplomasPage('assinados'); selectedElement='DiplomasAssinados'" [class.active]="selectedElement == 'DiplomasAssinados'" class="exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-diplomas-assinados-presidente.svg"></ion-icon>
<div *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openDiplomasPage('validar'); selectedElement='DiplomasPorValidar'" [class.active]="selectedElement == 'DiplomasPorValidar'" class="exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-expediente-diploma.svg"></ion-icon>
</div>
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'MDGPR' ">Diplomas por Validar</p>
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'PR'">Diplomas por Assinar</p>
<p class="text-center exp-card-content">{{count_dip_pv}} <span class="title1">Documentos</span> </p>
</div>
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'MDGPR'">Diplomas assinados PR</p>
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'PR'" >Diplomas</p>
<p class="text-center exp-card-content">{{ count_dip_as_pr }} <span class="title1">Documentos</span></p>
</div>
<div *ngIf="loggeduser.Profile == 'PR'" (click)="openDiplomasAssinarPage(); selectedElement='DiplomasAssinar'" [class.active]="selectedElement == 'DiplomasAssinar'" class="exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-expediente-diploma.svg"></ion-icon>
<div *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openDiplomasPage('assinados'); selectedElement='DiplomasAssinados'" [class.active]="selectedElement == 'DiplomasAssinados'" class="exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-diplomas-assinados-presidente.svg"></ion-icon>
</div>
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'MDGPR'">Diplomas assinados PR</p>
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'PR'" >Diplomas</p>
<p class="text-center exp-card-content">{{ count_dip_as_pr }} <span class="title1">Documentos</span></p>
</div>
<p class="text-center exp-card-title">Diplomas para Assinar</p>
<p class="text-center exp-card-content">{{count_dip_as}} <span class="title1">Documentos</span></p>
<div *ngIf="loggeduser.Profile == 'PR'" (click)="openDiplomasAssinarPage(); selectedElement='DiplomasAssinar'" [class.active]="selectedElement == 'DiplomasAssinar'" class="exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-expediente-diploma.svg"></ion-icon>
</div>
<p class="text-center exp-card-title">Diplomas para Assinar</p>
<p class="text-center exp-card-content">{{count_dip_as}} <span class="title1">Documentos</span></p>
</div>
</div>
</div>
</div>
</div>
<!-- Aside right -->
@@ -4,7 +4,22 @@ ion-content{
--padding-start:15px; */
/* --padding-bottom:15px; */
/* --background:#ecf8ff; */
--background: transparent;
--background: #ecf8ff;
}
ion-segment{
overflow: auto;
}
ion-segment-button{
margin: 0 auto !important;
padding: 0 !important;
--padding-bottom: 0px;
--padding-top: 5px;
--margin-bottom: 5px;
--margin-top: 0px;
min-height: 25px;
min-width: 25px;
}
:host{
// background: #0782c9;
@@ -12,8 +27,17 @@ ion-content{
text-align: center;
}
.title-container{
background:#ecf8ff;
padding: 30px 20px 15px 20px !important;
//margin-bottom: 15px;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
.title{
width: fit-content;
font-size: 25px !important;
float: left;
}
.btn-no-color{
display: flex;
float: right;
@@ -24,6 +48,14 @@ ion-content{
font-size: 30px;
color: #42b9fe;
}
.title-icons{
width: fit-content;
float: right !important;
align-self: baseline;
}
.title-icons fa-icon{
font-size: 25px !important;
}
}
ion-card{
@@ -87,16 +119,20 @@ ion-content{
font-family: Roboto;
margin: 0 auto;
background:#ecf8ff;
overflow:auto;
overflow:hidden;
padding: 0 !important;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
.aside-wrapper{
//border: 1px solid red;
overflow: hidden;
.listview{
width: 100%t;
padding: 0px 20px 15px 20px !important;
overflow: auto;
}
}
.aside{
align-items: center;
justify-content: center;
@@ -204,6 +240,143 @@ ion-content{
overflow: auto;
}
/* New list view CSS */
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;
}
}
}
@media only screen and (min-width: 561px) {
.exp-card-long{
@@ -218,16 +391,24 @@ ion-content{
@media only screen and (min-width: 701px) {
ion-content{
--background: transparent;
}
.title{
font-size: 15px !important;
}
.main-content{
border-top-left-radius: 25px;
border-top-right-radius: 25px;
overflow: hidden;
.aside-wrapper{
display: flex;
width: 35%;
justify-content: flex-start !important;
border-right: 1px solid #d8d8d8;
overflow: hidden;
.aside{
background:transparent;
@@ -329,7 +510,7 @@ ion-content{
}
@media only screen and (min-width: 801px) {
.title{
font-size: 25px;
font-size: 25px !important;
}
.content{
width: 65%;
@@ -21,6 +21,7 @@ import { PedidosStore } from 'src/app/store/pedidos-store.service';
import { ExpedienteprStore } from 'src/app/store/expedientepr-store.service';
import { DespachosprStore } from 'src/app/store/despachospr-store.service';
import { PermissionService } from 'src/app/OtherService/permission.service';
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
@Component({
selector: 'app-gabinete-digital',
templateUrl: './gabinete-digital.page.html',
@@ -30,9 +31,13 @@ import { PermissionService } from 'src/app/OtherService/permission.service';
export class GabineteDigitalPage implements OnInit {
segment:string;
segmentVista:string;
showLoader: boolean;
public profile:string;
allProcessesList: any = new Array();
skeletonLoader: boolean;
count_exp_dailywork=0;
count_exp_pr =0
count_desp_dailywork=0;
@@ -103,13 +108,16 @@ export class GabineteDigitalPage implements OnInit {
authService: AuthService,
public p: PermissionService
) {
this.loggeduser = authService.ValidatedUser;
this.loggeduser = authService.ValidatedUser;
window.onresize = (event) => {
// if not mobile remove all component
if( window.innerWidth <= 801){
if( window.innerWidth <= 701){
this.modalController.dismiss();
this.segmentVista = "listview";
}
else{
this.segmentVista = "boxview";
}
};
this.checkRoutes();
@@ -126,6 +134,13 @@ export class GabineteDigitalPage implements OnInit {
ngOnInit() {
if( window.innerWidth < 701) {
this.segmentVista = "listview";
}
else{
this.segmentVista = "boxview";
}
const pathname = window.location.pathname
this.LoadCounts();
@@ -140,6 +155,144 @@ export class GabineteDigitalPage implements OnInit {
});
this.hideRefreshButton();
this.loadAllProcesses();
}
async loadAllProcesses(){
let allProcessesList = await this.processesbackend.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();
}
viewProcessDetails(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')
}
}
onSegmentVistaChange(){
}
checkUser(){
@@ -24,6 +24,8 @@ import { ToastService } from 'src/app/services/toast.service';
import { ForwardPage } from 'src/app/modals/forward/forward.page';
import { async } from '@angular/core/testing';
import { PermissionService } from 'src/app/OtherService/permission.service';
import { Location } from '@angular/common';
@Component({
selector: 'app-pedido',
@@ -61,6 +63,7 @@ export class PedidoPage implements OnInit {
private animationController: AnimationController,
private toastService: ToastService,
public p: PermissionService,
private location: Location
) {
this.loggeduser = authService.ValidatedUser;
@@ -91,7 +94,7 @@ export class PedidoPage implements OnInit {
toDateString(e) {
return new Date(e).toDateString()
}
async LoadTaskDetail(serial: string) {
this.processes.GetTask(this.serialnumber).subscribe(res => {
@@ -167,7 +170,7 @@ export class PedidoPage implements OnInit {
window.history.back();
} finally {
if(error.status == 0) {
this.toastService.badRequest('Não é possível vizualizar este processo no modo offline')
this.toastService.badRequest('Não é possível visualizar este processo no modo offline')
} else {
this.toastService.badRequest('Processo não encontrado')
}
@@ -449,7 +452,7 @@ export class PedidoPage implements OnInit {
if( window.innerWidth <= 800){
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop'
classs = 'add-note-modal'
}
const modal = await this.modalController.create({
component: AddNotePage,
@@ -491,8 +494,9 @@ export class PedidoPage implements OnInit {
}
goBack() {
if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){
if (window.innerWidth <= 800) {
this.location.back();
/* if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){
if (window.innerWidth <= 700) {
this.router.navigate(['/home/gabinete-digital/pendentes']);
}
else {
@@ -509,7 +513,7 @@ export class PedidoPage implements OnInit {
}
}
else {
if (window.innerWidth <= 800) {
if (window.innerWidth <= 700) {
this.router.navigate(['/home/gabinete-digital/pedidos']);
}
else {
@@ -524,7 +528,7 @@ export class PedidoPage implements OnInit {
}
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
}
} */
}
}
@@ -116,7 +116,7 @@
</div>
<div [ngSwitch]="segment">
<div *ngSwitchCase="'parecer'" class="d-flex height-100 align-center justify-content-center" >
<div *ngSwitchCase="'parecer'" class="centered-div d-flex height-100 align-center justify-content-center" >
<div
*ngIf="!skeletonLoader && pedidosstorage.listparecer.length == 0"
class="empty-list d-flex height-100 align-center justify-content-center"
@@ -125,7 +125,7 @@
</div>
</div>
<div *ngSwitchCase="'deferimento'" class="d-flex height-100 align-center justify-content-center">
<div *ngSwitchCase="'deferimento'" class="centered-div d-flex height-100 align-center justify-content-center">
<div
*ngIf="!skeletonLoader && pedidosstorage.listdeferimento.length == 0"
class="empty-list d-flex height-100 align-center justify-content-center"
@@ -38,7 +38,7 @@ ion-content, .header-2, .main-content{
}
.ion-item-class{
padding: 0;
}
.label-text{
width: 100%;
@@ -87,7 +87,7 @@ ion-item{
.div-icon ion-icon{
display: block;
margin: 0 auto;
}
.div-content-expediente p, .div-content-pendentes p{
font-size: 14pt;
@@ -167,7 +167,7 @@ ion-item{
.exp-workflow{
float: left;
margin: 0 !important;
.label{
border-radius: 15px;
background: #ffb703;
@@ -230,4 +230,13 @@ ion-item{
font-size: 45px;
float: right;
margin-right: 10px;
}
}
.centered-div{
width: 100px;
height: 100px;
position: absolute;
top: 50%;
left: 50%;
margin: -35px 0 0 -35px;
}
@@ -75,7 +75,7 @@ export class PendentesPage implements OnInit {
async LoadList(){
this.skeletonLoader = true
this.skeletonLoader = true;
let pendentes = await this.processes.GetPendingTasks(false).toPromise();
this.pendentesList = [];
+1
View File
@@ -111,6 +111,7 @@ export class LoginPage implements OnInit {
getToken() {
this.notificatinsservice.getAndpostToken(this.username);
//alert('HERE');
}
async Login() {
@@ -89,7 +89,7 @@ export class ViewPublicationsPage implements OnInit {
}
getPublicationDetail() {
setTimeout(() => {
let allActions = this.publicationEventFolderStorage.list.concat(this.publicationTravelFolderService.list)
this.item = allActions.find((e)=> e.ProcessId == this.folderId);
@@ -128,6 +128,8 @@ export class ViewPublicationsPage implements OnInit {
});
console.log(folderId);
this.publicationListStorage.add(folderId, this.publicationList)
this.showLoader = false;
+19 -21
View File
@@ -14,7 +14,7 @@ export class AttachmentsService {
loggeduser: User;
headers: HttpHeaders;
constructor(private http: HttpClient, user: AuthService) {
constructor(private http: HttpClient, user: AuthService) {
this.loggeduser = user.ValidatedUser;
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
@@ -26,9 +26,9 @@ export class AttachmentsService {
params = params.set("SerialNumber", serialNumber);
let options = {
headers: this.headers,
params: params
let options = {
headers: this.headers,
params: params
};
return this.http.get<Attachment[]>(`${geturl}`, options);
}
@@ -39,10 +39,10 @@ export class AttachmentsService {
params = params.set("Source", source.toString());
/* params = params.set("SourceId", sourceid); */
let options = {
headers: this.headers,
params: params
let options = {
headers: this.headers,
params: params
};
return this.http.get<Attachment[]>(`${geturl}`, options);
@@ -54,37 +54,35 @@ export class AttachmentsService {
params = params.set("ParentId", eventId);
/* params = params.set("SourceId", sourceid); */
let options = {
headers: this.headers,
params: params
headers: this.headers,
params: params
};
return this.http.get<Attachment[]>(`${geturl}`, options);
}
setEventAttachmentById(body: EventAttachment) {
setEventAttachmentById(body: any) {
let geturl = environment.apiURL + 'Attachments/Create';
let options = {
headers: this.headers,
let options = {
headers: this.headers,
}
return this.http.post(`${geturl}`, body, options);
}
deleteEventAttachmentById(attachmentId) {
deleteEventAttachmentById(attachmentId) {
let geturl = environment.apiURL + `Attachments/Delete?attachmentId=${attachmentId}`;
let params = new HttpParams();
params = params.set("attachmentId", attachmentId);
let options = {
headers: this.headers,
params: params
let options = {
headers: this.headers,
params: params
}
return this.http.delete(`${geturl}`, options);
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { JsonStore } from './jsonStore.service';
describe('JsonStore', () => {
let service: JsonStore;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(JsonStore);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
+130
View File
@@ -0,0 +1,130 @@
///<reference path="../../../plugins/cordova-plugin-mfp/typings/worklight.d.ts" />
///<reference path="../../../plugins/cordova-plugin-mfp-jsonstore/typings/jsonstore.d.ts" />
import { Injectable } from "@angular/core";
@Injectable({
providedIn: 'root'
})
export class JsonStore {
createCollection(name, data) {
var collectionName = name;
var addOptions = {
// Mark data as dirty (true = yes, false = no), default true.
markDirty: true
};
var JSONStoreCollections = {};
JSONStoreCollections[collectionName] = {};
JSONStoreCollections[collectionName].searchFields = { UserId: 'integer' };
WL.JSONStore.init(JSONStoreCollections)
.then(function () {
WL.Logger.debug('Init done');
console.log('Init done');
return WL.JSONStore.get(collectionName).add(data, addOptions);
}).fail(function (err) {
WL.Logger.error(err);
console.log(err)
});
}
getCollection(collectionName) {
var allOptions = {
// Returns a maximum of 10 documents, default no limit.
limit: 10,
// Skip 0 documents, default no offset.
offset: 0,
// Search fields to return, default: ['_id', 'json'].
filter: ['UserId', 'json'],
// How to sort the returned values, default no sort.}]
};
var JSONStoreCollections = {};
JSONStoreCollections[collectionName] = {};
JSONStoreCollections[collectionName].searchFields = { UserId: 'integer' };
WL.JSONStore.init(JSONStoreCollections)
.then(function () {
WL.Logger.debug('Find all colletion data');
console.log('Find all colletion data');
}).fail(function (err) {
WL.Logger.error(err);
console.log("JsonStore getColletion error ",err)
});
const data = WL.JSONStore.get(collectionName).findAll(allOptions).then((value) => {
console.log('Find all colletion data', value);
return JSON.parse(value);
});
return data
//return notificationData
}
getColletionById(collectionName, value) {
var query = { UserId: value };
var allOptions = {
// Returns a maximum of 10 documents, default no limit.
limit: 10,
// Skip 0 documents, default no offset.
offset: 0,
// Search fields to return, default: ['_id', 'json'].
filter: ['UserId', 'json'],
// How to sort the returned values, default no sort.}]
};
var JSONStoreCollections = {};
JSONStoreCollections[collectionName] = {};
JSONStoreCollections[collectionName].searchFields = { UserId: 'integer' };
WL.JSONStore.init(JSONStoreCollections)
.then(function () {
WL.Logger.debug('Find colletion data by id');
console.log('Find colletion data by id');
return WL.JSONStore.get(collectionName).find(query, allOptions).then((value) => {
console.log('Find colletion data by id', value);
});
}).fail(function (err) {
WL.Logger.error(err);
console.log(err)
});
}
replaceDocument(collectionName: string, document: any) {
/* var document = { Example of how identify the document to replace
_id: 1, json: {name: 'chevy', age: 23}
}; */
var options = {};
WL.JSONStore.get(collectionName).replace(document, options).then(function (numberOfDocsReplaced) {
console.log("JsonStore replace document sucess: ", numberOfDocsReplaced)
}).fail(function (error) {
console.log("JsonStore replace document error: ", error)
});
}
removeDocument(collectionName: any,query: any,) {
/* var query = { _id: 1 }; Exemple of query*/
var options = { exact: true };
WL.JSONStore.get(collectionName).remove(query, options).then(function (numberOfDocsRemoved) {
console.log("JsonStore remove document sucess: ", numberOfDocsRemoved)
}).fail(function (error) {
console.log("JsonStore remove document erro: ", error)
});
}
}
+68 -4
View File
@@ -12,6 +12,7 @@ import { ModalController, AlertController, AnimationController, Platform } from
import { NavigationExtras,Router } from '@angular/router';
import { ToastService } from '../services/toast.service';
import { Optional } from '@angular/core';
import { JsonStore } from './jsonStore.service';
@Injectable({
providedIn: 'root'
@@ -20,6 +21,7 @@ export class NotificationsService {
adding: "intervenient" | "CC" = "intervenient";
folderId: string;
DataArray: Array<String> = [];
constructor(
private http: HttpClient,
@@ -31,7 +33,8 @@ export class NotificationsService {
private router: Router,
private toastService: ToastService,
private zone: NgZone,
private activeroute: ActivatedRoute) { }
private activeroute: ActivatedRoute,
private jsonstore: JsonStore) { }
getTokenByUserIdAndId(user, userID) {
const geturl = environment.apiURL + 'notifications/user/' + userID;
@@ -40,6 +43,7 @@ export class NotificationsService {
}
getAndpostToken(username) {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
console.log('Notifications not supported')
} else {
@@ -94,6 +98,62 @@ export class NotificationsService {
}
getAndpostToken2() {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
console.log('Notifications not supported')
} else {
const geturl = environment.apiURL + 'notifications/token';
window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then(
(token) => {
console.log('Push Notification: Success ' + token);
window['MFPPush'].initialize(
function (successResponse) {
console.log("Push notification Successfully Service intialized: " + successResponse);
},
function (failureResponse) {
console.log("Push notification failure Service intialized: " + failureResponse);
}
);
window['MFPPush'].registerDevice(null, (successResponse) => {
console.log("Successfully registered: " + JSON.stringify(successResponse));
console.log('token: ', successResponse.deviceId)
/* this.storageService.store(username, successResponse.deviceId);
this.storageService.get(username).then(value => {
console.log('STORAGE TOKEN', value)
this.storageService.get(AuthConnstants.USER).then(res => {
console.log('USERID', res);
const headers = { 'Authorization': 'Basic cGF1bG8ucGludG9AZ2FiaW5ldGVkaWdpdGFsLmxvY2FsOnRhYnRlc3RlQDAwNg==' };
const body = {
UserId: res.UserId,
TokenId: successResponse.deviceId,
Status: 1,
Service: 1
};
this.http.post<Token>(`${geturl}`, body, { headers }).subscribe(data => {
console.log('TOKEN USER MIDLE', data);
})
});
}); */
},
function (failureResponse) {
console.log("Successfully failue: " + JSON.stringify(failureResponse));
}
);
}, (error) => {
console.log('Push notification recived: failure ' + error.responseText);
console.log(JSON.stringify(error));
}
);
}
}
async onReceviNotification() {
window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then(
(token) => {
@@ -109,6 +169,10 @@ export class NotificationsService {
}
);
var notificationReceived = (message) => {
//this.jsonstore.createCollection('Notifications',message);
this.DataArray.push(message)
this.storageService.store("Notifications",JSON.stringify(this.DataArray))
console.log(message);
var data = JSON.parse(message.payload);
console.log(data.Service);
@@ -139,7 +203,7 @@ export class NotificationsService {
else if (data.Service === "gabinete-digital" && data.Object === "event-list") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',data.IdObject, 'gabinete-digital']));
}else if (data.Service === "gabinete-digital" && data.Object === "despachos") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos',data.IdObject,'gabinete-digital'],{replaceUrl: true}));
}
else if (data.Service === "gabinete-digital" && data.Object === "parecer") {
@@ -147,11 +211,11 @@ export class NotificationsService {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos',data.IdObject,'gabinete-digital']));
}
else if (data.Service === "gabinete-digital" && data.Object === "deferimento") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos',data.IdObject,'gabinete-digital']));
}
else if (data.Service === "gabinete-digital" && data.Object === "despachos-pr") {
let navigationExtras: NavigationExtras = {
queryParams: {
"serialNumber": data.IdObject,
@@ -108,7 +108,7 @@ export class ViewEventPage implements OnInit {
})
if(error.status == 0) {
this.toastService.badRequest('não é possível vizualizar este event no modo offline')
this.toastService.badRequest('Não é possível visualizar este evento no modo offline')
} else {
this.toastService.badRequest('Este evento já não existe na sua agenda')
}
@@ -19,14 +19,14 @@
</ion-toolbar>
</ion-header>
<ion-content>
<div class="width-100 overflow-y-auto height-100" [ngSwitch]="segment">
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
<div *ngIf="diplomasList.length >= 1">
<ion-list *ngSwitchCase="'validar'">
<ion-item
class="expediente ion-no-padding ion-no-margin cursor-pointer"
<div
class="expediente ion-no-padding ion-no-margin cursor-pointer"
*ngFor = "let task of diplomasList"
(click)="goToDiploma(task.SerialNumber)"
>
@@ -54,14 +54,14 @@
</div>
</div>
</div>
</ion-item>
</div>
</ion-list>
</div>
<div *ngIf="diplomasList.length >= 1">
<ion-list *ngSwitchCase="'assinados'">
<div
class="expediente ion-no-padding ion-no-margin cursor-pointer"
<div
class="expediente ion-no-padding ion-no-margin cursor-pointer"
*ngFor = "let task of diplomasList"
(click)="goToDiploma(task.SerialNumber)"
>
@@ -93,15 +93,15 @@
</ion-list>
</div>
<div
*ngIf="!skeletonLoader && diplomasList.length == 0"
<div
*ngIf="!skeletonLoader && diplomasList.length == 0"
class="empty-list d-flex height-100 align-center justify-content-center"
>
<span>Lista vazia</span>
</div>
<div *ngIf="skeletonLoader && diplomasList.length == 0">
<ion-list>
<ion-item>
<ion-thumbnail slot="end">
@@ -23,50 +23,79 @@
<ion-refresher-content>
</ion-refresher-content>
</ion-refresher>
<div class="main-content overflow-y-auto height-100" [ngSwitch]="segment" *ngIf="eventaprovacaostore.listmd">
<!-- <div class="header-content width-100"> -->
<div class="main-content overflow-y-auto height-100" [ngSwitch]="segment">
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<!-- </div> -->
<ion-list class="width-100" *ngSwitchCase="'MDGPR'" >
<div
class="expediente ion-no-padding ion-no-margin cursor-pointer"
*ngFor="let event of eventaprovacaostore.listmd"
(click)="goToEventDetail(event)"
>
<!-- (click)="openApproveModal(event)" -->
<div class="event-mdgpr-{{event.workflowInstanceDataFields.Agenda}} width-100">
<div class="approve-event-time">
<p>{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}</p>
<p>{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
<div *ngSwitchCase="'MDGPR'" class="height-100">
<div *ngIf="eventaprovacaostore.listmd.length != 0">
<ion-list class="width-100" >
<div
class="expediente ion-no-padding ion-no-margin cursor-pointer"
*ngFor="let event of eventaprovacaostore.listmd"
(click)="goToEventDetail(event)"
>
<!-- (click)="openApproveModal(event)" -->
<div class="event-mdgpr-{{event.workflowInstanceDataFields.Agenda}} width-100">
<div class="approve-event-time">
<p>{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}</p>
<p>{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
</div>
<div class="approve-event-detail">
<p *ngIf="toDateString(event.workflowInstanceDataFields.StartDate) != toDateString(event.workflowInstanceDataFields.EndDate)">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}</p>
<p *ngIf="toDateString(event.workflowInstanceDataFields.StartDate) == toDateString(event.workflowInstanceDataFields.EndDate)">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}</p>
<h3>{{event.workflowInstanceDataFields.Subject}}</h3>
</div>
</div>
</div>
<div class="approve-event-detail">
<p *ngIf="toDateString(event.workflowInstanceDataFields.StartDate) != toDateString(event.workflowInstanceDataFields.EndDate)">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}</p>
<p *ngIf="toDateString(event.workflowInstanceDataFields.StartDate) == toDateString(event.workflowInstanceDataFields.EndDate)">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}</p>
<h3>{{event.workflowInstanceDataFields.Subject}}</h3>
</ion-list>
</div>
<div *ngIf="eventaprovacaostore.listmd.length == 0" class="centered-div">
<div *ngSwitchCase="'MDGPR'" >
<div class="d-flex height-90 align-center justify-content-center"
>
Lista vazia
</div>
</div>
</div>
</ion-list>
<ion-list class="width-100" *ngSwitchCase="'PR'">
<div class="width-100" *ngIf="eventaprovacaostore.listpr">
<div
class="expediente ion-no-padding ion-no-margin cursor-pointer"
*ngFor="let event of eventaprovacaostore.listpr"
(click)="goToEventDetail(event)"
>
<div class="item event-pr-{{event.workflowInstanceDataFields.Agenda}} width-100">
<div class="approve-event-time">
<p>{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}</p>
<p>{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
</div>
<div class="approve-event-detail">
<p *ngIf="toDateString(event.workflowInstanceDataFields.StartDate) != toDateString(event.workflowInstanceDataFields.EndDate)">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}</p>
<p *ngIf="toDateString(event.workflowInstanceDataFields.StartDate) == toDateString(event.workflowInstanceDataFields.EndDate)">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}</p>
<h3>{{event.workflowInstanceDataFields.Subject}}</h3>
</div>
</div>
</div>
</div>
</ion-list>
</div>
<div *ngSwitchCase="'PR'">
<div *ngIf="eventaprovacaostore.listpr.length != 0">
<ion-list class="width-100" *ngSwitchCase="'PR'">
<div class="width-100" *ngIf="eventaprovacaostore.listpr">
<div
class="expediente ion-no-padding ion-no-margin cursor-pointer"
*ngFor="let event of eventaprovacaostore.listpr"
(click)="goToEventDetail(event)"
>
<div class="item event-pr-{{event.workflowInstanceDataFields.Agenda}} width-100">
<div class="approve-event-time">
<p>{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}</p>
<p>{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
</div>
<div class="approve-event-detail">
<p *ngIf="toDateString(event.workflowInstanceDataFields.StartDate) != toDateString(event.workflowInstanceDataFields.EndDate)">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}</p>
<p *ngIf="toDateString(event.workflowInstanceDataFields.StartDate) == toDateString(event.workflowInstanceDataFields.EndDate)">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}</p>
<h3>{{event.workflowInstanceDataFields.Subject}}</h3>
</div>
</div>
</div>
</div>
</ion-list>
</div>
<div *ngIf="eventaprovacaostore.listpr.length == 0" class="centered-div d-flex height-90 align-center justify-content-center">
<div *ngSwitchCase="'PR'" >
<div class="d-flex align-center justify-content-center"
*ngIf="eventaprovacaostore.listpr.length < 1">
Lista vazia
</div>
</div>
</div>
</div>
</div>
</ion-content>
@@ -157,7 +157,7 @@
.exp-workflow{
float: left;
margin: 0 !important;
.label{
border-radius: 15px;
background: #ffb703;
@@ -220,4 +220,13 @@
font-size: 45px;
float: right;
margin-right: 10px;
}
}
.centered-div{
width: 100px;
height: 100px;
position: absolute;
top: 50%;
left: 50%;
margin: -35px 0 0 -35px;
}
@@ -44,11 +44,11 @@ export class ExpedientesPrPage implements OnInit {
this.LoadList();
this.router.events.forEach((event) => {
if (event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?expedientespr=true') ||
if (event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?expedientespr=true') ||
event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?expedientes-pr=true')) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.refreshing()
} else {
@@ -85,7 +85,7 @@ export class ExpedientesPrPage implements OnInit {
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocumentsQty": element.totalDocuments,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
"Status": element.workflowInstanceDataFields.Status,
@@ -46,7 +46,7 @@ export class ExpedientsPage implements OnInit {
this.LoadList();
this.router.events.forEach((event) => {
if (event instanceof NavigationStart &&
if (event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?expedientes=true')) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.doRefresh()
@@ -57,7 +57,7 @@ export class ExpedientsPage implements OnInit {
});
}
segmentChanged(){
this.LoadList();
}
@@ -73,7 +73,7 @@ export class ExpedientsPage implements OnInit {
this.processes.GetTasksList("Expediente", false).subscribe(result => {
this.taskslist = [];
this.skeletonLoader = false
let res = result.reverse().filter(data => data.workflowInstanceDataFields.Status == "Active");
res.forEach(element => {
let date = new Date(element.taskStartDate);
@@ -86,13 +86,13 @@ export class ExpedientsPage implements OnInit {
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocumentsQty": element.totalDocuments,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
"Status": element.workflowInstanceDataFields.Status,
}
this.taskslist.push(task);
});
console.log("Buffer store", this.taskslist)
this.expedientegbstore.reset(this.taskslist);
@@ -103,7 +103,7 @@ export class ExpedientsPage implements OnInit {
setTimeout(()=>{
this.LoadList();
}, 1000)
}
goToExpediente(serialNumber:any){
@@ -109,7 +109,7 @@
</ion-list>
</div>
<div *ngSwitchCase="'parecer'" class="d-flex align-center justify-content-center" >
<div *ngSwitchCase="'parecer'" class="centered-div" >
<div
*ngIf="!skeletonLoader && pedidosstore.listparecer.length == 0"
class="empty-list d-flex height-100 align-center justify-content-center"
@@ -118,7 +118,7 @@
</div>
</div>
<div *ngSwitchCase="'deferimento'" class="d-flex align-center justify-content-center">
<div *ngSwitchCase="'deferimento'" class="centered-div">
<div
*ngIf="!skeletonLoader && pedidosstore.listdeferimento.length == 0"
class="empty-list d-flex height-100 align-center justify-content-center"
@@ -25,7 +25,7 @@
}
.ion-item-class{
padding: 0;
}
.label-text{
width: 100%;
@@ -75,7 +75,7 @@ ion-item{
.div-icon ion-icon{
display: block;
margin: 0 auto;
}
.div-content-expediente p, .div-content-pendentes p{
font-size: 14pt;
@@ -155,7 +155,7 @@ ion-item{
.exp-workflow{
float: left;
margin: 0 !important;
.label{
border-radius: 15px;
background: #ffb703;
@@ -218,4 +218,12 @@ ion-item{
font-size: 45px;
float: right;
margin-right: 10px;
}
}
.centered-div{
width: 100px;
height: 100px;
position: absolute;
top: 50%;
left: 50%;
margin: -35px 0 0 -35px;
}
@@ -115,7 +115,7 @@ export class PedidosPage implements OnInit {
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocumentsQty": element.totalDocuments,
"DocId": element.workflowInstanceDataFields.ParecerDocID,
"FolderID": element.workflowInstanceDataFields.FolderID,
"WorkflowName": element.workflowDisplayName,
@@ -150,7 +150,7 @@ export class PedidosPage implements OnInit {
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocumentsQty": element.totalDocuments,
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
"FolderID": element.workflowInstanceDataFields.FolderID,
"WorkflowName": element.workflowDisplayName,
@@ -25,7 +25,7 @@
}
.ion-item-class{
padding: 0;
}
.label-text{
width: 100%;
@@ -75,7 +75,7 @@ ion-item{
.div-icon ion-icon{
display: block;
margin: 0 auto;
}
.div-content-expediente p, .div-content-pendentes p{
font-size: 14pt;
@@ -146,8 +146,8 @@ ion-item{
}
.exp-middle-detail, .exp-bottom-detail{
margin-bottom: 5px;
}
.exp-middle-detail{
font-size: 12pt;
width: 100%;
@@ -156,7 +156,7 @@ ion-item{
.exp-workflow{
float: left;
margin: 0 !important;
.label{
border-radius: 15px;
background: #ffb703;
@@ -219,4 +219,4 @@ ion-item{
font-size: 45px;
float: right;
margin-right: 10px;
}
}
@@ -91,7 +91,7 @@ export class PendentesPage implements OnInit {
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocumentsQty": element.totalDocuments,
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
+3 -3
View File
@@ -2,7 +2,7 @@
<div class="mobile d-flex div-top-header justify-space-between">
<div class="div-search">
<div *ngIf="!hideSearchBtn" class="div-search">
<button class="btn-no-color" (click)="openSearch()">
<ion-icon class="font-45" src='assets/images/icons-search.svg'></ion-icon>
</button>
@@ -10,7 +10,7 @@
<div class="div-logo height-fit-content">
<img src='assets/images/logo-no-bg.png' alt='logo'>
</div>
<div class="div-profile" (click)="openProfile()">
<div class="div-profile cursor-pointer" (click)="openProfile()">
<ion-icon class="icon" src='assets/images/icons-profile.svg'></ion-icon>
<ion-label class="profile-text">{{loggeduser.Profile}}</ion-label>
</div>
@@ -52,7 +52,7 @@
</div>
<div class="header-btns d-flex">
<div class="mr-10 d-flex align-center cursor-pointer">
<div *ngIf="!hideSearchBtn" class="mr-10 d-flex align-center cursor-pointer">
<button (click)="openSearch();showSearch=true" *ngIf="!showSearch" class="btn-no-color">
<ion-icon class="font-45" src='assets/images/icons-search.svg'></ion-icon>
</button>
+8
View File
@@ -17,6 +17,7 @@ export class HeaderPage implements OnInit {
searchSubject: string = '';
showSearch=false;
loggeduser: User;
hideSearchBtn:boolean = false;
constructor(
private router: Router,
@@ -32,6 +33,13 @@ export class HeaderPage implements OnInit {
}
ngOnInit() {
this.hideSearch();
}
hideSearch(){
if(this.router.url == '/home/events' || this.router.url == '/home/chat'){
this.hideSearchBtn = true;
}
}
locationPathname(): string {
@@ -58,6 +58,8 @@
.tab{
height: 65px;
cursor: pointer;
user-select: none;
}
.active{
@@ -14,6 +14,7 @@
<button (click)="distartExpedientModal('descartar')" full class="btn-ok" shape="round" >Descartar</button>
<div hidden class="solid"></div>
<button hidden class="btn-cancel" shape="round" >Delegar</button>
<button (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documento</button>
</div>
<div *ngIf="loggeduser.Profile =='PR' " class="buttons">
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-ok" shape="round" >Marcar para Despacho</button>
@@ -2,10 +2,12 @@ import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { AnimationController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { SearchDocument } from 'src/app/models/search-document';
import { User } from 'src/app/models/user.model';
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
import { SearchPage } from 'src/app/pages/search/search.page';
import { AlertService } from 'src/app/services/alert.service';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { AuthService } from 'src/app/services/auth.service';
@@ -33,6 +35,9 @@ export class OptsExpedientePrPage implements OnInit {
serialnumber: string;
profile: string;
documents:SearchDocument[] = [];
attachments:any;
showEnviarPendentes = false;
loggeduser: User;
@@ -41,14 +46,14 @@ export class OptsExpedientePrPage implements OnInit {
private popoverController: PopoverController,
private modalController: ModalController,
private processes: ProcessesService,
private attachments: AttachmentsService,
private attachmentsService: AttachmentsService,
private activatedRoute: ActivatedRoute,
private userAuth: AuthService,
private navParams: NavParams,
private animationController: AnimationController,
private router: Router,
private toastService: ToastService
) {
this.task = this.navParams.get('task');
@@ -87,9 +92,9 @@ export class OptsExpedientePrPage implements OnInit {
cssClass: classs,
backdropDismiss: true
});
await modal.present();
modal.onDidDismiss().then(async (res) => {
console.log(res);
if(res.data){
@@ -99,7 +104,7 @@ export class OptsExpedientePrPage implements OnInit {
SourceId: e.Id,
}
});
let docs = {
ProcessInstanceID: "",
Attachments: DocumentToSave,
@@ -118,8 +123,8 @@ export class OptsExpedientePrPage implements OnInit {
async approve(note:string, documents:any){
this.popoverController.dismiss();
let body = {
"serialNumber": this.task.SerialNumber,
let body = {
"serialNumber": this.task.SerialNumber,
"action": "Aprovar",
"ActionTypeId": 100000004 ,
"dataFields": {
@@ -150,7 +155,7 @@ export class OptsExpedientePrPage implements OnInit {
cssClass: 'discart-expedient-modal',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then( async (res)=>{
console.log(res['data']);
@@ -168,7 +173,7 @@ export class OptsExpedientePrPage implements OnInit {
const loader = this.toastService.loading()
try {
try {
await this.processes.CompleteTask(otherbody).toPromise()
this.toastService.successMessage('Processo descartado');
this.goBack();
@@ -187,7 +192,7 @@ export class OptsExpedientePrPage implements OnInit {
if(res['data']== 'Yes'){
const loader = this.toastService.loading()
try {
try {
await this.processes.CompleteTask(body).toPromise();
this.toastService.successMessage('Processo descartado');
this.goBack();
@@ -218,8 +223,8 @@ export class OptsExpedientePrPage implements OnInit {
async sendToReview(note:string, documents:any){
let body = {
"serialNumber": this.task.SerialNumber,
let body = {
"serialNumber": this.task.SerialNumber,
"action": "Retificar",
"ActionTypeId": 99999877,
"dataFields": {
@@ -277,7 +282,7 @@ export class OptsExpedientePrPage implements OnInit {
// alert('close '+ res['data'])
if(res['data']){
console.log('open discart');
this.distartExpedientModal(body);
}
@@ -320,4 +325,52 @@ export class OptsExpedientePrPage implements OnInit {
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
}
getAttachments(serialNumber){
this.attachmentsService.getAttachmentsBySerial(serialNumber).subscribe(res=>{
this.attachments = res;
});
}
attachDocument(){
this.popoverController.dismiss();
this.getDoc();
}
async getDoc() {
const modal = await this.modalController.create({
component: SearchPage,
cssClass: 'modal-width-100-width-background modal',
componentProps: {
type: 'AccoesPresidenciais & ArquivoDespachoElect',
showSearchInput: true,
select: true
}
});
await modal.present();
modal.onDidDismiss().then((res)=>{
if(res){
const data = res.data;
this.documents.push(data.selected);
console.log( this.documents);
this.documents.forEach(element =>{
let body = {
"Source": "1",
"SourceId": element.Id,
"SourceTitle": element.Assunto,
"SerialNumber": this.task.SerialNumber,
"ApplicationId": element.ApplicationType
}
this.attachmentsService.setEventAttachmentById(body).subscribe((res)=>{
this.getAttachments(this.task.SerialNumber);
});
})
}
});
}
}
@@ -41,17 +41,15 @@ export class ViewPublicationsPage implements OnInit {
private loadingController: LoadingService,
private modalController: ModalController,
private publications: PublicationsService,
) {
) {
this.item = new PublicationFolder();
}
ngOnInit() {
console.log(this.folderId);
if(typeof(this.folderId) == 'object') {
this.folderId = this.folderId['ProcessId']
}
this.getPublications();
this.getPublicationDetail();
}
@@ -67,7 +65,7 @@ export class ViewPublicationsPage implements OnInit {
this.getPublicationDetail();
}, 100)
}
doRefresh(event) {
@@ -82,20 +80,20 @@ export class ViewPublicationsPage implements OnInit {
close() {
this.closeDesktopComponent.emit();
}
getPublicationDetail() {
getPublicationDetail() {
let allActions = this.publicationEventFolderStorage.list.concat(this.publicationTravelFolderService.list)
this.item = allActions.find((e)=> e.ProcessId == this.folderId)
this.item = allActions.find((e)=> e.ProcessId == this.folderId);
}
getPublications() {
this.showLoader = true;
const folderId = this.folderId
this.publications.GetPublications(folderId).subscribe(res=> {
this.publicationList = new Array();
res.forEach(element => {
@@ -118,7 +116,7 @@ export class ViewPublicationsPage implements OnInit {
}
this.publicationList.push(item);
});
this.publicationListStorage.add(folderId, this.publicationList)
this.showLoader = false;
@@ -130,7 +128,7 @@ export class ViewPublicationsPage implements OnInit {
}
this.showLoader = false;
})
}
+5 -5
View File
@@ -9,7 +9,7 @@ export class LocalstoreService {
private prefix = 'v14-'
constructor() {
const key = SHA1('version').toString()
this.set(key, this.prefix)
}
@@ -22,7 +22,7 @@ export class LocalstoreService {
keyName = this.getKey(keyName)
const ciphertext = localStorage.getItem(keyName)
const ciphertext = localStorage.getItem(keyName)
const hashKey = SHA1(keyName).toString()
@@ -41,7 +41,7 @@ export class LocalstoreService {
}
set(keyName, value) {
keyName = this.getKey(keyName)
if(typeof(value) != 'string') {
@@ -65,10 +65,10 @@ export const localstoreService = new LocalstoreService()
// // Listen for messages
// socket.addEventListener('message', function (event) {
// console.log('Message from server ', event.data); // Message from server mobile first é fraco
// var p = Promise.resolve(event.data);
// p.then(function(v) {
// console.log(v); // mobile first é fraco
// });
// });
// });
+4 -4
View File
@@ -11,13 +11,13 @@ export class PublicationListService {
// main data
private _document: Publication[] = []
// local storage keyName
private keyName: string;
private keyName: string;
constructor() {
this.keyName = (SHA1(this.constructor.name+ 'view-publication-list/local')).toString()
setTimeout(()=>{
setTimeout(()=>{
let restore = localstoreService.get(this.keyName, [])
this._document = restore.document
}, 10)
@@ -35,7 +35,7 @@ export class PublicationListService {
add(folderId, document) {
this._document[folderId] = document
setTimeout(()=> {
setTimeout(()=> {
localstoreService.set(this.keyName, {
document: this._document
})
@@ -45,4 +45,4 @@ export class PublicationListService {
}
export const PublicationListStorage = new PublicationListService()
export const PublicationListStorage = new PublicationListService()