This commit is contained in:
tiago.kayaya
2021-06-17 16:12:56 +01:00
parent 4b067e2517
commit 0c32592894
16 changed files with 94 additions and 75 deletions
+2 -2
View File
@@ -22,10 +22,10 @@
<ion-icon class="nav-icon" src="assets/images/icons-nav-actions.svg"></ion-icon>
<ion-label class="overflow-visible">Ações</ion-label>
</ion-tab-button>
<!-- <ion-tab-button tab="chat">
<ion-tab-button tab="chat">
<ion-icon class="nav-icon" src="assets/images/icons-nav-chat-inactive.svg"></ion-icon>
<ion-label>Chat</ion-label>
</ion-tab-button> -->
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet">
+1 -1
View File
@@ -85,7 +85,7 @@
<ion-footer>
<div class="buttons">
<button class="btn-cancel" shape="round" (click)="cancelTask()">Cancelar</button>
<button class="btn-ok" shape="round" (click)="notImplemented()">Gravar</button>
<button class="btn-ok" shape="round" (click)="saveTask()">Gravar</button>
</div>
</ion-footer>
+27 -7
View File
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { NavigationExtras, Router } from '@angular/router';
import { AlertController, AnimationController, ModalController, NavParams } from '@ionic/angular';
import { Event } from 'src/app/models/event.model'
import { EventBody } from 'src/app/models/eventbody.model';
@@ -78,6 +78,19 @@ export class ForwardPage implements OnInit {
cancelTask() {
this.modalController.dismiss(null);
}
goBack() {
this.modalController.dismiss(null);
if (window.innerWidth <= 800) {
this.router.navigate(['/home/gabinete-digital/pedidos']);
} else {
let navigationExtras: NavigationExtras = {
queryParams: {
"pedidos": true,
}
}
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
}
async assignar(note:string, documents:any) {
let body = {
@@ -112,11 +125,17 @@ export class ForwardPage implements OnInit {
this.toastService.badRequest("Selecione apenas um destinatário");
}
else {
let attendees: any = this.taskParticipants.concat(this.taskParticipantsCc);
attendees = attendees.map(function(val) {
return {
UserEmail: val.EmailAddress,
UserType: val.IsRequired?"I": "CC"
};
});
let body = {
"usersSelected": this.taskParticipants,
"distributionType": "paralelo",
"priority": 0,
"countryCode": "string",
"usersSelected": attendees,
"serialNumber": this.task.SerialNumber,
"action": "Reencaminhar",
"actionTypeId": 98,
@@ -127,9 +146,10 @@ export class ForwardPage implements OnInit {
"AttachmentList" :docs,
}
console.log(body);
this.processes.DelegateTask(body).subscribe(res=>{
this.processes.CompleteParecerPrTask(body).subscribe(res=>{
console.log(res);
this.toastService.successMessage('Processo delegado')
this.toastService.successMessage('Processo delegado');
this.goBack();
},
(error)=>{
this.toastService.badRequest("Processo não delegado")
@@ -9,6 +9,6 @@
<button class="btn-ok" shape="round" (click)="approveTask()">Aprovar</button>
<div class="solid"></div>
<button class="btn-cancel" shape="round" (click)="editTask()">Editar</button>
<button class="btn-delete" shape="round" (click)="deleteTask()">Rejeitar</button>
<button class="btn-delete" shape="round" (click)="rejeitar()">Rejeitar</button>
</div>
</ion-content>
@@ -35,44 +35,53 @@ export class EventActionsPopoverPage implements OnInit {
}
};
}
goBack(){
this.closePopover();
this.router.navigate(['/home/gabinete-digital/event-list']);
}
closePopover(){
this.popoverController.dismiss();
}
approveTask() {
let body = { "serialNumber": this.serialNumber, "action": "Aprovar" }
console.log(body);
try {
this.processes.PostTaskAction(body).toPromise()
this.router.navigate(['/home/gabinete-digital/event-list']);
this.modalController.dismiss(null);
this.toastService.successMessage()
this.toastService.successMessage();
this.goBack();
} catch (error) {
this.toastService.badRequest()
}
}
emendarTask() {
let body = { "serialNumber": this.serialNumber, "action": "Rejeitar" }
console.log(body);
try {
this.processes.PostTaskAction(body).toPromise()
this.router.navigate(['/home/gabinete-digital/event-list']);
this.modalController.dismiss(null);
this.toastService.successMessage()
this.processes.PostTaskAction(body).toPromise();
this.toastService.successMessage();
this.goBack();
} catch (error) {
this.toastService.badRequest()
}
}
deleteTask(){
async rejeitar(){
let body = { "serialNumber": this.serialNumber, "action": "Rejeitar" }
console.log(body);
try {
this.processes.PostTaskAction(body).toPromise();
await this.toastService.successMessage('Processo rejeitado');
this.goBack();
} catch (error) {
this.toastService.badRequest()
}
}
async editTask() {
console.log(this.serialNumber);
console.log(this.instanceId);
@@ -76,7 +76,6 @@ export class ApproveEventPage implements OnInit {
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
}
async getTask() {
@@ -97,10 +96,8 @@ export class ApproveEventPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise()
this.toastService.successMessage()
this.toastService.successMessage('Evento aprovado', ()=>{
this.goBack();
});
this.toastService.successMessage();
this.goBack();
} catch (error) {
this.toastService.badRequest()
@@ -126,18 +123,13 @@ export class ApproveEventPage implements OnInit {
async rejeitar(serialNumber:string){
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
console.log(body);
this.toastService.successMessage('Process');
try {
this.processes.PostTaskAction(body).toPromise();
await this.toastService.successMessage('Processo rejeitado');
await this.toastService.successMessage('Processo rejeitado', ()=>{
this.goBack();
});
this.goBack();
} catch (error) {
this.toastService.badRequest()
}
}
async getAttachments(instanceId:string){
@@ -37,7 +37,7 @@ export class EventListPage implements OnInit {
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == this.router.url) {
this.doRefresh();
this.LoadToApproveEvents();
}
});
@@ -35,14 +35,14 @@
<div class="overflow-y-auto">
<div class="middle-content">
<h5 *ngIf="intervenientes">Intervenientes</h5>
<!-- <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>
</ion-item> -->
<div *ngIf="cc.length > 0">
<h5>Com conhecimento</h5>
<ion-item class="ion-no-margin ion-no-padding">
@@ -82,28 +82,16 @@ export class ExpedientePage implements OnInit {
doRefresh() {
this.LoadList();
setTimeout(() => {
}, 2000);
}
goBack() {
this.router.navigate(['/home/gabinete-digital']);
}
goToExpediente(serialNumber:any) {
let navigationExtras: NavigationExtras = {
queryParams: {
"serialNumber": serialNumber,
"caller": "gabinete"
}
}
goToExpediente(serialNumber:any){
this.router.navigate(['/home/gabinete-digital/expediente',serialNumber,'gabinete-digital']);
}
}
@@ -3,18 +3,19 @@
</ion-header>
<ion-content class="height-100">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<ion-refresher-content>
</ion-refresher-content>
</ion-refresher>
<div class="main-content d-flex height-100">
<!-- Aside left -->
<div class="aside-wrapper d-flex flex-column justify-center width-md-40 flex-grow-1 ">
<div class="title-container">
<ion-label class="title">Gabinete Digital</ion-label>
<button class="btn-no-color btn-refresh" (click)="doRefresh()">
<button class="btn-no-color btn-refresh" (click)="doRefresh($event)">
<ion-icon class="title-icon" name="reload-circle"></ion-icon>
</button>
</div>
@@ -260,7 +260,7 @@ export class GabineteDigitalPage implements OnInit {
}
doRefresh() {
doRefresh(event) {
this.closeAllDesktopComponents();
switch(this.loggeduser.Profile){
case 'MDGPR':
@@ -276,8 +276,7 @@ export class GabineteDigitalPage implements OnInit {
this.LoadCounts();
//this.refreshExpedientes();
setTimeout(() => {
}, 2000);
event.target.complete();
}
notImplemented(){
@@ -445,14 +445,16 @@ export class PedidoPage implements OnInit {
}
goBack() {
let navigationExtras: NavigationExtras = {
queryParams: {
"pedidos": true,
if (window.innerWidth <= 800) {
this.router.navigate(['/home/gabinete-digital/pedidos']);
} else {
let navigationExtras: NavigationExtras = {
queryParams: {
"pedidos": true,
}
}
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
@@ -3,7 +3,7 @@
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<ion-refresher-content>
</ion-refresher-content>
@@ -24,7 +24,7 @@
<button class="btn-no-color" (click)="AddPublicationFolder()">
<ion-icon slot="icon-only" src='assets/images/icons-add.svg'></ion-icon>
</button>
<button class="btn-no-color" (click)="doRefresh()">
<button class="btn-no-color" (click)="doRefresh($event)">
<ion-icon slot="icon-only" class="title-icon" name="reload-circle" title="Actualizar"></ion-icon>
</button>
</div>
@@ -68,13 +68,12 @@ export class PublicationsPage implements OnInit {
}
});
}
doRefresh() {
/* this.getActions(); */
doRefresh(event) {
this.getActions();
setTimeout(() => {
this.getActions();
/* event.target.complete(); */
}, 2000);
event.target.complete();
}, 250);
}
get windowInnerWidth(): number {
@@ -125,7 +124,7 @@ export class PublicationsPage implements OnInit {
});
await modal.present();
modal.onDidDismiss().then(()=>{
this.doRefresh();
this.getActions();
});
} else {
this.desktopComponent.showAddActions = true;
+10
View File
@@ -139,6 +139,7 @@ export class ProcessesService {
};
return this.http.post<any>(`${geturl}`, body, options)
}
CompleteTask(body:any){
const geturl = environment.apiURL + 'Tasks/CompleteTask';
@@ -148,6 +149,15 @@ export class ProcessesService {
return this.http.post<any>(`${geturl}`, body, options)
}
CompleteParecerPrTask(body:any){
const geturl = environment.apiURL + 'Tasks/CompleteTaskParecerPr';
let options = {
headers: this.headers,
};
return this.http.post<any>(`${geturl}`, body, options)
}
UpdateTaskStatus(FolderId:string): Observable<any>{
const geturl = environment.apiURL + 'Tasks/UpdateTaskStatus';
let params = new HttpParams();
@@ -127,10 +127,9 @@ export class ApproveEventPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise()
this.router.navigate(['/home/gabinete-digital/event-list']);
this.modalController.dismiss(null);
this.toastService.successMessage('Evento rejeitado')
} catch (error) {
this.toastService.badRequest('Evento não rejeitado')
this.toastService.badRequest('Processo não efectuado')
}
}