diff --git a/src/app/home/home-routing.module.ts b/src/app/home/home-routing.module.ts index 8899495e2..cd42571d5 100644 --- a/src/app/home/home-routing.module.ts +++ b/src/app/home/home-routing.module.ts @@ -102,6 +102,24 @@ const routes: Routes = [ path: 'view-event', loadChildren: () => import('../pages/agenda/view-event/view-event.module').then( m => m.ViewEventPageModule) }, + { + path:'event-list', + children: [ + { + path:'', + loadChildren: ()=> import('../pages/gabinete-digital/event-list/event-list.module').then(m => m.EventListPageModule) + }, + { + path:'approve-event', + children : [ + { + path:':serialNumber/:caller', + loadChildren: ()=> import('../pages/gabinete-digital/event-list/approve-event/approve-event.module').then(m => m.ApproveEventPageModule) + }, + ] + } + ] + }, ] }, { @@ -144,10 +162,15 @@ const routes: Routes = [ 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) - }, - ] + path:'approve-event', + children : [ + { + path:':serialNumber/:caller', + loadChildren: ()=> import('../pages/gabinete-digital/event-list/approve-event/approve-event.module').then(m => m.ApproveEventPageModule) + }, + ] + } + ] }, { path: 'events-to-approve', diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index b7e87e60b..1546c27c7 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -192,7 +192,7 @@ export class CreateProcessPage implements OnInit { try { await this.processes.postDespatcho(this.postData).toPromise(); - this.FinalizarDespacho(); + this.FinalizarDespacho('Despacho criado'); } catch (error) { this.toastService.badRequest('Processo não efectuado'); } @@ -211,8 +211,7 @@ export class CreateProcessPage implements OnInit { try { await this.processes.postParecer(this.postData).toPromise(); - - this.FinalizarParecer('Pedido de Parecer criado'); + this.FinalizarParecer('Pedido de Parecer enviado'); } catch (error) { this.toastService.badRequest('Processo não efectuado'); @@ -232,7 +231,7 @@ export class CreateProcessPage implements OnInit { try { await this.processes.postDeferimento(this.postData).toPromise(); - this.executado('Pedido de Deferimento criado'); + this.FinalizarDeferimento('Pedido de deferimento enviado'); } catch (error) { this.toastService.badRequest('Processo não efectuado'); @@ -348,17 +347,18 @@ export class CreateProcessPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise(); - this.toastService.successMessage(''); + this.toastService.successMessage(message); } catch (error) { this.toastService.badRequest('Processo não efectuado'); } } - async FinalizarDespacho() { - + async FinalizarDespacho(message?) { + let body; - if(this.task.activityInstanceName =='Tarefa de Despacho' || this.task.activityInstanceName =='Reexecutar Despacho') { + if(this.task.activityInstanceName =='Tarefa de Despacho' || + this.task.activityInstanceName =='Reexecutar Despacho') { body = { "serialNumber": this.task.serialNumber, @@ -370,7 +370,11 @@ export class CreateProcessPage implements OnInit { "AttachmentList" :null, } } - else if(this.task.activityInstanceName =='Concluir Despacho' || this.task.activityInstanceName == 'Concluir Parecer') { + else if(this.task.activityInstanceName =='Concluir Despacho' || + this.task.activityInstanceName == 'Concluir Parecer' || + this.task.activityInstanceName =='Concluir Deferimento' || + this.task.activityInstanceName =='Reapreciar Deferimento' + ) { body = { "serialNumber": this.task.serialNumber, @@ -381,12 +385,12 @@ export class CreateProcessPage implements OnInit { }, "AttachmentList" :null, } - } - + console.log(body); + try { await this.processes.CompleteTask(body).toPromise(); - this.toastService.successMessage(''); + this.toastService.successMessage(message); } catch (error) { this.toastService.badRequest('Processo não efectuado'); } @@ -394,16 +398,32 @@ export class CreateProcessPage implements OnInit { } async FinalizarParecer(message?) { - let body = { - "serialNumber": this.task.serialNumber, - "action": "Parecer", - "ActionTypeId": 96, - "dataFields": { - "ReviewUserComment": '', - }, - "AttachmentList" :null, - } + let body; + if(this.task.activityInstanceName =='Concluir Deferimento' || + this.task.activityInstanceName =='Reapreciar Deferimento' + ){ + body = { + "serialNumber": this.task.serialNumber, + "action": "Parecer", + "ActionTypeId": 92, + "dataFields": { + "ReviewUserComment": message, + }, + "AttachmentList" :null, + } + } + else{ + body = { + "serialNumber": this.task.serialNumber, + "action": "Parecer", + "ActionTypeId": 96, + "dataFields": { + "ReviewUserComment": message, + }, + "AttachmentList" :null, + } + } try { await this.processes.CompleteTask(body).toPromise(); @@ -413,6 +433,26 @@ export class CreateProcessPage implements OnInit { } } + + async FinalizarDeferimento(message?){ + if(this.task.activityInstanceName =='Reapreciar Deferimento'){ + let body = { + "serialNumber": this.task.serialNumber, + "action": "Parecer", + "ActionTypeId": 92, + "dataFields": { + "ReviewUserComment": '', + }, + "AttachmentList" :null, + } + try { + await this.processes.CompleteTask(body).toPromise(); + this.toastService.successMessage(message) + } catch (e) { + this.toastService.badRequest() + } + } + } async addParticipants() { diff --git a/src/app/models/event.model.ts b/src/app/models/event.model.ts index 37240f58f..831bbf1e7 100644 --- a/src/app/models/event.model.ts +++ b/src/app/models/event.model.ts @@ -32,7 +32,7 @@ export class EventToApproveEdit { "StartDate": "2021-05-12T10:30:00" "EndDate": "2021-05-12T11:30:00" "Private": false - "ReviewUserComments": "" + "ReviewUserComment": "" "MDName": "Paulo Pinto" "MDEmail": "paulo.pinto@gabinetedigital.local" "Agenda": "Oficial" | "Pessoal" diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index c1d8e8791..89ee25930 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -1175,17 +1175,8 @@ export class AgendaPage implements OnInit { async viewEventsToApprove(){ await this.cloneAllmobileComponent() - if( window.innerWidth <= 1024){ - const modal = await this.modalCtrl.create({ - component: EventListPage, - componentProps:{ - profile: this.profile, - }, - cssClass: 'modal modal-desktop', - backdropDismiss: false - }); - await modal.present(); - modal.onDidDismiss(); + if( window.innerWidth <= 801){ + this.router.navigate(['/home/agenda/event-list']); } else { // hide all components this.cloneAllmobileComponent(); diff --git a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts index cad42776f..38f0b2c90 100644 --- a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts +++ b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts @@ -70,7 +70,7 @@ export class EventActionsPopoverPage implements OnInit { } async emendarTask() { - console.log('Mobile'); + this.closePopover(); const modal = await this.modalController.create({ component: EmendMessageModalPage, @@ -122,8 +122,7 @@ export class EventActionsPopoverPage implements OnInit { } async editTask() { - console.log(this.serialNumber); - console.log(this.instanceId); + this.closePopover(); const modal = await this.modalController.create({ component: EditEventToApproveComponent, componentProps: { diff --git a/src/app/pages/events/events.page.html b/src/app/pages/events/events.page.html index 54e6d6ad3..0b3fd939f 100644 --- a/src/app/pages/events/events.page.html +++ b/src/app/pages/events/events.page.html @@ -55,7 +55,7 @@