mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
save
This commit is contained in:
@@ -26,7 +26,7 @@ export enum Sources
|
|||||||
export class EventAttachment {
|
export class EventAttachment {
|
||||||
|
|
||||||
Id?: string; // id do evento
|
Id?: string; // id do evento
|
||||||
ParentId: string;
|
ParentId?: string;
|
||||||
Source: string;
|
Source: string;
|
||||||
SourceId: string;
|
SourceId: string;
|
||||||
Link?: string;
|
Link?: string;
|
||||||
|
|||||||
+13
-5
@@ -61,13 +61,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom-content width-100">
|
<div class="bottom-content width-100">
|
||||||
|
<h5>Documentos Anexados</h5>
|
||||||
|
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<h5>Documentos Anexados</h5>
|
<ion-item *ngFor="let attachment of attachments; let i = index"
|
||||||
<ion-item class="ion-no-margin ion-no-padding cursor-pointer">
|
class="ion-no-margin ion-no-padding cursor-pointer">
|
||||||
<ion-label
|
<ion-label
|
||||||
(click)="viewDocument()">
|
(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 class="attach-title-item">{{attachment.Description}}<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>
|
<p>
|
||||||
|
<span class="span-left">{{attachment.Stakeholders}}</span>
|
||||||
|
<span *ngIf="!attachment.Stakeholders" class="span-left">Rementente indefinido</span>
|
||||||
|
<span class="span-right">{{ attachment.CreateDate | date: 'dd/MM/yy' }}</span>
|
||||||
|
</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
@@ -83,7 +89,7 @@
|
|||||||
*ngFor="let event of eventsList"
|
*ngFor="let event of eventsList"
|
||||||
(click)="viewEventDetail(event.EventId)"
|
(click)="viewEventDetail(event.EventId)"
|
||||||
>
|
>
|
||||||
<!-- [routerLink]="['/home/events', event.EventId, 'events']" -->
|
|
||||||
<div class="content-{{profile}}-{{event.CalendarName}} width-100 ">
|
<div class="content-{{profile}}-{{event.CalendarName}} width-100 ">
|
||||||
<div class="approve-event-time">
|
<div class="approve-event-time">
|
||||||
<p>{{event.StartDate | date: 'HH:mm'}}</p>
|
<p>{{event.StartDate | date: 'HH:mm'}}</p>
|
||||||
@@ -100,6 +106,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -112,6 +119,7 @@
|
|||||||
<div hidden class="solid"></div>
|
<div hidden class="solid"></div>
|
||||||
<button hidden class="btn-cancel" shape="round" >Delegar</button>
|
<button hidden class="btn-cancel" shape="round" >Delegar</button>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
<button (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documento <br />(Gestão Documental)</button>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="loggeduser.Profile =='PR' " class="buttons">
|
<div *ngIf="loggeduser.Profile =='PR' " class="buttons">
|
||||||
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-ok" shape="round" >Marcar para Despacho</button>
|
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-ok" shape="round" >Marcar para Despacho</button>
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.p
|
|||||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||||
import { OptsExpedientePrPage } from 'src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page';
|
import { OptsExpedientePrPage } from 'src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||||
|
import { Attachment } from 'src/app/models/attachment.model';
|
||||||
|
import { SearchDocument } from 'src/app/models/search-document';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-expediente-pr',
|
selector: 'app-expediente-pr',
|
||||||
@@ -44,11 +47,12 @@ export class ExpedientePrPage implements OnInit {
|
|||||||
cc: any = [];
|
cc: any = [];
|
||||||
|
|
||||||
loggeduser: User;
|
loggeduser: User;
|
||||||
|
documents:SearchDocument[] = [];
|
||||||
|
attachments:any;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private processes: ProcessesService,
|
private processes: ProcessesService,
|
||||||
private iab: InAppBrowser,
|
private iab: InAppBrowser,
|
||||||
private attachments: AttachmentsService,
|
|
||||||
private events: EventsService,
|
private events: EventsService,
|
||||||
private menu: MenuController,
|
private menu: MenuController,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
@@ -58,6 +62,7 @@ export class ExpedientePrPage implements OnInit {
|
|||||||
private userAuth: AuthService,
|
private userAuth: AuthService,
|
||||||
private animationController: AnimationController,
|
private animationController: AnimationController,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
|
private attachmentsService: AttachmentsService,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
this.loggeduser = userAuth.ValidatedUser;
|
this.loggeduser = userAuth.ValidatedUser;
|
||||||
@@ -81,10 +86,14 @@ export class ExpedientePrPage implements OnInit {
|
|||||||
}
|
}
|
||||||
/* this.serialnumber = paramMap.get('SerialNumber'); */
|
/* this.serialnumber = paramMap.get('SerialNumber'); */
|
||||||
this.LoadTaskDetail(this.serialnumber);
|
this.LoadTaskDetail(this.serialnumber);
|
||||||
this.LoadRelatedEvents(this.serialnumber);
|
//this.LoadRelatedEvents(this.serialnumber);
|
||||||
|
//this.getAttachments(this.serialnumber);
|
||||||
});
|
});
|
||||||
this.LoadTaskDetail(this.serialnumber);
|
this.LoadTaskDetail(this.serialnumber);
|
||||||
this.LoadRelatedEvents(this.serialnumber);
|
this.getAttachments(this.serialnumber);
|
||||||
|
//this.LoadRelatedEvents(this.serialnumber);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
toDateString(e) {
|
toDateString(e) {
|
||||||
@@ -168,10 +177,7 @@ export class ExpedientePrPage implements OnInit {
|
|||||||
"Status": res.workflowInstanceDataFields.Status,
|
"Status": res.workflowInstanceDataFields.Status,
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('task', this.task);
|
|
||||||
|
|
||||||
this.fulltask = res;
|
this.fulltask = res;
|
||||||
console.log('GetTask', res);
|
|
||||||
|
|
||||||
let thedate = new Date(this.task.CreateDate);
|
let thedate = new Date(this.task.CreateDate);
|
||||||
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
|
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
|
||||||
@@ -203,9 +209,18 @@ export class ExpedientePrPage implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getAttachments(serialNumber){
|
||||||
|
console.log(serialNumber);
|
||||||
|
|
||||||
|
this.attachmentsService.getAttachmentsBySerial(serialNumber).subscribe(res=>{
|
||||||
|
this.attachments = res;
|
||||||
|
console.log('res', res);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async LoadRelatedEvents(serial: string) {
|
async LoadRelatedEvents(serial: string) {
|
||||||
if (this.eventsList == null) {
|
if (this.eventsList == null) {
|
||||||
this.attachments.getAttachmentsBySerial(serial).subscribe(res => {
|
this.attachmentsService.getAttachmentsBySerial(serial).subscribe(res => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
res.forEach(att => {
|
res.forEach(att => {
|
||||||
if (this.eventsList == null) {
|
if (this.eventsList == null) {
|
||||||
@@ -230,6 +245,48 @@ export class ExpedientePrPage implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
attachDocument(){
|
||||||
|
this.getDoc();
|
||||||
|
}
|
||||||
|
|
||||||
|
async getDoc() {
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: SearchPage,
|
||||||
|
cssClass: 'modal-width-100-width-background modal',
|
||||||
|
componentProps: {
|
||||||
|
type: 'AccoesPresidenciais & ArquivoDespachoElect',
|
||||||
|
showSearchInput: true,
|
||||||
|
select: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
await modal.present();
|
||||||
|
modal.onDidDismiss().then((res)=>{
|
||||||
|
if(res){
|
||||||
|
const data = res.data;
|
||||||
|
this.documents.push(data.selected);
|
||||||
|
console.log( this.documents);
|
||||||
|
this.documents.forEach(element =>{
|
||||||
|
let body = {
|
||||||
|
"Source": "1",
|
||||||
|
"SourceId": element.Id,
|
||||||
|
"SourceTitle": element.Assunto,
|
||||||
|
"SerialNumber": this.task.SerialNumber,
|
||||||
|
"ApplicationId": element.ApplicationType
|
||||||
|
}
|
||||||
|
this.attachmentsService.setEventAttachmentById(body).subscribe((res)=>{
|
||||||
|
this.getAttachments(this.task.SerialNumber);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
removeAttachment(index: number){
|
||||||
|
this.documents = this.documents.filter( (e, i) => index != i);
|
||||||
|
}
|
||||||
|
|
||||||
openMenu() {
|
openMenu() {
|
||||||
this.menu.open();
|
this.menu.open();
|
||||||
this.modalController.dismiss();
|
this.modalController.dismiss();
|
||||||
|
|||||||
@@ -63,14 +63,12 @@ export class AttachmentsService {
|
|||||||
return this.http.get<Attachment[]>(`${geturl}`, options);
|
return this.http.get<Attachment[]>(`${geturl}`, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
setEventAttachmentById(body: EventAttachment) {
|
setEventAttachmentById(body: any) {
|
||||||
|
|
||||||
let geturl = environment.apiURL + 'Attachments/Create';
|
let geturl = environment.apiURL + 'Attachments/Create';
|
||||||
|
|
||||||
let options = {
|
let options = {
|
||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.http.post(`${geturl}`, body, options);
|
return this.http.post(`${geturl}`, body, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<button (click)="distartExpedientModal('descartar')" full class="btn-ok" shape="round" >Descartar</button>
|
<button (click)="distartExpedientModal('descartar')" full class="btn-ok" shape="round" >Descartar</button>
|
||||||
<div hidden class="solid"></div>
|
<div hidden class="solid"></div>
|
||||||
<button hidden class="btn-cancel" shape="round" >Delegar</button>
|
<button hidden class="btn-cancel" shape="round" >Delegar</button>
|
||||||
|
<button (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documento <br />(Gestão Documental)</button>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="loggeduser.Profile =='PR' " class="buttons">
|
<div *ngIf="loggeduser.Profile =='PR' " class="buttons">
|
||||||
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-ok" shape="round" >Marcar para Despacho</button>
|
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-ok" shape="round" >Marcar para Despacho</button>
|
||||||
|
|||||||
@@ -2,10 +2,12 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
||||||
import { AnimationController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
import { AnimationController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||||
|
import { SearchDocument } from 'src/app/models/search-document';
|
||||||
import { User } from 'src/app/models/user.model';
|
import { User } from 'src/app/models/user.model';
|
||||||
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
||||||
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||||
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||||
|
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||||
import { AlertService } from 'src/app/services/alert.service';
|
import { AlertService } from 'src/app/services/alert.service';
|
||||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||||
import { AuthService } from 'src/app/services/auth.service';
|
import { AuthService } from 'src/app/services/auth.service';
|
||||||
@@ -33,6 +35,9 @@ export class OptsExpedientePrPage implements OnInit {
|
|||||||
serialnumber: string;
|
serialnumber: string;
|
||||||
profile: string;
|
profile: string;
|
||||||
|
|
||||||
|
documents:SearchDocument[] = [];
|
||||||
|
attachments:any;
|
||||||
|
|
||||||
showEnviarPendentes = false;
|
showEnviarPendentes = false;
|
||||||
|
|
||||||
loggeduser: User;
|
loggeduser: User;
|
||||||
@@ -41,7 +46,7 @@ export class OptsExpedientePrPage implements OnInit {
|
|||||||
private popoverController: PopoverController,
|
private popoverController: PopoverController,
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
private processes: ProcessesService,
|
private processes: ProcessesService,
|
||||||
private attachments: AttachmentsService,
|
private attachmentsService: AttachmentsService,
|
||||||
private activatedRoute: ActivatedRoute,
|
private activatedRoute: ActivatedRoute,
|
||||||
private userAuth: AuthService,
|
private userAuth: AuthService,
|
||||||
private navParams: NavParams,
|
private navParams: NavParams,
|
||||||
@@ -320,4 +325,51 @@ export class OptsExpedientePrPage implements OnInit {
|
|||||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getAttachments(serialNumber){
|
||||||
|
this.attachmentsService.getAttachmentsBySerial(serialNumber).subscribe(res=>{
|
||||||
|
this.attachments = res;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
attachDocument(){
|
||||||
|
this.getDoc();
|
||||||
|
}
|
||||||
|
|
||||||
|
async getDoc() {
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: SearchPage,
|
||||||
|
cssClass: 'modal-width-100-width-background modal',
|
||||||
|
componentProps: {
|
||||||
|
type: 'AccoesPresidenciais & ArquivoDespachoElect',
|
||||||
|
showSearchInput: true,
|
||||||
|
select: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
await modal.present();
|
||||||
|
modal.onDidDismiss().then((res)=>{
|
||||||
|
if(res){
|
||||||
|
const data = res.data;
|
||||||
|
this.documents.push(data.selected);
|
||||||
|
console.log( this.documents);
|
||||||
|
this.documents.forEach(element =>{
|
||||||
|
let body = {
|
||||||
|
"Source": "1",
|
||||||
|
"SourceId": element.Id,
|
||||||
|
"SourceTitle": element.Assunto,
|
||||||
|
"SerialNumber": this.task.SerialNumber,
|
||||||
|
"ApplicationId": element.ApplicationType
|
||||||
|
}
|
||||||
|
this.attachmentsService.setEventAttachmentById(body).subscribe((res)=>{
|
||||||
|
this.getAttachments(this.task.SerialNumber);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user