diff --git a/src/app/modals/document-detail/document-detail.page.ts b/src/app/modals/document-detail/document-detail.page.ts index a99a3c870..7532fd2f7 100644 --- a/src/app/modals/document-detail/document-detail.page.ts +++ b/src/app/modals/document-detail/document-detail.page.ts @@ -59,41 +59,43 @@ export class DocumentDetailPage implements OnInit { console.log(res) this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]); - }); - - let task: ExpedientTaskModalPageNavParamsTask - - let document: FromSearchDocument = this.LoadedDocument - let folder: SearchFolder = this.LoadedDocument - - if(this.LoadedDocument.ApplicationID == 361) { - task = { - serialNumber: folder.DispatchNumber, - taskStartDate: folder.DateDispatch, - isEvent: true, - workflowInstanceDataFields: { - FsId: folder.ApplicationID || folder.ApplicationId, - FolderID: null, - DocId: folder.DispatchNumber, - Subject: folder.Assunto - }, - } - } else if (document.ApplicationID == 8 || document.ApplicationId == 8) { - task = { - serialNumber: document.DocId, - taskStartDate: document.DocDate, - isEvent: true, - workflowInstanceDataFields: { - FsId: document.ApplicationID || document.ApplicationId, - FolderID: null, - DocId: document.DocId || document.DocID, - Subject: document.Assunto + let task: ExpedientTaskModalPageNavParamsTask + let document: FromSearchDocument = this.LoadedDocument + let folder: SearchFolder = this.LoadedDocument + + if(this.LoadedDocument.ApplicationID == 361) { + task = { + serialNumber: folder.DispatchNumber, + taskStartDate: folder.DateDispatch, + isEvent: true, + workflowInstanceDataFields: { + FsId: folder.ApplicationID || folder.ApplicationId, + FolderID: null, + DocId: folder.DispatchNumber, + Subject: folder.Assunto + }, } + } else if (document.ApplicationID == 8 || document.ApplicationId == 8) { + task = { + serialNumber: document.DocId, + taskStartDate: document.DocDate, + isEvent: true, + workflowInstanceDataFields: { + FsId: document.ApplicationID || document.ApplicationId, + FolderID: null, + DocId: document.DocId || document.DocID, + Subject: document.Assunto + } + } + } else { + alert('alert') } - } + + this.task = task + console.log('this.task = task', this.task) - this.task = task + }); } @@ -167,6 +169,8 @@ export class DocumentDetailPage implements OnInit { component: SearchedDocumentOptionsPage, cssClass: 'exp-options', componentProps: { + task: this.task, + LoadedDocument: this.LoadedDocument }, translucent: true }); diff --git a/src/app/shared/popover/searched-document-options/searched-document-options.page.ts b/src/app/shared/popover/searched-document-options/searched-document-options.page.ts index c4a89183d..2f34e72cd 100644 --- a/src/app/shared/popover/searched-document-options/searched-document-options.page.ts +++ b/src/app/shared/popover/searched-document-options/searched-document-options.page.ts @@ -3,13 +3,11 @@ import { ActivatedRoute, Router } from '@angular/router'; import { ModalController, NavParams, PopoverController } from '@ionic/angular'; import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting/document-set-up-meeting.page'; import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage'; -import { FromSearchDocument, SearchFolder } from 'src/app/models/search-document'; import { PermissionService } from 'src/app/OtherService/permission.service'; import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page'; import { ProcessesService } from 'src/app/services/processes.service'; import { ToastService } from 'src/app/services/toast.service'; - @Component({ selector: 'app-searched-document-options', templateUrl: './searched-document-options.page.html', @@ -38,49 +36,12 @@ export class SearchedDocumentOptionsPage implements OnInit { close() { this.modalController.dismiss(); - - let document: FromSearchDocument = this.LoadedDocument - let folder: SearchFolder = this.LoadedDocument - let task; - - if(folder.ApplicationID == 361) { - task = { - serialNumber: folder.DispatchNumber, - taskStartDate: folder.DateDispatch, - isEvent: true, - Folio: folder.Assunto, - FsId: folder.ApplicationID, - workflowInstanceDataFields: { - FsId: folder.ApplicationID, - FolderID: null, - DocId: folder.DispatchNumber, - Subject: folder.Assunto - }, - } - } else if (document.ApplicationID == 8 || document.ApplicationId == 8) { - task = { - taskStartDate: document.DocDate, - isEvent: true, - Folio: document.Assunto, - FsId: document.ApplicationID, - workflowInstanceDataFields: { - FsId: document.ApplicationID || document.ApplicationId, - FolderID: null, - DocId: document.DocID || document.DocId, - Subject: document.Assunto - } - } - } - - - } goBack() { this.modalController.dismiss(); } - async openBookMeetingModal() { const task: ExpedientTaskModalPageNavParamsTask = this.task @@ -91,10 +52,13 @@ export class SearchedDocumentOptionsPage implements OnInit { } else { classs = 'modal modal-desktop showAsideOptions' } + + console.log(this.LoadedDocument, task, ':Cars:') + const modal = await this.modalController.create({ component: DocumentSetUpMeetingPage, componentProps: { - task: task, + task: this.task, document: this.LoadedDocument }, cssClass: classs, @@ -102,7 +66,7 @@ export class SearchedDocumentOptionsPage implements OnInit { }); await modal.present(); modal.onDidDismiss().then( async(res)=>{ - this.modalController.dismiss(); + this.popoverController.dismiss(); }); } @@ -121,17 +85,17 @@ export class SearchedDocumentOptionsPage implements OnInit { component: ExpedientTaskModalPage, componentProps: { taskAction: taskAction, - task: task, + task: this.task, }, cssClass: classs, }); await modal.present(); - modal.onDidDismiss().then( async(res)=>{ - this.modalController.dismiss(); + modal.onDidDismiss().then( async(res) => { + this.popoverController.dismiss(); }); } - async distartExpedientModal(body:any){} + async distartExpedientModal(body:any) {} }