This commit is contained in:
Eudes Inácio
2021-10-18 07:44:49 +01:00
9 changed files with 105 additions and 132 deletions
@@ -50,7 +50,7 @@
<div class="ion-icon-class">
<ion-icon class="icon-time" slot="start" name="time-outline"></ion-icon>
</div>
<div class="ion-input-class" [class.input-error]="Form?.get('Priority')?.invalid && validateFrom ">
<div class="ion-input-class" [class.input-error]="Form?.get('Priority')?.invalid && validateFrom || validateField ">
<ion-select
placeholder="Prazo*"
[(ngModel)]="postData.Priority"
@@ -88,7 +88,8 @@ export class ExpedientTaskModalPage implements OnInit {
toppings = new FormControl();
Form: FormGroup;
validateFrom = false
validateFrom = false;
validateField = false;
get toppingsValues() {
return this.toppings.value;
@@ -184,7 +185,7 @@ export class ExpedientTaskModalPage implements OnInit {
}
runValidation() {
this.validateFrom = true
this.validateFrom = true;
}
injectValidation() {
@@ -426,17 +427,23 @@ export class ExpedientTaskModalPage implements OnInit {
}
}
try {
this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
await this.toastService.successMessage('Processo efetuado');
this.modalController.dismiss(action_despacho_pr);
} catch (error) {
await this.toastService.badRequest('Processo não efetuado')
} finally {
loader.remove()
}
if(this.postData.DispatchFolder.Message){
try {
this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
await this.toastService.successMessage('Processo efetuado');
this.modalController.dismiss(action_despacho_pr);
} catch (error) {
console.log('this.taskResult', this.taskResult);
await this.toastService.badRequest('Processo não efetuado')
} finally {
//loader.remove()
}
}
else{
this.validateField = true;
this.toastService.badRequest('Por favor adicione uma nota');
}
loader.remove();
break;
case '1': // parecer
@@ -459,24 +466,16 @@ export class ExpedientTaskModalPage implements OnInit {
}
}
if(this.postData.DispatchFolder.Message){
try {
try {
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
await this.toastService.successMessage('Pedido enviado');
this.modalController.dismiss(action_parecer_pr);
} catch (error) {
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
await this.toastService.successMessage('Pedido enviado');
this.modalController.dismiss(action_parecer_pr);
} catch (error) {
await this.toastService.badRequest('Processo não efetuado')
} finally {
//loader.remove()
}
await this.toastService.badRequest('Processo não efetuado')
} finally {
loader.remove()
}
else{
this.toastService.badRequest('Por favor adicione uma nota');
}
loader.remove();
break;
}