Bug creating task on expediente solved

This commit is contained in:
Eudes Inácio
2022-05-05 15:30:31 +01:00
parent 174072d911
commit 54c8c4da0c
@@ -227,7 +227,7 @@ export class ExpedientTaskModalPage implements OnInit {
//
async saveTask() {
if(this.loggeduser.Profile == 'MDGPR') {
if(this.loggeduser.Profile != 'PR') {
this.injectValidation()
this.runValidation()
@@ -485,6 +485,112 @@ export class ExpedientTaskModalPage implements OnInit {
break;
}
break;
default:
if(this.taskParticipants.length > 0) {
switch (this.taskType) {
case '0': // Despacho
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.loggeduser.Email,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
AttachmentList: docs,
}
let action_despacho = {
"serialNumber": this.task.serialNumber,
"action": "Tratado",
"ActionTypeId": 94,
"dataFields": {
"Note": "",
}
}
try {
this.taskResult = await this.processes.postDespatcho(this.postData).toPromise();
await this.toastService._successMessage('Processo efetuado');
this.modalController.dismiss(action_despacho);
} catch (error) {
await this.toastService._badRequest('Processo não efetuado')
} finally {
loader.remove()
}
break;
case '1': // Parecer
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.loggeduser.Email,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
AttachmentList: docs
}
let action_parecer = {
"serialNumber": this.task.serialNumber,
"action": "Tratado",
"ActionTypeId": 92,
"dataFields": {
"Note": "",
}
}
try {
this.taskResult = await this.processes.postParecer(this.postData).toPromise();
await this.toastService._successMessage('Pedido enviado');
this.modalController.dismiss(action_parecer);
} catch (error) {
await this.toastService._badRequest('Processo não efetuado')
} finally {
loader.remove()
}
break;
case '2': // Deferimento
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.loggeduser.Email,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
AttachmentList: docs
}
//
let action_deferimento = {
"serialNumber": this.task.serialNumber,
"action": "Tratado",
"ActionTypeId": 93,
"dataFields": {
"Note": "",
}
}
try {
this.taskResult = await this.processes.postDeferimento(this.postData).toPromise();
this.toastService._successMessage('Processo efetuado');
this.modalController.dismiss(action_deferimento);
} catch (error) {
await this.toastService._badRequest('Processo não efetuado')
} finally {
loader.remove()
}
break;
}
}
}
}