mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
74 lines
2.2 KiB
TypeScript
74 lines
2.2 KiB
TypeScript
import { Component, OnInit } from '@angular/core';
|
|
import { MenuController, ModalController, NavParams } from '@ionic/angular';
|
|
import { AlertService } from 'src/app/services/alert.service';
|
|
import { ProcessesService } from 'src/app/services/processes.service';
|
|
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
|
|
|
@Component({
|
|
selector: 'app-document-detail',
|
|
templateUrl: './document-detail.page.html',
|
|
styleUrls: ['./document-detail.page.scss'],
|
|
})
|
|
export class DocumentDetailPage implements OnInit {
|
|
|
|
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
|
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
|
|
|
customDate:any;
|
|
|
|
docId: string;
|
|
applicationId:string;
|
|
LoadedDocument:any = null;
|
|
|
|
constructor(
|
|
private navParams: NavParams,
|
|
private modalController: ModalController,
|
|
private alertService: AlertService,
|
|
private processes: ProcessesService,
|
|
private menu: MenuController,
|
|
private iab: InAppBrowser,
|
|
) {
|
|
this.docId = this.navParams.get('docId');
|
|
this.applicationId = this.navParams.get('applicationId');
|
|
}
|
|
|
|
ngOnInit() {
|
|
|
|
this.LoadDocumentDetails();
|
|
|
|
}
|
|
|
|
async LoadDocumentDetails() {
|
|
this.processes.GetDocumentDetails(this.docId, this.applicationId).subscribe(res=>{
|
|
this.LoadedDocument = res;
|
|
|
|
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() {
|
|
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();
|
|
|
|
});
|
|
}
|
|
|
|
openMenu() {
|
|
this.menu.open();
|
|
this.modalController.dismiss();
|
|
}
|
|
close(){
|
|
this.modalController.dismiss();
|
|
}
|
|
notImplemented(){
|
|
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
|
|
}
|
|
|
|
}
|