mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Improve
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AnimationController, ModalController, NavParams } from '@ionic/angular';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { SearchList } from 'src/app/models/search-document';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
|
||||
@Component({
|
||||
@@ -10,7 +10,7 @@ import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
})
|
||||
export class AddNotePage implements OnInit {
|
||||
note: string = '';
|
||||
documents: SearchDocument[] = [];
|
||||
documents: SearchList[] = [];
|
||||
loadedAttachments:any;
|
||||
hideThisFeature: boolean = true;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { SearchList } from 'src/app/models/search-document';
|
||||
import { NewEventPage } from 'src/app/pages/agenda/new-event/new-event.page';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
@@ -14,7 +14,7 @@ import { environment } from 'src/environments/environment';
|
||||
})
|
||||
export class ChatOptionsFeaturesPage implements OnInit {
|
||||
|
||||
documents:SearchDocument[] = [];
|
||||
documents:SearchList[] = [];
|
||||
members: any;
|
||||
attendees: EventPerson[] = [];
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { AuthService } from 'src/app/services/auth.service';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { ExpedienteDetailPage } from 'src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { SearchList } from 'src/app/models/search-document';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
@@ -78,7 +78,7 @@ export class CreateProcessPage implements OnInit {
|
||||
emptyTextDescription = "Sem intervenientes selecionados";
|
||||
showEmptyContainer = true;
|
||||
|
||||
documents:SearchDocument[] = [];
|
||||
documents:SearchList[] = [];
|
||||
|
||||
loggeduser: User;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AnimationController, ModalController, NavParams } from '@ionic/angular';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { SearchList } from 'src/app/models/search-document';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
@@ -14,7 +14,7 @@ export class DarParecerPage implements OnInit {
|
||||
note:string;
|
||||
serialNumber:string;
|
||||
instanceId: string;
|
||||
documents:SearchDocument[] = [];
|
||||
documents:SearchList[] = [];
|
||||
|
||||
constructor(
|
||||
private processes: ProcessesService,
|
||||
|
||||
@@ -11,7 +11,7 @@ import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discar
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { SearchList } from 'src/app/models/search-document';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
|
||||
@Component({
|
||||
@@ -39,7 +39,7 @@ export class DelegarPage implements OnInit {
|
||||
showAttendees= false;
|
||||
|
||||
hideThisFeature: boolean = true;
|
||||
documents: SearchDocument[] = [];
|
||||
documents: SearchList[] = [];
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||
import { DocumentSetUpMeetingPage } from '../document-set-up-meeting/document-set-up-meeting.page';
|
||||
import { FromSearchDocument, SearchFolder } from 'src/app/models/search-document';
|
||||
import { SearchDocumentDetails, SearchFolderDetails } from 'src/app/models/search-document';
|
||||
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
|
||||
import { PermissionService } from 'src/app/OtherService/permission.service';
|
||||
import { SearchedDocumentOptionsPage } from 'src/app/shared/popover/searched-document-options/searched-document-options.page';
|
||||
@@ -26,10 +26,10 @@ export class DocumentDetailPage implements OnInit {
|
||||
applicationId:string;
|
||||
LoadedDocument:any = null;
|
||||
|
||||
folder: SearchFolder
|
||||
document: FromSearchDocument
|
||||
folder: SearchFolderDetails
|
||||
document: SearchDocumentDetails
|
||||
|
||||
task: any = {}
|
||||
task: ExpedientTaskModalPageNavParamsTask;
|
||||
|
||||
constructor(
|
||||
private navParams: NavParams,
|
||||
@@ -61,8 +61,8 @@ export class DocumentDetailPage implements OnInit {
|
||||
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
|
||||
|
||||
let task: ExpedientTaskModalPageNavParamsTask
|
||||
let document: FromSearchDocument = this.LoadedDocument
|
||||
let folder: SearchFolder = this.LoadedDocument
|
||||
let document: SearchDocumentDetails = this.LoadedDocument
|
||||
let folder: SearchFolderDetails = this.LoadedDocument
|
||||
|
||||
if(this.LoadedDocument.ApplicationID == 361 || this.LoadedDocument.ApplicationId == 361) {
|
||||
task = {
|
||||
@@ -160,7 +160,7 @@ export class DocumentDetailPage implements OnInit {
|
||||
const modal = await this.modalController.create({
|
||||
component: DocumentSetUpMeetingPage,
|
||||
componentProps: {
|
||||
task: this.task,
|
||||
subject: this.task.workflowInstanceDataFields.Subject,
|
||||
document: this.LoadedDocument,
|
||||
},
|
||||
cssClass: classs,
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
<mat-form-field appearance="none" class="width-100 date-hour-picker d-md-block">
|
||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||
placeholder="Início*"
|
||||
[formControl]="dateControlStart"
|
||||
[(ngModel)]="postData.StartDate"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||
@@ -180,7 +180,7 @@
|
||||
<mat-form-field appearance="none" class="date-hour-picker width-100 d-none d-md-block">
|
||||
<input matInput [ngxMatDatetimePicker]="fim"
|
||||
placeholder="Fim*"
|
||||
[formControl]="dateControlEnd"
|
||||
[(ngModel)]="postData.EndDate"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
|
||||
|
||||
@@ -2,10 +2,9 @@ import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { Event } from 'src/app/models/event.model'
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { SearchDocumentDetails, SearchFolderDetails, SearchFolderDetailsDocuments, SearchList } from 'src/app/models/search-document';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
@@ -15,14 +14,11 @@ import * as _moment from 'moment';
|
||||
import * as _rollupMoment from 'moment';
|
||||
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||
import { MAT_DATE_LOCALE } from '@angular/material/core';
|
||||
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { DocumentService } from 'src/app/Rules/document.service';
|
||||
import { DocumentSetUpMeeting, Attachments } from 'src/app/models/CallMeeting';
|
||||
import { DocumentSetUpMeeting } from 'src/app/models/CallMeeting';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { SearchDocumentPipe } from 'src/app/pipes/search-document.pipe';
|
||||
|
||||
const moment = _rollupMoment || _moment;
|
||||
import { EventService } from 'src/app/services/rules/event.service';
|
||||
import { EventPipe } from 'src/app/pipes/event.pipe';
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
@@ -58,9 +54,6 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
public stepMinute = 5;
|
||||
public stepSecond = 5;
|
||||
|
||||
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
|
||||
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
|
||||
|
||||
p: any = {}
|
||||
|
||||
Form: FormGroup;
|
||||
@@ -68,42 +61,21 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
recurringTypes = [];
|
||||
Occurrence: Date = new Date()
|
||||
EventRecurrenceType = '-1'
|
||||
|
||||
showLoader = false
|
||||
|
||||
get dateStart () {
|
||||
if( window.innerWidth < 801) {
|
||||
return this.postData.StartDate;
|
||||
}
|
||||
else{
|
||||
return this.dateControlStart.value;
|
||||
}
|
||||
}
|
||||
|
||||
get dateEnd () {
|
||||
if( window.innerWidth < 801) {
|
||||
return this.postData.EndDate;
|
||||
}
|
||||
else{
|
||||
return this.dateControlEnd.value;
|
||||
}
|
||||
}
|
||||
|
||||
@ViewChild('picker') picker: any;
|
||||
@ViewChild('fim') fim: any;
|
||||
@ViewChild('inicio') inicio: any;
|
||||
@ViewChild('picker1') picker1: any;
|
||||
|
||||
task: any;
|
||||
|
||||
taskParticipants: EventPerson[] = [];
|
||||
taskParticipantsCc: EventPerson[] = [];
|
||||
|
||||
taskDocId:string;
|
||||
loadedAttachments:any;
|
||||
documents: SearchDocument[] = [];
|
||||
|
||||
attachments:SearchDocument[] = [];
|
||||
attachments: SearchList[] = [];
|
||||
|
||||
adding: "intervenient" | "CC" = "intervenient";
|
||||
|
||||
@@ -114,29 +86,30 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
loggeduser: User;
|
||||
emptyTextDescription = "Sem intervenientes selecionados";
|
||||
|
||||
document: any;
|
||||
|
||||
private searchDocumentPipe = SearchDocumentPipe
|
||||
document: SearchFolderDetails | SearchDocumentDetails | any;
|
||||
subject: string
|
||||
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private router:Router,
|
||||
private navParams: NavParams,
|
||||
private processes:ProcessesService,
|
||||
authService: AuthService,
|
||||
private toastService: ToastService,
|
||||
private documentService: DocumentService,
|
||||
private calendarService: EventsService,
|
||||
private eventService: EventService,
|
||||
private eventPipe: EventPipe
|
||||
) {
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
this.task = this.navParams.get('task');
|
||||
this.document = this.navParams.get('document')
|
||||
this.subject = this.navParams.get('subject')
|
||||
|
||||
this.postData = new Event();
|
||||
this.postData.Body ={ BodyType : "1", Text : ""};
|
||||
|
||||
this.postData.Subject = this.task.workflowInstanceDataFields.Subject;
|
||||
this.postData.Subject = this.subject
|
||||
this.postData.CalendarName = "Oficial";
|
||||
|
||||
this.postData.Category = 'Reunião'
|
||||
@@ -144,7 +117,6 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.adding = "intervenient";
|
||||
console.log(this.task);
|
||||
this.setDefaultTime()
|
||||
this.getRecurrenceTypes();
|
||||
}
|
||||
@@ -164,22 +136,10 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
|
||||
goBack() {
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
|
||||
runValidation() {
|
||||
this.validateFrom = true
|
||||
}
|
||||
|
||||
get dateValid() {
|
||||
if (window.innerWidth <= 800) {
|
||||
return this.postData.StartDate < this.postData.EndDate? ['ok']: []
|
||||
} else {
|
||||
return ['ok']
|
||||
}
|
||||
}
|
||||
|
||||
injectValidation() {
|
||||
|
||||
this.Form = new FormGroup({
|
||||
@@ -193,7 +153,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
CalendarName: new FormControl(this.postData.CalendarName, [
|
||||
// Validators.required
|
||||
]),
|
||||
Date: new FormControl(this.dateValid, [
|
||||
Date: new FormControl( (this.postData.StartDate < this.postData.EndDate), [
|
||||
Validators.required
|
||||
]),
|
||||
participantes: new FormControl(this.taskParticipants, [
|
||||
@@ -216,68 +176,80 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
|
||||
let Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
|
||||
let data: DocumentSetUpMeeting = {
|
||||
EventProcess: {
|
||||
Body: this.postData.Body.Text,
|
||||
Location: this.postData.Location,
|
||||
StartDate: this.dateStart,
|
||||
EndDate: this.dateEnd,
|
||||
EventType: 'Reunião',
|
||||
ParticipantsList: Attendees,
|
||||
Subject: this.postData.Subject,
|
||||
IsRecurring: this.postData.IsRecurring,
|
||||
Message: this.postData.Subject,
|
||||
IsAllDayEvent: this.postData.IsRecurring,
|
||||
EventRecurrence: {
|
||||
Type: this.EventRecurrenceType,
|
||||
LastOccurrence: this.Occurrence
|
||||
},
|
||||
},
|
||||
|
||||
Attachments: []
|
||||
}
|
||||
|
||||
if(this.document.Documents) {
|
||||
this.document.Documents.forEach( (ele) => {
|
||||
console.log(ele)
|
||||
data.Attachments.push({
|
||||
var Attachments: addAttachment[] = []
|
||||
let folder: SearchFolderDetails = this.document
|
||||
let document: SearchDocumentDetails = this.document
|
||||
|
||||
if(folder.Documents) {
|
||||
this.document.Documents.forEach( (_folder: SearchFolderDetailsDocuments) => {
|
||||
Attachments.push({
|
||||
ApplicationId: 361,
|
||||
Source: 1,
|
||||
SourceId: ele.docID || ele.docId || ele.DocId,
|
||||
SourceName: ele.Assunto
|
||||
SourceId: _folder['docID'] || _folder['docId'] || _folder.DocId,
|
||||
SourceTitle: _folder.Assunto,
|
||||
})
|
||||
});
|
||||
} else {
|
||||
data.Attachments.push({
|
||||
Attachments.push({
|
||||
ApplicationId: 8,
|
||||
Source: 1,
|
||||
SourceId: this.document.docID || this.document.docId || this.document.DocId,
|
||||
SourceName: this.document.Assunto
|
||||
SourceId: document['docID'] || document['docId'] || document.DocId,
|
||||
SourceTitle: document.Assunto
|
||||
})
|
||||
}
|
||||
|
||||
this.attachments.forEach((e)=> {
|
||||
console.log('e', e)
|
||||
data.Attachments.push({
|
||||
Attachments.push({
|
||||
ApplicationId: e.ApplicationType,
|
||||
Source: 1,
|
||||
SourceId: e.Id,
|
||||
SourceName: e.Assunto
|
||||
SourceTitle: e.Assunto
|
||||
})
|
||||
})
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.documentService.setUpMeeting(data).toPromise()
|
||||
this.toastService.successMessage('Processo criado')
|
||||
this.close()
|
||||
} catch(e) {
|
||||
this.toastService.badRequest("Processo não criado")
|
||||
} finally {
|
||||
loader.remove()
|
||||
let postEvent = {
|
||||
EventId: '',
|
||||
Subject: this.postData.Subject,
|
||||
Body: this.postData.Body.Text,
|
||||
Location: this.postData.Location,
|
||||
CalendarId: this.postData.CalendarName,
|
||||
CalendarName: this.postData.CalendarName,
|
||||
StartDate: this.postData.StartDate,
|
||||
EndDate: this.postData.EndDate,
|
||||
EventType: 'Reunião',
|
||||
Attendees: Attendees,
|
||||
IsMeeting: false, //
|
||||
IsRecurring: this.postData.IsRecurring,
|
||||
AppointmentState: 0, //
|
||||
TimeZone: '', //
|
||||
Organizer: '', //
|
||||
Category: 'Reunião',
|
||||
HasAttachments: false,
|
||||
EventRecurrence: {
|
||||
Type: this.EventRecurrenceType,
|
||||
LastOccurrence: this.Occurrence
|
||||
},
|
||||
}
|
||||
|
||||
this.eventService.create({
|
||||
body: postEvent,
|
||||
calendar: this.postData.CalendarName
|
||||
}).subscribe(async (respose) => {
|
||||
|
||||
const res: any = respose;
|
||||
const eventId: string = res
|
||||
|
||||
const DocumentToSave = this.attachments.map((e) => {
|
||||
return this.eventPipe.AttactSearchResult(e, eventId, {})
|
||||
});
|
||||
|
||||
await DocumentToSave.forEach(async (attachments, i) => {
|
||||
await this.eventService.addAttachment(attachments).toPromise();
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
async addParticipants() {
|
||||
|
||||
@@ -12,7 +12,7 @@ import { AlertService } from 'src/app/services/alert.service';
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { SearchList } from 'src/app/models/search-document';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
|
||||
@@ -40,7 +40,7 @@ export class ForwardPage implements OnInit {
|
||||
formLocationSatus: boolean = false;
|
||||
showAttendees= false;
|
||||
|
||||
documents:SearchDocument[] = [];
|
||||
documents:SearchList[] = [];
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
|
||||
Reference in New Issue
Block a user