This commit is contained in:
tiago.kayaya
2021-04-28 10:40:41 +01:00
parent 50f51eeaca
commit 91163070ad
5 changed files with 45 additions and 43 deletions
@@ -91,45 +91,18 @@
<div class="bottom-content width-100">
<ion-list>
<h5>Documentos Anexados</h5>
<ion-item class="ion-no-margin ion-no-padding">
<ion-item *ngFor="let attachment of attachments" class="ion-no-margin ion-no-padding">
<ion-label
(click)="viewDocument()">
<p class="attach-title-item">{{ task.Folio }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p><span class="span-left">{{task.Remetente}}</span><span class="span-right">{{ task.CreateDate | date: 'dd/MM/yy' }}</span></p>
(click)="viewDocument(attachment.DocId)">
<p *ngIf="attachment.Assunto" class="attach-title-item">{{ attachment.Assunto }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p *ngIf="!attachment.Assunto" class="attach-title-item">{{ attachment.DocNumber }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p><span class="span-left">{{attachment.Sender}}</span><span class="span-right">{{ attachment.DocDate | date: 'dd/MM/yy' }}</span></p>
</ion-label>
</ion-item>
</ion-list>
</div>
<div *ngIf="eventsList">
<h3 class="h3-event-title">Eventos Associados</h3>
<ion-list>
<div *ngIf="eventsList">
<ion-item-sliding>
<ion-item
class="Rectangle" lines="none"
*ngFor="let event of eventsList"
(click)="viewEventDetail(event.EventId)"
>
<!-- [routerLink]="['/home/events', event.EventId, 'events']" -->
<div class="content-{{profile}}-{{event.CalendarName}}">
<div class="approve-event-time">
<p>{{event.StartDate | date: 'hh:mm'}}</p>
<p>{{event.EndDate | date: 'hh:mm'}}</p>
</div>
<div class="approve-event-detail">
<p *ngIf="event.StartDate != event.EndDate">{{event.StartDate | date: 'd/M/yy' }} - {{ event.EndDate | date: 'dd/mm/yy'}} | {{event.Location}}</p>
<p *ngIf="event.StartDate == event.EndDate">{{event.StartDate | date: 'd/M/yy' }} | {{event.Location}}</p>
<h3>{{event.Subject}}</h3>
</div>
</div>
</ion-item>
</ion-item-sliding>
</div>
</ion-list>
</div>
</div>
<div *ngIf="task" class="aside-right flex-column height-100">
<div class="buttons">
<button (click)="executado()" class="btn-ok" shape="round" >Executado</button>
@@ -27,6 +27,7 @@ export class DespachoPage implements OnInit {
customDate:any;
task: any;
attachments:any;
fulltask: any;
eventsList: Event[];
serialnumber: string;
@@ -37,7 +38,7 @@ export class DespachoPage implements OnInit {
constructor(private activateRoute: ActivatedRoute,
private processes: ProcessesService,
private iab: InAppBrowser,
private attachments: AttachmentsService,
private attachmentsService: AttachmentsService,
private events: EventsService,
private menu: MenuController,
private router: Router,
@@ -101,14 +102,23 @@ export class DespachoPage implements OnInit {
});
console.log(users);
})
});
this.getDocumentDetails(this.task.FolderId, '361');
});
}
getDocumentDetails(forlderId:string, applicationId:string){
this.processes.GetDocumentDetails(forlderId,applicationId).subscribe(res=>{
this.attachments = res.Documents;
console.log(res['Documents']);
console.log(this.attachments);
})
}
async LoadRelatedEvents(serial: string) {
if (this.eventsList == null) {
this.attachments.getAttachmentsBySerial(serial).subscribe(res => {
this.attachmentsService.getAttachmentsBySerial(serial).subscribe(res => {
console.log(res);
res.forEach(att => {
if (this.eventsList == null) {
@@ -123,8 +133,8 @@ export class DespachoPage implements OnInit {
}
}
viewDocument(){
this.processes.GetDocumentUrl(this.task.DocId, this.task.FsId).subscribe(res=>{
viewDocument(docId:string){
this.processes.GetDocumentUrl(docId, '361').subscribe(res=>{
console.log(res);
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
+3 -1
View File
@@ -53,9 +53,11 @@ export class AuthService {
if (result)
{
this.ValidatedUser = user;
console.log(user);
//if(!environment.production){
localStorage.setItem('user', JSON.stringify(Object.assign(user, response) ) );
localStorage.setItem('user', JSON.stringify(Object.assign(user, response)));
//}
this.storageService.store(AuthConnstants.USER, response);
@@ -44,7 +44,7 @@
</div>
<div class="exp-icon">
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
<label></label>
<label>{{task.DocumentsQty}}</label>
</div>
</div>
<div class="exp-bottom-detail">
@@ -10,6 +10,7 @@ import { ModalController, NavParams } from '@ionic/angular';
import { ExpedienteDetailPage } from 'src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page';
import { AlertService } from 'src/app/services/alert.service';
import { DespachoPage } from 'src/app/pages/gabinete-digital/despachos/despacho/despacho.page';
import { AuthService } from 'src/app/services/auth.service';
@Component({
selector: 'app-despachos',
@@ -36,6 +37,7 @@ export class DespachosPage implements OnInit {
private processes:ProcessesService,
private modalController: ModalController,
private alertService: AlertService,
private authService: AuthService,
) {
this.profile = 'mdgpr';
}
@@ -44,6 +46,9 @@ export class DespachosPage implements OnInit {
//Inicializar segment
this.segment = "despachos";
this.LoadList();
this.authService.userData$.subscribe((res:any)=>{
console.log(res);
});
}
segmentChanged(ev: any) {
this.LoadList();
@@ -65,12 +70,11 @@ export class DespachosPage implements OnInit {
this.despachoList = new Array();
let res = result.reverse();
res.forEach(element => {
console.log(element.workflowInstanceDataFields.SourceSecFsID);
console.log(element.workflowInstanceDataFields.FolderID);
let aplicationId = element.workflowInstanceDataFields.SourceSecFsID;
let DocId = element.workflowInstanceDataFields.FolderID;
this.processes.GetDocumentDetails(DocId, aplicationId).subscribe(res=>{
this.processes.GetDocumentDetails(DocId, '361').subscribe(res=>{
this.totalDocs = res.DocumentsTotal;
console.log(res.DocumentsTotal);
console.log(element);
@@ -85,6 +89,19 @@ export class DespachosPage implements OnInit {
"DocumentsQty": this.totalDocs,
}
this.despachoList.push(task);
},
(error)=>{
let task: DailyWorkTask = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.workflowInstanceDataFields.Sender,
"CreateDate": formatDate(new Date(element.taskStartDate), 'yyyy-MM-dd HH:mm', 'pt'),
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
}
this.despachoList.push(task);
});
});