This commit is contained in:
tiago.kayaya
2021-08-18 16:44:25 +01:00
80 changed files with 1349 additions and 1419 deletions
+3 -17
View File
@@ -90,18 +90,8 @@ export class EventsPage implements OnInit {
this.prEventList = null;
// list
this.LoadList();
/* this.screenOrientation.onChange().subscribe(
() => {
alert("Orientation updated" + this.screenOrientation.type);
this.existingScreenOrientation = this.screenOrientation.type;
}
); */
this.platform.resize.subscribe(async () => {
//alert('Resize event detected');
//console.log('Resize event detected');
console.log('Resize event detected');
});
@@ -109,18 +99,14 @@ export class EventsPage implements OnInit {
}
ngOnInit() {
//Inicializar segment
this.segment = "Combinada";
//Initialize profile as mdgpr
this.profile = "mdgpr";
/* console.log(this.profile); */
this.showGreeting();
const pathname = window.location.pathname
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == pathname) {
if(event instanceof NavigationEnd && event.url == '/home/events') {
this.RefreshEvents();
this.LoadList();
}
@@ -2,11 +2,11 @@
<app-header></app-header>
</ion-header>
<ion-content>
<div class="main-content d-flex height-100">
<div class="content d-flex flex-column px-20" *ngIf="task">
<div class="main-header">
<div class="title-content width-100 d-flex justify-space-between">
<div class="font-30 cursor-pointer" (click)="goBack()" defaultHref="#">
<div class="main-content d-flex height-100 px-20">
<div class="content d-flex flex-column" *ngIf="task">
<div class="main-header" >
<div class="title-content width-100 d-flex justify-space-between align-center">
<div class="font-30 cursor-pointer align-center d-flex" (click)="goBack()" defaultHref="#">
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
</div>
<div class="middle d-flex align-center flex-grow-1">
@@ -17,7 +17,7 @@
</div>
</div>
</div>
<div class="upper-content">
<div class="upper-content" >
<div class="content-details">
<ion-label>
<p><span class="date">{{customDate}}</span><span class="label">{{ task.activityInstanceName }}</span></p>
@@ -27,7 +27,7 @@
</div>
<div class="line"></div>
<div class="overflow-y-auto px-20">
<div class="overflow-y-auto">
<div class="middle-content" >
<div *ngIf="intervenientes.length > 0">
<h5 >Intervenientes</h5>
@@ -61,7 +61,7 @@
<div class="bottom-content width-100">
<ion-list *ngIf="attachments">
<h5>Documentos Anexados</h5>
<ion-item *ngFor="let attachment of attachments"
<ion-item *ngFor="let attachment of fulltask.Documents"
class="ion-no-margin ion-no-padding cursor-pointer">
<ion-label
(click)="viewDocument(attachment.DocId)">
@@ -81,8 +81,8 @@ export class DespachoPrPage implements OnInit {
// this.LoadRelatedEvents(this.serialnumber);
}
close(){
this.modalController.dismiss();
close() {
this.goBack()
}
goBack() {
@@ -129,7 +129,6 @@ export class DespachoPrPage implements OnInit {
}
});
this.getDocumentDetails(this.task.FolderId, '361');
}, (error)=>{
try {
@@ -146,13 +145,6 @@ export class DespachoPrPage implements OnInit {
});
}
getDocumentDetails(forlderId:string, applicationId:string) {
this.processes.GetDocumentDetails(forlderId,applicationId).subscribe(res=>{
this.attachments = res.Documents;
console.log(res['Documents']);
console.log(this.attachments);
})
}
// async LoadRelatedEvents(serial: string) {
// if (this.eventsList == null) {
@@ -514,9 +506,12 @@ export class DespachoPrPage implements OnInit {
popover.onDidDismiss().then(( res =>{
if( res['data'] == 'close') {
this.goBack()
this.goBack()
}
console.log('alert ...'+ JSON.stringify(res))
}))
}
@@ -68,7 +68,8 @@ export class DespachosPrPage implements OnInit {
const location = window.location
const pathname = location.pathname + location.search
this.LoadList();
this.LoadList()
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
@@ -97,12 +98,10 @@ export class DespachosPrPage implements OnInit {
openExpedientDetailPage(data){
console.log(data);
// this.openExpedientDetail.emit(data);
}
async LoadList() {
this.skeletonLoader = true
let result = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
@@ -119,8 +118,6 @@ export class DespachosPrPage implements OnInit {
console.log(result);
despachosPr = await result.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
console.log(despachosPr);
break;
}
@@ -10,6 +10,7 @@ import { DespachoPage } from './despacho.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { HeaderPageModule } from 'src/app/shared/header/header.module';
import { TaskDetailsPageModule } from 'src/app/shared/gabinete-digital/generic/task-details/task-details.module'
@NgModule({
imports: [
@@ -19,6 +20,8 @@ import { HeaderPageModule } from 'src/app/shared/header/header.module';
DespachoPageRoutingModule,
HeaderPageModule,
// entries
TaskDetailsPageModule
],
declarations: [
DespachoPage,
@@ -4,71 +4,19 @@
<ion-content>
<div class="main-content d-flex height-100">
<div class="content d-flex flex-column" *ngIf="task">
<div class="main-header">
<div class="title-content width-100 d-flex justify-space-between align-center">
<div class=" btn-dismiss font-30 cursor-pointer" (click)="goBack()" defaultHref="#">
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
</div>
<div class="middle d-flex align-center flex-grow-1">
<ion-label class="title">{{ task.Folio}}</ion-label>
</div>
<div class="div-icon" (click)="openOptions()">
<ion-icon src="assets/images/icons-menu.svg"></ion-icon>
</div>
</div>
</div>
<div class="upper-content">
<div class="content-details">
<ion-label>
<p><span class="date">{{customDate}}</span><span class="label">{{ task.activityInstanceName }}</span></p>
<p><span class="color-red">{{ task.DeadlineType }}</span></p>
</ion-label>
</div>
</div>
<div class="line"></div>
<div class="overflow-y-auto" style="margin-right: -20px; margin-right: -20px;">
<div class="middle-content">
<h5 *ngIf="intervenientes">Intervenientes</h5>
<ion-item class="ion-no-margin ion-no-padding">
<ion-label>
<div *ngFor="let interveniente of intervenientes">
<p>{{interveniente.Name}}</p>
</div>
</ion-label>
</ion-item>
<div *ngIf="cc.length > 0">
<h5>Com conhecimento</h5>
<ion-item class="ion-no-margin ion-no-padding">
<ion-label>
<div *ngFor="let c of cc">
<p>{{c.Name}}</p>
</div>
</ion-label>
</ion-item>
</div>
<div *ngIf="fulltask.workflowInstanceDataFields.TaskMessage">
<h5>Detalhes</h5>
<ion-item class="ion-no-margin ion-no-padding">
<p [innerHTML]="fulltask.workflowInstanceDataFields.TaskMessage"></p>
</ion-item>
</div>
</div>
<div class="bottom-content width-100">
<ion-list>
<h5>Documentos Anexados</h5>
<ion-item class="ion-no-margin ion-no-padding cursor-pointer" *ngFor="let Document of fulltask.Documents">
<ion-label class="d-block" (click)="viewDocument(Document.DocId)">
<p class="attach-title-item">{{ Document.Assunto }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p><span class="span-left">{{ Document.Sender}}</span><span class="span-right">{{ Document.DocDate | date: 'dd/MM/yyyy HH:mm' }}</span></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
</div>
<app-task-details class="content"
[task]="task"
[intervenientes]="intervenientes"
[cc]="cc"
[customDate]="customDate"
[fulltask]="fulltask"
(openOptions)="openOptions($event)"
(goBack)="goBack($event)"
(viewDocument)="viewDocument($event)"
>
</app-task-details>
<div *ngIf="task" class="aside-right flex-column height-100">
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
@@ -17,6 +17,7 @@ import { DespachosOptionsPage } from 'src/app/shared/popover/despachos-options/d
import { ToastService } from 'src/app/services/toast.service';
import { DespachoService } from 'src/app/Rules/despacho.service'
import { Location } from '@angular/common'
import { customTask, customTaskList, fullTask } from 'src/app/models/dailyworktask.model';
@Component({
selector: 'app-despacho',
@@ -29,7 +30,9 @@ export class DespachoPage implements OnInit {
customDate:any;
task: any;
// task: customTask;
task;
attachments:any;
fulltask: any;
eventsList: Event[] = [];
@@ -50,7 +53,8 @@ export class DespachoPage implements OnInit {
private activatedRoute: ActivatedRoute,
private toastService: ToastService,
private despachoService: DespachoService,
private location: Location
private location: Location,
) {
this.activatedRoute.paramMap.subscribe(params => {
@@ -69,12 +73,9 @@ export class DespachoPage implements OnInit {
if (!paramMap.has('SerialNumber')) {
return;
}
/* this.serialnumber = paramMap.get('SerialNumber'); */
this.LoadTaskDetail(this.serialnumber);
// this.LoadRelatedEvents(this.serialnumber);
});
this.LoadTaskDetail(this.serialnumber);
// this.LoadRelatedEvents(this.serialnumber);
this.LoadTaskDetail(this.serialnumber)
}
close() {
@@ -114,7 +115,7 @@ export class DespachoPage implements OnInit {
}
async LoadTaskDetail(serial: string) {
this.processes.GetTask(serial).subscribe(res => {
this.processes.GetTask(serial).subscribe( (res: fullTask) => {
this.task = {
"SerialNumber": res.serialNumber,
"Folio": res.workflowInstanceDataFields.Subject,
@@ -123,9 +124,10 @@ export class DespachoPage implements OnInit {
"DocumentURL": res.workflowInstanceDataFields.ViewerRequest,
"Remetente": res.workflowInstanceDataFields.Sender,
"Note": res.workflowInstanceDataFields.TaskMessage || res.workflowInstanceDataFields.Note,
"FolderId": res.workflowInstanceDataFields.FolderID,
"FolderID": res.workflowInstanceDataFields.FolderID,
"FsId": '361',
"DocId": res.workflowInstanceDataFields.DispatchDocId,
"DocumentsQty": '',
"WorkflowName": res.workflowDisplayName,
"DeadlineType": res.workflowInstanceDataFields.DeadlineType,
"activityInstanceName": res.activityInstanceName,
@@ -136,7 +138,7 @@ export class DespachoPage implements OnInit {
let thedate = new Date(this.task.CreateDate);
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
this.processes.GetTaskParticipants(this.task.FolderId).subscribe(users=>{
this.processes.GetTaskParticipants(this.task.FolderID).subscribe(users=>{
this.intervenientes = users.filter(user=>{
return user.Type == 'I';
@@ -145,12 +147,11 @@ export class DespachoPage implements OnInit {
return user.Type == 'CC';
});
});
this.getDocumentDetails(this.task.FolderId, '361');
}, (error)=>{
try {
this.goBack()
} catch (e) {
window.history.back();
this.location.back();
} finally {
if(error.status == 0) {
this.toastService.badRequest('Não é possível visualizar este processo no modo offline')
@@ -161,27 +162,6 @@ export class DespachoPage implements OnInit {
});
}
getDocumentDetails(forlderId:string, applicationId:string) {
this.processes.GetDocumentDetails(forlderId,applicationId).subscribe(res=>{
this.attachments = res.Documents;
})
}
// async LoadRelatedEvents(serial: string) {
// if (this.eventsList == null) {
// this.attachmentsService.getAttachmentsBySerial(serial).subscribe(res => {
// res.forEach(att => {
// if (this.eventsList == null) {
// this.eventsList = new Array();
// }
// this.events.getEvent(att.ParentId).subscribe(event => {
// this.eventsList.push(event);
// });
// });
// });
// }
// }
viewDocument(docId:string){
this.processes.GetDocumentUrl(docId, '361').subscribe(res=>{
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
@@ -399,7 +379,7 @@ export class DespachoPage implements OnInit {
});
}
async distartExpedientModal(){
async distartExpedientModal() {
console.log(this.fulltask);
const modal = await this.modalController.create({
component: DiscartExpedientModalPage,
@@ -56,7 +56,8 @@ export class DespachosPage implements OnInit {
const location = window.location
const pathname = location.pathname + location.search
this.LoadList();
this.LoadList()
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
@@ -1,11 +1,12 @@
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
import { NavigationEnd, NavigationExtras, Router } from '@angular/router';
import { DailyWorkTask, tasksList } from '../../../models/dailyworktask.model';
import { customTask, DailyWorkTask, tasksList } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service';
import { formatDate } from '@angular/common';
import { ModalController, NavParams } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service';
import { DiplomaPage } from 'src/app/pages/gabinete-digital/diplomas/diploma/diploma.page';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
@Component({
selector: 'app-diplomas-assinar',
@@ -22,6 +23,7 @@ export class DiplomasAssinarPage implements OnInit {
@Input() profile:string;
@Input() segment:string;
customTaskPipe = new CustomTaskPipe()
skeletonLoader = true
constructor(
@@ -35,8 +37,9 @@ export class DiplomasAssinarPage implements OnInit {
ngOnInit() {
const location = window.location
const pathname = location.pathname + location.search
this.LoadList();
this.LoadList()
this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && event.url.startsWith(pathname)) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
@@ -76,43 +79,10 @@ export class DiplomasAssinarPage implements OnInit {
let diplomasAssinar = diplomas.reverse().filter(data => data.activityInstanceName == "Assinar Diploma");
console.log(diplomasAssinar);
diplomasAssinar.forEach(element => {
let DocId = element.workflowInstanceDataFields.FolderID;
let ApplicationId = element.workflowInstanceDataFields.ApplicationId;
this.processes.GetDocumentDetails(DocId, '361').subscribe(res=>{
this.totalDocs = res.DocumentsTotal;
console.log(res.DocumentsTotal);
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.workflowInstanceDataFields.Sender,
"CreateDate": formatDate(new Date(element.taskStartDate), 'yyyy-MM-dd HH:mm', 'pt'),
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": element.totalDocuments,
"DocId": element.workflowInstanceDataFields.DocId,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
"Status": element.workflowInstanceDataFields.Status,
}
this.diplomasList.push(task);
},
(error)=>{
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.workflowInstanceDataFields.Sender,
"CreateDate": formatDate(new Date(element.taskStartDate), 'yyyy-MM-dd HH:mm', 'pt'),
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": element.totalDocuments,
"DocId": element.workflowInstanceDataFields.DocId,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
"Status": element.workflowInstanceDataFields.Status,
}
this.diplomasList.push(task);
});
let task: customTask = this.customTaskPipe.transform(element)
this.diplomasList.push(task);
});
@@ -43,7 +43,8 @@ constructor(
const location = window.location
const pathname = location.pathname + location.search
this.LoadList();
this.LoadList()
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
@@ -42,8 +42,9 @@ export class EventListPage implements OnInit {
const location = window.location
const pathname = location.pathname + location.search
this.LoadToApproveEvents();
this.LoadToApproveEvents()
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
@@ -37,9 +37,9 @@ export class ExpedientePage implements OnInit {
const location = window.location
const pathname = location.pathname + location.search
this.LoadList();
this.LoadList()
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
@@ -48,7 +48,6 @@ export class ExpedientePrPage implements OnInit {
private iab: InAppBrowser,
private events: EventsService,
private menu: MenuController,
private router: Router,
private modalController: ModalController,
public popoverController: PopoverController,
private activatedRoute: ActivatedRoute,
@@ -86,7 +85,7 @@ export class ExpedientePrPage implements OnInit {
return new Date(e).toDateString()
}
close(){
close() {
this.modalController.dismiss();
}
@@ -129,7 +128,7 @@ export class ExpedientePrPage implements OnInit {
} */
}
sendExpedienteToPending(){
sendExpedienteToPending() {
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
console.log(res);
this.toastService.successMessage('Processo enviado para pendentes')
@@ -140,7 +139,6 @@ export class ExpedientePrPage implements OnInit {
});
}
async LoadTaskDetail(serial: string) {
this.processes.GetTask(serial).subscribe(res => {
@@ -155,9 +153,9 @@ export class ExpedientePrPage implements OnInit {
"CreateDate":taskDate,
"DocumentURL": res.workflowInstanceDataFields.ViewerRequest,
"Remetente": res.workflowInstanceDataFields.Sender,
"Note": res.workflowInstanceDataFields.TaskMessage || res.workflowInstanceDataFields.Note,
"Note": res.workflowInstanceDataFields.TaskMessage || res.workflowInstanceDataFields.Note, //
"FolderId": res.workflowInstanceDataFields.FolderID,
"FsId": res.workflowInstanceDataFields.FsId,
"FsId": res.workflowInstanceDataFields.FsId, //
"DocId": res.workflowInstanceDataFields.DocId || res.workflowInstanceDataFields.DocID,
"WorkflowName": res.workflowDisplayName,
"activityInstanceName": res.activityInstanceName,
@@ -196,32 +194,6 @@ 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.attachmentsService.getAttachmentsBySerial(serial).subscribe(res => {
console.log(res);
res.forEach(att => {
if (this.eventsList == null) {
this.eventsList = new Array();
}
this.events.getEvent(att.ParentId).subscribe(event => {
this.eventsList.push(event);
console.log(this.eventsList);
});
});
});
}
}
viewDocument(DocId:string) {
this.processes.GetDocumentUrl(DocId, this.task.FsId).subscribe(res=>{
console.log(res);
@@ -562,7 +534,6 @@ export class ExpedientePrPage implements OnInit {
});
}
async openOptions(taskAction?: any) {
const popover = await this.popoverController.create({
component: OptsExpedientePrPage,
@@ -47,7 +47,7 @@ export class ExpedientesPrPage implements OnInit {
const location = window.location
const pathname = location.pathname + location.search
this.LoadList();
this.LoadList()
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
@@ -61,7 +61,7 @@ export class ExpedientesPrPage implements OnInit {
}
LoadList(){
LoadList() {
this.skeletonLoader = true
this.processes.GetTasksList("Expediente", false).subscribe(result => {
@@ -1,13 +1,8 @@
import { AfterViewInit, Component, DoCheck, OnInit, ViewChild } from '@angular/core';
import { Component, DoCheck, OnInit, ViewChild } from '@angular/core';
import { ProcessesService } from 'src/app/services/processes.service';
import { AlertService } from 'src/app/services/alert.service';
import { ModalController } from '@ionic/angular';
import { EventListPage } from './event-list/event-list.page';
import { ExpedientePage } from './expediente/expediente.page';
import { ActivatedRoute, NavigationEnd, NavigationExtras, Router } from '@angular/router';
import { DespachosPage } from './despachos/despachos.page';
import { PedidosPage } from './pedidos/pedidos.page';
/* import { PendentesPage } from './pendentes/pendentes.page'; */
import { AuthService } from 'src/app/services/auth.service';
import { User } from 'src/app/models/user.model';
import { ExpedientsPage } from 'src/app/shared/gabinete-digital/expedients/expedients.page';
@@ -23,6 +18,7 @@ import { DespachosprStore } from 'src/app/store/despachospr-store.service';
import { PermissionService } from 'src/app/OtherService/permission.service';
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { WaitForDomService } from 'src/app/services/dom/wait-for-dom.service';
@Component({
selector: 'app-gabinete-digital',
templateUrl: './gabinete-digital.page.html',
@@ -182,7 +178,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
}
async loadAllProcesses(){
async loadAllProcesses() {
let allProcessesList = await this.processesbackend.GetTasksList("", false).toPromise();
console.log(allProcessesList);
@@ -211,11 +207,12 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
"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;
}
@@ -244,7 +241,6 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
let diffDays = totalDays;
let diffMinutes = minutes;
console.log(allday);
if(totalDays == 0){
if(allday){
customDate = this.getCustomDate(start)+", "+this.getCustomHours(start)+" (todo dia)";
@@ -53,8 +53,8 @@ export class PedidosPage implements OnInit {
ngOnInit() {
this.LoadList();
this.LoadList()
this.router.events.forEach((event) => {
if(event instanceof NavigationStart && '/home/gabinete-digital/pedidos?parecer=true'.startsWith(event.url) ||
event instanceof NavigationStart && '/home/gabinete-digital/pedidos?deferimento=true'.startsWith(event.url)
@@ -11,6 +11,7 @@ import { SharedModule } from 'src/app/shared/shared.module';
import { HeaderPageModule } from 'src/app/shared/header/header.module';
import { BtnModalDismissPageModule } from 'src/app/shared/btn-modal-dismiss/btn-modal-dismiss.module';
import { TaskListPageModule } from 'src/app/shared/gabinete-digital/generic/task-list/task-list.module';
@NgModule({
imports: [
@@ -21,6 +22,8 @@ import { BtnModalDismissPageModule } from 'src/app/shared/btn-modal-dismiss/btn-
PendentesPageRoutingModule,
HeaderPageModule,
BtnModalDismissPageModule,
// entryComponents
TaskListPageModule
],
declarations: [PendentesPage]
})
@@ -15,91 +15,21 @@
</div>
</ion-header>
<ion-content>
<ion-content style="background-color: white;">
<div class="main-content width-100 overflow-y-auto height-100">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
refreshingSpinner="circles"
refreshingText="A actualizar...">
</ion-refresher-content>
</ion-refresher>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
refreshingSpinner="circles"
refreshingText="A actualizar...">
</ion-refresher-content>
</ion-refresher>
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
<div *ngIf="pendentesstore.list.length >= 1" class="width-100">
<div >
<ion-list>
<div
class="expediente ion-no-padding ion-no-margin cursor-pointer"
*ngFor = "let task of pendentesstore.list"
(click)="viewTaskDetails(task.SerialNumber, task.WorkflowName)"
>
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
<div class="item width-100">
<div class="exp-top-detail">
<div class="subject">
<ion-label>{{ task.Folio }}</ion-label>
</div>
<div class="exp-icon">
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
<label *ngIf="task.DocumentsQty != 0">{{task.DocumentsQty}}</label>
</div>
</div>
<div class="exp-bottom-detail">
<div class="exp-remetente">
<ion-label>{{task.Senders}}</ion-label>
</div>
</div>
<div class="exp-middle-detail">
<div class="exp-workflow">
<span class="label">{{task.activityInstanceName}}</span>
</div>
<div class="exp-date">
<ion-label>{{ task.CreateDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
</div>
</div>
</div>
</div>
</ion-list>
</div>
</div>
<!-- Empty -->
<div
*ngIf="!skeletonLoader && pendentesstore.list.length == 0"
class="empty-list d-flex height-100 align-center justify-content-center"
>
<span>Lista vazia</span>
</div>
<div *ngIf="skeletonLoader && pendentesstore.list.length == 0">
<ion-list>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
<app-task-list class="height-100"
[taskList] = pendentesstore.list
[skeletonLoader] = skeletonLoader
(viewTaskDetail)="viewTaskDetails($event)"
> </app-task-list>
</ion-content>
@@ -9,11 +9,13 @@
border-top-left-radius: 24px;
}
ion-content, .header-2, .main-content{
.header-2{
padding: 30px 20px 0 20px !important;
background-color: white;
}
.main-content {
background-color: white;
padding-top: 0px !important;
}
@@ -2,13 +2,14 @@ import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angu
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
import { CalendarComponent } from 'ionic2-calendar';
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { DailyWorkTask } from '../../../models/dailyworktask.model';
import { customTaskList, DailyWorkTask } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service';
import { formatDate } from '@angular/common';
import { AlertService } from 'src/app/services/alert.service';
import { PendentesStore } from 'src/app/store/pendestes-store.service';
import { User } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
@Component({
@@ -19,7 +20,6 @@ import { AuthService } from 'src/app/services/auth.service';
export class PendentesPage implements OnInit {
@ViewChild(CalendarComponent) myCal: CalendarComponent;
pendentesList:DailyWorkTask[] = [];
taskType: string;
serialNumber:string;
totalDocs:any;
@@ -30,6 +30,7 @@ export class PendentesPage implements OnInit {
segment:string;
skeletonLoader = true
pendentesstore = PendentesStore;
customTaskPipe = new CustomTaskPipe()
constructor(
private processes:ProcessesService,
@@ -49,6 +50,8 @@ export class PendentesPage implements OnInit {
const location = window.location
const pathname = location.pathname + location.search
this.LoadList()
this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && event.url.startsWith(pathname)) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
@@ -69,46 +72,31 @@ export class PendentesPage implements OnInit {
this.router.navigate(['/home/gabinete-digital']);
}
notImplemented(){
notImplemented() {
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
}
async LoadList(){
async LoadList() {
this.skeletonLoader = true;
let pendentes = await this.processes.GetPendingTasks(false).toPromise();
this.pendentesList = [];
let pendentesList = [];
pendentes.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.DocIdDiferimento,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
"Status": element.workflowInstanceDataFields.Status,
}
this.pendentesList.push(task);
this.pendentesList = removeDuplicate( this.pendentesList)
this.pendentesList = this.sortArrayISODate(this.pendentesList);
let task: customTaskList = this.customTaskPipe.transform(element);
pendentesList.push(task);
});
this.pendentesstore.reset(this.pendentesList);
pendentesList = removeDuplicate( pendentesList)
pendentesList = this.sortArrayISODate(pendentesList);
this.pendentesstore.reset(pendentesList);
this.skeletonLoader = false;
}
sortArrayISODate(myArray: any){
sortArrayISODate(myArray: any) {
return myArray.sort(function(a, b) {
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
});
@@ -128,18 +116,27 @@ export class PendentesPage implements OnInit {
}, 2000);
}
async viewTaskDetails(serialNumber:string, workflowName:string) {
if(workflowName == 'Despacho'){
this.router.navigate(['/home/gabinete-digital/despachos',serialNumber,'gabinete-digital']);
async viewTaskDetails({ SerialNumber, WorkflowName, activityInstanceName }:customTaskList) {
if(WorkflowName == 'Despacho') {
this.router.navigate(['/home/gabinete-digital/despachos',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 == 'Pedido de Parecer' || WorkflowName == 'Pedido de Deferimento' || 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/expediente',serialNumber,'gabinete-digital']);
else if(WorkflowName == 'Expediente') {
this.router.navigate(['/home/gabinete-digital/expediente',SerialNumber,'gabinete-digital']);
}
else if(workflowName == 'Expediente' && this.loggeduser.Profile == 'PR') {
this.router.navigate(['/home/gabinete-digital/expedientes-pr',serialNumber,'gabinete-digital']);
else if(WorkflowName == 'Expediente' && this.loggeduser.Profile == 'PR') {
this.router.navigate(['/home/gabinete-digital/expedientes-pr',SerialNumber,'gabinete-digital']);
}
else if (activityInstanceName == "Tarefa de Parecer") {
this.router.navigate(['/home/gabinete-digital/pedidos',SerialNumber,'gabinete-digital']);
}
else if(activityInstanceName == "Tarefa de Despacho") {
this.router.navigate(['/home/gabinete-digital/despachos',SerialNumber,'gabinete-digital']);
}
else {
console.log('cant find page for this task', WorkflowName, activityInstanceName)
}
}
@@ -148,5 +145,4 @@ export class PendentesPage implements OnInit {
return new Date(e).toDateString()
}
}
+2 -2
View File
@@ -140,10 +140,10 @@ export class InactivityPage implements OnInit {
const encrypted = crypto.SHA1(code)
if(!this.hasPin) {
// alert('storePin')
// console.log('storePin')
this.storePin()
} else {
// alert('pinLogin')
// console.log('pinLogin')
this.pinLogin()
}
}
+3 -3
View File
@@ -111,7 +111,7 @@ export class LoginPage implements OnInit {
getToken() {
this.notificatinsservice.getAndpostToken(this.username);
//alert('HERE');
//console.log('HERE');
}
async Login() {
@@ -161,10 +161,10 @@ export class LoginPage implements OnInit {
const encrypted = crypto.SHA1(code)
if(!this.hasPin) {
// alert('storePin')
// console.log('storePin')
this.storePin()
} else {
// alert('pinLogin')
// console.log('pinLogin')
this.pinLogin()
}
}
@@ -248,7 +248,7 @@ export class NewPublicationPage implements OnInit {
else {
const date = formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss')
alert(date)
console.log(date)
this.publication = {
DateIndex: date,