mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
save
This commit is contained in:
@@ -36,6 +36,15 @@ const routes: Routes = [
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
path:'expedientes-pr',
|
||||
children: [
|
||||
{
|
||||
path:':SerialNumber/:caller',
|
||||
loadChildren: ()=> import('../pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.module').then(m => m.ExpedientePrPageModule),
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -154,6 +163,19 @@ const routes: Routes = [
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'expedientes-pr',
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
loadChildren: ()=> import('../pages/gabinete-digital/expedientes-pr/expedientes-pr.module').then(m => m.ExpedientesPrPageModule),
|
||||
},
|
||||
{
|
||||
path:':SerialNumber/:caller',
|
||||
loadChildren: ()=> import('../pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.module').then(m => m.ExpedientePrPageModule),
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'despachos',
|
||||
children: [
|
||||
|
||||
@@ -310,18 +310,35 @@ export class EventsPage implements OnInit {
|
||||
}
|
||||
|
||||
goToExpediente(SerialNumber:any){
|
||||
this.router.navigate(['/home/events/expediente', SerialNumber, 'events']);
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
this.router.navigate(['/home/events/expediente', SerialNumber, 'events']);
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR'){
|
||||
this.router.navigate(['/home/events/expedientes-pr', SerialNumber, 'events']);
|
||||
}
|
||||
}
|
||||
|
||||
viewExpedientListPage(){
|
||||
if( window.innerWidth <= 1024){
|
||||
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
if( window.innerWidth < 801){
|
||||
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||
}
|
||||
else{
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"expedientes": true,} };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
}
|
||||
else{
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"expedientes": true,} };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
else if(this.loggeduser.Profile == 'PR'){
|
||||
if( window.innerWidth < 801){
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr']);
|
||||
}
|
||||
else{
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"expedientes-pr": true,} };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -38,13 +38,14 @@ export class ExpedientePrPage implements OnInit {
|
||||
fulltask: any;
|
||||
eventsList: Event[];
|
||||
serialnumber: string;
|
||||
caller:string;
|
||||
profile: string;
|
||||
intervenientes: any;
|
||||
cc: any = [];
|
||||
|
||||
loggeduser: User;
|
||||
|
||||
constructor(private activateRoute: ActivatedRoute,
|
||||
constructor(
|
||||
private processes: ProcessesService,
|
||||
private iab: InAppBrowser,
|
||||
private attachments: AttachmentsService,
|
||||
@@ -52,7 +53,6 @@ export class ExpedientePrPage implements OnInit {
|
||||
private menu: MenuController,
|
||||
private router: Router,
|
||||
private modalController: ModalController,
|
||||
private alertService: AlertService,
|
||||
public popoverController: PopoverController,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private userAuth: AuthService,
|
||||
@@ -61,10 +61,12 @@ export class ExpedientePrPage implements OnInit {
|
||||
|
||||
) {
|
||||
this.loggeduser = userAuth.ValidatedUser;
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
if(params["serialNumber"]) {
|
||||
this.serialnumber = params["serialNumber"];
|
||||
console.log(params["serialNumber"]);
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
if(params["params"].SerialNumber) {
|
||||
this.serialnumber = params["params"].SerialNumber;
|
||||
}
|
||||
if(params["params"].caller) {
|
||||
this.caller = params["params"].caller;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -73,7 +75,7 @@ export class ExpedientePrPage implements OnInit {
|
||||
this.profile = "mdgpr";
|
||||
console.log(this.serialnumber);
|
||||
|
||||
this.activateRoute.paramMap.subscribe(paramMap => {
|
||||
this.activatedRoute.paramMap.subscribe(paramMap => {
|
||||
if (!paramMap.has('SerialNumber')) {
|
||||
return;
|
||||
}
|
||||
@@ -90,15 +92,42 @@ export class ExpedientePrPage implements OnInit {
|
||||
}
|
||||
|
||||
goBack() {
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"expedientes-pr": true,
|
||||
if(this.task.Status == "Pending" && this.caller != 'events'){
|
||||
if (window.innerWidth <= 800) {
|
||||
this.router.navigate(['/home/gabinete-digital/pendentes']);
|
||||
}
|
||||
else {
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"pendentes": true,
|
||||
}
|
||||
}
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
};
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
switch (params["params"].caller) {
|
||||
case 'events':
|
||||
this.router.navigate(['/home',params["params"].caller]);
|
||||
break;
|
||||
|
||||
case 'gabinete-digital':
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"expedientes-pr": true,
|
||||
}
|
||||
}
|
||||
if( window.innerWidth < 801) {
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr']);
|
||||
} else {
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
sendExpedienteToPending(){
|
||||
@@ -332,14 +361,14 @@ export class ExpedientePrPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise();
|
||||
this.toastService.successMessage('Processo descartado')
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
//Do nothing
|
||||
@@ -347,30 +376,24 @@ export class ExpedientePrPage implements OnInit {
|
||||
}
|
||||
else{
|
||||
if(res['data']== 'Yes'){
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
}
|
||||
this.goBack();
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
console.log('Update');
|
||||
try {
|
||||
//await this.processes.CompleteTask(body).toPromise()
|
||||
this.toastService.successMessage()
|
||||
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
|
||||
this.toastService.successMessage();
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
console.log('Update');
|
||||
|
||||
try {
|
||||
await this.processes.UpdateTaskStatus(this.task.FolderId);
|
||||
this.toastService.successMessage()
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -36,10 +36,10 @@ export class ExpedientesPrPage implements OnInit {
|
||||
private router: Router,
|
||||
) {
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
this.LoadList();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.LoadList();
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
||||
this.LoadList();
|
||||
@@ -47,15 +47,6 @@ export class ExpedientesPrPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
notImplemented(){
|
||||
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
|
||||
}
|
||||
|
||||
openExpedientDetailPage(data){
|
||||
console.log(data);
|
||||
this.openExpedientDetail.emit(data);
|
||||
}
|
||||
|
||||
LoadList(){
|
||||
this.showLoader = true;
|
||||
switch (this.loggeduser.Profile) {
|
||||
@@ -124,13 +115,7 @@ export class ExpedientesPrPage implements OnInit {
|
||||
}
|
||||
|
||||
goToExpediente(serialNumber:any){
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"serialNumber": serialNumber,
|
||||
"profile": this.loggeduser.Profile
|
||||
}
|
||||
};
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr/expediente-pr'], navigationExtras);
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr',serialNumber,'gabinete-digital']);
|
||||
}
|
||||
|
||||
async viewExpedientDetail(serialNumber:any) {
|
||||
|
||||
@@ -153,7 +153,6 @@ export class EditEventToApprovePage implements OnInit {
|
||||
}
|
||||
|
||||
setOtherData() {
|
||||
|
||||
if(this.eventProcess.workflowInstanceDataFields.ParticipantsList) {
|
||||
this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => {
|
||||
if(e.IsRequired) {
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
<button (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Aprovar</button>
|
||||
<button (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="distartExpedientModal(fulltask)" class="btn-cancel" shape="round" >Descartar</button>
|
||||
<button (click)="distartExpedientModal('descartar')" full class="btn-ok" shape="round" >Descartar</button>
|
||||
<div hidden class="solid"></div>
|
||||
<button hidden class="btn-cancel" shape="round" >Delegar</button>
|
||||
</div>
|
||||
<div *ngIf="loggeduser.Profile =='PR' " class="buttons">
|
||||
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-ok" shape="round" >Marcar para Despacho</button>
|
||||
<button (click)="distartExpedientModal(fulltask)" class="btn-cancel" shape="round" >Descartar</button>
|
||||
<button (click)="distartExpedientModal('descartar')" full class="btn-ok" shape="round" >Descartar</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
|
||||
@@ -33,6 +33,8 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
serialnumber: string;
|
||||
profile: string;
|
||||
|
||||
showEnviarPendentes = false;
|
||||
|
||||
loggeduser: User;
|
||||
|
||||
constructor(
|
||||
@@ -53,18 +55,21 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
this.fulltask = this.navParams.get('fulltask');
|
||||
|
||||
this.loggeduser = userAuth.ValidatedUser;
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
if(params["serialNumber"]) {
|
||||
this.serialnumber = params["serialNumber"];
|
||||
console.log(params["serialNumber"]);
|
||||
}
|
||||
});
|
||||
this.profile = "mdgpr";
|
||||
if(this.task.Status != 'Pending'){
|
||||
this.showEnviarPendentes = true;
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
|
||||
close(){
|
||||
if( window.innerWidth <= 1024){
|
||||
this.popoverController.dismiss();
|
||||
}
|
||||
else{
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
async openAddNoteModal(actionName:string) {
|
||||
@@ -112,6 +117,7 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
}
|
||||
|
||||
async approve(note:string, documents:any){
|
||||
this.popoverController.dismiss();
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
"action": "Aprovar",
|
||||
@@ -131,15 +137,11 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
async distartExpedientModal(body:any) {
|
||||
async distartExpedientModal(body:any){
|
||||
this.popoverController.dismiss();
|
||||
console.log(this.fulltask);
|
||||
const modal = await this.modalController.create({
|
||||
component: DiscartExpedientModalPage,
|
||||
componentProps: {
|
||||
serialNumber: this.fulltask.serialNumber,
|
||||
folderId: this.fulltask.workflowInstanceDataFields.FolderID,
|
||||
action: 'complete',
|
||||
},
|
||||
cssClass: 'discart-expedient-modal',
|
||||
backdropDismiss: false
|
||||
@@ -148,42 +150,53 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
console.log(res['data']);
|
||||
if(res['data']== 'Yes'){
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.toastService.successMessage()
|
||||
this.goBack();
|
||||
if(body == 'descartar'){
|
||||
if(res['data']== 'Yes'){
|
||||
let otherbody = {
|
||||
"serialNumber": this.task.SerialNumber,
|
||||
"action": "Passivo",
|
||||
"ActionTypeId": 99999877,
|
||||
"dataFields": {
|
||||
"Note": "",
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
|
||||
else if(res['data'] == 'No'){
|
||||
//Do nothing
|
||||
}
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
let otherbody = {
|
||||
"serialNumber": body.serialNumber,
|
||||
"action": "Passivo",
|
||||
"ActionTypeId": 99999877,
|
||||
"dataFields": {
|
||||
"Note": "",
|
||||
else{
|
||||
if(res['data']== 'Yes'){
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
}
|
||||
this.goBack();
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
console.log('Update');
|
||||
try {
|
||||
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
|
||||
this.toastService.successMessage();
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
this.toastService.successMessage()
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//Volta na lista principal
|
||||
this.goBack();
|
||||
this.modalController.dismiss();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -209,6 +222,7 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
}
|
||||
|
||||
sendExpedienteToPending(){
|
||||
this.popoverController.dismiss();
|
||||
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.close();
|
||||
@@ -270,16 +284,6 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
|
||||
close() {
|
||||
if( window.innerWidth <= 1024) {
|
||||
this.popoverController.dismiss();
|
||||
}
|
||||
else{
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
goBack() {
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
|
||||
Reference in New Issue
Block a user