This commit is contained in:
tiago.kayaya
2021-08-05 14:10:39 +01:00
12 changed files with 119 additions and 52 deletions
@@ -111,16 +111,14 @@ export class ViewEventPage implements OnInit {
if(this.isModal) {
this.close()
} else {
// this.activatedRoute.paramMap.subscribe(params => {
// if(params["params"].caller == 'expediente'){
// window.history.back();
// }
// else{
// this.router.navigate(['/home',params["params"].caller]);
// }
// });
this.location.back();
this.activatedRoute.paramMap.subscribe(params => {
if(params["params"].caller == 'expediente'){
window.history.back();
}
else{
this.router.navigate(['/home',params["params"].caller]);
}
});
}
}
@@ -133,15 +131,15 @@ export class ViewEventPage implements OnInit {
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */
loader.remove()
}, (error)=>{
if(error.status == 0) {
this.toastService.badRequest('Não é possível visualizar este evento no modo offline')
this.toastService.badRequest('não é possível vizualizar este event no modo offline')
} else {
this.toastService.badRequest('Este evento já não existe na sua agenda')
}
}
loader.remove()
this.modalController.dismiss('Eevento não Encontrado');
this.modalController.dismiss('Eevent not Foud');
this.location.back();
});
}
@@ -165,7 +163,7 @@ export class ViewEventPage implements OnInit {
async OpenDeleteEventModal() {
const modal = await this.modalController.create({
component: EliminateEventPage,
componentProps: {
@@ -20,6 +20,7 @@ import { FormControl, FormGroup, Validators } from '@angular/forms';
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
import { task } from 'src/app/models/ExpedientTaskModalPage';
import { DespachoService } from 'src/app/Rules/despacho.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
@@ -101,11 +102,14 @@ export class ExpedientTaskModalPage implements OnInit {
private userAuth: AuthService,
private animationController: AnimationController,
private toastService: ToastService,
private despachoService: DespachoService
) {
this.loggeduser = userAuth.ValidatedUser;
this.task = this.navParams.get('task');
console.log(this.task)
this.taskType = this.navParams.get('taskAction');
this.selectedTypes = ['99999850'];
@@ -371,7 +375,7 @@ export class ExpedientTaskModalPage implements OnInit {
break;
case 'PR':
switch (this.taskType) {
case '0':
case '0': // despacho
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
@@ -393,7 +397,7 @@ export class ExpedientTaskModalPage implements OnInit {
}
try {
this.taskResult = await this.processes.postDespatchoPr(this.postData).toPromise();
this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
await this.toastService.successMessage('Processo efetuado');
this.modalController.dismiss(action_despacho_pr);
} catch (error) {
@@ -437,7 +441,7 @@ export class ExpedientTaskModalPage implements OnInit {
loader.remove()
}
break;
}
}
break;
}
}
@@ -79,7 +79,8 @@
<button (click)="openAddNoteModal('Arquivar')" class="btn-cancel" shape="round" >Arquivar</button>
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
<button *ngIf="p.userRole(['MDGPR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-ok" shape="round" >Marcar para Despacho</button>
<button *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
@@ -88,7 +89,8 @@
<button (click)="openAddNoteModal('Arquivar')" class="btn-cancel" shape="round" >Arquivar</button>
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
<button *ngIf="p.userRole(['MDGPR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-ok" shape="round" >Marcar para Despacho</button>
<button *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
@@ -97,7 +99,8 @@
<button (click)="openAddNoteModal('Arquivar')" class="btn-cancel" shape="round" >Arquivar</button>
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
<button *ngIf="p.userRole(['MDGPR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-ok" shape="round" >Marcar para Despacho</button>
<button hidden (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openAddNoteModal('Solicitar Reapreciação')" class="btn-cancel" shape="round" >Solicitar Reapreciação</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
@@ -23,8 +23,10 @@ import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.p
import { ToastService } from 'src/app/services/toast.service';
import { ForwardPage } from 'src/app/modals/forward/forward.page';
import { async } from '@angular/core/testing';
import { PermissionService } from 'src/app/OtherService/permission.service';
import { Location } from '@angular/common';
@Component({
selector: 'app-pedido',
templateUrl: './pedido.page.html',
@@ -60,7 +62,8 @@ export class PedidoPage implements OnInit {
authService: AuthService,
private animationController: AnimationController,
private toastService: ToastService,
private location: Location,
public p: PermissionService,
private location: Location
) {
this.loggeduser = authService.ValidatedUser;
@@ -492,7 +495,7 @@ export class PedidoPage implements OnInit {
goBack() {
this.location.back();
/* if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){
if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){
if (window.innerWidth <= 700) {
this.router.navigate(['/home/gabinete-digital/pendentes']);
}
@@ -525,7 +528,7 @@ export class PedidoPage implements OnInit {
}
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
} */
}
}
}