mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
save
This commit is contained in:
@@ -26,7 +26,7 @@ export enum Sources
|
||||
export class EventAttachment {
|
||||
|
||||
Id?: string; // id do evento
|
||||
ParentId: string;
|
||||
ParentId?: string;
|
||||
Source: string;
|
||||
SourceId: string;
|
||||
Link?: string;
|
||||
@@ -34,4 +34,4 @@ export class EventAttachment {
|
||||
ApplicationId: string;
|
||||
SourceTitle: string;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+16
-8
@@ -61,29 +61,35 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-content width-100">
|
||||
<h5>Documentos Anexados</h5>
|
||||
|
||||
<ion-list>
|
||||
<h5>Documentos Anexados</h5>
|
||||
<ion-item class="ion-no-margin ion-no-padding cursor-pointer">
|
||||
<ion-item *ngFor="let attachment of attachments; let i = index"
|
||||
class="ion-no-margin ion-no-padding cursor-pointer">
|
||||
<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>
|
||||
<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">{{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-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"
|
||||
<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}} width-100 ">
|
||||
<div class="approve-event-time">
|
||||
<p>{{event.StartDate | date: 'HH:mm'}}</p>
|
||||
@@ -100,6 +106,7 @@
|
||||
</div>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -112,6 +119,7 @@
|
||||
<div hidden class="solid"></div>
|
||||
<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)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documento <br />(Gestão Documental)</button>
|
||||
</div>
|
||||
<div *ngIf="loggeduser.Profile =='PR' " class="buttons">
|
||||
<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 { OptsExpedientePrPage } from 'src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page';
|
||||
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({
|
||||
selector: 'app-expediente-pr',
|
||||
@@ -44,11 +47,12 @@ export class ExpedientePrPage implements OnInit {
|
||||
cc: any = [];
|
||||
|
||||
loggeduser: User;
|
||||
documents:SearchDocument[] = [];
|
||||
attachments:any;
|
||||
|
||||
constructor(
|
||||
private processes: ProcessesService,
|
||||
private iab: InAppBrowser,
|
||||
private attachments: AttachmentsService,
|
||||
private events: EventsService,
|
||||
private menu: MenuController,
|
||||
private router: Router,
|
||||
@@ -58,6 +62,7 @@ export class ExpedientePrPage implements OnInit {
|
||||
private userAuth: AuthService,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
|
||||
) {
|
||||
this.loggeduser = userAuth.ValidatedUser;
|
||||
@@ -81,10 +86,14 @@ export class ExpedientePrPage implements OnInit {
|
||||
}
|
||||
/* this.serialnumber = paramMap.get('SerialNumber'); */
|
||||
this.LoadTaskDetail(this.serialnumber);
|
||||
this.LoadRelatedEvents(this.serialnumber);
|
||||
//this.LoadRelatedEvents(this.serialnumber);
|
||||
//this.getAttachments(this.serialnumber);
|
||||
});
|
||||
this.LoadTaskDetail(this.serialnumber);
|
||||
this.LoadRelatedEvents(this.serialnumber);
|
||||
this.getAttachments(this.serialnumber);
|
||||
//this.LoadRelatedEvents(this.serialnumber);
|
||||
|
||||
|
||||
}
|
||||
|
||||
toDateString(e) {
|
||||
@@ -168,10 +177,7 @@ export class ExpedientePrPage implements OnInit {
|
||||
"Status": res.workflowInstanceDataFields.Status,
|
||||
}
|
||||
|
||||
console.log('task', this.task);
|
||||
|
||||
this.fulltask = res;
|
||||
console.log('GetTask', res);
|
||||
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
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) {
|
||||
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) {
|
||||
@@ -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() {
|
||||
this.menu.open();
|
||||
this.modalController.dismiss();
|
||||
|
||||
@@ -14,7 +14,7 @@ export class AttachmentsService {
|
||||
loggeduser: User;
|
||||
headers: HttpHeaders;
|
||||
|
||||
constructor(private http: HttpClient, user: AuthService) {
|
||||
constructor(private http: HttpClient, user: AuthService) {
|
||||
this.loggeduser = user.ValidatedUser;
|
||||
this.headers = new HttpHeaders();
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
@@ -26,9 +26,9 @@ export class AttachmentsService {
|
||||
|
||||
params = params.set("SerialNumber", serialNumber);
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<Attachment[]>(`${geturl}`, options);
|
||||
}
|
||||
@@ -39,10 +39,10 @@ export class AttachmentsService {
|
||||
|
||||
params = params.set("Source", source.toString());
|
||||
/* params = params.set("SourceId", sourceid); */
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
return this.http.get<Attachment[]>(`${geturl}`, options);
|
||||
@@ -54,37 +54,35 @@ export class AttachmentsService {
|
||||
|
||||
params = params.set("ParentId", eventId);
|
||||
/* params = params.set("SourceId", sourceid); */
|
||||
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
return this.http.get<Attachment[]>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
setEventAttachmentById(body: EventAttachment) {
|
||||
setEventAttachmentById(body: any) {
|
||||
|
||||
let geturl = environment.apiURL + 'Attachments/Create';
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
}
|
||||
|
||||
return this.http.post(`${geturl}`, body, options);
|
||||
}
|
||||
|
||||
deleteEventAttachmentById(attachmentId) {
|
||||
|
||||
deleteEventAttachmentById(attachmentId) {
|
||||
|
||||
let geturl = environment.apiURL + `Attachments/Delete?attachmentId=${attachmentId}`;
|
||||
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("attachmentId", attachmentId);
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
}
|
||||
|
||||
return this.http.delete(`${geturl}`, options);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<button (click)="distartExpedientModal('descartar')" full class="btn-ok" shape="round" >Descartar</button>
|
||||
<div hidden class="solid"></div>
|
||||
<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 *ngIf="loggeduser.Profile =='PR' " class="buttons">
|
||||
<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 { AnimationController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
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 { 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 { 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 { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
@@ -33,6 +35,9 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
serialnumber: string;
|
||||
profile: string;
|
||||
|
||||
documents:SearchDocument[] = [];
|
||||
attachments:any;
|
||||
|
||||
showEnviarPendentes = false;
|
||||
|
||||
loggeduser: User;
|
||||
@@ -41,14 +46,14 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
private popoverController: PopoverController,
|
||||
private modalController: ModalController,
|
||||
private processes: ProcessesService,
|
||||
private attachments: AttachmentsService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private userAuth: AuthService,
|
||||
private navParams: NavParams,
|
||||
private animationController: AnimationController,
|
||||
private router: Router,
|
||||
private toastService: ToastService
|
||||
|
||||
|
||||
) {
|
||||
|
||||
this.task = this.navParams.get('task');
|
||||
@@ -87,9 +92,9 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
cssClass: classs,
|
||||
backdropDismiss: true
|
||||
});
|
||||
|
||||
|
||||
await modal.present();
|
||||
|
||||
|
||||
modal.onDidDismiss().then(async (res) => {
|
||||
console.log(res);
|
||||
if(res.data){
|
||||
@@ -99,7 +104,7 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
SourceId: e.Id,
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
let docs = {
|
||||
ProcessInstanceID: "",
|
||||
Attachments: DocumentToSave,
|
||||
@@ -118,8 +123,8 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
|
||||
async approve(note:string, documents:any){
|
||||
this.popoverController.dismiss();
|
||||
let body = {
|
||||
"serialNumber": this.task.SerialNumber,
|
||||
let body = {
|
||||
"serialNumber": this.task.SerialNumber,
|
||||
"action": "Aprovar",
|
||||
"ActionTypeId": 100000004 ,
|
||||
"dataFields": {
|
||||
@@ -150,7 +155,7 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
cssClass: 'discart-expedient-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
console.log(res['data']);
|
||||
@@ -168,7 +173,7 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
@@ -187,7 +192,7 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
if(res['data']== 'Yes'){
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
@@ -218,8 +223,8 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
|
||||
|
||||
async sendToReview(note:string, documents:any){
|
||||
let body = {
|
||||
"serialNumber": this.task.SerialNumber,
|
||||
let body = {
|
||||
"serialNumber": this.task.SerialNumber,
|
||||
"action": "Retificar",
|
||||
"ActionTypeId": 99999877,
|
||||
"dataFields": {
|
||||
@@ -277,7 +282,7 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
// alert('close '+ res['data'])
|
||||
if(res['data']){
|
||||
console.log('open discart');
|
||||
|
||||
|
||||
this.distartExpedientModal(body);
|
||||
|
||||
}
|
||||
@@ -320,4 +325,51 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
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