mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Push notification event-list route added
This commit is contained in:
@@ -26,6 +26,7 @@ npm-debug.log*
|
||||
/coverage
|
||||
/dist
|
||||
/node_modules
|
||||
/android
|
||||
/platforms
|
||||
/plugins
|
||||
/www
|
||||
|
||||
@@ -68,19 +68,6 @@ const routes: Routes = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'agenda',
|
||||
children: [
|
||||
{
|
||||
path:'evento',
|
||||
loadChildren: ()=> import('../pages/gabinete-digital/event-list/event-list.page').then(m => m.EventListPage)
|
||||
},
|
||||
{
|
||||
path:':eventId/:caller',
|
||||
loadChildren: ()=> import('../pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page').then(m => m.ApproveEventModalPage),
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'gabinete-digital',
|
||||
children: [
|
||||
@@ -112,6 +99,10 @@ const routes: Routes = [
|
||||
path:'',
|
||||
loadChildren: ()=> import('../pages/gabinete-digital/event-list/event-list.module').then(m => m.EventListPageModule)
|
||||
},
|
||||
{
|
||||
path:':serialNumber',
|
||||
loadChildren: ()=> import('../pages/gabinete-digital/event-list/approve-event/approve-event.module').then(m => m.ApproveEventPageModule),
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
|
||||
+12
-11
@@ -1,4 +1,4 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnInit, NgZone } from '@angular/core';
|
||||
import { EventsService } from '../services/events.service';
|
||||
import { formatDate } from '@angular/common';
|
||||
import { Event } from '../models/event.model';
|
||||
@@ -9,7 +9,7 @@ import { PublicationDetailPage } from '../../app/pages/publications/view-publica
|
||||
import { ViewPublicationsPage } from '../../app/pages/publications/view-publications/view-publications.page';
|
||||
import { ExpedienteDetailPage } from '../../app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page'
|
||||
import { ViewEventPage } from '../../app/pages/agenda/view-event/view-event.page'
|
||||
import { ApproveEventModalPage } from '../pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page'
|
||||
import { ApproveEventModalPage } from '../../app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page';
|
||||
|
||||
import { Plugins, PushNotification, PushNotificationToken, PushNotificationActionPerformed, Modals } from '@capacitor/core';
|
||||
import { Router } from '@angular/router';
|
||||
@@ -31,7 +31,7 @@ export class HomePage implements OnInit {
|
||||
totalExpediente = 0;
|
||||
profile: string;
|
||||
|
||||
constructor(private eventService: EventsService, private processesbackend: ProcessesService, private router: Router, private modalController: ModalController,) { }
|
||||
constructor(private ngZone: NgZone,private eventService: EventsService, private processesbackend: ProcessesService, private router: Router, private modalController: ModalController,) { }
|
||||
|
||||
ngOnInit() {
|
||||
//Initialize profile as mdgpr
|
||||
@@ -119,16 +119,17 @@ export class HomePage implements OnInit {
|
||||
|
||||
service = "agenda" ? this.router.navigate(['/home/', service, idObject, 'home']) : */
|
||||
|
||||
if (service === "agenda" && object != "evento") {
|
||||
if (service === "agenda") {
|
||||
//this.router.navigate(['/home/', service, idObject, 'home']);
|
||||
this.viewEventDetail(idObject)
|
||||
} else if (service === "agenda" && object === "evento") {
|
||||
this.router.navigate(['/home/', service, idObject, 'home']);
|
||||
} else if (service === "gabinete-digital" && object != "expediente") {
|
||||
this.router.navigate(['/home/', service]);
|
||||
} else if (service === "gabinete-digital" && object != "expediente" || object != "event-list") {
|
||||
this.router.navigate(['/home/gabinete-digital']);
|
||||
} else if (service === "gabinete-digital" && object === "expediente") {
|
||||
this.viewExpedientDetail(idObject)
|
||||
} else if (service === "accoes" && object === "accao") {
|
||||
} else if (service === "gabinete-digital" && object === "event-list") {
|
||||
/* this.ngZone.run(() => {this.router.navigate(['/home/gabinete-digital/event-list', idObject])}) */
|
||||
this.openApproveModal(idObject);
|
||||
} else if (service === "accoes" && object === "accao") {
|
||||
this.viewPublications(idObject)
|
||||
} else if (service === "accoes" && object === "publicacao") {
|
||||
this.viewPublicationDetail(idObject)
|
||||
@@ -191,7 +192,7 @@ export class HomePage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
async openApproveModal(eventSerialNumber){
|
||||
async openApproveModal(eventSerialNumber){
|
||||
const modal = await this.modalController.create({
|
||||
component: ApproveEventModalPage,
|
||||
componentProps:{
|
||||
@@ -204,7 +205,7 @@ export class HomePage implements OnInit {
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
}
|
||||
|
||||
async viewEventDetail(eventId:any) {
|
||||
console.log(this.profile);
|
||||
|
||||
@@ -19,7 +19,6 @@ import {
|
||||
DAYS_OF_WEEK,
|
||||
} from 'angular-calendar';
|
||||
import { CustomDateFormatter } from './custom-date-formatter.provider';
|
||||
import { ApproveEventModalPage } from './approve-event-modal/approve-event-modal.page';
|
||||
import { EventListPage } from '../gabinete-digital/event-list/event-list.page';
|
||||
|
||||
@Component({
|
||||
|
||||
+69
-60
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit, NgZone } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { Event } from 'src/app/models/event.model';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
@@ -8,6 +8,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { EmendMessageModalPage } from '../../../agenda/emend-message-modal/emend-message-modal.page';
|
||||
import { EventActionsPopoverPage } from '../../../agenda/event-actions-popover/event-actions-popover.page';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-approve-event-modal',
|
||||
templateUrl: './approve-event-modal.page.html',
|
||||
@@ -15,88 +16,95 @@ import { EventActionsPopoverPage } from '../../../agenda/event-actions-popover/e
|
||||
})
|
||||
export class ApproveEventModalPage implements OnInit {
|
||||
event: Event;
|
||||
loadedEvent:any;
|
||||
loadedAttachments:any;
|
||||
serialNumber:string;
|
||||
customDate:any;
|
||||
today:any;
|
||||
|
||||
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 router: Router,
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
private processes:ProcessesService,
|
||||
private processes: ProcessesService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private popoverController: PopoverController,
|
||||
private menu: MenuController,
|
||||
private alertService: AlertService,
|
||||
private ngZone: NgZone,
|
||||
)
|
||||
{
|
||||
this.serialNumber = this.navParams.get('serialNumber');
|
||||
}
|
||||
private activatedRoute: ActivatedRoute,
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(paramMap =>
|
||||
{
|
||||
if (!paramMap.has("serialNumber")){
|
||||
return;
|
||||
}
|
||||
else{
|
||||
this.serialNumber = paramMap.get('serialNumber');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getTask();
|
||||
this.getAttachments();
|
||||
}
|
||||
|
||||
notImplemented(){
|
||||
notImplemented() {
|
||||
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
|
||||
}
|
||||
|
||||
close(){
|
||||
this.ngZone.run(() => { this.router.navigate(['/home/gabinete-digital/event-list'])});
|
||||
close() {
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
|
||||
getTask(){
|
||||
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()]);
|
||||
|
||||
this.customDate = this.days[this.today.getDay()] + ", " + this.today.getDate() + " de " + (this.months[this.today.getMonth()]);
|
||||
|
||||
})
|
||||
}
|
||||
approveTask(serialNumber:string){
|
||||
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.ngZone.run(() => { this.router.navigate(['/home/gabinete-digital/event-list'])});
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
|
||||
emendTask(serialNumber:string){
|
||||
emendTask(serialNumber: string) {
|
||||
/* console.log('Emendar'); */
|
||||
this.menu.close();
|
||||
this.openEmendMessageModal(serialNumber);
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
|
||||
rejectTask(serialNumber:string){
|
||||
|
||||
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.ngZone.run(() => {this.router.navigate(['/home/gabinete-digital/event-list']);})
|
||||
this.router.navigate(['/home/gabinete-digital/event-list'])
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
getAttachments(){
|
||||
this.attachmentsService.getAttachmentsBySerial(this.serialNumber).subscribe(res=>{
|
||||
getAttachments() {
|
||||
this.attachmentsService.getAttachmentsBySerial(this.serialNumber).subscribe(res => {
|
||||
this.loadedAttachments = res;
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
|
||||
async openOptions(ev:any) {
|
||||
async openOptions(ev: any) {
|
||||
const popover = await this.popoverController.create({
|
||||
component: EventActionsPopoverPage,
|
||||
cssClass: 'event-actions-popover',
|
||||
@@ -107,36 +115,37 @@ export class ApproveEventModalPage implements OnInit {
|
||||
}
|
||||
openMenu() {
|
||||
this.menu.open();
|
||||
}
|
||||
async openEmendMessageModal(serialNumber:string) {
|
||||
const modal = await this.modalController.create({
|
||||
component: EmendMessageModalPage,
|
||||
componentProps:{
|
||||
|
||||
},
|
||||
cssClass: 'emend-message-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
}
|
||||
async openEmendMessageModal(serialNumber: string) {
|
||||
const modal = await this.modalController.create({
|
||||
component: EmendMessageModalPage,
|
||||
componentProps: {
|
||||
|
||||
await modal.present();
|
||||
},
|
||||
cssClass: 'emend-message-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
modal.onDidDismiss().then(res => {
|
||||
if(res.data !== ''){
|
||||
let body = { "serialNumber": serialNumber,
|
||||
"action": "Emendar",
|
||||
"dataFields": {
|
||||
"ReviewerComments": res.data,
|
||||
}
|
||||
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!');
|
||||
}
|
||||
console.log(body);
|
||||
this.processes.PostTaskAction(body);
|
||||
this.ngZone.run(() => {this.router.navigate(['/home/gabinete-digital/event-list'])})
|
||||
this.alertService.presentAlert('Operação realizada com sucesso!');
|
||||
}
|
||||
else{
|
||||
this.alertService.presentAlert('Operação cancelada!');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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,142 @@
|
||||
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],
|
||||
})
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
<ion-item-sliding>
|
||||
<ion-item class="Rectangle" lines="none"
|
||||
*ngFor="let event of eventsMDGPRList" (click)="openApproveModal(event.serialNumber)">
|
||||
|
||||
<div class="content-mdgpr-{{event.workflowInstanceDataFields.Agenda}}">
|
||||
<div class="approve-event-time">
|
||||
<p>{{event.workflowInstanceDataFields.StartDate | date: 'hh:mm'}}</p>
|
||||
|
||||
@@ -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({
|
||||
@@ -80,7 +80,7 @@ export class LoginPage implements OnInit {
|
||||
|
||||
storeUserIdANdToken() {
|
||||
|
||||
/* (PushNotifications as any).requestPermission().then(result => {
|
||||
(PushNotifications as any).requestPermission().then(result => {
|
||||
PushNotifications.register();
|
||||
});
|
||||
|
||||
@@ -94,24 +94,26 @@ export class LoginPage implements OnInit {
|
||||
this.storageService.get(AuthConnstants.USER).then(res => {
|
||||
console.log('USERID', res);
|
||||
const headers = { 'Authorization': 'Basic cGF1bG8ucGludG9AZ2FiaW5ldGVkaWdpdGFsLmxvY2FsOnRhYnRlc3RlQDAwNg==' };
|
||||
const body = { UserId: res,
|
||||
const body = {
|
||||
UserId: res,
|
||||
TokenId: token.value,
|
||||
Status: 1,
|
||||
Service: 1 };
|
||||
Service: 1
|
||||
};
|
||||
|
||||
this.http.post<Token>('https://equilibrium.dyndns.info/GabineteDigital.Services/V4/api/notifications/token', body,{headers}).subscribe(data => {
|
||||
this.http.post<Token>('https://equilibrium.dyndns.info/GabineteDigital.Services/V4/api/notifications/token', body, { headers }).subscribe(data => {
|
||||
console.log('TOKEN USER MIDLE', data);
|
||||
})
|
||||
/*this.http.get<Token>('http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V4/api/notifications/user/'+res).subscribe(data => {
|
||||
console.log('TOKEN USER MIDLE',data);
|
||||
})*/
|
||||
|
||||
/* });
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
); */
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user