This commit is contained in:
Peter Maquiran
2022-06-21 13:47:50 +01:00
parent d6ea689f57
commit fad6da112d
5 changed files with 170 additions and 76 deletions
@@ -1,9 +1,11 @@
<ion-header class="ion-no-border">
<ion-header class="ion-no-border pb-20">
<app-header > </app-header>
</ion-header>
<ion-content class="container-wrapper">
<div class="main-content d-flex height-100 width-100 overflow-hidden">
<div class="content d-flex flex-column" *ngIf="task">
<div class="main-header">
<div class="title-content width-100 d-flex justify-space-between">
@@ -15,9 +17,6 @@
<ion-label class="title">{{ task.Folio}}</ion-label>
</div>
<div class="div-icon" (click)="openOptions()">
<!-- <ion-menu-button autoHide="false">
<ion-icon name="ellipsis-vertical-outline"></ion-icon>
</ion-menu-button> -->
<ion-icon class="font-25 cursor-pointer" name="ellipsis-vertical-outline"></ion-icon>
</div>
</div>
@@ -77,7 +76,10 @@
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
<div class="buttons">
<button (click)="Assinar()" class="btn-cancel" shape="round" >Assinado</button>
<button (click)="enviarDiploma({note: '', documents: [], serialnumber: task.SerialNumber})" class="btn-cancel" shape="round" >Enviar Diploma</button>
<button (click)="openDelegarModal()" class="btn-cancel" shape="round" >Delegar</button>
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para pendentes</button>
<div class="solid"></div>
</div>
</div>
@@ -9,7 +9,9 @@ import { ToastService } from 'src/app/services/toast.service';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service';
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
import { DespachoService } from 'src/app/Rules/despacho.service'
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
@Component({
selector: 'app-diplomas-gerar',
@@ -38,7 +40,8 @@ export class DiplomasGerarPage implements OnInit {
private activatedRoute: ActivatedRoute,
private toastService: ToastService,
private RouteService: RouteService,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private despachoService: DespachoService,
) {
this.activatedRoute.paramMap.subscribe(params => {
if(params["params"].SerialNumber) {
@@ -110,6 +113,8 @@ export class DiplomasGerarPage implements OnInit {
});
this.getDocumentDetails(this.task.FolderId, '361');
}, (error)=>{
try {
this.toastService._badRequest('Processo não encontrado')
@@ -127,6 +132,94 @@ export class DiplomasGerarPage implements OnInit {
}
async openDelegarModal() {
let classs;
if (window.innerWidth <= 800) {
classs = 'book-meeting-modal modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: DelegarPage,
componentProps: {
task: this.task,
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then(res => {
if(res){
const data = res.data;
if(data == 'close') {
this.goBack();
}
}
});
}
async openBookMeetingModal() {
let classs;
if (window.innerWidth <= 800) {
classs = 'book-meeting-modal modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: BookMeetingModalPage,
componentProps: {
task: this.task,
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
}
async sendExpedienteToPending() {
this.despachoService.sendExpedienteToPending(this.serialnumber).subscribe(res => {
this.goBack();
this.toastService.successMessage()
},
error => {
this.toastService.badRequest("Processo não enviado para despacho")
});
}
async enviarDiploma({note = '', documents = [], serialnumber}) {
let body = {
"serialNumber": serialnumber,
"action": "Enviar diploma",
"ActionTypeId": 104,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
const loader = this.toastService.loading()
try {
await this.processes.CompleteTask(body).toPromise();
this.modalController.dismiss('sucess');
this.toastService._successMessage('Parecer enviado');
} catch (error) {
this.toastService._badRequest("Parecer não solicitado");
} finally {
loader.remove()
}
}
async viewDocument(DocId:string, Document) {
const modal = await this.modalController.create({
@@ -185,6 +278,7 @@ export class DiplomasGerarPage implements OnInit {
}
}
toDateString(e) {
return new Date(e).toDateString()