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 9365a90b5..7e9a71c41 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 @@ -133,8 +133,8 @@ export class ExpedienteDetailPage implements OnInit { loader.remove() } } - - + + async openAddNoteModal(actionName:string) { let classs; if( window.innerWidth < 801) { @@ -235,6 +235,8 @@ export class ExpedienteDetailPage implements OnInit { async LoadTaskDetail(serial: string) { this.processes.GetTask(serial).subscribe(res => { + console.log(res); + this.task = { "SerialNumber": res.serialNumber, "Folio": res.workflowInstanceDataFields.Subject, @@ -248,6 +250,8 @@ export class ExpedienteDetailPage implements OnInit { "DocId": res.workflowInstanceDataFields.DocID, "WorkflowName": res.workflowDisplayName, "Status": res.workflowInstanceDataFields.Status, + "DispatchNumber": res.workflowInstanceDataFields.DispatchNumber, + "AttachmentsProcessLastInstanceID": res.workflowInstanceDataFields.AttachmentsProcessLastInstanceID, } this.fulltask = res; @@ -341,20 +345,22 @@ export class ExpedienteDetailPage implements OnInit { if(res){ const data = res.data; this.documents.push(data.selected); - console.log( this.documents); this.documents.forEach(element =>{ - let body = { - "Source": "1", - "SourceId": element.Id, - "SourceTitle": element.Assunto, - "SerialNumber": this.task.SerialNumber, - "ApplicationId": element.ApplicationType + /* let body = { + "InstanceID":null, + "WorkflowDisplayName": this.task.WorkflowName, + "FolderID": this.task.FolderId, + "DispatchNumber": this.task.DispatchNumber, + "AttachmentsProcessLastInstanceID": this.task.AttachmentsProcessLastInstanceID, + "Attachments": [ + ApplicationId: element.ApplicationType, + SourceId: element.Id, + }, } - this.attachmentsService.setEventAttachmentById(body).subscribe((res)=>{ + this.attachmentsService.AddAttachment(body).subscribe((res)=>{ this.getAttachments(this.task.SerialNumber); - }); - }) - + }); */ + }); } }); diff --git a/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts b/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts index ef2b30daa..144c6215b 100644 --- a/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts +++ b/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts @@ -250,6 +250,8 @@ export class ExpedientePrPage implements OnInit { } attachDocument(){ + console.log('HERE'); + this.getDoc(); } @@ -266,21 +268,37 @@ export class ExpedientePrPage implements OnInit { await modal.present(); modal.onDidDismiss().then((res)=>{ if(res){ + console.log(res); + const data = res.data; this.documents.push(data.selected); - console.log( this.documents); - this.documents.forEach(element =>{ + console.log('RES'+ this.documents); + + /* let body = { + "InstanceID":null, + "WorkflowDisplayName": "", + "FolderID": '', + "DispatchNumber": '', + "AttachmentsProcessLastInstanceID": '', + "Attachments": this.documents, + } + this.attachmentsService.AddAttachment(body).subscribe((res)=>{ + this.getAttachments(this.task.SerialNumber); + }); */ + + /* this.documents.forEach(element =>{ let body = { - "Source": "1", - "SourceId": element.Id, - "SourceTitle": element.Assunto, - "SerialNumber": this.task.SerialNumber, - "ApplicationId": element.ApplicationType + "InstanceID":'', + "WorkflowDisplayName": "1", + "FolderID": element.Id, + "DispatchNumber": element.Assunto, + "AttachmentsProcessLastInstanceID": this.task.SerialNumber, + "Attachments": element.ApplicationType } - this.attachmentsService.setEventAttachmentById(body).subscribe((res)=>{ + this.attachmentsService.AddAttachment(body).subscribe((res)=>{ this.getAttachments(this.task.SerialNumber); }); - }) + }) */ } }); diff --git a/src/app/services/attachments.service.ts b/src/app/services/attachments.service.ts index 094688a27..9e66f7906 100644 --- a/src/app/services/attachments.service.ts +++ b/src/app/services/attachments.service.ts @@ -88,4 +88,13 @@ export class AttachmentsService { return this.http.delete(`${geturl}`, options); } + AddAttachment(body: any) { + + let geturl = environment.apiURL + 'Attachments/CreateAttachmentProcess'; + let options = { + headers: this.headers, + } + return this.http.post(`${geturl}`, body, options); + } + }