lot of changes

This commit is contained in:
Eudes Inácio
2023-10-19 16:51:12 +01:00
parent ff52c56cde
commit 57f51903bc
51 changed files with 43514 additions and 1079 deletions
@@ -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 {