diff --git a/src/app/Rules/deadline.service.spec.ts b/src/app/Rules/deadline.service.spec.ts
new file mode 100644
index 000000000..8b6eb75e4
--- /dev/null
+++ b/src/app/Rules/deadline.service.spec.ts
@@ -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();
+ });
+});
diff --git a/src/app/Rules/deadline.service.ts b/src/app/Rules/deadline.service.ts
new file mode 100644
index 000000000..776129c02
--- /dev/null
+++ b/src/app/Rules/deadline.service.ts
@@ -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';
+ }
+
+ }
+
+}
diff --git a/src/app/Rules/deploma.service.spec.ts b/src/app/Rules/deploma.service.spec.ts
new file mode 100644
index 000000000..462f2540e
--- /dev/null
+++ b/src/app/Rules/deploma.service.spec.ts
@@ -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();
+ });
+});
diff --git a/src/app/Rules/deploma.service.ts b/src/app/Rules/deploma.service.ts
new file mode 100644
index 000000000..feaba66ec
--- /dev/null
+++ b/src/app/Rules/deploma.service.ts
@@ -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);
+ }
+
+}
diff --git a/src/app/pipes/search-document.pipe.ts b/src/app/pipes/search-document.pipe.ts
index 1e6757287..5b09290df 100644
--- a/src/app/pipes/search-document.pipe.ts
+++ b/src/app/pipes/search-document.pipe.ts
@@ -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) {
diff --git a/src/app/shared/popover/deploma-options/deploma-options.page.html b/src/app/shared/popover/deploma-options/deploma-options.page.html
index c51bfb0e6..664a787d8 100644
--- a/src/app/shared/popover/deploma-options/deploma-options.page.html
+++ b/src/app/shared/popover/deploma-options/deploma-options.page.html
@@ -1,9 +1,4 @@
-
-
-
diff --git a/src/app/shared/popover/deploma-options/deploma-options.page.ts b/src/app/shared/popover/deploma-options/deploma-options.page.ts
index 282d44f2f..6b808b6e1 100644
--- a/src/app/shared/popover/deploma-options/deploma-options.page.ts
+++ b/src/app/shared/popover/deploma-options/deploma-options.page.ts
@@ -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();
}
diff --git a/src/app/shared/popover/opts-expediente/opts-expediente.page.html b/src/app/shared/popover/opts-expediente/opts-expediente.page.html
index ab18db976..6a76061f4 100644
--- a/src/app/shared/popover/opts-expediente/opts-expediente.page.html
+++ b/src/app/shared/popover/opts-expediente/opts-expediente.page.html
@@ -17,7 +17,7 @@
-
+
@@ -29,7 +29,7 @@
-
+
diff --git a/src/app/shared/popover/opts-expediente/opts-expediente.page.ts b/src/app/shared/popover/opts-expediente/opts-expediente.page.ts
index e83ce5649..56cbb5128 100644
--- a/src/app/shared/popover/opts-expediente/opts-expediente.page.ts
+++ b/src/app/shared/popover/opts-expediente/opts-expediente.page.ts
@@ -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;
diff --git a/src/app/shared/popover/request-options/request-options.page.ts b/src/app/shared/popover/request-options/request-options.page.ts
index 047127efa..35358223f 100644
--- a/src/app/shared/popover/request-options/request-options.page.ts
+++ b/src/app/shared/popover/request-options/request-options.page.ts
@@ -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');
diff --git a/src/app/shared/popover/searched-document-options/searched-document-options.page.ts b/src/app/shared/popover/searched-document-options/searched-document-options.page.ts
index 2f34e72cd..800d2583f 100644
--- a/src/app/shared/popover/searched-document-options/searched-document-options.page.ts
+++ b/src/app/shared/popover/searched-document-options/searched-document-options.page.ts
@@ -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
) { }