mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Improve expediente descart
This commit is contained in:
@@ -13,7 +13,9 @@ import { SearchDocumentPipe } from 'src/app/pipes/search-document.pipe';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
import { Location } from '@angular/common';
|
||||
import { TaskService } from 'src/app/Rules/task.service'
|
||||
import { ExpedienteService } from 'src/app/Rules/expediente.service';
|
||||
@Component({
|
||||
selector: 'app-opts-expediente',
|
||||
templateUrl: './opts-expediente.page.html',
|
||||
@@ -40,6 +42,9 @@ export class OptsExpedientePage implements OnInit {
|
||||
private activatedRoute: ActivatedRoute,
|
||||
public p: PermissionService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private location: Location,
|
||||
private TaskService: TaskService,
|
||||
private expedienteService: ExpedienteService
|
||||
) {
|
||||
this.task = this.navParams.get('task');
|
||||
this.fulltask = this.navParams.get('fulltask');
|
||||
@@ -81,7 +86,8 @@ export class OptsExpedientePage implements OnInit {
|
||||
}
|
||||
}
|
||||
else {
|
||||
window.history.back();
|
||||
this.location.back()
|
||||
|
||||
|
||||
/* this.activatedRoute.paramMap.subscribe(params => {
|
||||
console.log('YES');
|
||||
@@ -354,24 +360,16 @@ export class OptsExpedientePage implements OnInit {
|
||||
|
||||
if(body == 'descartar') {
|
||||
if(res['data']== 'Yes') {
|
||||
let otherbody = {
|
||||
"serialNumber": this.task.SerialNumber,
|
||||
"action": "Passivo",
|
||||
"ActionTypeId": 99999877,
|
||||
"dataFields": {
|
||||
"Note": "",
|
||||
}
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
await this.expedienteService.discard({SerialNumber: this.task.SerialNumber}).toPromise()
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
} finally {
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -382,7 +380,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(res['data']== 'Yes'){
|
||||
if(res['data']== 'Yes') {
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user