This commit is contained in:
Peter Maquiran
2021-08-05 11:47:09 +01:00
parent 38313e3260
commit ca665294f0
10 changed files with 122 additions and 39 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]);
}
});
}
}
@@ -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,6 +23,7 @@ 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';
@Component({
selector: 'app-pedido',
@@ -58,7 +59,9 @@ export class PedidoPage implements OnInit {
public popoverController: PopoverController,
authService: AuthService,
private animationController: AnimationController,
private toastService: ToastService,) {
private toastService: ToastService,
public p: PermissionService,
) {
this.loggeduser = authService.ValidatedUser;
this.activatedRoute.paramMap.subscribe(params => {