mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
add viewer
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() {
|
||||
|
||||
@@ -20,12 +20,8 @@ export class ViewDocumentPage implements OnInit {
|
||||
viewerUrl: string;
|
||||
trustedUrl: any;
|
||||
file: any;
|
||||
|
||||
sourceId: any;
|
||||
applicationId: any;
|
||||
LoadedDocument: any;
|
||||
docId: any
|
||||
folderId: any
|
||||
task: ExpedientTaskModalPageNavParamsTask;
|
||||
Document: any
|
||||
|
||||
@@ -36,18 +32,10 @@ export class ViewDocumentPage implements OnInit {
|
||||
private processes: ProcessesService,
|
||||
) {
|
||||
this.file = this.navParams.get('file');
|
||||
this.sourceId = this.navParams.get('sourceId');
|
||||
this.applicationId = this.navParams.get('applicationId');
|
||||
this.docId = this.navParams.get('docId');
|
||||
this.folderId = this.navParams.get('folderId')
|
||||
this.Document = this.navParams.get('Document')
|
||||
|
||||
// console.log('this.Document', this.Document)
|
||||
// if(this.Document.ApplicationId == 361) {
|
||||
// this.sourceId = this.folderId
|
||||
// } else if(this.Document.ApplicationId == 8) {
|
||||
// this.sourceId = this.Document.DocId || this.Document.SourceId
|
||||
// }
|
||||
this.task = this.navParams.get('task')
|
||||
|
||||
}
|
||||
|
||||
@@ -56,14 +44,11 @@ export class ViewDocumentPage implements OnInit {
|
||||
this.processes.GetViewer(this.docId, this.applicationId).subscribe(res=>{
|
||||
const link: string = res
|
||||
this.trustedUrl = this.sanitazer.bypassSecurityTrustResourceUrl(link);
|
||||
console.log('trustedUrl', this.trustedUrl)
|
||||
})
|
||||
|
||||
//this.getDetails()
|
||||
}
|
||||
|
||||
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
@@ -102,7 +87,7 @@ export class ViewDocumentPage implements OnInit {
|
||||
component: DocumentSetUpMeetingPage,
|
||||
componentProps: {
|
||||
subject: this.task.workflowInstanceDataFields.Subject,
|
||||
document: this.LoadedDocument,
|
||||
document: this.Document,
|
||||
},
|
||||
cssClass: classs,
|
||||
backdropDismiss: false
|
||||
@@ -114,6 +99,7 @@ export class ViewDocumentPage implements OnInit {
|
||||
}
|
||||
|
||||
// efetuar despacho
|
||||
|
||||
async openExpedientActionsModal( taskAction: any) {
|
||||
|
||||
let classs;
|
||||
@@ -127,8 +113,8 @@ export class ViewDocumentPage implements OnInit {
|
||||
componentProps: {
|
||||
taskAction: taskAction,
|
||||
task: this.task,
|
||||
seachDocuments: this.LoadedDocument,
|
||||
aplicationId: this.LoadedDocument.ApplicationId || this.LoadedDocument.ApplicationID
|
||||
seachDocuments: this.Document,
|
||||
aplicationId: this.Document.ApplicationId || this.Document.ApplicationID
|
||||
},
|
||||
cssClass: classs,
|
||||
});
|
||||
|
||||
@@ -113,6 +113,7 @@ export class DespachoPage implements OnInit {
|
||||
|
||||
async LoadTaskDetail(serial: string) {
|
||||
this.processes.GetTask(serial).subscribe( (res: fullTask) => {
|
||||
|
||||
this.task = {
|
||||
"SerialNumber": res.serialNumber,
|
||||
"Folio": res.workflowInstanceDataFields.Subject,
|
||||
@@ -173,7 +174,8 @@ export class DespachoPage implements OnInit {
|
||||
Document,
|
||||
applicationId: Document.ApplicationId,
|
||||
docId: Document.DocId || Document.SourceId,
|
||||
folderId: this.task.FolderId
|
||||
folderId: this.task.FolderId,
|
||||
task: this.fulltask
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
|
||||
@@ -8,12 +8,9 @@ import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { EliminateEventPage } from 'src/app/modals/eliminate-event/eliminate-event.page';
|
||||
import { SearchDocumentDetails, SearchFolderDetails } from 'src/app/models/search-document';
|
||||
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
|
||||
import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting/document-set-up-meeting.page';
|
||||
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||
import { SearchedDocumentOptionsPage } from '../../popover/searched-document-options/searched-document-options.page';
|
||||
import { EventDetailsDocumentsOptionsPage } from '../../popover/event-details-documents-options/event-details-documents-options.page';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
|
||||
@Component({
|
||||
@@ -250,7 +247,7 @@ export class ViewEventPage implements OnInit {
|
||||
workflowInstanceDataFields: {
|
||||
FolderID: '',
|
||||
Subject: selectedDoc.SourceName,
|
||||
SourceSecFsID: selectedDoc.ApplicationId,
|
||||
SourceSecFsID: selectedDoc.ApplicationId || selectedDoc.ApplicationID,
|
||||
SourceType: 'DOC',
|
||||
SourceID: selectedDoc.SourceId,
|
||||
DispatchNumber: ''
|
||||
@@ -259,21 +256,23 @@ export class ViewEventPage implements OnInit {
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
trustedUrl: '',
|
||||
file: {
|
||||
title: this.task.workflowInstanceDataFields.Subject,
|
||||
url: '',
|
||||
title_link: '',
|
||||
},
|
||||
applicationId: this.task.workflowInstanceDataFields.SourceSecFsID,
|
||||
docId: selectedDoc.SourceId,
|
||||
folderId: ''
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
trustedUrl: '',
|
||||
file: {
|
||||
title: this.task.workflowInstanceDataFields.Subject,
|
||||
url: '',
|
||||
title_link: '',
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
Document: this.loadedEvent.Attachments[ this.dicIndex],
|
||||
applicationId: this.task.workflowInstanceDataFields.SourceSecFsID,
|
||||
docId: selectedDoc.SourceId,
|
||||
folderId: '',
|
||||
task: this.task
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user