fix edit event to approve

This commit is contained in:
Peter Maquiran
2024-03-02 08:06:41 +01:00
parent 8c467340b6
commit e0c75e6d87
3 changed files with 47 additions and 44 deletions
@@ -8,7 +8,7 @@
<ion-header>
<div class="title-content">
<div class="middle">
<ion-label class="title">Editar evento por aprovar ccxcxcxc</ion-label> <br>
<ion-label class="title">Editar evento por aprovar</ion-label> <br>
<i style="margin-top: -5px; font-size: 15px;" > Campos marcados com * são obrigatórios</i>
</div>
@@ -148,8 +148,8 @@ export class EditEventToApproveComponent implements OnInit {
async getTask() {
const result = await this.processes.GetTask(this.serialNumber).toPromise();
this.eventProcess = result
this.eventProcess.workflowInstanceDataFields.Category = result.workflowInstanceDataFields.EventType
this.eventProcess.workflowInstanceDataFields.LastOccurrence = new Date(this.eventProcess.workflowInstanceDataFields.LastOccurrence)
@@ -190,17 +190,17 @@ export class EditEventToApproveComponent implements OnInit {
getRecurrenceTypes() {
this.eventsService.getRecurrenceTypes().subscribe(res=>{
this.recurringTypes = res;
});
}
onSelectedRecurringChanged(ev:any){
this.calculetedLastOccurrence(ev);
if(ev.length > 1){
this.postEvent.EventRecurrence.Type = ev.filter(data => data != '-1');
}
if(ev.length == 0){
@@ -209,7 +209,7 @@ export class EditEventToApproveComponent implements OnInit {
}
calculetedLastOccurrence(type:number){
var valor;
var valor;
var opcao: boolean;
if (type == 0) {
valor = 7;
@@ -235,15 +235,15 @@ export class EditEventToApproveComponent implements OnInit {
this.eventProcess.workflowInstanceDataFields.LastOccurrence = time;
} else {
time = new Date(
time.getFullYear() + valor,
time.getMonth(),
time.getDate(),
time.getHours(),
time.getFullYear() + valor,
time.getMonth(),
time.getDate(),
time.getHours(),
time.getMinutes()
);
this.eventProcess.workflowInstanceDataFields.LastOccurrence = time;
}
}
openLastOccurrence() {
@@ -318,24 +318,26 @@ export class EditEventToApproveComponent implements OnInit {
if(document['action'] == 'add') {
delete document.action
this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{
this.toastService._successMessage();
window['approve-event-getTask'] ()
// this.toastService._successMessage();
}, error =>{
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest();
}
});
} else if(document['action'] == 'delete') {
delete document.action
this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{
this.toastService._successMessage()
window['approve-event-getTask'] ()
// this.toastService._successMessage()
}, error =>{
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
})
@@ -360,7 +362,7 @@ export class EditEventToApproveComponent implements OnInit {
backdropDismiss: false
});
modal.onDidDismiss().then((data) => {
@@ -372,7 +374,7 @@ export class EditEventToApproveComponent implements OnInit {
this.setIntervenient(newAttendees);
this.setIntervenientCC(newAttendeesCC);
}
});
await modal.present();
@@ -420,7 +422,7 @@ export class EditEventToApproveComponent implements OnInit {
this.loadedAttachments = result
//
//
}
deleteAttachment(attachment: Attachment, index) {
@@ -463,7 +465,7 @@ export class EditEventToApproveComponent implements OnInit {
this.loadedAttachments.push(DocumentToSave)
// await this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{
// this.getAttachments();