From 345a2cdbcacc4e78c2eb9a3cb6d200b483f82148 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 18 Jun 2021 16:03:49 +0100 Subject: [PATCH] Improve create process --- .../create-process/create-process.page.ts | 43 +++++++++++++------ 1 file changed, 31 insertions(+), 12 deletions(-) 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'); } }