integrate expediente-pr

This commit is contained in:
tiago.kayaya
2021-05-25 16:07:26 +01:00
parent ea83f4e2a6
commit 0cf08fc7b3
7 changed files with 112 additions and 115 deletions
@@ -115,16 +115,11 @@ export class ExpedientTaskModalPage implements OnInit {
}
ngOnInit() {
this.taskDate = new Date(this.task.taskStartDate);
if(!this.task.hasOwnProperty('isEvent')) {
// if not
this.getAttachments();
}
this.getSubjectType();
}
close(){
@@ -132,15 +127,15 @@ export class ExpedientTaskModalPage implements OnInit {
this.modalController.dismiss(null);
}
getSubjectType() {
getSubjectType(){
this.processes.GetSubjectType().subscribe(res=>{
console.log(res);
this.subjectTypes = res;
});
}
cancelTask() {
this.modalController.dismiss(null);
}
async saveTask(){
@@ -157,9 +152,7 @@ export class ExpedientTaskModalPage implements OnInit {
else if(this.postData.Priority=='99999864'){
this.dispatchFolder.DeadlineType = 'Urgentíssimo';
}
let attendees = this.taskParticipants.concat(this.taskParticipantsCc);
attendees = attendees.map(function(val) {
return {
UserEmail: val.EmailAddress,
@@ -205,7 +198,14 @@ export class ExpedientTaskModalPage implements OnInit {
// console.log('this.postData', this.postData, this.taskType);
try {
this.taskResult = await this.processes.postDespatcho(this.postData).toPromise()
switch(this.loggeduser.Profile){
case 'MDGPR':
this.taskResult = await this.processes.postDespatcho(this.postData).toPromise();
break;
case 'PR':
this.taskResult = await this.processes.postDespatchoPr(this.postData).toPromise();
break;
}
await this.successMessage('Processo efetuado')
} catch (error) {
await this.badRequest('Processo não efetuado')
@@ -239,7 +239,15 @@ export class ExpedientTaskModalPage implements OnInit {
//console.log(this.postData);
try {
this.taskResult = await this.processes.postParecer(this.postData).toPromise()
switch(this.loggeduser.Profile){
case 'MDGPR':
this.taskResult = await this.processes.postParecer(this.postData).toPromise();
break;
case 'PR':
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
break;
}
await this.successMessage('Processo efetuado')
} catch (error) {
await this.badRequest('Processo não efetuado')