This commit is contained in:
tiago.kayaya
2021-07-13 09:31:42 +01:00
parent f457952220
commit f1d706a0d5
4 changed files with 32 additions and 40 deletions
@@ -192,18 +192,6 @@
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon> <ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
</div> </div>
<div (click)="openLastOccurrence()" class="ion-input-class flex-grow-1"> <div (click)="openLastOccurrence()" class="ion-input-class flex-grow-1">
<!-- <ion-datetime
placeholder="Última ocorrência"
[(ngModel)]="postEvent.EventRecurrence.LastOccurrence"
displayFormat="DD MMM YYYY"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
min="2021"
max="2045"
>
</ion-datetime> -->
<!-- <ion-input placeholder="Data fim" [(ngModel)]="postData.EndDate"></ion-input> -->
<!-- [formControl]="dateControlOccurrence" -->
<mat-form-field class="date-hour-picker"> <mat-form-field class="date-hour-picker">
<input matInput [ngxMatDatetimePicker]="occurrrence" <input matInput [ngxMatDatetimePicker]="occurrrence"
@@ -102,13 +102,12 @@ export class EditEventPage implements OnInit {
public alertController: AlertController, public alertController: AlertController,
private attachmentsService: AttachmentsService, private attachmentsService: AttachmentsService,
private toastService: ToastService ) { private toastService: ToastService ) {
//this.dateControlOccurrence = this.postEvent.EventRecurrence.LastOccurrence;
} }
ngOnInit() { ngOnInit() {
console.log(this.postEvent); console.log(this.postEvent);
this.dateControlOccurrence = new FormControl(moment(this.postEvent.EventRecurrence.LastOccurrence));
if(!this.restoreTemporaryData()) { if(!this.restoreTemporaryData()) {
// clear // clear
@@ -152,9 +151,14 @@ export class EditEventPage implements OnInit {
this.restoreDatepickerData(); this.restoreDatepickerData();
this.getRecurrenceTypes(); this.getRecurrenceTypes();
this.selectedRecurringType = this.postEvent.EventRecurrence.Type.toString();
setTimeout(() => { setTimeout(() => {
this.selectedRecurringType = this.postEvent.EventRecurrence.Type.toString(); this.selectedRecurringType = this.postEvent.EventRecurrence.Type.toString();
console.log(this.selectedRecurringType);
}, 1000); }, 1000);
} }
close() { close() {
@@ -209,9 +213,9 @@ export class EditEventPage implements OnInit {
dateEnd: new FormControl(this.dateEnd, [ dateEnd: new FormControl(this.dateEnd, [
Validators.required Validators.required
]), ]),
IsRecurring: new FormControl(this.postEvent.IsRecurring, [ /* IsRecurring: new FormControl(this.postEvent.IsRecurring, [
Validators.required Validators.required
]), ]), */
participantes: new FormControl(this.taskParticipants, [ participantes: new FormControl(this.taskParticipants, [
Validators.required Validators.required
]), ]),
@@ -352,8 +352,8 @@ export class NewEventPage implements OnInit {
if (this.postEvent) { if (this.postEvent) {
this.dateControlStart = new FormControl(moment(this.postEvent.StartDate, "DD MM YYYY hh:mm")); this.dateControlStart = new FormControl(moment(this.postEvent.StartDate, "DD MM YYYY hh:mm"));
this.dateControlEnd = new FormControl(moment(this.postEvent.EndDate, "DD MM YYYY hh:mm")); this.dateControlEnd = new FormControl(moment(this.postEvent.EndDate, "DD MM YYYY hh:mm"));
this.dateControlOccurrence = new FormControl(moment(this.postEvent.EventRecurrence.LastOccurrence, "DD MM YYYY hh:mm"))
} }
} }
async save() { async save() {
@@ -33,10 +33,10 @@ export class ViewEventPage implements OnInit {
customDate:any; customDate:any;
today:any; today:any;
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"]; months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"]; days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
documents: Attachment[] = []; documents: Attachment[] = [];
dicIndex = 0; dicIndex = 0;
@@ -54,7 +54,7 @@ export class ViewEventPage implements OnInit {
private modalController: ModalController, private modalController: ModalController,
public popoverController: PopoverController, public popoverController: PopoverController,
private toastService: ToastService, private toastService: ToastService,
) )
{ {
this.isEventEdited = false; this.isEventEdited = false;
this.loadedEvent = new Event(); this.loadedEvent = new Event();
@@ -63,19 +63,19 @@ export class ViewEventPage implements OnInit {
} }
ngOnInit() { ngOnInit() {
/* console.log(this.eventId); */ /* console.log(this.eventId); */
this.loadEvent(); this.loadEvent();
//this.getAttachments(); //this.getAttachments();
} }
ngOnChanges(changes: any): void { ngOnChanges(changes: any): void {
this.loadedAttachments = null; this.loadedAttachments = null;
this.loadEvent(); this.loadEvent();
} }
openOptions(){ openOptions(){
} }
docIndex(index: number) { docIndex(index: number) {
@@ -84,7 +84,7 @@ export class ViewEventPage implements OnInit {
close(){ close(){
console.log(this.isEventEdited); console.log(this.isEventEdited);
this.viewEventDetailDismiss.emit({ this.viewEventDetailDismiss.emit({
type: 'close' type: 'close'
}) })
@@ -93,7 +93,7 @@ export class ViewEventPage implements OnInit {
loadEvent(){ loadEvent(){
this.eventsService.getEvent(this.eventId).subscribe(res => { this.eventsService.getEvent(this.eventId).subscribe(res => {
this.loadedEvent = res; this.loadedEvent = res;
// console.log(res); console.log(res);
this.today = new Date(res.StartDate); this.today = new Date(res.StartDate);
// console.log(new Date(this.today)); // console.log(new Date(this.today));
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
@@ -102,11 +102,11 @@ export class ViewEventPage implements OnInit {
} }
deleteEvent(){ deleteEvent(){
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0).subscribe(async () => this.eventsService.deleteEvent(this.loadedEvent.EventId, 0).subscribe(async () =>
{ {
this.toastService.successMessage('Evento apagado'); this.toastService.successMessage('Evento apagado');
this.close(); this.close();
}); });
} }
getAttachments(eventId){ getAttachments(eventId){
@@ -122,14 +122,14 @@ export class ViewEventPage implements OnInit {
event: this.loadedEvent event: this.loadedEvent
}) })
} }
viewDocument(sourceId){ viewDocument(sourceId){
this.processes.GetDocumentUrl(sourceId, '8').subscribe(res=>{ this.processes.GetDocumentUrl(sourceId, '8').subscribe(res=>{
console.log(res); console.log(res);
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank"); const browser = this.iab.create(url,"_blank");
browser.show(); browser.show();
}); });
} }
@@ -149,9 +149,9 @@ export class ViewEventPage implements OnInit {
taskStartDate: doc.CreateDate, taskStartDate: doc.CreateDate,
isEvent: true, isEvent: true,
workflowInstanceDataFields: { workflowInstanceDataFields: {
FsId: doc.ApplicationId, FsId: doc.ApplicationId,
FolderID: null, FolderID: null,
DocId: doc.SourceId, DocId: doc.SourceId,
Subject: doc.SourceName Subject: doc.SourceName
}, },
} }
@@ -170,7 +170,7 @@ export class ViewEventPage implements OnInit {
console.log(res['data']); console.log(res['data']);
if(res['data']=='openDiscart'){ if(res['data']=='openDiscart'){
console.log('open discart'); console.log('open discart');
// this.distartExpedientModal(); // this.distartExpedientModal();
} }
@@ -187,13 +187,13 @@ export class ViewEventPage implements OnInit {
taskStartDate: doc.CreateDate, taskStartDate: doc.CreateDate,
isEvent: true, isEvent: true,
workflowInstanceDataFields: { workflowInstanceDataFields: {
FsId: doc.ApplicationId, FsId: doc.ApplicationId,
FolderID: null, FolderID: null,
DocId: doc.SourceId, DocId: doc.SourceId,
Subject: doc.SourceName Subject: doc.SourceName
}, },
} }
let classs; let classs;
if( window.innerWidth <= 800){ if( window.innerWidth <= 800){
classs = 'book-meeting-modal modal modal-desktop' classs = 'book-meeting-modal modal modal-desktop'
@@ -213,7 +213,7 @@ export class ViewEventPage implements OnInit {
} }
async openTaskOptions() { async openTaskOptions() {
const doc = this.loadedAttachments[ this.dicIndex]; const doc = this.loadedAttachments[ this.dicIndex];
@@ -223,9 +223,9 @@ export class ViewEventPage implements OnInit {
taskStartDate: doc.CreateDate, taskStartDate: doc.CreateDate,
isEvent: true, isEvent: true,
workflowInstanceDataFields: { workflowInstanceDataFields: {
FsId: doc.ApplicationId, FsId: doc.ApplicationId,
FolderID: null, FolderID: null,
DocId: doc.SourceId, DocId: doc.SourceId,
Subject: doc.SourceName Subject: doc.SourceName
}, },
} }
@@ -242,4 +242,4 @@ export class ViewEventPage implements OnInit {
return await popover.present(); return await popover.present();
} }
} }