- + -
. - +
+
@@ -72,8 +72,8 @@
-
Lista vazia diff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts index 8061f5af1..ad6a55936 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts +++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts @@ -224,7 +224,18 @@ export class ExpedienteDetailPage implements OnInit { modal.onDidDismiss().then( async(res)=>{ let body = res['data']; if(res['data']) { - await this.distartExpedientModal(body); + + //await this.distartExpedientModal(body); + const loader = this.toastService.loading() + try { + await this.processes.CompleteTask(body).toPromise(); + this.toastService.successMessage('Processo descartado'); + this.goBack(); + } catch (error) { + this.toastService.badRequest('Processo não descartado') + } finally { + loader.remove() + } } else{ this.close(); @@ -260,7 +271,7 @@ export class ExpedienteDetailPage implements OnInit { try { await this.processes.CompleteTask(otherbody).toPromise() - //this.toastService.successMessage('Processo descartado'); + this.toastService.successMessage('Processo descartado'); this.goBack(); } catch (error) { this.toastService.badRequest('Processo não descartado') @@ -275,6 +286,7 @@ export class ExpedienteDetailPage implements OnInit { } else{ if(res['data']== 'Yes'){ + const loader = this.toastService.loading() try { await this.processes.CompleteTask(body).toPromise(); diff --git a/src/app/shared/popover/deploma-options/deploma-options.page.html b/src/app/shared/popover/deploma-options/deploma-options.page.html index 314ef58db..c51bfb0e6 100644 --- a/src/app/shared/popover/deploma-options/deploma-options.page.html +++ b/src/app/shared/popover/deploma-options/deploma-options.page.html @@ -5,11 +5,16 @@
-
+ + +
+ +
diff --git a/src/app/shared/popover/deploma-options/deploma-options.page.ts b/src/app/shared/popover/deploma-options/deploma-options.page.ts index e2d36dfd9..282d44f2f 100644 --- a/src/app/shared/popover/deploma-options/deploma-options.page.ts +++ b/src/app/shared/popover/deploma-options/deploma-options.page.ts @@ -28,7 +28,7 @@ export class DeplomaOptionsPage implements OnInit { private processes: ProcessesService, private navParams: NavParams, private toastService: ToastService, - private router: Router,) { + private router: Router,) { this.serialnumber = this.navParams.get('serialNumber'); } @@ -36,8 +36,41 @@ export class DeplomaOptionsPage implements OnInit { console.log(this.serialnumber); } + async Assinar(){ + this.popoverController.dismiss(); - async openAddNoteModal(actionName:string) { + let body = { + "action": "Assinado", + "serialNumber": this.serialnumber, + "ActionTypeId": 99999842, + "dataFields": { + "ReviewUserComment": '', + }, + "AttachmentList": [], + } + + console.log(body); + + + const loader = this.toastService.loading() + + try { + await this.processes.CompleteTask(body).toPromise() + + this.toastService.successMessage(false, ()=>{ + this.goBack(); + }) + } catch (error) { + this.toastService.badRequest() + } + finally { + loader.remove() + } + + } + + + /* async openAddNoteModal(actionName:string) { this.popoverController.dismiss(); let classs; if( window.innerWidth <= 800){ @@ -52,25 +85,27 @@ export class DeplomaOptionsPage implements OnInit { cssClass: classs, backdropDismiss: true }); - + await modal.present(); - + modal.onDidDismiss().then(async (res) => { if(res.data){ - + const DocumentToSave = res.data.documents.map((e) => { return { ApplicationId: e.ApplicationType, SourceId: e.Id, } }); - + let docs = { ProcessInstanceID: "", Attachments: DocumentToSave, } + this.Assinar(); + if(actionName == 'Solicitar assinatura'){ await this.askSignature(res.data.note, docs); @@ -82,11 +117,11 @@ export class DeplomaOptionsPage implements OnInit { } } }); - } + } */ - async askToChange(note:string, documents:any){ - let body = { - "serialNumber": this.serialnumber, + /* async askToChange(note:string, documents:any){ + let body = { + "serialNumber": this.serialnumber, "action": "Retificar", "ActionTypeId": 99999841, "dataFields": { @@ -96,7 +131,7 @@ export class DeplomaOptionsPage implements OnInit { } const loader = this.toastService.loading() - + try { await this.processes.CompleteTask(body).toPromise() this.close(); @@ -131,8 +166,8 @@ export class DeplomaOptionsPage implements OnInit { } async askSignature(note:string, documents:any) { - let body = { - "serialNumber": this.serialnumber, + let body = { + "serialNumber": this.serialnumber, "action": "Aprovar", "ActionTypeId": 99999840, "dataFields": { @@ -152,16 +187,15 @@ export class DeplomaOptionsPage implements OnInit { } finally { loader.remove() } - - } + + } */ goBack() { - this.close(); - this.router.navigate(['/home/gabinete-digital/diplomas']); + this.router.navigate(['/home/gabinete-digital/diplomas-assinar']); } - + close(){ this.popoverController.dismiss(); } diff --git a/src/app/shared/popover/messages-options/messages-options.page.html b/src/app/shared/popover/messages-options/messages-options.page.html index 62e6265a2..98acbea72 100644 --- a/src/app/shared/popover/messages-options/messages-options.page.html +++ b/src/app/shared/popover/messages-options/messages-options.page.html @@ -7,6 +7,6 @@
- +
diff --git a/src/app/shared/popover/opts-expediente/opts-expediente.page.ts b/src/app/shared/popover/opts-expediente/opts-expediente.page.ts index d1284d828..47bd03dd9 100644 --- a/src/app/shared/popover/opts-expediente/opts-expediente.page.ts +++ b/src/app/shared/popover/opts-expediente/opts-expediente.page.ts @@ -28,7 +28,7 @@ export class OptsExpedientePage implements OnInit { private toastService: ToastService, private router: Router, private activatedRoute: ActivatedRoute, - ) { + ) { this.task = this.navParams.get('task'); this.fulltask = this.navParams.get('fulltask'); @@ -58,7 +58,7 @@ export class OptsExpedientePage implements OnInit { if(this.task.Status == "Pending" && this.caller != 'events'){ if (window.innerWidth <= 800) { this.router.navigate(['/home/gabinete-digital/pendentes']); - } + } else { let navigationExtras: NavigationExtras = { queryParams: { @@ -70,19 +70,19 @@ export class OptsExpedientePage implements OnInit { } else{ window.history.back(); - + /* this.activatedRoute.paramMap.subscribe(params => { console.log('YES'); console.log(params); - - + + switch (params["params"].caller) { case 'events': console.log('here-1'); - + this.router.navigate(['/home',params["params"].caller]); break; - + case 'gabinete-digital': console.log('here0'); let navigationExtras: NavigationExtras = { @@ -93,12 +93,12 @@ export class OptsExpedientePage implements OnInit { if( window.innerWidth < 801) { this.router.navigate(['/home/gabinete-digital/expediente']); console.log('here'); - + } else { this.router.navigate(['/home/gabinete-digital'], navigationExtras); } break; - + } }); */ } @@ -152,12 +152,22 @@ export class OptsExpedientePage implements OnInit { cssClass: classs, }); await modal.present(); - modal.onDidDismiss().then(res=>{ + modal.onDidDismiss().then(async res=>{ console.log(res['data']); let body = res['data']; if(res['data']){ console.log('open discart') - this.distartExpedientModal(body); + //this.distartExpedientModal(body); + const loader = this.toastService.loading() + try { + await this.processes.CompleteTask(body).toPromise(); + this.toastService.successMessage('Processo descartado'); + this.goBack(); + } catch (error) { + this.toastService.badRequest('Processo não descartado') + } finally { + loader.remove() + } } else{ console.log('Not open'); @@ -174,7 +184,7 @@ export class OptsExpedientePage implements OnInit { cssClass: 'discart-expedient-modal', backdropDismiss: false }); - + await modal.present(); modal.onDidDismiss().then( async (res)=>{ console.log(res['data']); @@ -192,7 +202,7 @@ export class OptsExpedientePage implements OnInit { const loader = this.toastService.loading() - try { + try { await this.processes.CompleteTask(otherbody).toPromise() this.toastService.successMessage('Processo descartado'); this.goBack(); @@ -201,7 +211,7 @@ export class OptsExpedientePage implements OnInit { } finally { loader.remove() } - + } else if(res['data'] == 'No'){ @@ -212,7 +222,7 @@ export class OptsExpedientePage implements OnInit { if(res['data']== 'Yes'){ const loader = this.toastService.loading() - try { + try { await this.processes.CompleteTask(body).toPromise(); this.toastService.successMessage('Processo descartado'); this.goBack();