mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
save
This commit is contained in:
@@ -28,7 +28,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
) {
|
||||
) {
|
||||
this.task = this.navParams.get('task');
|
||||
this.fulltask = this.navParams.get('fulltask');
|
||||
|
||||
@@ -58,7 +58,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
if(this.task.Status == "Pending" && this.caller != 'events'){
|
||||
if (window.innerWidth <= 800) {
|
||||
this.router.navigate(['/home/gabinete-digital/pendentes']);
|
||||
}
|
||||
}
|
||||
else {
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
@@ -70,19 +70,19 @@ export class OptsExpedientePage implements OnInit {
|
||||
}
|
||||
else{
|
||||
window.history.back();
|
||||
|
||||
|
||||
/* this.activatedRoute.paramMap.subscribe(params => {
|
||||
console.log('YES');
|
||||
console.log(params);
|
||||
|
||||
|
||||
|
||||
|
||||
switch (params["params"].caller) {
|
||||
case 'events':
|
||||
console.log('here-1');
|
||||
|
||||
|
||||
this.router.navigate(['/home',params["params"].caller]);
|
||||
break;
|
||||
|
||||
|
||||
case 'gabinete-digital':
|
||||
console.log('here0');
|
||||
let navigationExtras: NavigationExtras = {
|
||||
@@ -93,12 +93,12 @@ export class OptsExpedientePage implements OnInit {
|
||||
if( window.innerWidth < 801) {
|
||||
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||
console.log('here');
|
||||
|
||||
|
||||
} else {
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}); */
|
||||
}
|
||||
@@ -152,12 +152,22 @@ export class OptsExpedientePage implements OnInit {
|
||||
cssClass: classs,
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
modal.onDidDismiss().then(async res=>{
|
||||
console.log(res['data']);
|
||||
let body = res['data'];
|
||||
if(res['data']){
|
||||
console.log('open discart')
|
||||
this.distartExpedientModal(body);
|
||||
//this.distartExpedientModal(body);
|
||||
const loader = this.toastService.loading()
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
}
|
||||
else{
|
||||
console.log('Not open');
|
||||
@@ -174,7 +184,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
cssClass: 'discart-expedient-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
console.log(res['data']);
|
||||
@@ -192,7 +202,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
@@ -201,7 +211,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
@@ -212,7 +222,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
if(res['data']== 'Yes'){
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
|
||||
Reference in New Issue
Block a user