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