This commit is contained in:
Peter Maquiran
2021-07-16 19:32:13 +01:00
parent c028e4e6f5
commit 050f84bc8e
13 changed files with 49 additions and 48 deletions
@@ -318,7 +318,7 @@ export class CreateProcessPage implements OnInit {
try {
await this.processes.postDespatcho(this.postData).toPromise();
this.executado(loader, 'Despacho criado');
await this.executado(loader, 'Despacho criado');
} catch (error) {
this.toastService.badRequest('Processo não efectuado');
}
@@ -337,7 +337,7 @@ export class CreateProcessPage implements OnInit {
try {
await this.processes.postParecer(this.postData).toPromise();
this.executado(loader);
await this.executado(loader);
this.toastService.successMessage('Pedido de Parecer criado');
}
catch (error) {
@@ -358,7 +358,7 @@ export class CreateProcessPage implements OnInit {
try {
await this.processes.postDeferimento(this.postData).toPromise();
this.executado(loader);
await this.executado(loader);
this.toastService.successMessage('Pedido de Deferimento criado');
}
catch (error) {
@@ -31,7 +31,7 @@ export class DarParecerPage implements OnInit {
ngOnInit() {
console.log(this.serialNumber
);
);
}
@@ -79,7 +79,7 @@ export class DarParecerPage implements OnInit {
this.documents = this.documents.filter( (e, i) => index != i);
}
async getDoc(){
async getDoc() {
const modal = await this.modalController.create({
component: SearchPage,
cssClass: 'modal-width-100-width-background modal',
@@ -56,13 +56,13 @@ export class EventActionsPopoverPage implements OnInit {
this.popoverController.dismiss();
}
approveTask() {
async approveTask() {
let body = { "serialNumber": this.serialNumber, "action": "Aprovar" }
console.log(body);
const loader = this.toastService.loading()
try {
this.processes.PostTaskAction(body).toPromise()
await this.processes.PostTaskAction(body).toPromise()
this.toastService.successMessage();
this.goBack();
@@ -127,7 +127,7 @@ export class EventActionsPopoverPage implements OnInit {
const loader = this.toastService.loading()
try {
this.processes.PostTaskAction(body).toPromise();
await this.processes.PostTaskAction(body).toPromise();
await this.toastService.successMessage('Processo rejeitado');
this.goBack();
} catch (error) {
@@ -335,7 +335,7 @@ export class DespachoPrPage implements OnInit {
await modal.present();
modal.onDidDismiss().then(res => {
modal.onDidDismiss().then( async (res) => {
console.log(res);
if(res.data){
@@ -354,19 +354,19 @@ export class DespachoPrPage implements OnInit {
}
if(actionName == 'Executado'){
this.executado(res.data.note, docs);
await this.executado(res.data.note, docs);
}
else if(actionName == 'Arquivar'){
this.arquivar(res.data.note, docs);
await this.arquivar(res.data.note, docs);
}
else if(actionName == 'Gerar Diploma'){
this.generateDiploma(res.data.note, docs);
await this.generateDiploma(res.data.note, docs);
}
else if(actionName == 'Concluido'){
this.concluir(res.data.note, docs);
await this.concluir(res.data.note, docs);
}
else if(actionName == 'Reexecução'){
this.reexecutar(res.data.note, docs);
await this.reexecutar(res.data.note, docs);
}
this.goBack();
}
@@ -306,7 +306,7 @@ export class DespachoPage implements OnInit {
await modal.present();
modal.onDidDismiss().then(res => {
modal.onDidDismiss().then( async (res) => {
if(res.data){
const DocumentToSave = res.data.documents.map((e) => {
@@ -323,14 +323,14 @@ export class DespachoPage implements OnInit {
if(actionName == 'Executado'){
this.executado(res.data.note, docs);
await this.executado(res.data.note, docs);
}
else if(actionName == 'Arquivar'){
this.arquivar(res.data.note, docs);
await this.arquivar(res.data.note, docs);
this.goBack();
}
else if(actionName == 'Reexecução'){
this.reexecute(res.data.note, docs);
await this.reexecute(res.data.note, docs);
this.goBack();
}
}
@@ -253,7 +253,7 @@ export class DiplomaPage implements OnInit {
await modal.present();
modal.onDidDismiss().then(res => {
modal.onDidDismiss().then(async (res) => {
if(res.data){
@@ -271,15 +271,15 @@ export class DiplomaPage implements OnInit {
if(actionName == 'Solicitar assinatura'){
this.askSignature(res.data.note, docs);
await this.askSignature(res.data.note, docs);
this.goBack();
}
else if(actionName == 'Solicitar alteração'){
this.askToChange(res.data.note, docs);
await this.askToChange(res.data.note, docs);
this.goBack();
}
else if(actionName == 'Concluir diploma'){
this.finish(res.data.note, docs);
await this.finish(res.data.note, docs);
this.goBack();
}
}
@@ -177,7 +177,7 @@ export class ApproveEventPage implements OnInit {
console.log(body);
const loader = this.toastService.loading()
try {
this.processes.PostTaskAction(body).toPromise();
await this.processes.PostTaskAction(body).toPromise();
await this.toastService.successMessage('Processo rejeitado');
this.goBack();
} catch (error) {
@@ -22,6 +22,7 @@ import { User } from 'src/app/models/user.model';
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
import { ToastService } from 'src/app/services/toast.service';
import { ForwardPage } from 'src/app/modals/forward/forward.page';
import { async } from '@angular/core/testing';
@Component({
selector: 'app-pedido',
@@ -76,7 +77,7 @@ export class PedidoPage implements OnInit {
this.LoadTaskDetail(this.serialnumber);
}
close(){
close() {
this.modalController.dismiss();
}
notImplemented(){
@@ -437,8 +438,8 @@ export class PedidoPage implements OnInit {
await modal.present();
modal.onDidDismiss().then(res => {
const DocumentToSave = res.data.documents.map((e) => {
modal.onDidDismiss().then( async (res) => {
const DocumentToSave = await res.data.documents.map( async (e) => {
return {
ApplicationId: e.ApplicationType,
SourceId: e.Id,
@@ -451,15 +452,15 @@ export class PedidoPage implements OnInit {
if(res.data){
if(actionName == 'Solicitar Reapreciação') {
this.repreciar(res.data.note, docs);
await this.repreciar(res.data.note, docs);
this.goBack();
}
else if(actionName == 'Arquivar'){
this.arquivar(res.data.note, docs);
await this.arquivar(res.data.note, docs);
this.goBack();
}
else if(actionName == 'Assignar'){
this.assignar(res.data.note, docs);
await this.assignar(res.data.note, docs);
}
}
});
@@ -55,7 +55,7 @@ export class DeplomaOptionsPage implements OnInit {
await modal.present();
modal.onDidDismiss().then(res => {
modal.onDidDismiss().then(async (res) => {
if(res.data){
@@ -73,11 +73,11 @@ export class DeplomaOptionsPage implements OnInit {
if(actionName == 'Solicitar assinatura'){
this.askSignature(res.data.note, docs);
await this.askSignature(res.data.note, docs);
this.goBack();
}
else if(actionName == 'Solicitar alteração'){
this.askToChange(res.data.note, docs);
await this.askToChange(res.data.note, docs);
this.goBack();
}
}
@@ -178,7 +178,7 @@ export class DespachosOptionsPage implements OnInit {
await modal.present();
modal.onDidDismiss().then(res => {
modal.onDidDismiss().then(async (res) => {
console.log(res);
if(res.data) {
@@ -195,19 +195,19 @@ export class DespachosOptionsPage implements OnInit {
}
if(actionName == 'Executado'){
this.executado(res.data.note, docs);
await this.executado(res.data.note, docs);
}
else if(actionName == 'Arquivar'){
this.arquivar(res.data.note, docs);
await this.arquivar(res.data.note, docs);
}
else if(actionName == 'Gerar Diploma'){
this.generateDiploma(res.data.note, docs);
await this.generateDiploma(res.data.note, docs);
}
else if(actionName == 'Concluido'){
//this.concluir(res.data.note, docs);
}
else if(actionName == 'Reexecução'){
this.reexecutar(res.data.note, docs);
await this.reexecutar(res.data.note, docs);
}
this.goBack();
}
@@ -211,7 +211,7 @@ export class DespachosPrOptionsPage implements OnInit {
await modal.present();
modal.onDidDismiss().then(res => {
modal.onDidDismiss().then(async (res) => {
console.log(res);
if(res.data){
@@ -230,19 +230,19 @@ export class DespachosPrOptionsPage implements OnInit {
}
if(actionName == 'Executado'){
this.executado(res.data.note, docs);
await this.executado(res.data.note, docs);
}
else if(actionName == 'Arquivar'){
this.arquivar(res.data.note, docs);
await this.arquivar(res.data.note, docs);
}
else if(actionName == 'Gerar Diploma'){
this.generateDiploma(res.data.note, docs);
await this.generateDiploma(res.data.note, docs);
}
else if(actionName == 'Concluido'){
//this.concluir(res.data.note, docs);
}
else if(actionName == 'Reexecução'){
this.reexecutar(res.data.note, docs);
await this.reexecutar(res.data.note, docs);
}
this.goBack();
}
@@ -90,7 +90,7 @@ export class OptsExpedientePrPage implements OnInit {
await modal.present();
modal.onDidDismiss().then(res => {
modal.onDidDismiss().then(async (res) => {
console.log(res);
if(res.data){
const DocumentToSave = res.data.documents.map((e) => {
@@ -106,10 +106,10 @@ export class OptsExpedientePrPage implements OnInit {
}
if(actionName == 'Aprovar'){
this.approve(res.data.note, docs);
await this.approve(res.data.note, docs);
}
else if(actionName == 'Revisão'){
this.sendToReview(res.data.note, docs);
await this.sendToReview(res.data.note, docs);
}
this.goBack();
}
@@ -199,7 +199,7 @@ export class RequestOptionsPage implements OnInit {
await modal.present();
modal.onDidDismiss().then(res => {
modal.onDidDismiss().then(async (res) => {
const DocumentToSave = res.data.documents.map((e) => {
@@ -218,10 +218,10 @@ export class RequestOptionsPage implements OnInit {
if(res.data){
if(actionName == 'Solicitar Reapreciação') {
this.repreciar(res.data.note, docs);
await this.repreciar(res.data.note, docs);
}
else if(actionName == 'Arquivar'){
this.arquivar(res.data.note, docs);
await this.arquivar(res.data.note, docs);
}
}
});