mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
Add validation for mobile
This commit is contained in:
@@ -199,73 +199,69 @@ export class CreateProcessPage implements OnInit {
|
||||
this.dispatchFolder.SubjectTypes = this.selectedTypes;
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
if(this.taskParticipants.length > 0) {
|
||||
switch (this.taskType) {
|
||||
case '0':
|
||||
this.postData = {
|
||||
DistributionType: "Paralelo",
|
||||
CountryCode: 'AO',
|
||||
Priority: this.postData.Priority,
|
||||
UserEmail: this.loggeduser.Email,
|
||||
UsersSelected: attendees,
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
}
|
||||
console.log('this.postData', this.postData, this.taskType);
|
||||
|
||||
try {
|
||||
await this.processes.postDespatcho(this.postData).toPromise();
|
||||
this.FinalizarDespacho('Despacho criado');
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
}
|
||||
|
||||
break;
|
||||
case '1':
|
||||
this.postData = {
|
||||
DistributionType: "Paralelo",
|
||||
CountryCode: 'AO',
|
||||
Priority: this.postData.Priority,
|
||||
UserEmail: this.loggeduser.Email,
|
||||
UsersSelected: attendees,
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
}
|
||||
console.log(this.postData);
|
||||
|
||||
try {
|
||||
await this.processes.postParecer(this.postData).toPromise();
|
||||
this.FinalizarParecer('Pedido de Parecer enviado');
|
||||
}
|
||||
catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
}
|
||||
|
||||
break;
|
||||
case '2':
|
||||
this.postData = {
|
||||
DistributionType: "Paralelo",
|
||||
CountryCode: 'AO',
|
||||
Priority: this.postData.Priority,
|
||||
UserEmail: this.loggeduser.Email,
|
||||
UsersSelected: attendees,
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
}
|
||||
console.log(this.postData);
|
||||
|
||||
try {
|
||||
await this.processes.postDeferimento(this.postData).toPromise();
|
||||
this.FinalizarDeferimento('Pedido de deferimento enviado');
|
||||
}
|
||||
catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
}
|
||||
break;
|
||||
switch (this.taskType) {
|
||||
case '0':
|
||||
this.postData = {
|
||||
DistributionType: "Paralelo",
|
||||
CountryCode: 'AO',
|
||||
Priority: this.postData.Priority,
|
||||
UserEmail: this.loggeduser.Email,
|
||||
UsersSelected: attendees,
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
}
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
else {
|
||||
this.toastService.badRequest('Lista de intervenientes vazia. Por favor, adicione 1 ou mais intervenientes.');
|
||||
}
|
||||
|
||||
console.log('this.postData', this.postData, this.taskType);
|
||||
|
||||
try {
|
||||
await this.processes.postDespatcho(this.postData).toPromise();
|
||||
this.FinalizarDespacho('Despacho criado');
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
}
|
||||
|
||||
break;
|
||||
case '1':
|
||||
this.postData = {
|
||||
DistributionType: "Paralelo",
|
||||
CountryCode: 'AO',
|
||||
Priority: this.postData.Priority,
|
||||
UserEmail: this.loggeduser.Email,
|
||||
UsersSelected: attendees,
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
}
|
||||
console.log(this.postData);
|
||||
|
||||
try {
|
||||
await this.processes.postParecer(this.postData).toPromise();
|
||||
this.FinalizarParecer('Pedido de Parecer enviado');
|
||||
}
|
||||
catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
}
|
||||
|
||||
break;
|
||||
case '2':
|
||||
this.postData = {
|
||||
DistributionType: "Paralelo",
|
||||
CountryCode: 'AO',
|
||||
Priority: this.postData.Priority,
|
||||
UserEmail: this.loggeduser.Email,
|
||||
UsersSelected: attendees,
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
}
|
||||
console.log(this.postData);
|
||||
|
||||
try {
|
||||
await this.processes.postDeferimento(this.postData).toPromise();
|
||||
this.FinalizarDeferimento('Pedido de deferimento enviado');
|
||||
}
|
||||
catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
}
|
||||
break;
|
||||
}
|
||||
this.modalController.dismiss();
|
||||
|
||||
break;
|
||||
|
||||
case 'PR':
|
||||
|
||||
@@ -62,14 +62,14 @@ export class DespachosPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
//Inicializar segment
|
||||
this.segment = "despachos";
|
||||
this.LoadList();
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
||||
this.doRefresh();
|
||||
}
|
||||
});
|
||||
//Inicializar segment
|
||||
this.segment = "despachos";
|
||||
this.LoadList();
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
||||
this.doRefresh();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user