This commit is contained in:
tiago.kayaya
2021-06-09 16:56:17 +01:00
45 changed files with 572 additions and 285 deletions
@@ -83,14 +83,14 @@ export class DespachoPrPage implements OnInit {
}
goBack(){
// let navigationExtras: NavigationExtras = {
// queryParams: {
// "despachospr": true,
// }
// };
// this.router.navigate(['/home/gabinete-digital'], navigationExtras);
let navigationExtras: NavigationExtras = {
queryParams: {
"despachospr": true,
}
};
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
window.history.back()
}
@@ -174,7 +174,7 @@ export class DespachoPrPage implements OnInit {
this.modalController.dismiss();
}
async executado(note:string, documents:any){
async executado(note:string, documents:any) {
let body = {
"serialNumber": this.serialnumber,
"action": "Conhecimento",
@@ -464,7 +464,7 @@ export class DespachoPrPage implements OnInit {
return await popover.present();
}
async successMessage(message?: string) {
async successMessage(message?: any, callback?) {
const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create()
@@ -503,11 +503,14 @@ export class DespachoPrPage implements OnInit {
modal.present()
setTimeout(()=>{
if (callback) {
callback()
}
modal.dismiss()
},3000)
},7000)
}
async badRequest(message?) {
async badRequest(message?: string, callback?) {
const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create()
.addElement(baseEl.querySelector('ion-backdrop')!)
@@ -545,7 +548,10 @@ export class DespachoPrPage implements OnInit {
modal.present()
setTimeout(()=>{
if (callback) {
callback()
}
modal.dismiss()
},3000)
},7000)
}
}
@@ -85,7 +85,17 @@ export class DespachoPage implements OnInit {
}
goBack() {
window.history.back()
// window.history.back()
let navigationExtras: NavigationExtras = {
queryParams: {
// "serialNumber": serialNumber,
'despachos': true
}
}
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
@@ -209,7 +219,7 @@ export class DespachoPage implements OnInit {
}
async reexecute(note:string, documents:any){
async reexecute(note:string, documents:any) {
let body = {
"serialNumber": this.serialnumber,
"action": "Reencaminhar",
@@ -231,7 +241,7 @@ export class DespachoPage implements OnInit {
}
sendExpedienteToPending(){
async sendExpedienteToPending() {
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
console.log(res);
this.close();
@@ -414,7 +424,7 @@ export class DespachoPage implements OnInit {
}
async successMessage(message?: string) {
async successMessage(message?: any, callback?) {
const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create()
@@ -453,12 +463,15 @@ export class DespachoPage 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')!)
@@ -496,7 +509,10 @@ export class DespachoPage implements OnInit {
modal.present()
setTimeout(()=>{
if (callback) {
callback()
}
modal.dismiss()
},3000)
},7000)
}
}
@@ -53,8 +53,14 @@ export class DiplomaAssinarPage implements OnInit {
this.LoadTaskDetail(this.serialnumber);
}
goBack(){
window.history.back()
goBack() {
let navigationExtras: NavigationExtras = {
queryParams: {
"diplomas": true,
}
}
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
async openOptions(taskAction?: any) {
@@ -144,18 +150,20 @@ export class DiplomaAssinarPage implements OnInit {
}
try {
await this.processes.CompleteTask(body).toPromise()
this.goBack();
this.successMessage()
this.successMessage(false, ()=>{
this.goBack();
})
} catch (error) {
this.badRequest()
}
}
close(){
close() {
this.modalController.dismiss();
}
async successMessage(message?: string) {
async successMessage(message?: any, callback?) {
const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create()
@@ -194,12 +202,15 @@ export class DiplomaAssinarPage 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')!)
@@ -237,8 +248,11 @@ export class DiplomaAssinarPage implements OnInit {
modal.present()
setTimeout(()=>{
if (callback) {
callback()
}
modal.dismiss()
},3000)
},7000)
}
}
@@ -55,14 +55,15 @@ export class DiplomaPage implements OnInit {
}
goBack() {
// let navigationExtras: NavigationExtras = {
// queryParams: {
// "diplomas": true,
// }
// };
// this.router.navigate(['/home/gabinete-digital'], navigationExtras);
window.history.back()
let navigationExtras: NavigationExtras = {
queryParams: {
"diplomas": true,
}
}
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
async openOptions(taskAction?: any) {
@@ -152,8 +153,11 @@ export class DiplomaPage implements OnInit {
}
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
this.successMessage()
this.successMessage(false, ()=>{
this.close();
})
} catch (error) {
this.badRequest()
}
@@ -271,7 +275,7 @@ export class DiplomaPage implements OnInit {
this.modalController.dismiss();
}
async successMessage(message?: string) {
async successMessage(message?: any, callback?) {
const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create()
@@ -310,12 +314,15 @@ export class DiplomaPage 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')!)
@@ -353,8 +360,11 @@ export class DiplomaPage implements OnInit {
modal.present()
setTimeout(()=>{
if (callback) {
callback()
}
modal.dismiss()
},3000)
},7000)
}
}
@@ -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)
}
}
@@ -305,7 +305,7 @@ export class BookMeetingModalPage implements OnInit {
async successMessage(message?: string) {
async successMessage(message?: any, callback?) {
const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create()
@@ -350,7 +350,7 @@ export class BookMeetingModalPage implements OnInit {
}
async badRequest(message?: string) {
async badRequest(message?: string, callback?) {
const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create()
.addElement(baseEl.querySelector('ion-backdrop')!)
@@ -388,8 +388,11 @@ export class BookMeetingModalPage implements OnInit {
modal.present()
setTimeout(()=>{
if (callback) {
callback()
}
modal.dismiss()
},3000)
},7000)
}
goToGabinete() {
@@ -528,7 +528,7 @@ export class ExpedientTaskModalPage implements OnInit {
}
async successMessage(message?: string) {
async successMessage(message?: any, callback?) {
const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create()
@@ -567,12 +567,15 @@ export class ExpedientTaskModalPage 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')!)
@@ -610,8 +613,11 @@ export class ExpedientTaskModalPage implements OnInit {
modal.present()
setTimeout(()=>{
if (callback) {
callback()
}
modal.dismiss()
},3000)
},7000)
}
}
@@ -109,7 +109,7 @@
<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)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" *ngIf="hideSendToPendentes" >Enviar para Pendentes</button>
<div hidden class="solid"></div>
<button hidden class="btn-cancel" shape="round" >Delegar</button>
<button hidden (click)="showToast()" class="btn-cancel" shape="round" >ShowToast</button>
@@ -39,6 +39,9 @@ export class ExpedienteDetailPage implements OnInit {
intervenientes: any;
cc: any = [];
hideSendToPendentes = true
constructor(private activateRoute: ActivatedRoute,
private processes: ProcessesService,
private iab: InAppBrowser,
@@ -53,12 +56,19 @@ export class ExpedienteDetailPage implements OnInit {
private toastService: ToastService,
private animationController: AnimationController
) {
this.activatedRoute.queryParams.subscribe(params => {
if(params["serialNumber"]) {
this.serialnumber = params["serialNumber"];
console.log(params["serialNumber"]);
}
if(params["type"] == "pendentes") {
this.hideSendToPendentes = false
}
});
}
ngOnInit() {
@@ -76,29 +86,45 @@ export class ExpedienteDetailPage implements OnInit {
this.LoadRelatedEvents(this.serialnumber);
}
close(){
close() {
this.modalController.dismiss();
}
showToast(){
showToast() {
this.toastService.presentToast('Não foi possível fazer login"');
}
/* goBack() {
window.history.back()
} */
goBack(){
let navigationExtras: NavigationExtras = {
queryParams: {
"expedientes": true,
goBack() {
this.activatedRoute.queryParams.subscribe(params => {
if(params["from"] == "inicio") {
this.router.navigate(['/home/events']);
} else {
let navigationExtras: NavigationExtras = {
queryParams: {
"expedientes": true,
}
}
if( window.innerWidth < 801) {
this.router.navigate(['/home/gabinete-digital/expediente']);
} else {
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
}
};
if( window.innerWidth < 801){
this.router.navigate(['/home/gabinete-digital/expediente']);
} else {
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
});
}
sendExpedienteToPending(){
@@ -334,7 +360,7 @@ export class ExpedienteDetailPage implements OnInit {
async successMessage(message?: string) {
async successMessage(message?: any, callback?) {
const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create()
@@ -373,12 +399,15 @@ export class ExpedienteDetailPage 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')!)
@@ -416,8 +445,11 @@ export class ExpedienteDetailPage implements OnInit {
modal.present()
setTimeout(()=>{
if (callback) {
callback()
}
modal.dismiss()
},3000)
},7000)
}
}
@@ -87,17 +87,24 @@ export class ExpedientePage implements OnInit {
}, 2000);
}
goBack(){
goBack() {
this.router.navigate(['/home/gabinete-digital']);
}
goToExpediente(serialNumber:any){
goToExpediente(serialNumber:any) {
let navigationExtras: NavigationExtras = {
queryParams: {
"serialNumber": serialNumber,
"serialNumber": serialNumber,
"from": "gabinete",
"type": "pendentes"
}
};
}
this.router.navigate(['/home/gabinete-digital/expediente/expediente-detail'], navigationExtras);
}
}
@@ -88,14 +88,14 @@ export class ExpedientePrPage implements OnInit {
}
goBack() {
// let navigationExtras: NavigationExtras = {
// queryParams: {
// "expedientes-pr": true,
// }
// };
// this.router.navigate(['/home/gabinete-digital'], navigationExtras);
let navigationExtras: NavigationExtras = {
queryParams: {
"expedientes-pr": true,
}
};
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
window.history.back();
}
@@ -440,7 +440,7 @@ export class ExpedientePrPage implements OnInit {
return await popover.present();
}
async successMessage(message?: string) {
async successMessage(message?: any, callback?) {
const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create()
@@ -479,12 +479,15 @@ export class ExpedientePrPage implements OnInit {
modal.present()
setTimeout(()=>{
if (callback) {
callback()
}
modal.dismiss()
},3000)
},7000)
}
async badRequest(message?) {
async badRequest(message?: string, callback?) {
const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create()
.addElement(baseEl.querySelector('ion-backdrop')!)
@@ -150,14 +150,14 @@ export class ExpedientesPrPage implements OnInit {
}
goBack() {
// let navigationExtras: NavigationExtras = {
// queryParams: {
// "expedientes-pr": true,
// }
// };
// this.router.navigate(['/home/gabinete-digital'], navigationExtras);
let navigationExtras: NavigationExtras = {
queryParams: {
"expedientes-pr": true,
}
};
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
window.history.back();
// window.history.back();
}
@@ -407,14 +407,18 @@ export class PedidoPage implements OnInit {
}
goBack() {
window.history.back();
let navigationExtras: NavigationExtras = {
queryParams: {
"pedidos": true,
}
}
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
async successMessage(message?: string) {
async successMessage(message?: any, callback?) {
const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create()
@@ -453,12 +457,15 @@ export class PedidoPage implements OnInit {
modal.present()
setTimeout(()=>{
if (callback) {
callback()
}
modal.dismiss()
},3000)
},7000)
}
async badRequest(message?) {
async badRequest(message?: string, callback?) {
const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create()
.addElement(baseEl.querySelector('ion-backdrop')!)
@@ -54,8 +54,16 @@ export class PendentesPage implements OnInit {
}
goBack() {
let navigationExtras: NavigationExtras = {
queryParams: {
"pedidos": true,
}
}
window.history.back();
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
// window.history.back();
}
notImplemented(){
@@ -168,7 +176,8 @@ export class PendentesPage implements OnInit {
let navigationExtras: NavigationExtras = {
queryParams: {
"serialNumber": serialNumber,
"from": "pendentes"
"from": "pendentes",
"type": "pendentes"
}
};
this.router.navigate(['/home/gabinete-digital/expediente/expediente-detail'], navigationExtras);