From a0a63383c626d516cf7391b8fa2d12d1a29f0101 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Thu, 19 Aug 2021 18:56:08 +0100 Subject: [PATCH] Fix --- .../despachos-pr-options.page.ts | 33 +++++++++++++++++-- src/app/store/localstore.service.ts | 2 +- src/app/store/publication-list.service.ts | 1 - 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.ts b/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.ts index 6e9814807..2f0326b59 100644 --- a/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.ts +++ b/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.ts @@ -244,17 +244,44 @@ export class DespachosPrOptionsPage implements OnInit { else if(actionName == 'Gerar Diploma'){ await this.generateDiploma(res.data.note, docs); } - else if(actionName == 'Concluido'){ - //this.concluir(res.data.note, docs); - } else if(actionName == 'Reexecução'){ await this.reexecutar(res.data.note, docs); + } + else if(actionName == 'Concluido'){ + await this.concluir(res.data.note, docs); } this.goBack(); } }); } + + async concluir(note:string, documents:any){ + let body = { + "serialNumber": this.serialNumber, + "action": "Executado", + "ActionTypeId": 104, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList" :documents, + } + + const loader = this.toastService.loading() + + try { + await this.processes.CompleteTask(body).toPromise() + this.toastService.successMessage('') + this.close(); + } catch (error) { + this.toastService.badRequest() + } + finally { + loader.remove() + } + + } + async arquivar(note:string, documents:any){ let body = { "serialNumber": this.serialNumber, diff --git a/src/app/store/localstore.service.ts b/src/app/store/localstore.service.ts index 25e0ecc8a..bdf55dab8 100644 --- a/src/app/store/localstore.service.ts +++ b/src/app/store/localstore.service.ts @@ -59,7 +59,7 @@ export class LocalstoreService { export const localstoreService = new LocalstoreService() -// console.log( AES.encrypt( 'peter', 'v14-dba29fd8bdbf24ffe4840b0f778f70f6a163d424').toString()) +console.log( AES.encrypt( 'pode ser qualquer', 'ayrton').toString() ) // // Create WebSocket connection. // const socket = new WebSocket('ws://localhost:8080'); diff --git a/src/app/store/publication-list.service.ts b/src/app/store/publication-list.service.ts index af78763be..48e3e4a26 100644 --- a/src/app/store/publication-list.service.ts +++ b/src/app/store/publication-list.service.ts @@ -1,5 +1,4 @@ import { Injectable } from '@angular/core' -import { Publication } from 'src/app/models/publication' import { localstoreService } from './localstore.service' import { SHA1 } from 'crypto-js'