diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index 5fc93cac4..d2cf3fa16 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -326,21 +326,40 @@ export class CreateProcessPage implements OnInit { } async executado(message?) { - let body = { - "serialNumber": this.task.serialNumber, - "action": "Conhecimento", - "ActionTypeId": 104, - "dataFields": { - "ReviewUserComment": '', - }, - "AttachmentList" :null, - } + + let body; + + if(this.task.activityInstanceName =='Tarefa de Despacho' || this.task.activityInstanceName =='Reexecutar Despacho') { + + body = { + "serialNumber": this.task.serialNumber, + "action": "Conhecimento", + "ActionTypeId": 104, + "dataFields": { + "ReviewUserComment": '', + }, + "AttachmentList" :null, + } + } + else if(this.task.activityInstanceName =='Concluir Despacho' || this.task.activityInstanceName == 'Concluir Parecer') { + + body = { + "serialNumber": this.task.serialNumber, + "action": "Despacho", + "ActionTypeId": 94, + "dataFields": { + "ReviewUserComment": '', + }, + "AttachmentList" :null, + } + + } try { await this.processes.CompleteTask(body).toPromise(); - this.toastService.successMessage(message) - } catch(e) { - this.toastService.badRequest() + this.toastService.successMessage(''); + } catch (error) { + this.toastService.badRequest('Processo não efectuado'); } }