diff --git a/src/app/modals/document-detail/document-detail.page.html b/src/app/modals/document-detail/document-detail.page.html index 57c6aed55..3dc1ed785 100644 --- a/src/app/modals/document-detail/document-detail.page.html +++ b/src/app/modals/document-detail/document-detail.page.html @@ -33,7 +33,7 @@ -
+
@@ -47,7 +47,7 @@ {{LoadedDocument.Subject}}
- +
diff --git a/src/app/modals/document-detail/document-detail.page.ts b/src/app/modals/document-detail/document-detail.page.ts index cf43adca6..3787d7797 100644 --- a/src/app/modals/document-detail/document-detail.page.ts +++ b/src/app/modals/document-detail/document-detail.page.ts @@ -33,22 +33,23 @@ export class DocumentDetailPage implements OnInit { } ngOnInit() { - console.log(this.docId); - console.log(this.applicationId); + this.LoadDocumentDetails(); + } - async LoadDocumentDetails(){ - this.processes.GetDocumentDetails(this.docId, '').subscribe(res=>{ - console.log(res); - this.LoadedDocument = res[0]; + async LoadDocumentDetails() { + this.processes.GetDocumentDetails(this.docId, this.applicationId).subscribe(res=>{ + this.LoadedDocument = res; - let thedate = new Date(this.LoadedDocument.DateDocument); + this.LoadedDocument.Subject = this.LoadedDocument.Assunto + + let thedate = new Date(this.LoadedDocument.DateDispatch); this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]); }); } - viewDocument(){ + viewDocument() { this.processes.GetDocumentUrl(this.docId, '8').subscribe(res=>{ console.log(res); const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); diff --git a/src/app/models/despacho.model.ts b/src/app/models/despacho.model.ts index 50366f37f..c54241959 100644 --- a/src/app/models/despacho.model.ts +++ b/src/app/models/despacho.model.ts @@ -9,4 +9,10 @@ export class Despacho{ UserEmail: string; UsersSelected: Participant[]; DispatchFolder: Folder; + AttachmentList?: { + ProcessInstanceID: string, + "Source": string, + "UserId": string, + "Attachment": string + }[] } \ No newline at end of file diff --git a/src/app/pages/agenda/edit-event/edit-event.page.ts b/src/app/pages/agenda/edit-event/edit-event.page.ts index 4348e5135..5a20013f9 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.ts +++ b/src/app/pages/agenda/edit-event/edit-event.page.ts @@ -190,7 +190,8 @@ export class EditEventPage implements OnInit { component: SearchPage, cssClass: 'modal-width-100-width-background modal', componentProps: { - type: 'AccoesPresidenciais & ArquivoDespachoElect' + type: 'AccoesPresidenciais & ArquivoDespachoElect', + select: true } }); await modal.present(); diff --git a/src/app/pages/agenda/new-event/new-event.page.ts b/src/app/pages/agenda/new-event/new-event.page.ts index e2c3effb9..b7e0061a6 100644 --- a/src/app/pages/agenda/new-event/new-event.page.ts +++ b/src/app/pages/agenda/new-event/new-event.page.ts @@ -111,10 +111,10 @@ export class NewEventPage implements OnInit { close(){ this.modalController.dismiss(); } - async save(){ -/* console.log(this.postEvent); + async save() { + /* console.log(this.postEvent); console.log(this.profile); */ - + if(this.documents.length >= 0) { this.postEvent.HasAttachments = true; } @@ -207,7 +207,8 @@ export class NewEventPage implements OnInit { cssClass: 'modal-width-100-width-background modal', componentProps: { type: 'AccoesPresidenciais & ArquivoDespachoElect', - showSearchInput: true + showSearchInput: true, + select: true } }); await modal.present(); diff --git a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html index b4e6af69d..3e75c8c3a 100644 --- a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html +++ b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html @@ -166,19 +166,23 @@ -
- - Documentos Anexados - +
- + -

{{attachment.Description}}

-

{{attachment.Stakeholders}} {{ attachment.CreateDate | date: 'dd/MM/yyyy' }}

+

+ {{document.Assunto}} + {{document.appName}} + + + +

+

{{document.EntidadeOrganicaNome}} {{document.Data | date: 'dd-MM-yy'}}

+
diff --git a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.scss b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.scss index c2d07de8b..ed519ce96 100644 --- a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.scss +++ b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.scss @@ -167,4 +167,43 @@ text-align: right; float: right; font-size: 13px; - } \ No newline at end of file + } + + + + + + + .app-name{ + background: #42b9f2; + border-radius: 18px; + text-align: center; + display: flex; + align-items: center; + padding: 0px 5px; + color: white; + font-size: 9pt; + font-weight: 500; + height: 19px; + -webkit-border-radius: 18px; + -moz-border-radius: 18px; + -ms-border-radius: 18px; + -o-border-radius: 18px; + } + + +.close-button { + display: none; +} + + +.list:hover { + + .app-name { + display: none; + } + + .close-button { + display: block !important; + } +} \ No newline at end of file diff --git a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts index 7c87e7a1f..e8b0c9246 100644 --- a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts +++ b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts @@ -11,6 +11,7 @@ import { EventsService } from 'src/app/services/events.service'; import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page'; import { AttachmentsService } from 'src/app/services/attachments.service'; import { SearchPage } from 'src/app/pages/search/search.page'; +import { SearchDocument } from 'src/app/models/search-document'; @Component({ selector: 'app-book-meeting-modal', @@ -27,6 +28,7 @@ export class BookMeetingModalPage implements OnInit { taskDocId:string; loadedAttachments:any; + documents:SearchDocument[] = []; adding: "intervenient" | "CC" = "intervenient"; @@ -234,25 +236,19 @@ export class BookMeetingModalPage implements OnInit { }); await modal.present(); modal.onDidDismiss().then((res)=> { - const data = res.data; - //data.selected - const DocumentToSave = { - SourceTitle: data.selected.Assunto, - ParentId: 'this.postEvent.EventId', - Source: '1', - SourceId: data.selected.Id, - ApplicationId: data.selected.ApplicationType.toString(), - Id: '0', - Link: '', - SerialNumber: '', - }; - - this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe( ()=>{ - this.getAttachments(); - }); + if(res){ + const data = res.data; + this.documents.push(data.selected); + } }); } + removeAttachment(index: number){ + + this.documents = this.documents.filter( (e, i) => index != i); + + } + validateFormInputs(){ let formLocation = this.postData.Location.trim(); diff --git a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html index 1c13dace4..393596dbd 100644 --- a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html +++ b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html @@ -100,19 +100,23 @@ -
- - Documentos Anexados - +
- + -

{{attachment.Description}}

-

{{attachment.Stakeholders}} {{ attachment.CreateDate | date: 'dd/MM/yyyy' }}

+

+ {{document.Assunto}} + {{document.appName}} + + + +

+

{{document.EntidadeOrganicaNome}} {{document.Data | date: 'dd-MM-yy'}}

+
diff --git a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.scss b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.scss index 3e7127273..0c23c34ab 100644 --- a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.scss +++ b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.scss @@ -148,4 +148,78 @@ text-align: right; float: right; font-size: 13px; +} + + + + +.app-name{ + background: #42b9f2; + border-radius: 18px; + text-align: center; + display: flex; + align-items: center; + padding: 0px 5px; + color: white; + font-size: 9pt; + font-weight: 500; + height: 19px; + -webkit-border-radius: 18px; + -moz-border-radius: 18px; + -ms-border-radius: 18px; + -o-border-radius: 18px; +} + + +.close-button { +display: none; +} + + +.list:hover { + +.app-name { + display: none; +} + +.close-button { + display: block !important; +} +} + + + + +.app-name{ + background: #42b9f2; + border-radius: 18px; + text-align: center; + display: flex; + align-items: center; + padding: 0px 5px; + color: white; + font-size: 9pt; + font-weight: 500; + height: 19px; + -webkit-border-radius: 18px; + -moz-border-radius: 18px; + -ms-border-radius: 18px; + -o-border-radius: 18px; +} + + +.close-button { +display: none; +} + + +.list:hover { + +.app-name { + display: none; +} + +.close-button { + display: block !important; +} } \ No newline at end of file diff --git a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts index 6907f6483..6f6adeaad 100644 --- a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts +++ b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts @@ -15,6 +15,9 @@ import { AttachmentsService } from 'src/app/services/attachments.service'; import { ExpedienteDetailPage } from '../expediente-detail/expediente-detail.page'; import { AlertService } from 'src/app/services/alert.service'; import { SearchPage } from 'src/app/pages/search/search.page'; +import { SearchDocument } from 'src/app/models/search-document'; +import { EventAttachment } from 'src/app/models/attachment.model'; +import { User } from 'src/app/models/user.model'; @Component({ selector: 'app-expedient-task-modal', @@ -37,7 +40,10 @@ export class ExpedientTaskModalPage implements OnInit { taskDate: Date; taskDescription: string; user: string; + loadedAttachments:any; + documents:SearchDocument[] = []; + subjectTypes:any; postData: Despacho; @@ -56,6 +62,8 @@ export class ExpedientTaskModalPage implements OnInit { taskResult: any = {} + loggeduser: User; + constructor( private modalController: ModalController, private router:Router, @@ -63,7 +71,12 @@ export class ExpedientTaskModalPage implements OnInit { private attachmentsService: AttachmentsService, private navParams: NavParams, private alertController: AlertService, - private authService: AuthService) { + private authService: AuthService, + private userAuth: AuthService) { + + + this.loggeduser = userAuth.ValidatedUser; + this.user = environment.defaultuser +'@'+ environment.domain; this.task = this.navParams.get('task'); @@ -144,6 +157,7 @@ export class ExpedientTaskModalPage implements OnInit { } let attendees = this.taskParticipants.concat(this.taskParticipantsCc); + attendees = attendees.map(function(val) { return { UserEmail: val.EmailAddress, @@ -151,6 +165,16 @@ export class ExpedientTaskModalPage implements OnInit { }; }) + + const DocumentToSave = this.documents.map((e) => { + return { + ProcessInstanceID: '', + "Source": "webTRIX", + "UserId": this.loggeduser.UserId.toString(), + "Attachment": `${e.ApplicationType}@DOC@${e.Id}` + }; + }); + if(this.taskParticipants.length > 0) { switch (this.taskType) { case '0': @@ -162,6 +186,7 @@ export class ExpedientTaskModalPage implements OnInit { SubjectTypeId: this.postData.SubjectTypeId, UsersSelected: attendees, DispatchFolder: this.dispatchFolder, + AttachmentList: DocumentToSave } console.log('this.postData', this.postData, this.taskType); this.taskResult = await this.processes.postDespatcho(this.postData); @@ -175,6 +200,7 @@ export class ExpedientTaskModalPage implements OnInit { SubjectTypeId: this.postData.SubjectTypeId, UsersSelected: attendees, DispatchFolder: this.dispatchFolder, + AttachmentList: DocumentToSave } console.log(this.postData); this.taskResult = await this.processes.postParecer(this.postData); @@ -188,6 +214,7 @@ export class ExpedientTaskModalPage implements OnInit { SubjectTypeId: this.postData.SubjectTypeId, UsersSelected: attendees, DispatchFolder: this.dispatchFolder, + AttachmentList: DocumentToSave } console.log(this.postData); this.taskResult = await this.processes.postDeferimento(this.postData); @@ -378,24 +405,17 @@ export class ExpedientTaskModalPage implements OnInit { }); await modal.present(); modal.onDidDismiss().then((res)=>{ - const data = res.data; - //data.selected - const DocumentToSave = { - SourceTitle: data.selected.Assunto, - ParentId: 'this.postEvent.EventId', // instance - Source: '1', - SourceId: data.selected.Id, - ApplicationId: data.selected.ApplicationType.toString(), - Id: '0', - Link: '', - SerialNumber: '', - }; - - this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe( ()=>{ - this.getAttachments(); - }); + if(res){ + const data = res.data; + this.documents.push(data.selected); + } }); } + removeAttachment(index: number){ + + this.documents = this.documents.filter( (e, i) => index != i); + + } } \ No newline at end of file diff --git a/src/app/pages/search/search.page.html b/src/app/pages/search/search.page.html index 6670418cd..dd5b4d003 100644 --- a/src/app/pages/search/search.page.html +++ b/src/app/pages/search/search.page.html @@ -141,7 +141,7 @@