mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
save
This commit is contained in:
@@ -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