mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into feature/calendar-fix1
This commit is contained in:
@@ -135,8 +135,6 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
//Go to the next view of the calendar month/week/day
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<ion-menu autoHide="false" side="end" content-id="main-content">
|
||||
<ion-header>
|
||||
<ion-toolbar translucent>
|
||||
<ion-title>Acções</ion-title>
|
||||
<ion-title>Ações</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
|
||||
@@ -49,7 +49,7 @@ export class ApproveEventModalPage implements OnInit {
|
||||
}
|
||||
|
||||
close(){
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
/* this.router.navigate(['/home/gabinete-digital/event-list']); */
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<div class="content-details">
|
||||
<ion-label>
|
||||
<p>{{customDate}}</p>
|
||||
<p>das {{loadedEvent.StartDate | date: 'hh:mm'}} às {{loadedEvent.EndDate | date: 'hh:mm'}}</p>
|
||||
<p>das {{loadedEvent.StartDate | date: 'HH:mm'}} às {{loadedEvent.EndDate | date: 'HH:mm'}}</p>
|
||||
<p *ngIf="!loadedEvent.IsRecurring">(Não se repete)</p>
|
||||
<p *ngIf="loadedEvent.IsRecurring">Repete</p>
|
||||
</ion-label>
|
||||
|
||||
@@ -95,10 +95,10 @@ export class ChatPage implements OnInit {
|
||||
this.userDirectMessages = res.ims.sort((a,b)=>{
|
||||
var dateA = new Date(a._updatedAt).getTime();
|
||||
var dateB = new Date(b._updatedAt).getTime();
|
||||
this.showLoader = false;
|
||||
return dateB - dateA;
|
||||
});
|
||||
console.log(this.userDirectMessages);
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
getChatMembers(){
|
||||
@@ -116,10 +116,10 @@ export class ChatPage implements OnInit {
|
||||
this.allGroups = all.sort((a,b)=>{
|
||||
var dateA = new Date(a._updatedAt).getTime();
|
||||
var dateB = new Date(b._updatedAt).getTime();
|
||||
this.showLoader = false;
|
||||
return dateB - dateA;
|
||||
});
|
||||
console.log(this.allGroups);
|
||||
this.showLoader = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ export class MessagesPage implements OnInit, AfterViewChecked {
|
||||
/* console.log(res); */
|
||||
this.messages = res['messages'].reverse();
|
||||
console.log(this.messages);
|
||||
|
||||
this.showLoader = false;
|
||||
})
|
||||
}
|
||||
getChatMembers(){
|
||||
|
||||
@@ -1,6 +1,21 @@
|
||||
<ion-header class="ion-no-border">
|
||||
<app-header-no-search></app-header-no-search>
|
||||
</ion-header>
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar class="bg-blue">
|
||||
<ion-label>
|
||||
<p class="time ion-text-center">{{customDate}}</p>
|
||||
</ion-label>
|
||||
<ion-label>
|
||||
<p 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 class="meeting-description"> "{{currentEvent}}"</div>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<!-- Default Refresher -->
|
||||
|
||||
@@ -12,7 +27,7 @@
|
||||
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
|
||||
<ion-label>
|
||||
<!-- <ion-label>
|
||||
<p class="time ion-text-center">{{customDate}}</p>
|
||||
</ion-label>
|
||||
<ion-label>
|
||||
@@ -20,9 +35,9 @@
|
||||
</ion-label>
|
||||
|
||||
<div class="next-meeting">
|
||||
<div class="meeting-time">{{hoursMinutes}}</div>
|
||||
<div class="meeting-time">{{currentHoursMinutes | date: 'HH:mm'}}</div>
|
||||
<div class="meeting-description"> "{{currentEvent}}"</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="conteiner-box" ng-swipe-up="swipe($event)">
|
||||
<div class="schedule">
|
||||
@@ -31,7 +46,12 @@
|
||||
<ion-icon class="icon" slot="end" src="assets/images/icons-default-agenda.svg" ></ion-icon>
|
||||
<div class="text">A sua Agenda</div>
|
||||
</div>
|
||||
<ion-icon class="icon-next" slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg" ></ion-icon>
|
||||
<ion-icon
|
||||
class="icon-next"
|
||||
slot="end"
|
||||
src="assets/images/icons-arrow-circle-arrow-right.svg"
|
||||
[routerLink]="['/home/agenda']"
|
||||
></ion-icon>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
@@ -40,10 +60,8 @@
|
||||
(click)="viewEventDetail(event.EventId)">
|
||||
<div class="d-flex content-{{profile}}-{{event.CalendarName}}">
|
||||
<div class="schedule-time">
|
||||
|
||||
<div class="time-start">{{event.StartDate | date: 'hh:mm'}}</div>
|
||||
<div class="time-end">{{event.EndDate | date: 'hh:mm'}}</div>
|
||||
|
||||
<div class="time-start">{{event.StartDate | date: 'HH:mm'}}</div>
|
||||
<div class="time-end">{{event.EndDate | date: 'HH:mm'}}</div>
|
||||
</div>
|
||||
<div class="schedule-details">
|
||||
<div class="location">{{event.Location}}</div>
|
||||
@@ -64,33 +82,35 @@
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="schedule">
|
||||
<div class="schedule-header">
|
||||
<div class="title">
|
||||
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
|
||||
<div class="text">Correspondência por ler</div>
|
||||
</div>
|
||||
<ion-icon class="icon-next" slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg" ></ion-icon>
|
||||
<ion-icon
|
||||
class="icon-next"
|
||||
slot="end"
|
||||
src="assets/images/icons-arrow-circle-arrow-right.svg"
|
||||
(click)="openExpedientList()"
|
||||
></ion-icon>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
<ul>
|
||||
<li *ngFor = "let task of taskslist"
|
||||
(click)="viewExpedientDetail(task.SerialNumber)">
|
||||
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
|
||||
<li *ngFor = "let task of expedientList"
|
||||
(click)="viewExpedientDetail(task.serialNumber)">
|
||||
<!-- [routerLink]="['/home/gabinete-digital/expediente']" -->
|
||||
>
|
||||
<div class="d-flex">
|
||||
<div class="schedule-date">
|
||||
|
||||
<div class="time-start">{{ momentGG(task.CreateDate,'dd/MM/yy')}}</div>
|
||||
<div class="time-start">{{ momentGG(task.CreateDate,'HH:mm')}}</div>
|
||||
|
||||
|
||||
<div class="time-end">{{task.taskStartDate | date: 'dd-MM-yy'}}</div>
|
||||
<div class="time-start">{{task.taskStartDate | date: 'HH:mm'}}</div>
|
||||
</div>
|
||||
<div class="schedule-details pointer">
|
||||
<div class="description">{{ task.Folio }}</div>
|
||||
<div class="location">{{ task.Remetente }}</div>
|
||||
<div class="description">{{ task.workflowInstanceFolio }}</div>
|
||||
<div class="location">{{ task.workflowInstanceDataFields.Sender }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Event } from '../../models/event.model';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { ActivatedRoute, NavigationEnd } from '@angular/router';
|
||||
import { formatDate } from '@angular/common';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { StorageService } from 'src/app/services/storage.service';
|
||||
@@ -16,7 +17,6 @@ import { DailyWorkTask } from '../../models/dailyworktask.model';
|
||||
import { ViewEventPage } from '../agenda/view-event/view-event.page';
|
||||
import { ExpedientePage } from '../gabinete-digital/expediente/expediente.page';
|
||||
import { ExpedienteDetailPage } from '../gabinete-digital/expediente/expediente-detail/expediente-detail.page';
|
||||
import { momentG } from 'src/plugin/momentG'
|
||||
|
||||
@Component({
|
||||
selector: 'app-events',
|
||||
@@ -26,7 +26,6 @@ import { momentG } from 'src/plugin/momentG'
|
||||
export class EventsPage implements OnInit {
|
||||
/* Get current system date */
|
||||
today = new Date();
|
||||
todayEnd = new Date();
|
||||
|
||||
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||
@@ -54,11 +53,12 @@ export class EventsPage implements OnInit {
|
||||
|
||||
customText = false;
|
||||
totalEvent=0;
|
||||
currentHoursMinutes: String;
|
||||
currentHoursMinutes: Date;
|
||||
|
||||
showLoader: boolean;
|
||||
|
||||
taskslist:DailyWorkTask[];
|
||||
expedientList:any;
|
||||
|
||||
constructor(private eventService: EventsService,
|
||||
private router: Router,
|
||||
@@ -69,16 +69,9 @@ export class EventsPage implements OnInit {
|
||||
private authService: AuthService,
|
||||
private processes:ProcessesService) {
|
||||
this.prEventList = null;
|
||||
|
||||
// update hours and minutes
|
||||
setInterval(()=> {
|
||||
this.currentHoursMinutes = momentG(new Date(), 'HH:MM', 'pt');
|
||||
}, 1000);
|
||||
|
||||
// list
|
||||
this.LoadList();
|
||||
|
||||
this.todayEnd = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 23, 59, 59);
|
||||
|
||||
}
|
||||
|
||||
@@ -94,22 +87,6 @@ export class EventsPage implements OnInit {
|
||||
this.profile = "mdgpr";
|
||||
console.log(this.profile);
|
||||
|
||||
// set event list
|
||||
/* if(this.profile == "mdgpr"){
|
||||
this.eventService.getAllMdEvents(formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss', 'pt'), formatDate(new Date(), 'yyyy-MM-dd', 'pt') + ' 23:59:59').subscribe(res => {
|
||||
this.eventsList = res;
|
||||
console.log(this.eventsList);
|
||||
this.totalEvent = this.eventsList.length;
|
||||
});
|
||||
}
|
||||
else{
|
||||
this.eventService.getAllPrEvents(formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss', 'pt'), formatDate(new Date(), 'yyyy-MM-dd', 'pt') + ' 23:59:59').subscribe(res => {
|
||||
this.eventsList = res;
|
||||
this.totalEvent = this.eventsList.length;
|
||||
});
|
||||
|
||||
} */
|
||||
|
||||
this.storageService.get(AuthConnstants.USER).then(res=>{
|
||||
console.log(res);
|
||||
});
|
||||
@@ -127,9 +104,6 @@ export class EventsPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
momentGG(date, fomate, UTC ){
|
||||
return momentG(date, fomate, UTC);
|
||||
}
|
||||
|
||||
doRefresh(event) {
|
||||
this.RefreshEvents();
|
||||
@@ -143,27 +117,38 @@ export class EventsPage implements OnInit {
|
||||
RefreshEvents(){
|
||||
this.showLoader = true;
|
||||
|
||||
let date = new Date();
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let start = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
let end = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" 23:59:59";
|
||||
|
||||
switch (this.segment)
|
||||
{
|
||||
case "Combinada":
|
||||
if(this.profile == "mdgpr"){
|
||||
this.eventService.getAllMdEvents(this.today.toLocaleString(), this.todayEnd.toLocaleString()).subscribe(res => {
|
||||
this.eventService.getAllMdEvents(start, end).subscribe(res => {
|
||||
this.eventsList = res;
|
||||
|
||||
if(res.length > 0){
|
||||
this.currentEvent = res[0].Subject;
|
||||
this.currentHoursMinutes = res[0].StartDate;
|
||||
}
|
||||
|
||||
this.totalEvent = this.eventsList.length;
|
||||
this.showLoader = false;
|
||||
});
|
||||
}else{
|
||||
this.eventService.getAllPrEvents(this.today.toLocaleString(), this.todayEnd.toLocaleString()).subscribe(res => {
|
||||
this.eventService.getAllPrEvents(start, end).subscribe(res => {
|
||||
this.eventsList = res;
|
||||
console.log(this.eventsList);
|
||||
console.log(res)
|
||||
console.log(res[0])
|
||||
this.currentEvent = res[0].Subject;
|
||||
console.log(res);
|
||||
console.log(res[0]);
|
||||
|
||||
if(res.length > 0){
|
||||
this.currentEvent = res[0].Subject;
|
||||
this.currentHoursMinutes = res[0].StartDate;
|
||||
}
|
||||
|
||||
this.totalEvent = this.eventsList.length;
|
||||
this.showLoader = false;
|
||||
});
|
||||
@@ -172,12 +157,12 @@ export class EventsPage implements OnInit {
|
||||
break;
|
||||
case "Pessoal":
|
||||
if(this.profile == "mdgpr"){
|
||||
this.eventService.getAllMdEvents(this.today.toLocaleString(), this.todayEnd.toLocaleString()).subscribe(res => {
|
||||
this.eventService.getAllMdEvents(start, end).subscribe(res => {
|
||||
this.personaleventsList = res.filter(data => data.CalendarName == "Pessoal");
|
||||
this.showLoader = false;
|
||||
});
|
||||
}else{
|
||||
this.eventService.getAllPrEvents(this.today.toLocaleString(), this.todayEnd.toLocaleString()).subscribe(res => {
|
||||
this.eventService.getAllPrEvents(start, end).subscribe(res => {
|
||||
this.personaleventsList = res.filter(data => data.CalendarName == "Pessoal");
|
||||
this.showLoader = false;
|
||||
});
|
||||
@@ -186,12 +171,12 @@ export class EventsPage implements OnInit {
|
||||
break;
|
||||
case "Oficial":
|
||||
if(this.profile == "mdgpr"){
|
||||
this.eventService.getAllMdEvents(this.today.toLocaleString(), this.todayEnd.toLocaleString()).subscribe(res => {
|
||||
this.eventService.getAllMdEvents(start, end).subscribe(res => {
|
||||
this.officialeventsList = res.filter(data => data.CalendarName == "Oficial");;
|
||||
this.showLoader = false;
|
||||
});
|
||||
}else{
|
||||
this.eventService.getAllPrEvents(this.today.toLocaleString(), this.todayEnd.toLocaleString()).subscribe(res => {
|
||||
this.eventService.getAllPrEvents(start, end).subscribe(res => {
|
||||
this.officialeventsList = res.filter(data => data.CalendarName == "Oficial");;
|
||||
this.showLoader = false;
|
||||
});
|
||||
@@ -261,38 +246,11 @@ export class EventsPage implements OnInit {
|
||||
return await modal.present();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @returns time in format HH:MM
|
||||
*/
|
||||
get hoursMinutes():String {
|
||||
|
||||
return this.currentHoursMinutes;
|
||||
|
||||
}
|
||||
|
||||
LoadList()
|
||||
{
|
||||
this.processes.GetTasksList("Expediente", false).subscribe(result => {
|
||||
|
||||
const AllResult = new Array();
|
||||
|
||||
result.forEach(element => {
|
||||
let task: DailyWorkTask = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": element.workflowInstanceFolio,
|
||||
"Senders": element.originator.email,
|
||||
"CreateDate": new Date(element.taskStartDate).toLocaleString(),
|
||||
"DocumentURL": element.formURL,
|
||||
"Remetente": element.workflowInstanceDataFields.Remetente
|
||||
}
|
||||
// CreateDate
|
||||
AllResult.push(task);
|
||||
});
|
||||
|
||||
|
||||
this.taskslist = AllResult.reverse()
|
||||
|
||||
this.expedientList = result.reverse();
|
||||
console.log(this.expedientList);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -324,7 +282,8 @@ export class EventsPage implements OnInit {
|
||||
}
|
||||
|
||||
async viewExpedientDetail(serialNumber:any) {
|
||||
console.log(this.profile);
|
||||
/* console.log(this.profile);
|
||||
console.log(serialNumber); */
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ExpedienteDetailPage,
|
||||
@@ -344,6 +303,19 @@ export class EventsPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
async openExpedientList(){
|
||||
const modal = await this.modalController.create({
|
||||
component: ExpedientePage,
|
||||
componentProps:{
|
||||
profile: this.profile,
|
||||
},
|
||||
cssClass: 'modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { ApproveEventModalPage } from './approve-event-modal.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ApproveEventModalPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class ApproveEventModalPageRoutingModule {}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ApproveEventModalPageRoutingModule } from './approve-event-modal-routing.module';
|
||||
|
||||
import { ApproveEventModalPage } from './approve-event-modal.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ApproveEventModalPageRoutingModule
|
||||
],
|
||||
declarations: [ApproveEventModalPage]
|
||||
})
|
||||
export class ApproveEventModalPageModule {}
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
<ion-header class="ion-no-border">
|
||||
<div class="header-content">
|
||||
<div class="header-icon-left">
|
||||
<ion-icon (click)="close()" src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="header-title">
|
||||
<label>{{loadedEvent.workflowInstanceDataFields.Subject}}</label>
|
||||
</div>
|
||||
<div class="header-icon-right">
|
||||
<ion-icon (click)="notImplemented()" src="assets/images/icons-edit.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</ion-header>
|
||||
<ion-menu autoHide="false" side="end" content-id="main-content">
|
||||
<ion-header>
|
||||
<ion-toolbar translucent>
|
||||
<ion-title>Acções</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<ion-list>
|
||||
<ion-item (click)="approveTask(loadedEvent.serialNumber)">
|
||||
<ion-icon name="checkmark-sharp"></ion-icon>
|
||||
<ion-label>Aprovar</ion-label>
|
||||
</ion-item>
|
||||
<ion-item (click)="emendTask(loadedEvent.serialNumber)">
|
||||
<ion-icon name="create-outline"></ion-icon>
|
||||
<ion-label>Emendar</ion-label>
|
||||
</ion-item>
|
||||
<ion-item (click)="rejectTask(loadedEvent.serialNumber)">
|
||||
<ion-icon name="close-sharp"></ion-icon>
|
||||
<ion-label>Rejeitar</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
</ion-menu>
|
||||
|
||||
<ion-content id="main-content">
|
||||
<div class="upper-content">
|
||||
<div class="content-location">
|
||||
<div class="location-detail">
|
||||
<ion-label >{{loadedEvent.workflowInstanceDataFields.Location}}</ion-label>
|
||||
</div>
|
||||
<div class="button-calendar-type">
|
||||
<ion-button class="button-calendar-type" slot="end">{{loadedEvent.workflowInstanceDataFields.Agenda}}</ion-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-details">
|
||||
<ion-label>
|
||||
<p>{{customDate}}</p>
|
||||
<p>das {{loadedEvent.workflowInstanceDataFields.StartDate | date: 'hh:mm'}} às {{loadedEvent.workflowInstanceDataFields.EndDate | date: 'hh:mm'}}</p>
|
||||
<p *ngIf="!loadedEvent.workflowInstanceDataFields.IsRecurring">(Não se repete)</p>
|
||||
<p *ngIf="loadedEvent.workflowInstanceDataFields.IsRecurring">Repete</p>
|
||||
</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="middle-content">
|
||||
<ion-item>
|
||||
<ion-label>
|
||||
<h3>Intervenientes</h3>
|
||||
<p>{{loadedEvent.workflowInstanceDataFields.Participants}}</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label>
|
||||
<h3>Detalhes</h3>
|
||||
<p>{{loadedEvent.workflowInstanceDataFields.Body}}</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</div>
|
||||
|
||||
<div *ngIf="loadedAttachments" class="bottom-content">
|
||||
<ion-list>
|
||||
<h3>Documentos Anexados</h3>
|
||||
<ion-item>
|
||||
<ion-label>
|
||||
<p class="attach-title-item">Receita por Natureza</p>
|
||||
<p><span class="span-left">{{loadedAttachments.Remetente}}</span><span class="span-right">{{loadedAttachments.CreateDate}}<!-- {{ task.CreateDate | date: 'dd-MM-yy' }} --></span></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</ion-content>
|
||||
<ion-footer>
|
||||
<ion-toolbar>
|
||||
<div class="buttons">
|
||||
<ion-item lines="none">
|
||||
<p>
|
||||
<ion-button class="button-edit-event" shape="round" (click)="emendTask(loadedEvent.serialNumber)">Emendar</ion-button>
|
||||
</p>
|
||||
<p>
|
||||
<ion-menu-button autoHide="false">
|
||||
<ion-icon (click)="openMenu()" name="ellipsis-vertical-outline"></ion-icon>
|
||||
</ion-menu-button>
|
||||
</p>
|
||||
<p>
|
||||
<ion-button class="button-approve" shape="round" (click)="approveTask(loadedEvent.serialNumber)">Aprovar</ion-button>
|
||||
</p>
|
||||
</ion-item>
|
||||
<ion-item hidden>
|
||||
<p>
|
||||
<ion-button class="button-reject" shape="round" (click)="rejectTask(loadedEvent.serialNumber)">Rejeitar</ion-button>
|
||||
</p>
|
||||
</ion-item>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
ion-content{
|
||||
--padding-top:0px;
|
||||
--padding-start: 20px;
|
||||
--padding-end: 20px;
|
||||
font-size: 18px;
|
||||
}
|
||||
ion-menu{
|
||||
--height: 225px;
|
||||
}
|
||||
.header-content{
|
||||
width: 360px;
|
||||
overflow: auto;
|
||||
margin: 25px auto;
|
||||
}
|
||||
.header-icon-left{
|
||||
width: 36px;
|
||||
font-size: 33px;
|
||||
color: #42b9fe;
|
||||
float: left;
|
||||
}
|
||||
.header-title{
|
||||
width: 264px;
|
||||
font-family: Roboto;
|
||||
font-size: 25px;
|
||||
margin: 0 5px 0 5px;
|
||||
padding: 0;
|
||||
color:#000;
|
||||
float: left;
|
||||
}
|
||||
.header-icon-right{
|
||||
width: 45px;
|
||||
font-size: 45px;
|
||||
float: left;
|
||||
overflow: auto;
|
||||
}
|
||||
.upper-content{
|
||||
margin-left: 50px;
|
||||
overflow: auto;
|
||||
font-size: 18px;
|
||||
|
||||
.content-location{
|
||||
width: 360px;
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.location-detail{
|
||||
width: 210px;
|
||||
font-weight: 700;
|
||||
font-size: 18px;
|
||||
float: left;
|
||||
margin: 5px 5px 5px 0px;
|
||||
}
|
||||
.button-calendar-type{
|
||||
width: 91px;
|
||||
--border-radius: 12.5px;
|
||||
--background: #ffb703;
|
||||
margin-left: 5px;
|
||||
float: left;
|
||||
}
|
||||
.button-calendar-type ion-button{
|
||||
height: 25px;
|
||||
}
|
||||
.button-edit-event {
|
||||
width: 140px;
|
||||
height: 44px;
|
||||
border-radius: 22.5px;
|
||||
--background: #e0e9ee;
|
||||
--color:#061b52;
|
||||
}
|
||||
.content-details p{
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
.middle-conten{
|
||||
.middle-content h3, .middle-content p{
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom-content{
|
||||
width: 360px;
|
||||
margin: 0 auto;
|
||||
|
||||
.bottom-content h3{
|
||||
font-size: 16px;
|
||||
margin: 0 0 0 10px;
|
||||
}
|
||||
.attach-document{
|
||||
font-size: 15px;
|
||||
color: #0d89d1;
|
||||
margin: 5px 5px 5px 10px;
|
||||
padding: 5px;
|
||||
float: left;
|
||||
}
|
||||
.attach-icon{
|
||||
width: 37px;
|
||||
font-size: 35px;
|
||||
float: left;
|
||||
}
|
||||
.attach-title-item{
|
||||
width: 100%;
|
||||
font-size: 15px;
|
||||
color:#0d89d1;
|
||||
}
|
||||
/* SPAN */
|
||||
.span-left{
|
||||
float: left;
|
||||
font-size: 15x;
|
||||
}
|
||||
.span-right{
|
||||
text-align: right;
|
||||
float: right;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
.buttons{
|
||||
width: 360px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.button-options {
|
||||
height: 44px;
|
||||
--color: #42b9fe;
|
||||
/* opacity: 0; */
|
||||
}
|
||||
.button-approve {
|
||||
width: 140px;
|
||||
height: 44px;
|
||||
border-radius: 22.5px;
|
||||
--background: #42b9fe;
|
||||
}
|
||||
.button-reject {
|
||||
width: 140px;
|
||||
height: 44px;
|
||||
--color: #d30a0a;
|
||||
border-radius: 22.5px;
|
||||
--background: #ffe0e0;
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ApproveEventModalPage } from './approve-event-modal.page';
|
||||
|
||||
describe('ApproveEventModalPage', () => {
|
||||
let component: ApproveEventModalPage;
|
||||
let fixture: ComponentFixture<ApproveEventModalPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ApproveEventModalPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ApproveEventModalPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { Event } from 'src/app/models/event.model';
|
||||
import { EmendMessageModalPage } from 'src/app/pages/agenda/emend-message-modal/emend-message-modal.page';
|
||||
import { EventActionsPopoverPage } from 'src/app/pages/agenda/event-actions-popover/event-actions-popover.page';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-approve-event-modal',
|
||||
templateUrl: './approve-event-modal.page.html',
|
||||
styleUrls: ['./approve-event-modal.page.scss'],
|
||||
})
|
||||
export class ApproveEventModalPage implements OnInit {
|
||||
event: Event;
|
||||
loadedEvent:any;
|
||||
loadedAttachments:any;
|
||||
serialNumber:string;
|
||||
customDate:any;
|
||||
today:any;
|
||||
|
||||
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||
|
||||
|
||||
constructor(
|
||||
private router:Router,
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
private processes:ProcessesService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private popoverController: PopoverController,
|
||||
private menu: MenuController,
|
||||
private alertService: AlertService,
|
||||
)
|
||||
{
|
||||
this.serialNumber = this.navParams.get('serialNumber');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getTask();
|
||||
this.getAttachments();
|
||||
}
|
||||
|
||||
notImplemented(){
|
||||
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
|
||||
}
|
||||
|
||||
close(){
|
||||
/* this.router.navigate(['/home/gabinete-digital/event-list']); */
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
|
||||
getTask(){
|
||||
this.processes.GetTask(this.serialNumber).subscribe(res => {
|
||||
console.log(res);
|
||||
this.loadedEvent = res;
|
||||
this.today = new Date(res.workflowInstanceDataFields.StartDate);
|
||||
console.log(new Date(this.today));
|
||||
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
|
||||
|
||||
})
|
||||
}
|
||||
approveTask(serialNumber:string){
|
||||
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
|
||||
console.log(body);
|
||||
this.processes.PostTaskAction(body);
|
||||
this.alertService.presentAlert('Operação realizada com sucesso!');
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
|
||||
emendTask(serialNumber:string){
|
||||
/* console.log('Emendar'); */
|
||||
this.menu.close();
|
||||
this.openEmendMessageModal(serialNumber);
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
|
||||
rejectTask(serialNumber:string){
|
||||
|
||||
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||
console.log(body);
|
||||
this.processes.PostTaskAction(body);
|
||||
this.alertService.presentAlert('Operação realizada com sucesso!');
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
getAttachments(){
|
||||
this.attachmentsService.getAttachmentsBySerial(this.serialNumber).subscribe(res=>{
|
||||
this.loadedAttachments = res;
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
|
||||
async openOptions(ev:any) {
|
||||
const popover = await this.popoverController.create({
|
||||
component: EventActionsPopoverPage,
|
||||
cssClass: 'event-actions-popover',
|
||||
event: ev,
|
||||
translucent: true
|
||||
});
|
||||
return await popover.present();
|
||||
}
|
||||
openMenu() {
|
||||
this.menu.open();
|
||||
}
|
||||
async openEmendMessageModal(serialNumber:string) {
|
||||
const modal = await this.modalController.create({
|
||||
component: EmendMessageModalPage,
|
||||
componentProps:{
|
||||
|
||||
},
|
||||
cssClass: 'emend-message-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then(res => {
|
||||
if(res.data !== ''){
|
||||
let body = { "serialNumber": serialNumber,
|
||||
"action": "Emendar",
|
||||
"dataFields": {
|
||||
"ReviewerComments": res.data,
|
||||
}
|
||||
}
|
||||
console.log(body);
|
||||
this.processes.PostTaskAction(body);
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.alertService.presentAlert('Operação realizada com sucesso!');
|
||||
}
|
||||
else{
|
||||
this.alertService.presentAlert('Operação cancelada!');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { ApproveEventPage } from './approve-event.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ApproveEventPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class ApproveEventPageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ApproveEventPageRoutingModule } from './approve-event-routing.module';
|
||||
|
||||
import { ApproveEventPage } from './approve-event.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ApproveEventPageRoutingModule
|
||||
],
|
||||
declarations: [ApproveEventPage]
|
||||
})
|
||||
export class ApproveEventPageModule {}
|
||||
@@ -0,0 +1,107 @@
|
||||
<ion-header class="ion-no-border">
|
||||
<div *ngIf="loadedEvent" class="header-content">
|
||||
<div class="header-icon-left">
|
||||
<ion-icon (click)="close()" src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="header-title">
|
||||
<label>{{loadedEvent.workflowInstanceDataFields.Subject}}</label>
|
||||
</div>
|
||||
<div class="header-icon-right">
|
||||
<ion-icon (click)="notImplemented()" src="assets/images/icons-edit.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</ion-header>
|
||||
<ion-menu autoHide="false" side="end" content-id="main-content">
|
||||
<ion-header>
|
||||
<ion-toolbar translucent>
|
||||
<ion-title>Acções</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<ion-list>
|
||||
<ion-item (click)="approveTask(loadedEvent.serialNumber)">
|
||||
<ion-icon name="checkmark-sharp"></ion-icon>
|
||||
<ion-label>Aprovar</ion-label>
|
||||
</ion-item>
|
||||
<ion-item (click)="emendTask(loadedEvent.serialNumber)">
|
||||
<ion-icon name="create-outline"></ion-icon>
|
||||
<ion-label>Emendar</ion-label>
|
||||
</ion-item>
|
||||
<ion-item (click)="rejectTask(loadedEvent.serialNumber)">
|
||||
<ion-icon name="close-sharp"></ion-icon>
|
||||
<ion-label>Rejeitar</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
</ion-menu>
|
||||
|
||||
<ion-content id="main-content">
|
||||
<div class="upper-content">
|
||||
<div class="content-location" *ngIf="loadedEvent">
|
||||
<div class="location-detail">
|
||||
<ion-label >{{loadedEvent.workflowInstanceDataFields.Location}}</ion-label>
|
||||
</div>
|
||||
<div class="button-calendar-type">
|
||||
<ion-button class="button-calendar-type" slot="end">{{loadedEvent.workflowInstanceDataFields.Agenda}}</ion-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-details" *ngIf="loadedEvent">
|
||||
<ion-label>
|
||||
<p>{{customDate}}</p>
|
||||
<p>das {{loadedEvent.workflowInstanceDataFields.StartDate | date: 'hh:mm'}} às {{loadedEvent.workflowInstanceDataFields.EndDate | date: 'hh:mm'}}</p>
|
||||
<p *ngIf="!loadedEvent.workflowInstanceDataFields.IsRecurring">(Não se repete)</p>
|
||||
<p *ngIf="loadedEvent.workflowInstanceDataFields.IsRecurring">Repete</p>
|
||||
</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="middle-content" *ngIf="loadedEvent">
|
||||
<ion-item>
|
||||
<ion-label>
|
||||
<h3>Intervenientes</h3>
|
||||
<p>{{loadedEvent.workflowInstanceDataFields.Participants}}</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label>
|
||||
<h3>Detalhes</h3>
|
||||
<p>{{loadedEvent.workflowInstanceDataFields.Body}}</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</div>
|
||||
|
||||
<!-- <div *ngIf="loadedAttachments" class="bottom-content">
|
||||
<ion-list>
|
||||
<h3>Documentos Anexados</h3>
|
||||
<ion-item>
|
||||
<ion-label>
|
||||
<p class="attach-title-item">Receita por Natureza</p>
|
||||
<p><span class="span-left">{{loadedAttachments.Remetente}}</span><span class="span-right">{{loadedAttachments.CreateDate}}</span></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div> -->
|
||||
</ion-content>
|
||||
<ion-footer>
|
||||
<ion-toolbar>
|
||||
<div class="buttons">
|
||||
<ion-item lines="none">
|
||||
<p>
|
||||
<ion-button class="button-edit-event" shape="round" (click)="emendTask(loadedEvent.serialNumber)">Emendar</ion-button>
|
||||
</p>
|
||||
<p>
|
||||
<ion-menu-button autoHide="false">
|
||||
<ion-icon (click)="openMenu()" name="ellipsis-vertical-outline"></ion-icon>
|
||||
</ion-menu-button>
|
||||
</p>
|
||||
<p>
|
||||
<ion-button class="button-approve" shape="round" (click)="approveTask(loadedEvent.serialNumber)">Aprovar</ion-button>
|
||||
</p>
|
||||
</ion-item>
|
||||
<ion-item hidden>
|
||||
<p>
|
||||
<ion-button class="button-reject" shape="round" (click)="rejectTask(loadedEvent.serialNumber)">Rejeitar</ion-button>
|
||||
</p>
|
||||
</ion-item>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
@@ -0,0 +1,141 @@
|
||||
ion-content{
|
||||
--padding-top:0px;
|
||||
--padding-start: 20px;
|
||||
--padding-end: 20px;
|
||||
font-size: 18px;
|
||||
}
|
||||
ion-menu{
|
||||
--height: 225px;
|
||||
}
|
||||
.header-content{
|
||||
width: 360px;
|
||||
overflow: auto;
|
||||
margin: 25px auto;
|
||||
}
|
||||
.header-icon-left{
|
||||
width: 36px;
|
||||
font-size: 33px;
|
||||
color: #42b9fe;
|
||||
float: left;
|
||||
}
|
||||
.header-title{
|
||||
width: 264px;
|
||||
font-family: Roboto;
|
||||
font-size: 25px;
|
||||
margin: 0 5px 0 5px;
|
||||
padding: 0;
|
||||
color:#000;
|
||||
float: left;
|
||||
}
|
||||
.header-icon-right{
|
||||
width: 45px;
|
||||
font-size: 45px;
|
||||
float: left;
|
||||
overflow: auto;
|
||||
}
|
||||
.upper-content{
|
||||
margin-left: 50px;
|
||||
overflow: auto;
|
||||
font-size: 18px;
|
||||
|
||||
.content-location{
|
||||
width: 360px;
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.location-detail{
|
||||
width: 210px;
|
||||
font-weight: 700;
|
||||
font-size: 18px;
|
||||
float: left;
|
||||
margin: 5px 5px 5px 0px;
|
||||
}
|
||||
.button-calendar-type{
|
||||
width: 91px;
|
||||
--border-radius: 12.5px;
|
||||
--background: #ffb703;
|
||||
margin-left: 5px;
|
||||
float: left;
|
||||
}
|
||||
.button-calendar-type ion-button{
|
||||
height: 25px;
|
||||
}
|
||||
.button-edit-event {
|
||||
width: 140px;
|
||||
height: 44px;
|
||||
border-radius: 22.5px;
|
||||
--background: #e0e9ee;
|
||||
--color:#061b52;
|
||||
}
|
||||
.content-details p{
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
.middle-conten{
|
||||
.middle-content h3, .middle-content p{
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom-content{
|
||||
width: 360px;
|
||||
margin: 0 auto;
|
||||
|
||||
.bottom-content h3{
|
||||
font-size: 16px;
|
||||
margin: 0 0 0 10px;
|
||||
}
|
||||
.attach-document{
|
||||
font-size: 15px;
|
||||
color: #0d89d1;
|
||||
margin: 5px 5px 5px 10px;
|
||||
padding: 5px;
|
||||
float: left;
|
||||
}
|
||||
.attach-icon{
|
||||
width: 37px;
|
||||
font-size: 35px;
|
||||
float: left;
|
||||
}
|
||||
.attach-title-item{
|
||||
width: 100%;
|
||||
font-size: 15px;
|
||||
color:#0d89d1;
|
||||
}
|
||||
/* SPAN */
|
||||
.span-left{
|
||||
float: left;
|
||||
font-size: 15x;
|
||||
}
|
||||
.span-right{
|
||||
text-align: right;
|
||||
float: right;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
.buttons{
|
||||
width: 360px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.button-options {
|
||||
height: 44px;
|
||||
--color: #42b9fe;
|
||||
/* opacity: 0; */
|
||||
}
|
||||
.button-approve {
|
||||
width: 140px;
|
||||
height: 44px;
|
||||
border-radius: 22.5px;
|
||||
--background: #42b9fe;
|
||||
}
|
||||
.button-reject {
|
||||
width: 140px;
|
||||
height: 44px;
|
||||
--color: #d30a0a;
|
||||
border-radius: 22.5px;
|
||||
--background: #ffe0e0;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ApproveEventPage } from './approve-event.page';
|
||||
|
||||
describe('ApproveEventPage', () => {
|
||||
let component: ApproveEventPage;
|
||||
let fixture: ComponentFixture<ApproveEventPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ApproveEventPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ApproveEventPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,151 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { MenuController, ModalController, PopoverController } from '@ionic/angular';
|
||||
import { EmendMessageModalPage } from 'src/app/pages/agenda/emend-message-modal/emend-message-modal.page';
|
||||
import { EventActionsPopoverPage } from 'src/app/pages/agenda/event-actions-popover/event-actions-popover.page';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-approve-event',
|
||||
templateUrl: './approve-event.page.html',
|
||||
styleUrls: ['./approve-event.page.scss'],
|
||||
})
|
||||
export class ApproveEventPage implements OnInit {
|
||||
event: Event;
|
||||
loadedEvent: any;
|
||||
loadedAttachments: any;
|
||||
serialNumber: string;
|
||||
customDate: any;
|
||||
today: any;
|
||||
|
||||
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private modalController: ModalController,
|
||||
private processes: ProcessesService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private popoverController: PopoverController,
|
||||
private menu: MenuController,
|
||||
private alertService: AlertService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(paramMap =>
|
||||
{
|
||||
if (!paramMap.has("serialNumber")){
|
||||
return;
|
||||
}
|
||||
else{
|
||||
this.serialNumber = paramMap.get('serialNumber');
|
||||
console.log(this.serialNumber);
|
||||
|
||||
}
|
||||
});
|
||||
this.loadedEvent = null;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.serialNumber);
|
||||
|
||||
this.getTask();
|
||||
this.getAttachments();
|
||||
}
|
||||
|
||||
notImplemented() {
|
||||
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
|
||||
}
|
||||
|
||||
close() {
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
}
|
||||
|
||||
getTask() {
|
||||
this.processes.GetTask(this.serialNumber).subscribe(res => {
|
||||
console.log(res);
|
||||
this.loadedEvent = res;
|
||||
this.today = new Date(res.workflowInstanceDataFields.StartDate);
|
||||
console.log(new Date(this.today));
|
||||
this.customDate = this.days[this.today.getDay()] + ", " + this.today.getDate() + " de " + (this.months[this.today.getMonth()]);
|
||||
|
||||
})
|
||||
}
|
||||
approveTask(serialNumber: string) {
|
||||
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
|
||||
console.log(body);
|
||||
this.processes.PostTaskAction(body);
|
||||
this.alertService.presentAlert('Operação realizada com sucesso!');
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
}
|
||||
|
||||
emendTask(serialNumber: string) {
|
||||
/* console.log('Emendar'); */
|
||||
this.menu.close();
|
||||
this.openEmendMessageModal(serialNumber);
|
||||
this.close();
|
||||
}
|
||||
|
||||
rejectTask(serialNumber: string) {
|
||||
|
||||
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||
console.log(body);
|
||||
this.processes.PostTaskAction(body);
|
||||
this.alertService.presentAlert('Operação realizada com sucesso!');
|
||||
this.router.navigate(['/home/gabinete-digital/event-list'])
|
||||
this.close();
|
||||
}
|
||||
getAttachments() {
|
||||
this.attachmentsService.getAttachmentsBySerial(this.serialNumber).subscribe(res => {
|
||||
this.loadedAttachments = res;
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
|
||||
async openOptions(ev: any) {
|
||||
const popover = await this.popoverController.create({
|
||||
component: EventActionsPopoverPage,
|
||||
cssClass: 'event-actions-popover',
|
||||
event: ev,
|
||||
translucent: true
|
||||
});
|
||||
return await popover.present();
|
||||
}
|
||||
openMenu() {
|
||||
this.menu.open();
|
||||
}
|
||||
async openEmendMessageModal(serialNumber: string) {
|
||||
const modal = await this.modalController.create({
|
||||
component: EmendMessageModalPage,
|
||||
componentProps: {
|
||||
|
||||
},
|
||||
cssClass: 'emend-message-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then(res => {
|
||||
if (res.data !== '') {
|
||||
let body = {
|
||||
"serialNumber": serialNumber,
|
||||
"action": "Emendar",
|
||||
"dataFields": {
|
||||
"ReviewerComments": res.data,
|
||||
}
|
||||
}
|
||||
console.log(body);
|
||||
this.processes.PostTaskAction(body);
|
||||
this.router.navigate(['/home/gabinete-digital/event-list'])
|
||||
this.alertService.presentAlert('Operação realizada com sucesso!');
|
||||
}
|
||||
else {
|
||||
this.alertService.presentAlert('Operação cancelada!');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +1,21 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { EventListPage } from './event-list.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: EventListPage
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { EventListPage } from './event-list.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: EventListPage
|
||||
},
|
||||
{
|
||||
path: 'approve-event',
|
||||
loadChildren: () => import('./approve-event/approve-event.module').then( m => m.ApproveEventPageModule)
|
||||
];
|
||||
}
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class EventListPageRoutingModule {}
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
|
||||
+2
-2
@@ -149,7 +149,7 @@
|
||||
|
||||
|
||||
</div>
|
||||
<div *ngIf="!eventsList">
|
||||
<!-- <div *ngIf="!eventsList">
|
||||
<ion-list>
|
||||
<ion-list-header>
|
||||
<ion-label>
|
||||
@@ -190,7 +190,7 @@
|
||||
</ion-item>
|
||||
|
||||
</ion-list>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
+10
-7
@@ -12,6 +12,7 @@ import { AlertService } from 'src/app/services/alert.service';
|
||||
import { ExpedientTaskModalPage } from '../expedient-task-modal/expedient-task-modal.page';
|
||||
import { BookMeetingModalPage } from '../book-meeting-modal/book-meeting-modal.page';
|
||||
import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
|
||||
import { momentG } from 'src/plugin/momentG'
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente-detail',
|
||||
@@ -36,17 +37,19 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
private alertService: AlertService) {
|
||||
this,this.serialnumber = this.navParams.get('serialNumber');
|
||||
this,this.profile = this.navParams.get('profile');
|
||||
this.serialnumber = this.navParams.get('serialNumber');
|
||||
this.profile = this.navParams.get('profile');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.profile = "mdgpr";
|
||||
console.log(this.serialnumber);
|
||||
|
||||
this.activateRoute.paramMap.subscribe(paramMap => {
|
||||
if (!paramMap.has('SerialNumber')){
|
||||
return;
|
||||
}
|
||||
this.serialnumber = paramMap.get('SerialNumber');
|
||||
/* this.serialnumber = paramMap.get('SerialNumber'); */
|
||||
this.LoadTaskDetail(this.serialnumber);
|
||||
this.LoadRelatedEvents(this.serialnumber);
|
||||
});
|
||||
@@ -62,9 +65,9 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
"SerialNumber": res.serialNumber,
|
||||
"Folio": res.workflowInstanceFolio,
|
||||
"Senders": res.originator.email,
|
||||
"CreateDate": formatDate(new Date(res.taskStartDate), 'yyyy-MM-dd HH:mm', 'pt'),
|
||||
"DocumentURL": res.formURL,
|
||||
"Remetente": res.workflowInstanceDataFields.Remetente
|
||||
"CreateDate": momentG(new Date(res.taskStartDate),'yyyy-MM-dd HH:mm:ss'),
|
||||
"DocumentURL": res.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": res.workflowInstanceDataFields.Sender,
|
||||
}
|
||||
this.fulltask = res;
|
||||
console.log(res);
|
||||
@@ -93,7 +96,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
|
||||
viewDocument(){
|
||||
const url: string = this.task.DocumentURL.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
||||
const browser = this.iab.create(url,"_blank");
|
||||
const browser = this.iab.create(url,"_parent");
|
||||
browser.show();
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ export class ExpedientePage implements OnInit {
|
||||
"Folio": element.workflowInstanceFolio,
|
||||
"Senders": element.originator.email,
|
||||
"CreateDate": formatDate(new Date(element.taskStartDate), 'yyyy-MM-dd HH:mm', 'pt'),
|
||||
"DocumentURL": element.formURL,
|
||||
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": element.workflowInstanceDataFields.Remetente
|
||||
}
|
||||
this.taskslist.push(task);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<div class="div-title">
|
||||
<ion-label class="title">Gabinete Digital</ion-label>
|
||||
</div>
|
||||
<div class="div-icon">
|
||||
<div hidden class="div-icon">
|
||||
<ion-icon slot="end" src='assets/images/icons-add.svg'></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -12,10 +12,10 @@ import { NotificationsService } from 'src/app/services/notifications.service';
|
||||
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import { Token } from '../../models/token.model';
|
||||
|
||||
/* import { Plugins, PushNotification, PushNotificationToken, PushNotificationActionPerformed } from '@capacitor/core';
|
||||
*/
|
||||
/* const { PushNotifications } = Plugins;
|
||||
*/
|
||||
import { Plugins, PushNotification, PushNotificationToken, PushNotificationActionPerformed } from '@capacitor/core';
|
||||
|
||||
const { PushNotifications } = Plugins;
|
||||
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -62,11 +62,11 @@ export class LoginPage implements OnInit {
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
loginRocketChat(user: any) {
|
||||
loginRocketChat() {
|
||||
|
||||
let postData = {
|
||||
"user": user.username,
|
||||
"password": user.password,
|
||||
"user": this.username,
|
||||
"password": this.password,
|
||||
}
|
||||
this.authService.loginChat(postData).subscribe((res: any) => {
|
||||
console.log(res.data);
|
||||
@@ -80,7 +80,7 @@ export class LoginPage implements OnInit {
|
||||
|
||||
storeUserIdANdToken() {
|
||||
|
||||
/* (PushNotifications as any).requestPermission().then(result => {
|
||||
(PushNotifications as any).requestPermission().then(result => {
|
||||
PushNotifications.register();
|
||||
});
|
||||
|
||||
@@ -106,12 +106,12 @@ export class LoginPage implements OnInit {
|
||||
console.log('TOKEN USER MIDLE',data);
|
||||
})*/
|
||||
|
||||
/* });
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
); */
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
@@ -128,8 +128,8 @@ export class LoginPage implements OnInit {
|
||||
BasicAuthKey: ""
|
||||
}
|
||||
if (await this.authService.login(this.userattempt)) {
|
||||
/* this.loginRocketChat(); */
|
||||
this.storeUserIdANdToken()
|
||||
this.loginRocketChat();
|
||||
this.storeUserIdANdToken();
|
||||
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import { AlertService } from 'src/app/services/alert.service';
|
||||
/* const { Camera } = Plugins; */
|
||||
|
||||
//Cordova
|
||||
/* import { Camera, CameraOptions } from '@ionic-native/camera/ngx'; */
|
||||
import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
|
||||
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||
import { ViewPublicationsPage } from '../view-publications/view-publications.page';
|
||||
import { LoadingService } from 'src/app/services/loading.service';
|
||||
@@ -51,7 +51,7 @@ export class NewPublicationPage implements OnInit {
|
||||
public photoService: PhotoService,
|
||||
private navParams: NavParams,
|
||||
private publications: PublicationsService,
|
||||
/* private camera: Camera, */
|
||||
private camera: Camera,
|
||||
) {
|
||||
|
||||
this.publicationType = this.navParams.get('publicationType');
|
||||
@@ -65,8 +65,8 @@ export class NewPublicationPage implements OnInit {
|
||||
this.takePicture();
|
||||
}
|
||||
takePicture(){
|
||||
/* const options: CameraOptions = {
|
||||
quality: 100,
|
||||
const options: CameraOptions = {
|
||||
quality: 90,
|
||||
destinationType: this.camera.DestinationType.DATA_URL,
|
||||
encodingType: this.camera.EncodingType.JPEG,
|
||||
mediaType: this.camera.MediaType.PICTURE,
|
||||
@@ -82,12 +82,12 @@ export class NewPublicationPage implements OnInit {
|
||||
this.capturedImageTitle = new Date().getTime() + '.jpeg';
|
||||
}, (err) => {
|
||||
console.log(err);
|
||||
}); */
|
||||
});
|
||||
}
|
||||
|
||||
getPicture(){
|
||||
/* const options: CameraOptions = {
|
||||
quality: 100,
|
||||
const options: CameraOptions = {
|
||||
quality: 90,
|
||||
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
|
||||
destinationType: this.camera.DestinationType.DATA_URL,
|
||||
encodingType: this.camera.EncodingType.JPEG,
|
||||
@@ -103,7 +103,7 @@ export class NewPublicationPage implements OnInit {
|
||||
this.capturedImageTitle = new Date().getTime() + '.jpeg';
|
||||
}, (err) => {
|
||||
console.log(err);
|
||||
}); */
|
||||
});
|
||||
}
|
||||
|
||||
async save(){
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="main-header">
|
||||
<div class="title-content">
|
||||
<div class="div-title">
|
||||
<ion-label class="title">Acções Presidenciais</ion-label>
|
||||
<ion-label class="title">Ações Presidenciais</ion-label>
|
||||
</div>
|
||||
<div class="div-icon">
|
||||
<ion-icon (click)="AddPublicationFolder()" slot="end" src='assets/images/icons-add.svg'></ion-icon>
|
||||
|
||||
@@ -50,12 +50,12 @@ export class PublicationsPage implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
doRefresh(event) {
|
||||
doRefresh() {
|
||||
/* this.getActions(); */
|
||||
|
||||
setTimeout(() => {
|
||||
this.getActions();
|
||||
event.target.complete();
|
||||
/* event.target.complete(); */
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ export class PublicationsPage implements OnInit {
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(()=>{
|
||||
this.doRefresh(event);
|
||||
this.doRefresh();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
private publications:PublicationsService,
|
||||
) {
|
||||
this.publicationId = this.navParams.get('publicationId');
|
||||
this.folderId = this.navParams.get('folderIdId');
|
||||
/* this.folderId = this.navParams.get('folderIdId'); */
|
||||
this.publication = {
|
||||
DateIndex: null,
|
||||
DocumentId: '',
|
||||
@@ -52,7 +52,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
getPublicationDetail(){
|
||||
this.showLoader = true;
|
||||
console.log(this.publicationId);
|
||||
console.log(this.folderId);
|
||||
/* console.log(this.folderId); */
|
||||
this.publications.GetPublicationById(this.publicationId).subscribe(res=>{
|
||||
console.log(res);
|
||||
/* this.publication = res; */
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<!-- [routerLink]="['/home/publications/view-publications/publication-detail', publication.publicationId]" -->
|
||||
<div class="post-item"
|
||||
*ngFor="let publication of publicationList"
|
||||
(click)="viewPublicationDetail(publication.ProcessId,publication.DocumentId)">
|
||||
(click)="viewPublicationDetail(publication.DocumentId)">
|
||||
<div *ngIf="publication.FileBase64.length > 30" class="post-img">
|
||||
<img src="{{publication.FileBase64}}" alt="image">
|
||||
</div>
|
||||
|
||||
@@ -102,12 +102,11 @@ export class ViewPublicationsPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
async viewPublicationDetail(processId:string, publicationId:string) {
|
||||
async viewPublicationDetail(publicationId:string) {
|
||||
const modal = await this.modalController.create({
|
||||
component: PublicationDetailPage,
|
||||
componentProps:{
|
||||
publicationId: publicationId,
|
||||
folderId: processId,
|
||||
},
|
||||
cssClass: 'publication-detail',
|
||||
backdropDismiss: false
|
||||
|
||||
Reference in New Issue
Block a user