mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
View documents of event to aprove
This commit is contained in:
@@ -84,17 +84,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="loadedAttachments" class="bottom-content">
|
||||
<div *ngIf="loadedAttachments" class="bottom-content width-100">
|
||||
<ion-list>
|
||||
<h3>Documentos Anexados</h3>
|
||||
<ion-item class="ion-no-margin ion-no-padding">
|
||||
<h5>Documentos Anexados</h5>
|
||||
<ion-item class="ion-no-margin ion-no-padding"
|
||||
*ngFor="let attach of loadedAttachments"
|
||||
(click)="viewDocument(attach.SourceId)">
|
||||
<ion-label>
|
||||
<p class="attach-title-item">Receita por Natureza</p>
|
||||
<p><span class="span-left">{{loadedAttachments.Remetente}}</span><span class="span-right">{{loadedAttachments.CreateDate}}<!-- {{ task.CreateDate | date: 'dd-MM-yy' }} --></span></p>
|
||||
<p class="attach-title-item d-block">{{attach.SourceName}}</p>
|
||||
<p><span class="span-left">{{attach.Stakeholders}}</span><span class="span-right">{{ attach.CreateDate | date: 'dd-MM-yy' }}</span></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="overflow-y-auto">
|
||||
|
||||
@@ -81,7 +81,6 @@
|
||||
}
|
||||
|
||||
.bottom-content{
|
||||
width: 360px;
|
||||
margin: 0 auto;
|
||||
|
||||
.bottom-content h3{
|
||||
|
||||
@@ -7,6 +7,7 @@ import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { EmendMessageModalPage } from 'src/app/pages/agenda/emend-message-modal/emend-message-modal.page';
|
||||
import { EventActionsPopoverPage } from 'src/app/pages/agenda/event-actions-popover/event-actions-popover.page';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -27,6 +28,7 @@ export class ApproveEventComponent implements OnInit {
|
||||
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||
|
||||
@Input() serialNumber:string;
|
||||
@Input() InstanceId:string;
|
||||
@Input() showAside:boolean;
|
||||
|
||||
@Output() approveEventDismiss = new EventEmitter<any>();
|
||||
@@ -40,8 +42,11 @@ export class ApproveEventComponent implements OnInit {
|
||||
private attachmentsService: AttachmentsService,
|
||||
private popoverController: PopoverController,
|
||||
private menu: MenuController,
|
||||
private alertService: AlertService
|
||||
) { }
|
||||
private alertService: AlertService,
|
||||
private iab: InAppBrowser
|
||||
) {
|
||||
// $$$
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getTask();
|
||||
@@ -102,10 +107,20 @@ export class ApproveEventComponent implements OnInit {
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
|
||||
getAttachments(){
|
||||
this.attachmentsService.getAttachmentsBySerial(this.serialNumber).subscribe(res=>{
|
||||
this.loadedAttachments = res;
|
||||
console.log(res);
|
||||
async getAttachments(){
|
||||
console.log('load attachment')
|
||||
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
|
||||
|
||||
console.log('this.loadedAttachments', this.loadedAttachments)
|
||||
}
|
||||
|
||||
viewDocument(sourceId){
|
||||
this.processes.GetDocumentUrl(sourceId, '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();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -139,9 +154,9 @@ export class ApproveEventComponent implements OnInit {
|
||||
if(res.data !== ''){
|
||||
let body = { "serialNumber": serialNumber,
|
||||
"action": "Emendar",
|
||||
"dataFields": {
|
||||
"ReviewerComments": res.data,
|
||||
}
|
||||
"dataFields": {
|
||||
"ReviewerComments": res.data,
|
||||
}
|
||||
}
|
||||
console.log(body);
|
||||
this.processes.PostTaskAction(body);
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<ion-item
|
||||
class="item ion-no-padding width-100"
|
||||
*ngFor="let event of eventsMDGPRList"
|
||||
(click)="openApproveModal(event.serialNumber)">
|
||||
(click)="openApproveModal(event)">
|
||||
<div class="event-mdgpr-{{event.workflowInstanceDataFields.Agenda}} width-100">
|
||||
<div class="approve-event-time">
|
||||
<p>{{event.workflowInstanceDataFields.StartDate | date: 'hh:mm'}}</p>
|
||||
|
||||
@@ -31,7 +31,7 @@ export class EventsToApprovePage implements OnInit {
|
||||
private router: Router,
|
||||
//private navParams: NavParams,
|
||||
) { }
|
||||
S
|
||||
|
||||
ngOnInit() {
|
||||
//this.segment = this.navParams.get('segment');
|
||||
/* console.log(this.navParams.get('md')); */
|
||||
@@ -53,29 +53,46 @@ S
|
||||
|
||||
}
|
||||
|
||||
LoadToApproveEvents(){
|
||||
LoadToApproveEvents() {
|
||||
this.showLoader = true;
|
||||
|
||||
this.processes.GetToApprovedEvents('PR','false').subscribe(res=>{
|
||||
this.showLoader = false;
|
||||
this.eventsPRList = res;
|
||||
|
||||
console.log('this.eventsPRList', this.eventsPRList)
|
||||
});
|
||||
this.processes.GetToApprovedEvents('MDGPR','false').subscribe(res=>{
|
||||
this.showLoader = false;
|
||||
this.eventsMDGPRList = res;
|
||||
|
||||
console.log('this.eventsMDGPRList', this.eventsMDGPRList)
|
||||
});
|
||||
}
|
||||
async openApproveModal(eventSerialNumber){
|
||||
|
||||
async openApproveModal(eventToAprove) {
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
|
||||
let InstanceId;
|
||||
|
||||
console.log(eventToAprove)
|
||||
|
||||
if(!eventToAprove.workflowInstanceDataFields.hasOwnProperty('InstanceId')){
|
||||
InstanceId = ''
|
||||
} else {
|
||||
InstanceId =eventToAprove.workflowInstanceDataFields.InstanceId
|
||||
}
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ApproveEventComponent,
|
||||
componentProps:{
|
||||
serialNumber: eventSerialNumber,
|
||||
serialNumber: eventToAprove.serialNumber,
|
||||
InstanceId: InstanceId ,
|
||||
showAside: true,
|
||||
},
|
||||
cssClass: classs,
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
|
||||
.tab{
|
||||
height: 65px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.active{
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<span>Ínicio</span>
|
||||
</div>
|
||||
|
||||
<div class="tab mr-20 d-flex align-center" (click)="changeRoute('/home/agenda')" [class.active]="locationPathname() == '/home/agenda'">
|
||||
<div class="tab mr-20 d-flex align-center " (click)="changeRoute('/home/agenda')" [class.active]="locationPathname() == '/home/agenda'">
|
||||
<ion-icon class="font-40" src='assets/images/icons-nav-agenda-inactive.svg'></ion-icon>
|
||||
<span>Agenda</span>
|
||||
</div>
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
|
||||
.tab{
|
||||
height: 65px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.active{
|
||||
|
||||
Reference in New Issue
Block a user