Improve aparecer

This commit is contained in:
Peter Maquiran
2021-06-18 15:40:31 +01:00
parent 2cb614dec8
commit d73e03aaa5
2 changed files with 23 additions and 12 deletions
@@ -197,11 +197,10 @@ export class CreateProcessPage implements OnInit {
DispatchFolder: this.dispatchFolder,
}
console.log('this.postData', this.postData, this.taskType);
try {
await this.processes.postDespatcho(this.postData).toPromise();
this.FinalizarDespacho();
this.toastService.successMessage('Despacho criado');
} catch (error) {
this.toastService.badRequest('Processo não efectuado');
}
@@ -270,11 +269,12 @@ export class CreateProcessPage implements OnInit {
DispatchFolder: this.dispatchFolder,
}
console.log('this.postData', this.postData, this.taskType);
alert('nice !!')
try {
await this.processes.postDespatcho(this.postData).toPromise();
// await this.processes.postDespatcho(this.postData).toPromise();
this.executado();
this.toastService.successMessage('Despacho criado');
// this.toastService.successMessage('Despacho criado');
} catch (error) {
this.toastService.badRequest('Processo não efectuado');
}
@@ -344,8 +344,11 @@ export class CreateProcessPage implements OnInit {
async FinalizarDespacho() {
if(this.task.activityInstanceName =='Tarefa de Despacho' || this.task.activityInstanceName =='Reexecutar Despacho'){
let body = {
let body;
if(this.task.activityInstanceName =='Tarefa de Despacho' || this.task.activityInstanceName =='Reexecutar Despacho') {
body = {
"serialNumber": this.task.serialNumber,
"action": "Conhecimento",
"ActionTypeId": 104,
@@ -354,10 +357,10 @@ export class CreateProcessPage implements OnInit {
},
"AttachmentList" :null,
}
await this.processes.CompleteTask(body).toPromise();
}
else if(this.task.activityInstanceName =='Concluir Despacho'){
let body = {
else if(this.task.activityInstanceName =='Concluir Despacho' || this.task.activityInstanceName == 'Concluir Parecer') {
body = {
"serialNumber": this.task.serialNumber,
"action": "Despacho",
"ActionTypeId": 94,
@@ -366,8 +369,16 @@ export class CreateProcessPage implements OnInit {
},
"AttachmentList" :null,
}
await this.processes.CompleteTask(body).toPromise();
}
try {
await this.processes.CompleteTask(body).toPromise();
this.toastService.successMessage('');
} catch (error) {
this.toastService.badRequest('Processo não efectuado');
}
}
async FinalizarParecer() {