+
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 b61f13b57..1e4c08d71 100644
--- a/src/app/shared/popover/deploma-options/deploma-options.page.ts
+++ b/src/app/shared/popover/deploma-options/deploma-options.page.ts
@@ -27,7 +27,8 @@ export class DiplomaOptionsPage implements OnInit {
task: any
fulltask: any
DraftIds = ""
- DraftNames= ""
+ DraftNames = ""
+ asDrat: boolean;
constructor(
@@ -41,42 +42,43 @@ export class DiplomaOptionsPage implements OnInit {
private despachoService: DespachoService,
private httpErroHandle: HttpErrorHandle,
public TaskService: TaskService) {
- this.serialNumber = this.navParams.get('serialNumber');
- this.task = this.navParams.get('task');
- this.fulltask = this.navParams.get('fulltask');
+ this.serialNumber = this.navParams.get('serialNumber');
+ this.task = this.navParams.get('task');
+ this.fulltask = this.navParams.get('fulltask');
- this.DraftIds = this.navParams.get("DraftIds");
- this.DraftNames = this.navParams.get("DraftNames");
+ this.DraftIds = this.navParams.get("DraftIds");
+ this.DraftNames = this.navParams.get("DraftNames");
+ this.asDrat = this.navParams.get('asDrat');
- console.log('this.task', this.task)
+ console.log('this.task', this.task)
- }
+ }
ngOnInit() {
console.log(this.task.activityInstanceName)
}
- async openAddNoteModal(actionName:string) {
+ async openAddNoteModal(actionName: string) {
// this.popoverController.dismiss();
let classs;
- if( window.innerWidth <= 800) {
+ if (window.innerWidth <= 800) {
classs = 'modal modal-desktop'
- } else {
+ } else {
classs = 'modal modal-desktop'
}
const modal = await this.modalController.create({
component: AddNotePage,
- componentProps:{
- actionName:actionName
+ componentProps: {
+ actionName: actionName
},
cssClass: classs,
backdropDismiss: true
});
modal.onDidDismiss().then(async (res) => {
- if(res.data) {
+ if (res.data) {
const DocumentToSave = res.data.documents.map((e) => {
@@ -91,22 +93,22 @@ export class DiplomaOptionsPage implements OnInit {
Attachments: DocumentToSave,
}
- if(actionName == 'Solicitar assinatura') {
+ if (actionName == 'Solicitar assinatura') {
await this.askSignature(res.data.note, docs);
this.goBack();
- } else if(actionName == 'Solicitar alteração') {
+ } else if (actionName == 'Solicitar alteração') {
await this.askToChange(res.data.note, docs);
this.goBack();
} else if (actionName == 'Assinar Diploma') {
await this.sign(res.data.note, docs);
this.goBack();
- } else if(actionName == 'Concluir diploma'){
+ } else if (actionName == 'Concluir diploma') {
await this.finish(res.data.note, docs);
this.goBack();
} else if (actionName == 'Arquivo') {
await this.arquivar(res.data.note, docs);
this.goBack();
- } else if (actionName =='AssinarNew') {
+ } else if (actionName == 'AssinarNew') {
await this.AssinarNew(res.data.note, docs)
}
}
@@ -117,7 +119,7 @@ export class DiplomaOptionsPage implements OnInit {
await modal.present();
}
- async askToChange(note:string, documents:any){
+ async askToChange(note: string, documents: any) {
let body = {
"serialNumber": this.serialNumber,
"action": "Retificar",
@@ -125,7 +127,7 @@ export class DiplomaOptionsPage implements OnInit {
"dataFields": {
"ReviewUserComment": note,
},
- "AttachmentList" :documents,
+ "AttachmentList": documents,
}
const loader = this.toastService.loading()
@@ -135,13 +137,13 @@ export class DiplomaOptionsPage implements OnInit {
this.close();
this.toastService._successMessage()
} catch (error) {
- if(error.status == 0) {
+ if (error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
- } finally {
+ } finally {
loader.remove()
}
@@ -151,23 +153,23 @@ export class DiplomaOptionsPage implements OnInit {
async openBookMeetingModal(task: any) {
this.popoverController.dismiss();
let classs;
- if( window.innerWidth <= 800){
+ if (window.innerWidth <= 800) {
classs = 'book-meeting-modal modal modal-desktop'
- } else {
+ } else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: BookMeetingModalPage,
componentProps: {
task: this.task,
- fulltask:this.fulltask
+ fulltask: this.fulltask
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then(
- ()=> {},
+ () => { },
(error) => {
console.log(error)
}
@@ -175,7 +177,7 @@ export class DiplomaOptionsPage implements OnInit {
}
- async askSignature(note:string, documents:any) {
+ async askSignature(note: string, documents: any) {
let body = {
"serialNumber": this.serialNumber,
"action": "Aprovar",
@@ -183,7 +185,7 @@ export class DiplomaOptionsPage implements OnInit {
"dataFields": {
"ReviewUserComment": note,
},
- "AttachmentList" :documents,
+ "AttachmentList": documents,
}
const loader = this.toastService.loading()
@@ -193,20 +195,20 @@ export class DiplomaOptionsPage implements OnInit {
this.close();
this.toastService._successMessage()
} catch (error) {
- if(error.status == 0) {
+ if (error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
- } finally {
+ } finally {
loader.remove()
}
}
- async sign(note?:string, documents?:any) {
+ async sign(note?: string, documents?: any) {
let body = {
"serialNumber": this.serialNumber,
"action": "Assinado",
@@ -217,7 +219,7 @@ export class DiplomaOptionsPage implements OnInit {
"InstanceIDNew": this.task.InstanceID,
"DraftIds": "",
},
- "AttachmentList" : {
+ "AttachmentList": {
"ProcessInstanceID": this.task.InstanceID,
"DraftIds": null,
"Attachments": []
@@ -229,61 +231,65 @@ export class DiplomaOptionsPage implements OnInit {
await this.processes.CompleteTask(body).toPromise()
this.httpErroHandle.httpsSucessMessagge('Assinado')
} catch (error) {
- if(error.status == 0) {
+ if (error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
- } finally {}
+ } finally { }
}
async AssinarNew(note?, doc?) {
- const modal = await this.modalController.create({
- component: PopupQuestionPage,
- componentProps: {
- title: 'Deseja assinar este Diploma?',
- /* message: 'Nota: Ao Efetuar esta operação, o tratamento deste diploma não poderá ser realizado a partir da caixa de correspondência' */
+ if (this.asDrat) {
+ const modal = await this.modalController.create({
+ component: PopupQuestionPage,
+ componentProps: {
+ title: 'Deseja assinar este Diploma?',
+ /* message: 'Nota: Ao Efetuar esta operação, o tratamento deste diploma não poderá ser realizado a partir da caixa de correspondência' */
- },
- cssClass: "popup-question discart-expedient-modal",
- backdropDismiss: true
- });
+ },
+ cssClass: "popup-question discart-expedient-modal",
+ backdropDismiss: true
+ });
- modal.onDidDismiss().then(async (res) => {
- const data = res.data
- if(data == "Yes") {
- let body = {
- "InstanceId": this.task.InstanceID,
- "FolderId": this.task.FolderID,
- "DraftIds": this.DraftIds,
- "OriginalFileName": this.DraftNames
+ modal.onDidDismiss().then(async (res) => {
+ const data = res.data
+ if (data == "Yes") {
+ let body = {
+ "InstanceId": this.task.InstanceID,
+ "FolderId": this.task.FolderID,
+ "DraftIds": this.DraftIds,
+ "OriginalFileName": this.DraftNames
+ }
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.presidentialActionsSignature(body).toPromise()
+ await this.sign()
+ this.TaskService.loadDiplomas()
+ this.goBack();
+ } catch (error) {
+ this.httpErroHandle.httpStatusHandle(error)
+ }
+ finally {
+ loader.remove()
+ }
}
- const loader = this.toastService.loading()
- try {
- await this.processes.presidentialActionsSignature(body).toPromise()
- await this.sign()
- this.TaskService.loadDiplomas()
- this.goBack();
- } catch (error) {
- this.httpErroHandle.httpStatusHandle(error)
- }
- finally {
- loader.remove()
- }
- }
+ }, (error) => {
+ console.log(error)
+ });
- }, (error) => {
- console.log(error)
- });
-
- await modal.present();
+ await modal.present();
+ } else {
+ this.httpErroHandle.validationMessagge("diplomaAsDraft");
+ }
}
- async finish(note:string, documents:any){
+ async finish(note: string, documents: any) {
let body = {
"serialNumber": this.serialNumber,
@@ -292,7 +298,7 @@ export class DiplomaOptionsPage implements OnInit {
"dataFields": {
"ReviewUserComment": note,
},
- "AttachmentList" :documents,
+ "AttachmentList": documents,
}
const loader = this.toastService.loading()
@@ -301,11 +307,11 @@ export class DiplomaOptionsPage implements OnInit {
await this.processes.CompleteTask(body).toPromise();
this.toastService._successMessage('Processo concluído')
} catch (error) {
- if(error.status == 0) {
+ if (error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
- this.toastService._badRequest()
+ this.toastService._badRequest()
}
}
finally {
diff --git a/src/app/shared/popover/event-details-documents-options/event-details-documents-options.page.html b/src/app/shared/popover/event-details-documents-options/event-details-documents-options.page.html
index 2f6b4d610..45599c5af 100644
--- a/src/app/shared/popover/event-details-documents-options/event-details-documents-options.page.html
+++ b/src/app/shared/popover/event-details-documents-options/event-details-documents-options.page.html
@@ -9,7 +9,7 @@
diff --git a/src/app/shared/popover/event-details-documents-options/event-details-documents-options.page.ts b/src/app/shared/popover/event-details-documents-options/event-details-documents-options.page.ts
index efb1843d1..878a2e572 100644
--- a/src/app/shared/popover/event-details-documents-options/event-details-documents-options.page.ts
+++ b/src/app/shared/popover/event-details-documents-options/event-details-documents-options.page.ts
@@ -3,6 +3,10 @@ import { ModalController, NavParams } from '@ionic/angular';
import { PermissionService } from 'src/app/services/permission.service';
import { ProcessesService} from 'src/app/services/processes.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
+import { ToastService } from 'src/app/services/toast.service';
+import { TaskService } from 'src/app/services/task.service';
+import { RouteService } from 'src/app/services/route.service';
+import { PopupQuestionPage } from 'src/app/modals/popup-question/popup-question.page';
@Component({
selector: 'app-event-details-documents-options',
@@ -13,20 +17,35 @@ export class EventDetailsDocumentsOptionsPage implements OnInit {
Document: any
content: any = "";
+ InstanceID:any
+ FolderID:any
+ DraftIds:any
+ DraftNames:any
+ serialnumber: any
constructor(
public p: PermissionService,
private modalController: ModalController,
private navParams: NavParams,
private processService: ProcessesService,
- private erroHandler: HttpErrorHandle
+ private erroHandler: HttpErrorHandle,
+
+ private processes: ProcessesService,
+ private toastService: ToastService,
+ public TaskService: TaskService,
+ private RouteService: RouteService,
) {
this.Document = this.navParams.get('Document')
this.content = this.navParams.get('content')
+ this.InstanceID = this.navParams.get('InstanceId')
+ this.FolderID = this.navParams.get('FolderId')
+ this.DraftIds = this.navParams.get('DraftIds')
+ this.DraftNames = this.navParams.get('OriginalFileName')
+ this.serialnumber = this.navParams.get('Serialnumber');
}
ngOnInit() {
- console.log(this.content)
+ console.log(this.serialnumber)
}
close() {
@@ -86,4 +105,83 @@ export class EventDetailsDocumentsOptionsPage implements OnInit {
}
+ async Assinar() {
+ let body = {
+ "serialNumber": this.serialnumber,
+ "action": "Assinado",
+ "ActionTypeId": 99999842,
+ "FolderId": this.FolderID,
+ "dataFields": {
+ "ReviewUserComment": '',
+ "InstanceIDNew": this.InstanceID,
+ "DraftIds": "",
+ },
+ "AttachmentList": {
+ "ProcessInstanceID": this.InstanceID,
+ "DraftIds": null,
+ "Attachments": []
+ },
+ }
+
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.erroHandler.httpsSucessMessagge('Assinado')
+ } catch (error) {
+ this.erroHandler.httpStatusHandle(error)
+ }
+ finally { }
+
+ }
+
+ async AssinarDraft() {
+ const modal = await this.modalController.create({
+ component: PopupQuestionPage,
+ componentProps: {
+ title: 'Deseja assinar este Diploma?',
+ /* message: 'Nota: Ao Efetuar esta operação, o tratamento deste diploma não poderá ser realizado a partir da caixa de correspondência' */
+ },
+ cssClass: "popup-question discart-expedient-modal",
+ backdropDismiss: true
+ });
+
+ modal.onDidDismiss().then(async (res) => {
+ const data = res.data
+ if(data == "Yes") {
+ let body = {
+ "InstanceId": this.InstanceID,
+ "FolderId": this.FolderID,
+ "DraftIds": this.DraftIds,
+ "OriginalFileName": this.DraftNames
+ }
+
+ const loader = this.toastService.loading()
+
+
+ try {
+ await this.processes.presidentialActionsSignature(body).toPromise()
+
+ await this.Assinar();
+ this.TaskService.loadDiplomas();
+ this.goBackRoute();
+ } catch (error) {
+ this.erroHandler.httpStatusHandle(error)
+ }
+ finally {
+ loader.remove()
+ }
+ }
+
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+
+ }
+
+ goBackRoute() {
+ this.RouteService.goBack();
+ }
+
}
diff --git a/src/app/shared/publication/edit-action/edit-action.page.html b/src/app/shared/publication/edit-action/edit-action.page.html
index 083a6d005..16a5f0e76 100644
--- a/src/app/shared/publication/edit-action/edit-action.page.html
+++ b/src/app/shared/publication/edit-action/edit-action.page.html
@@ -113,14 +113,15 @@
diff --git a/src/app/shared/publication/new-action/new-action.page.html b/src/app/shared/publication/new-action/new-action.page.html
index 9b74f47a7..3bd0f9091 100644
--- a/src/app/shared/publication/new-action/new-action.page.html
+++ b/src/app/shared/publication/new-action/new-action.page.html
@@ -118,14 +118,15 @@
diff --git a/src/app/shared/publication/new-publication/new-publication.page.html b/src/app/shared/publication/new-publication/new-publication.page.html
index b68341348..6fbceb056 100644
--- a/src/app/shared/publication/new-publication/new-publication.page.html
+++ b/src/app/shared/publication/new-publication/new-publication.page.html
@@ -107,14 +107,15 @@
diff --git a/src/app/shared/publication/view-publications/view-publications.page.ts b/src/app/shared/publication/view-publications/view-publications.page.ts
index 90899c555..61e860d45 100644
--- a/src/app/shared/publication/view-publications/view-publications.page.ts
+++ b/src/app/shared/publication/view-publications/view-publications.page.ts
@@ -259,7 +259,7 @@ export class ViewPublicationsPage implements OnInit {
backdropDismiss: true,
componentProps: {
title: 'Deseja arquivar este acção?',
- description: 'Nota: Ao Efetuar esta operação, o tratamento deste acção não poderá ser realizado a partir da lista de acções'
+ /* description: 'Nota: Ao Efetuar esta operação, o tratamento deste acção não poderá ser realizado a partir da lista de acções' */
},
});
diff --git a/src/app/tiny-mce/tiny-mce.page.html b/src/app/tiny-mce/tiny-mce.page.html
index 1c4d03450..340e10835 100644
--- a/src/app/tiny-mce/tiny-mce.page.html
+++ b/src/app/tiny-mce/tiny-mce.page.html
@@ -9,9 +9,9 @@
{{Document.Assunto}}