mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
+27
-15
@@ -71,7 +71,8 @@ export class ApproveEventModalPage implements OnInit {
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
|
||||
getTask(){
|
||||
getTask() {
|
||||
|
||||
this.processes.GetTask(this.serialNumber).subscribe(res => {
|
||||
console.log('GET TASK SERIALNUMBER: ', this.serialNumber,'Approve event',res);
|
||||
this.loadedEvent = res;
|
||||
@@ -83,6 +84,7 @@ export class ApproveEventModalPage implements OnInit {
|
||||
this.getAttachments()
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
viewDocument(docId:string, applicationId:string){
|
||||
@@ -94,20 +96,22 @@ export class ApproveEventModalPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
async approveTask(serialNumber:string){
|
||||
async approveTask(serialNumber:string) {
|
||||
console.log('approveTask SERIALNUMBER: ', serialNumber)
|
||||
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
|
||||
console.log(body);
|
||||
try {
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
this.successMessage('Evento aprovado')
|
||||
|
||||
this.successMessage('Evento aprovado', ()=>{
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
})
|
||||
|
||||
} catch (error) {
|
||||
this.badRequest('Evento não aprovado')
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
emendTask(serialNumber:string){
|
||||
@@ -119,15 +123,17 @@ export class ApproveEventModalPage implements OnInit {
|
||||
}
|
||||
|
||||
async rejectTask(serialNumber:string) {
|
||||
// console.log('rejectTask: ',serialNumber)
|
||||
|
||||
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||
// console.log(body);
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
|
||||
this.successMessage('Evento rejeitado')
|
||||
this.successMessage('Evento rejeitado', () =>{
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
})
|
||||
|
||||
|
||||
} catch (error) {
|
||||
this.badRequest('Evento não rejeitado')
|
||||
}
|
||||
@@ -214,7 +220,7 @@ export class ApproveEventModalPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async successMessage(message?: string) {
|
||||
async successMessage(message?: any, callback?) {
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
@@ -253,12 +259,15 @@ export class ApproveEventModalPage implements OnInit {
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},3000)
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string) {
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
@@ -296,8 +305,11 @@ export class ApproveEventModalPage implements OnInit {
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},3000)
|
||||
},7000)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -63,10 +63,18 @@ export class ApproveEventPage implements OnInit {
|
||||
}
|
||||
|
||||
goBack() {
|
||||
window.history.back();
|
||||
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"eventos": true,
|
||||
}
|
||||
};
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
|
||||
|
||||
}
|
||||
|
||||
async getTask(){
|
||||
async getTask() {
|
||||
this.loadedEvent = await this.processes.GetTask(this.serialNumber).toPromise();
|
||||
console.log(this.loadedEvent);
|
||||
|
||||
@@ -78,17 +86,17 @@ export class ApproveEventPage implements OnInit {
|
||||
this.getAttachments(instanceId);
|
||||
}
|
||||
|
||||
async approveTask(serialNumber:string){
|
||||
async approveTask(serialNumber:string) {
|
||||
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
|
||||
console.log(body);
|
||||
|
||||
try {
|
||||
//await this.processes.PostTaskAction(body).toPromise()
|
||||
this.toastService.successMessage('Evento aprovado');
|
||||
setTimeout(()=>{
|
||||
//this.successMessage()
|
||||
this.toastService.successMessage('Evento aprovado', ()=>{
|
||||
this.goBack();
|
||||
},7000)
|
||||
//this.goBack();
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
@@ -115,10 +123,12 @@ export class ApproveEventPage implements OnInit {
|
||||
console.log(body);
|
||||
this.successMessage('Process');
|
||||
try {
|
||||
//this.processes.PostTaskAction(body).toPromise();
|
||||
|
||||
await this.toastService.successMessage('Processo rejeitado');
|
||||
this.goBack();
|
||||
this.processes.PostTaskAction(body).toPromise();
|
||||
await this.successMessage('Processo rejeitado');
|
||||
await this.toastService.successMessage('Processo rejeitado', ()=>{
|
||||
this.goBack();
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
@@ -193,14 +203,14 @@ export class ApproveEventPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
/* goToEventsToApprove(){
|
||||
goToEventsToApprove(){
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"eventos": true,
|
||||
}
|
||||
};
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
} */
|
||||
}
|
||||
|
||||
|
||||
async editar(serialNumber: string) {
|
||||
@@ -226,7 +236,7 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
|
||||
|
||||
async successMessage(message?: string) {
|
||||
async successMessage(message?: any, callback?) {
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
@@ -265,12 +275,15 @@ export class ApproveEventPage implements OnInit {
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},3000)
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string) {
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
@@ -308,8 +321,11 @@ export class ApproveEventPage implements OnInit {
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},3000)
|
||||
},7000)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user