mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
Update
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DeadlineService } from './deadline.service';
|
||||
|
||||
describe('DeadlineService', () => {
|
||||
let service: DeadlineService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(DeadlineService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,27 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DeadlineService {
|
||||
|
||||
constructor() { }
|
||||
|
||||
|
||||
priorityToDeadlineType(Priority): string {
|
||||
if(Priority=='99999861') {
|
||||
return 'Normal';
|
||||
}
|
||||
else if(Priority=='99999862') {
|
||||
return 'Urgente';
|
||||
}
|
||||
else if(Priority=='99999863') {
|
||||
return 'Muito Urgente';
|
||||
}
|
||||
else if(Priority=='99999864') {
|
||||
return 'Urgentíssimo';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DeplomaService } from './deploma.service';
|
||||
|
||||
describe('DeplomaService', () => {
|
||||
let service: DeplomaService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(DeplomaService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,58 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ProcessesService } from '../services/processes.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DeplomaService {
|
||||
|
||||
constructor(
|
||||
private processes: ProcessesService,
|
||||
) { }
|
||||
|
||||
|
||||
async askSignature({note, documents, serialNumber}) {
|
||||
let body = {
|
||||
"serialNumber": serialNumber,
|
||||
"action": "Aprovar",
|
||||
"ActionTypeId": 99999840,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
|
||||
return this.processes.CompleteTask(body)
|
||||
}
|
||||
|
||||
async askToChange({note, documents, serialNumber}) {
|
||||
let body = {
|
||||
"serialNumber": serialNumber,
|
||||
"action": "Retificar",
|
||||
"ActionTypeId": 99999841,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
|
||||
return this.processes.CompleteTask(body)
|
||||
|
||||
}
|
||||
|
||||
async finish({note, documents, serialNumber}) {
|
||||
|
||||
let body = {
|
||||
"serialNumber": serialNumber,
|
||||
"action": "Concluir",
|
||||
"ActionTypeId": 95,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
|
||||
return this.processes.CompleteTask(body);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { ExpedientTaskModalPageNavParamsTask } from '../models/ExpedientTaskModalPage';
|
||||
import { FromSearchDocument, SearchFolder } from '../models/search-document';
|
||||
|
||||
@Pipe({
|
||||
name: 'searchDocument'
|
||||
@@ -12,6 +14,10 @@ export class SearchDocumentPipe implements PipeTransform {
|
||||
|
||||
transformToAttachment(document): unknown {
|
||||
|
||||
let task: ExpedientTaskModalPageNavParamsTask
|
||||
//let _document: = this.LoadedDocument
|
||||
// let folder: SearchFolder = this.LoadedDocument
|
||||
|
||||
const attachments = []
|
||||
|
||||
if(document.Documents) {
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
<ion-content class="container">
|
||||
<div class="arrow-right" (click)="close()">
|
||||
<button class="btn-no-color">
|
||||
<ion-icon slot="end" class="arrow-right-icon" src='assets/images/icons-arrow-arrow-right.svg'></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- <div class="buttons">
|
||||
<button (click)="openAddNoteModal('Solicitar assinatura')" class="btn-cancel" shape="round" >Solicitar assinatura</button>
|
||||
@@ -13,8 +8,17 @@
|
||||
</div> -->
|
||||
|
||||
<div class="buttons">
|
||||
<button (click)="Assinar()" class="btn-cancel" shape="round" >Assinado</button>
|
||||
<div class="solid"></div>
|
||||
<div *ngIf="task" class="aside-right flex-column height-100">
|
||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Revisar Diploma'">
|
||||
<button (click)="openAddNoteModal('Solicitar assinatura')" class="btn-cancel" shape="round" >Solicitar assinatura do Presidente</button>
|
||||
<button (click)="openAddNoteModal('Solicitar alteração')" class="btn-cancel" shape="round" >Solicitar alteração</button>
|
||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
<div class="solid"></div>
|
||||
</div>
|
||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Diploma Assinado'">
|
||||
<button (click)="openAddNoteModal('Concluir diploma')" class="btn-cancel" shape="round" >Concluir</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { AnimationController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
import { DeplomaService } from 'src/app/Rules/deploma.service';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { BadRequestPage } from '../bad-request/bad-request.page';
|
||||
@@ -28,15 +29,18 @@ export class DeplomaOptionsPage implements OnInit {
|
||||
private processes: ProcessesService,
|
||||
private navParams: NavParams,
|
||||
private toastService: ToastService,
|
||||
private router: Router,) {
|
||||
private router: Router,
|
||||
private deplomaService: DeplomaService) {
|
||||
this.serialnumber = this.navParams.get('serialNumber');
|
||||
this.task = this.navParams.get('task');
|
||||
this.fulltask = this.navParams.get('fulltask');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.serialnumber);
|
||||
}
|
||||
|
||||
async Assinar(){
|
||||
async Assinar() {
|
||||
this.popoverController.dismiss();
|
||||
|
||||
let body = {
|
||||
@@ -49,9 +53,6 @@ export class DeplomaOptionsPage implements OnInit {
|
||||
"AttachmentList": [],
|
||||
}
|
||||
|
||||
console.log(body);
|
||||
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
@@ -70,7 +71,7 @@ export class DeplomaOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
/* async openAddNoteModal(actionName:string) {
|
||||
async openAddNoteModal(actionName:string) {
|
||||
this.popoverController.dismiss();
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
@@ -117,9 +118,9 @@ export class DeplomaOptionsPage implements OnInit {
|
||||
}
|
||||
}
|
||||
});
|
||||
} */
|
||||
}
|
||||
|
||||
/* async askToChange(note:string, documents:any){
|
||||
async askToChange(note:string, documents:any){
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
"action": "Retificar",
|
||||
@@ -188,7 +189,7 @@ export class DeplomaOptionsPage implements OnInit {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
} */
|
||||
}
|
||||
|
||||
|
||||
goBack() {
|
||||
@@ -196,7 +197,7 @@ export class DeplomaOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
close(){
|
||||
close() {
|
||||
this.popoverController.dismiss();
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<div class="flex-grow-1">
|
||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||
<button (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
<button *ngIf="!p.userRole(['PR'])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button>
|
||||
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
|
||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-ok" shape="round" >Enviar para pendentes</button>
|
||||
@@ -29,7 +29,7 @@
|
||||
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||
<div hidden class="solid"></div>
|
||||
<button hidden class="btn-cancel" shape="round" >Delegar</button>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
||||
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { PermissionService } from 'src/app/OtherService/permission.service';
|
||||
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';
|
||||
@@ -106,6 +107,77 @@ export class OptsExpedientePage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
attachDocument(){}
|
||||
|
||||
async openAddNoteModal(actionName:string) {
|
||||
let classs;
|
||||
if( window.innerWidth < 801) {
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
classs = 'add-note-modal'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
component: AddNotePage,
|
||||
componentProps:{
|
||||
showAttachmentBtn: false,
|
||||
},
|
||||
cssClass: classs,
|
||||
//backdropDismiss: true
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then(res => {
|
||||
console.log(res);
|
||||
if(res.data){
|
||||
const DocumentToSave = res.data.documents.map((e) => {
|
||||
return {
|
||||
ApplicationId: e.ApplicationType,
|
||||
SourceId: e.Id,
|
||||
}
|
||||
});
|
||||
|
||||
let docs = {
|
||||
ProcessInstanceID: "",
|
||||
Attachments: DocumentToSave,
|
||||
}
|
||||
|
||||
if(actionName == 'Aprovar'){
|
||||
this.approve(res.data.note, docs);
|
||||
}
|
||||
else if(actionName == 'Revisão'){
|
||||
this.sendToReview(res.data.note, docs);
|
||||
}
|
||||
this.goBack();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
async sendToReview(note:string, documents:any){
|
||||
let body = {
|
||||
"serialNumber": this.task.serialnumber,
|
||||
"action": "Retificar",
|
||||
"ActionTypeId": 99999877,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.toastService.successMessage()
|
||||
} catch(error) {
|
||||
this.toastService.badRequest()
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
}
|
||||
|
||||
sendExpedienteToPending() {
|
||||
this.close();
|
||||
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
|
||||
@@ -116,6 +188,33 @@ export class OptsExpedientePage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
async approve(note:string, documents:any){
|
||||
let body = {
|
||||
"serialNumber": this.task.serialnumber,
|
||||
"action": "Aprovar",
|
||||
"ActionTypeId": 100000004 ,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
|
||||
console.log(body);
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.close();
|
||||
this.toastService.successMessage('Processo aprovado')
|
||||
} catch(error) {
|
||||
this.toastService.badRequest('Processo não aprovado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async openBookMeetingModal() {
|
||||
this.close();
|
||||
let classs;
|
||||
|
||||
@@ -4,6 +4,7 @@ import { AnimationController, ModalController, NavParams, PopoverController } fr
|
||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { DarParecerPage } from 'src/app/modals/dar-parecer/dar-parecer.page';
|
||||
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||
import { PermissionService } from 'src/app/OtherService/permission.service';
|
||||
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';
|
||||
@@ -32,6 +33,7 @@ export class RequestOptionsPage implements OnInit {
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
private router: Router,
|
||||
public p: PermissionService,
|
||||
) {
|
||||
this.task = this.navParams.get('task');
|
||||
this.fulltask = this.navParams.get('fulltask');
|
||||
|
||||
@@ -22,10 +22,6 @@ export class SearchedDocumentOptionsPage implements OnInit {
|
||||
private popoverController: PopoverController,
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
private processes: ProcessesService,
|
||||
private toastService: ToastService,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
public p: PermissionService
|
||||
) { }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user