mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
view document change
This commit is contained in:
@@ -58,11 +58,10 @@
|
||||
</ion-label>
|
||||
|
||||
<ion-label
|
||||
(click)="viewDocument()"
|
||||
*ngIf="LoadedDocument.ApplicationId == 361 || LoadedDocument.ApplicationID == 361"
|
||||
>
|
||||
<div *ngFor="let Document of LoadedDocument.Documents">
|
||||
<div class="attach-title-item">
|
||||
<div *ngFor="let Document of LoadedDocument.Documents; let i = index">
|
||||
<div class="attach-title-item" (click)="docIndex(i);viewDocumentModal()">
|
||||
{{Document.Assunto}}
|
||||
</div>
|
||||
<div *ngIf="Document.Sender" class="d-flex justify-between" style="justify-content: space-between">
|
||||
@@ -76,7 +75,6 @@
|
||||
</ion-list>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="LoadedDocument" class="aside-right flex-column height-100">
|
||||
<div class="buttons">
|
||||
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||
|
||||
@@ -10,6 +10,7 @@ import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTas
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { SearchedDocumentOptionsPage } from 'src/app/shared/popover/searched-document-options/searched-document-options.page';
|
||||
import { Location } from '@angular/common';
|
||||
import { ViewDocumentPage } from '../view-document/view-document.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-document-detail',
|
||||
@@ -31,6 +32,8 @@ export class DocumentDetailPage implements OnInit {
|
||||
document: SearchDocumentDetails
|
||||
|
||||
task: ExpedientTaskModalPageNavParamsTask;
|
||||
DocumentTask: ExpedientTaskModalPageNavParamsTask;
|
||||
dicIndex = 0;
|
||||
|
||||
constructor(
|
||||
private navParams: NavParams,
|
||||
@@ -69,51 +72,121 @@ export class DocumentDetailPage implements OnInit {
|
||||
let folder: SearchFolderDetails = this.LoadedDocument
|
||||
|
||||
if(this.LoadedDocument.ApplicationID == 361 || this.LoadedDocument.ApplicationId == 361) {
|
||||
task = {
|
||||
serialNumber: folder.DispatchNumber,
|
||||
taskStartDate: folder.DateDispatch,
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FolderID: folder['FolderId'] || folder['FolderID'] || folder.folderId,
|
||||
Subject: folder.Assunto,
|
||||
SourceSecFsID: folder.ApplicationID || folder['ApplicationId'],
|
||||
SourceType: 'FOLDER',
|
||||
SourceID: folder.folderId,
|
||||
DispatchNumber: folder.DispatchNumber
|
||||
},
|
||||
}
|
||||
// task = {
|
||||
// serialNumber: folder.DispatchNumber,
|
||||
// taskStartDate: folder.DateDispatch,
|
||||
// isEvent: true,
|
||||
// workflowInstanceDataFields: {
|
||||
// FolderID: folder['FolderId'] || folder['FolderID'] || folder.folderId,
|
||||
// Subject: folder.Assunto,
|
||||
// SourceSecFsID: folder.ApplicationID || folder['ApplicationId'],
|
||||
// SourceType: 'FOLDER',
|
||||
// SourceID: folder.folderId,
|
||||
// DispatchNumber: folder.DispatchNumber
|
||||
// },
|
||||
// }
|
||||
} else if (document.ApplicationID == 8 || document.ApplicationId == 8) {
|
||||
task = {
|
||||
serialNumber: document.DocId,
|
||||
taskStartDate: document.DocDate,
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FolderID: null,
|
||||
Subject: document.Assunto,
|
||||
DispatchNumber: null,
|
||||
SourceSecFsID: document.ApplicationID || document.ApplicationId,
|
||||
SourceType: 'DOC',
|
||||
SourceID: document.DocId,
|
||||
}
|
||||
}
|
||||
// task = {
|
||||
// serialNumber: document.DocId,
|
||||
// taskStartDate: document.DocDate,
|
||||
// isEvent: true,
|
||||
// workflowInstanceDataFields: {
|
||||
// FolderID: null,
|
||||
// Subject: document.Assunto,
|
||||
// DispatchNumber: null,
|
||||
// SourceSecFsID: document.ApplicationID || document.folderId,
|
||||
// SourceType: 'DOC',
|
||||
// SourceID: document.DocId,
|
||||
// }
|
||||
// }
|
||||
} else {
|
||||
console.log('unexpected ApplicationID')
|
||||
}
|
||||
|
||||
this.task = task
|
||||
console.log('this.task = task', this.task)
|
||||
|
||||
task = {
|
||||
serialNumber: '',
|
||||
taskStartDate: '',
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FolderID: '',
|
||||
Subject: this.LoadedDocument.SourceName || this.LoadedDocument.Assunto,
|
||||
SourceSecFsID: this.LoadedDocument.ApplicationId || this.LoadedDocument.ApplicationID,
|
||||
SourceType: 'DOC',
|
||||
SourceID: this.LoadedDocument.DocId || this.LoadedDocument.SourceId || this.LoadedDocument['folderId'],
|
||||
DispatchNumber: ''
|
||||
}
|
||||
}
|
||||
|
||||
this.DocumentTask = Object.assign(task, res)
|
||||
console.log('this.DocumentTask = DocumentTask', this.DocumentTask)
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
viewDocument() {
|
||||
this.processes.GetDocumentUrl(this.docId, '8').subscribe(res=>{
|
||||
console.log(res);
|
||||
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
||||
const browser = this.iab.create(url,"_blank");
|
||||
browser.show();
|
||||
async viewDocument() {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
trustedUrl: '',
|
||||
file: {
|
||||
title: this.LoadedDocument.Assunto,
|
||||
url: '',
|
||||
title_link: '',
|
||||
},
|
||||
Document: this.LoadedDocument.Documents,
|
||||
applicationId: this.DocumentTask.workflowInstanceDataFields.SourceSecFsID,
|
||||
docId: this.DocumentTask.workflowInstanceDataFields.SourceID,
|
||||
task: this.DocumentTask
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
}
|
||||
|
||||
docIndex(index: number) {
|
||||
this.dicIndex = index;
|
||||
}
|
||||
|
||||
async viewDocumentModal() {
|
||||
|
||||
const selectedDoc = this.LoadedDocument.Documents[ this.dicIndex]
|
||||
|
||||
this.task = {
|
||||
serialNumber: '',
|
||||
taskStartDate: '',
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FolderID: '',
|
||||
Subject: selectedDoc.SourceName || selectedDoc.Assunto,
|
||||
SourceSecFsID: selectedDoc.ApplicationId || selectedDoc.ApplicationID,
|
||||
SourceType: 'DOC',
|
||||
SourceID: selectedDoc.DocId || selectedDoc.SourceId,
|
||||
DispatchNumber: ''
|
||||
}
|
||||
}
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
trustedUrl: '',
|
||||
file: {
|
||||
title: this.task.workflowInstanceDataFields.Subject,
|
||||
url: '',
|
||||
title_link: '',
|
||||
},
|
||||
Document: this.LoadedDocument.Documents[ this.dicIndex],
|
||||
applicationId: this.task.workflowInstanceDataFields.SourceSecFsID,
|
||||
docId: this.task.workflowInstanceDataFields.SourceID ,
|
||||
folderId: '',
|
||||
task: this.task
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
openMenu() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { Event } from 'src/app/models/event.model'
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { SearchDocumentDetails, SearchFolderDetails, SearchFolderDetailsDocuments, SearchList } from 'src/app/models/search-document';
|
||||
import { SearchDocumentDetails, SearchFolderDetails, SearchList } from 'src/app/models/search-document';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
@@ -14,7 +14,6 @@ import * as _moment from 'moment';
|
||||
import * as _rollupMoment from 'moment';
|
||||
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||
import { DocumentService } from 'src/app/Rules/document.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { EventService } from 'src/app/services/rules/event.service';
|
||||
import { EventPipe } from 'src/app/pipes/event.pipe';
|
||||
@@ -62,7 +61,6 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
EventRecurrenceType = '-1'
|
||||
showLoader = false
|
||||
|
||||
|
||||
@ViewChild('picker') picker: any;
|
||||
@ViewChild('fim') fim: any;
|
||||
@ViewChild('inicio') inicio: any;
|
||||
@@ -97,34 +95,30 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
private navParams: NavParams,
|
||||
authService: AuthService,
|
||||
private toastService: ToastService,
|
||||
private documentService: DocumentService,
|
||||
private calendarService: EventsService,
|
||||
private eventService: EventService
|
||||
) {
|
||||
) {
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
this.document = this.navParams.get('document')
|
||||
this.subject = this.navParams.get('subject')
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
this.document = this.navParams.get('document')
|
||||
this.subject = this.navParams.get('subject')
|
||||
this.postData = new Event();
|
||||
this.postData.Body ={ BodyType : "1", Text : ""};
|
||||
|
||||
this.postData = new Event();
|
||||
this.postData.Body ={ BodyType : "1", Text : ""};
|
||||
this.postData.Subject = this.subject
|
||||
this.postData.CalendarName = "Oficial";
|
||||
|
||||
this.postData.Subject = this.subject
|
||||
this.postData.CalendarName = "Oficial";
|
||||
|
||||
this.postData.Category = 'Reunião'
|
||||
this.postData.Category = 'Reunião'
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.adding = "intervenient";
|
||||
this.setDefaultTime()
|
||||
this.getRecurrenceTypes();
|
||||
console.log(this.document);
|
||||
|
||||
}
|
||||
|
||||
getRecurrenceTypes() {
|
||||
this.calendarService.getRecurrenceTypes().subscribe(res=>{
|
||||
this.calendarService.getRecurrenceTypes().subscribe( res=> {
|
||||
this.recurringTypes = res;
|
||||
});
|
||||
}
|
||||
@@ -178,43 +172,12 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
|
||||
let Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
|
||||
var Attachments: addAttachment[] = []
|
||||
let folder: SearchFolderDetails = this.document
|
||||
let document: SearchDocumentDetails = this.document
|
||||
|
||||
/* if(folder.Documents) {
|
||||
this.document.Documents.forEach( (_folder: SearchFolderDetailsDocuments) => {
|
||||
Attachments.push({
|
||||
ApplicationId: 361,
|
||||
Source: 1,
|
||||
SourceId: _folder['docID'] || _folder['docId'] || _folder.DocId,
|
||||
SourceTitle: _folder.Assunto,
|
||||
})
|
||||
});
|
||||
} else {
|
||||
Attachments.push({
|
||||
ApplicationId: 8,
|
||||
Source: 1,
|
||||
SourceId: document['docID'] || document['docId'] || document.DocId,
|
||||
SourceTitle: document.Assunto
|
||||
})
|
||||
}
|
||||
|
||||
this.attachments.forEach((e)=> {
|
||||
Attachments.push({
|
||||
ApplicationId: e.ApplicationType,
|
||||
Source: 1,
|
||||
SourceId: e.Id,
|
||||
SourceTitle: e.Assunto
|
||||
})
|
||||
}) */
|
||||
|
||||
if(this.document.Documents){
|
||||
this.document.Documents.forEach((e)=> {
|
||||
this.docs.push({
|
||||
ApplicationId: e.ApplicationId || e.ApplicationType,
|
||||
Source: 1,
|
||||
SourceId: e.DocId || e.docID || e.docId,
|
||||
SourceId: e.DocId || e.docID || e.docId || e.SourceId,
|
||||
SourceName: e.Assunto
|
||||
})
|
||||
})
|
||||
@@ -223,13 +186,11 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
this.docs.push({
|
||||
ApplicationId: this.document.ApplicationId || this.document.ApplicationType,
|
||||
Source: 1,
|
||||
SourceId: this.document.DocId || this.document.docID || this.document.docId,
|
||||
SourceId: this.document.DocId || this.document.docID || this.document.docId || this.document.SourceId,
|
||||
SourceName: this.document.Assunto
|
||||
})
|
||||
}
|
||||
|
||||
console.log(this.docs);
|
||||
|
||||
let postEvent = {
|
||||
EventId: '',
|
||||
Subject: this.postData.Subject,
|
||||
@@ -255,28 +216,17 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
Attachments: this.docs,
|
||||
}
|
||||
|
||||
console.log(postEvent);
|
||||
|
||||
|
||||
const laoder = this.toastService.loading()
|
||||
|
||||
this.eventService.create({ body: postEvent, calendar: this.postData.CalendarName }).subscribe(async (respose) => {
|
||||
const res: any = respose;
|
||||
const eventId: string = res
|
||||
|
||||
/* const DocumentToSave = this.attachments.map((e) => {
|
||||
return this.eventPipe.AttactSearchResult(e, eventId, {})
|
||||
});
|
||||
|
||||
await DocumentToSave.forEach(async (attachments, i) => {
|
||||
await this.eventService.addAttachment(attachments).toPromise();
|
||||
}); */
|
||||
|
||||
this.toastService.successMessage('Reunião criada')
|
||||
laoder.remove()
|
||||
this.toastService.successMessage('Reunião criada')
|
||||
this.modalController.dismiss()
|
||||
},(error) => {
|
||||
}, (error) => {
|
||||
laoder.remove()
|
||||
this.toastService.badRequest('Não foi possível marcar a reunião');
|
||||
}, ()=>{
|
||||
laoder.remove()
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<ion-toolbar class="d-flex">
|
||||
<div class="d-flex align-items-center px-20 pt-20 font-25">
|
||||
<div class="left cursor-pointer" (click)="close()">
|
||||
<!-- <ion-icon class="font-35" src="assets/images/icons-arrow-arrow-left.svg"></ion-icon> -->
|
||||
<fa-icon icon="chevron-left" class="menu-icon"></fa-icon>
|
||||
</div>
|
||||
|
||||
@@ -10,7 +9,7 @@
|
||||
{{file.title}}
|
||||
</div>
|
||||
|
||||
<div class="right cursor-pointer">
|
||||
<div class="right cursor-pointer" (click)="openOptions()">
|
||||
<fa-icon icon="ellipsis-v" class="menu-icon"></fa-icon>
|
||||
</div>
|
||||
|
||||
@@ -19,7 +18,12 @@
|
||||
</ion-header>
|
||||
|
||||
<ion-content class="pt-10 height-100">
|
||||
<div class="height-100">
|
||||
<div class="height-100" *ngIf="trustedUrl">
|
||||
<iframe id="iframe" [src]="trustedUrl" height="100%" width="100%" title="Iframe Example"></iframe>
|
||||
</div>
|
||||
|
||||
<div *ngIf="!trustedUrl" class=" height-100 width-100 d-flex align-center justify-center">
|
||||
<img src="/assets/images/Blocks-loader.gif" />
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
|
||||
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
|
||||
import { SearchDocumentDetails, SearchFolderDetails } from 'src/app/models/search-document';
|
||||
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 { EventDetailsDocumentsOptionsPage } from 'src/app/shared/popover/event-details-documents-options/event-details-documents-options.page';
|
||||
import { DocumentSetUpMeetingPage } from '../document-set-up-meeting/document-set-up-meeting.page';
|
||||
8
|
||||
@Component({
|
||||
selector: 'app-view-document',
|
||||
templateUrl: './view-document.page.html',
|
||||
@@ -13,28 +19,108 @@ export class ViewDocumentPage implements OnInit {
|
||||
a:string = "https://equilibrium.dyndns.info/FileShare/pdfjs/web/viewer.html?file=";
|
||||
viewerUrl: string;
|
||||
trustedUrl: any;
|
||||
file:any;
|
||||
file: any;
|
||||
applicationId: any;
|
||||
docId: any
|
||||
task: ExpedientTaskModalPageNavParamsTask;
|
||||
Document: any
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
private sanitazer: DomSanitizer,
|
||||
private processes: ProcessesService,
|
||||
) {
|
||||
|
||||
this.file = this.navParams.get('file');
|
||||
this.url = this.file.title_link;
|
||||
console.log(this.url);
|
||||
this.applicationId = this.navParams.get('applicationId');
|
||||
this.docId = this.navParams.get('docId');
|
||||
this.Document = this.navParams.get('Document')
|
||||
this.task = this.navParams.get('task')
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.viewerUrl = this.url.replace("webTRIX.Viewer.Branch1/pdfjs/web/viewpdf.aspx?file=/webTRIX.Viewer.Branch1/arq/637690403731947760.pdf&i", "FileShare/pdfjs/web/viewer.html?file");
|
||||
this.trustedUrl = this.sanitazer.bypassSecurityTrustResourceUrl(this.viewerUrl);
|
||||
console.log(this.trustedUrl);
|
||||
|
||||
this.processes.GetViewer(this.docId, this.applicationId).subscribe(res=>{
|
||||
const link: string = res
|
||||
this.trustedUrl = this.sanitazer.bypassSecurityTrustResourceUrl(link);
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
async openOptions() {
|
||||
const modal = await this.modalController.create({
|
||||
component: EventDetailsDocumentsOptionsPage,
|
||||
cssClass: 'model aside-modal search-submodal',
|
||||
componentProps: {
|
||||
fulltask: this.task,
|
||||
task: this.task
|
||||
}
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
if(res.data.component == 'openBookMeetingModal') {
|
||||
this.openBookMeetingModal()
|
||||
} else if(res.data.component == 'openExpedientActionsModal') {
|
||||
this.openExpedientActionsModal(res.data.taskAction)
|
||||
} else {
|
||||
console.log('component not found')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async openBookMeetingModal() {
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth < 701) {
|
||||
classs = 'book-meeting-modal modal modal-desktop'
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
component: DocumentSetUpMeetingPage,
|
||||
componentProps: {
|
||||
subject: this.task.workflowInstanceDataFields.Subject,
|
||||
document: this.Document,
|
||||
},
|
||||
cssClass: classs,
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
//this.location.back();
|
||||
});
|
||||
}
|
||||
|
||||
// efetuar despacho
|
||||
|
||||
async openExpedientActionsModal( taskAction: any) {
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth < 701) {
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
component: ExpedientTaskModalPage,
|
||||
componentProps: {
|
||||
taskAction: taskAction,
|
||||
task: this.task,
|
||||
seachDocuments: this.Document,
|
||||
aplicationId: this.Document.ApplicationId || this.Document.ApplicationID
|
||||
},
|
||||
cssClass: classs,
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then( async(res)=>{});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user