This commit is contained in:
Peter Maquiran
2023-08-14 16:25:57 +01:00
parent 4ae2e7cfa8
commit 0c64632986
10 changed files with 107 additions and 19 deletions
@@ -13,6 +13,7 @@ import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { environment } from 'src/environments/environment';
import { TaskService } from 'src/app/services/task.service'
@Component({
selector: 'app-despachos-options',
@@ -36,6 +37,7 @@ export class DespachosOptionsPage implements OnInit {
public ThemeService: ThemeService,
private RouteService: RouteService,
private httpErrorHandle: HttpErrorHandle,
public TaskService: TaskService
) {
this.task = this.navParams.get('task')
this.fulltask = this.navParams.get('fulltask')
@@ -249,7 +251,7 @@ export class DespachosOptionsPage implements OnInit {
await this.generateDiploma(res.data.note, docs);
}
else if(actionName == 'Concluido') {
//this.concluir(res.data.note, docs);
this.concluir(res.data.note, docs);
}
else if(actionName == 'Reexecução') {
await this.reexecutar(res.data.note, docs);
@@ -261,6 +263,34 @@ export class DespachosOptionsPage implements OnInit {
});
}
async concluir(note: string, documents: any) {
let body = {
"serialNumber": this.serialNumber,
"action": "Arquivo",
"ActionTypeId": 95,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList": documents,
}
const loader = this.toastService.loading()
try {
await this.processes.CompleteTask(body).toPromise()
this.httpErrorHandle.httpsSucessMessagge('Concluir Despacho')
this.TaskService.loadDiplomas()
} catch (error) {
this.httpErrorHandle.httpStatusHandle(error)
}
finally {
loader.remove()
}
}
async arquivar(note:string, documents:any) {
let body = {
"serialNumber": this.serialNumber,