mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +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,
|
||||
|
||||
@@ -14,8 +14,8 @@ export class DocumentSetUpMeeting {
|
||||
"Body": string,
|
||||
"Location": string,
|
||||
"Subject": string,
|
||||
"StartDate"?: string,
|
||||
"EndDate"?: string,
|
||||
"StartDate"?: string | Date,
|
||||
"EndDate"?: string | Date,
|
||||
"ReviewUserComment"?: string,
|
||||
"MDName"?: string,
|
||||
"MDEmail"?: string,
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
interface addAttachment {
|
||||
SourceTitle: string;
|
||||
ParentId?: string;
|
||||
Source: any;
|
||||
SourceId: any;
|
||||
ApplicationId: any;
|
||||
Id?: any;
|
||||
Link?: any;
|
||||
SerialNumber?: any
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
export class SearchDocument {
|
||||
export class SearchList {
|
||||
ApplicationType: number | string;
|
||||
Assunto: string;
|
||||
Data: string;
|
||||
@@ -7,6 +7,7 @@ export class SearchDocument {
|
||||
EntidadeOrganicaNome: string;
|
||||
Id: string;
|
||||
appName?: string;
|
||||
ApplicationName: string;
|
||||
}
|
||||
|
||||
export class Attachments {
|
||||
@@ -18,7 +19,7 @@ export class Attachments {
|
||||
}
|
||||
|
||||
// details
|
||||
export class FromSearchDocument {
|
||||
export class SearchDocumentDetails {
|
||||
ApplicationId: number
|
||||
ApplicationID: number
|
||||
Assunto: string
|
||||
@@ -28,21 +29,17 @@ export class FromSearchDocument {
|
||||
SenderId: number
|
||||
}
|
||||
|
||||
|
||||
|
||||
// details
|
||||
export class SearchFolder {
|
||||
export class SearchFolderDetails {
|
||||
ApplicationID: number
|
||||
ApplicationId: number
|
||||
Assunto:string
|
||||
DateDispatch: string
|
||||
DispatchNumber: string
|
||||
Docs: string
|
||||
Documents: {
|
||||
Assunto: string
|
||||
DocDate: string
|
||||
DocId: number
|
||||
DocNumber: string
|
||||
Sender: string
|
||||
}[]
|
||||
Documents: SearchFolderDetailsDocuments[]
|
||||
DocumentsTotal: 2
|
||||
IntervenerList: string[]
|
||||
Interveners: string
|
||||
@@ -51,4 +48,24 @@ export class SearchFolder {
|
||||
SenderId: null | string
|
||||
Status: string
|
||||
folderId: number
|
||||
}
|
||||
}
|
||||
export class SearchFolderDetailsDocuments {
|
||||
Assunto: string
|
||||
DocDate: string
|
||||
DocId: number
|
||||
DocNumber: string
|
||||
Sender: string
|
||||
}
|
||||
|
||||
export interface SearchCategory {
|
||||
SecFsId?: any;
|
||||
Id: number;
|
||||
Name: string;
|
||||
Qtd: number;
|
||||
}
|
||||
|
||||
export interface searchResult {
|
||||
Categories: SearchCategory[];
|
||||
Documents: SearchList[];
|
||||
Total: number;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { AnimationController, ModalController, NavParams } from '@ionic/angular'
|
||||
import { EventAttachment } from 'src/app/models/attachment.model';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
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 { User } from 'src/app/models/user.model';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
@@ -56,7 +56,7 @@ export class NewEventPage implements OnInit {
|
||||
taskParticipants: any = [];
|
||||
taskParticipantsCc: any = [];
|
||||
|
||||
documents:SearchDocument[] = [];
|
||||
documents:SearchList[] = [];
|
||||
|
||||
loggeduser: User;
|
||||
members:any;
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ import { EventsService } from 'src/app/services/events.service';
|
||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { 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';
|
||||
@@ -102,7 +102,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
taskDocId:string;
|
||||
loadedAttachments:any;
|
||||
documents:SearchDocument[] = [];
|
||||
documents:SearchList[] = [];
|
||||
|
||||
adding: "intervenient" | "CC" = "intervenient";
|
||||
|
||||
|
||||
+2
-2
@@ -12,7 +12,7 @@ import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { ExpedienteDetailPage } from '../expediente-detail/expediente-detail.page';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { SearchList } from 'src/app/models/search-document';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
@@ -62,7 +62,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
taskDescription: string;
|
||||
|
||||
loadedAttachments:any;
|
||||
documents:SearchDocument[] = [];
|
||||
documents:SearchList[] = [];
|
||||
|
||||
subjectTypes:any[] = [];
|
||||
selectedTypes: string[]=[];
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { Location } from '@angular/common';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { SearchList } from 'src/app/models/search-document';
|
||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { PermissionService } from 'src/app/OtherService/permission.service';
|
||||
import { SearchDocumentPipe } from 'src/app/pipes/search-document.pipe';
|
||||
@@ -42,7 +42,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
profile: string;
|
||||
intervenientes: any;
|
||||
cc: any = [];
|
||||
documents:SearchDocument[] = [];
|
||||
documents:SearchList[] = [];
|
||||
attachments:any;
|
||||
|
||||
hideSendToPendentes = true
|
||||
|
||||
@@ -16,7 +16,7 @@ import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { OptsExpedientePrPage } from 'src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { SearchList } from 'src/app/models/search-document';
|
||||
import { Location } from '@angular/common';
|
||||
import { AttachmentList } from 'src/app/models/Excludetask';
|
||||
|
||||
@@ -41,7 +41,7 @@ export class ExpedientePrPage implements OnInit {
|
||||
cc: any = [];
|
||||
|
||||
loggeduser: User;
|
||||
documents:SearchDocument[] = [];
|
||||
documents: SearchList[] = [];
|
||||
attachments:any;
|
||||
|
||||
constructor(
|
||||
@@ -341,7 +341,7 @@ export class ExpedientePrPage implements OnInit {
|
||||
modal.onDidDismiss().then(res => {
|
||||
console.log(res);
|
||||
if(res.data){
|
||||
const DocumentToSave = res.data.documents.map((e:SearchDocument) => {
|
||||
const DocumentToSave = res.data.documents.map((e:SearchList) => {
|
||||
return {
|
||||
ApplicationId: e.ApplicationType,
|
||||
SourceId: e.Id,
|
||||
|
||||
@@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { SearchService } from "../../services/search.service";
|
||||
import { SearchCategory } from "src/app/models/search-category";
|
||||
import { SearchDocument } from "src/app/models/search-document";
|
||||
import { formatDate } from '@angular/common';
|
||||
import { SenderPage } from 'src/app/pages/search/sender/sender.page';
|
||||
import { OrganicEntityPage } from 'src/app/pages/search/organic-entity/organic-entity.page';
|
||||
@@ -10,6 +9,7 @@ import WordCloud from 'src/plugin/wordcloud2.js';
|
||||
import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
|
||||
import { PublicationDetailPage } from '../publications/view-publications/publication-detail/publication-detail.page';
|
||||
import { DocumentDetailPage } from 'src/app/modals/document-detail/document-detail.page';
|
||||
import { SearchList } from 'src/app/models/search-document';
|
||||
|
||||
@Component({
|
||||
selector: 'app-search',
|
||||
@@ -27,9 +27,9 @@ export class SearchPage implements OnInit {
|
||||
ordinance: string;
|
||||
|
||||
searchCategories: SearchCategory[] = [];
|
||||
showSearchDocuments: SearchDocument[] = [];
|
||||
showSearchDocuments: SearchList[] = [];
|
||||
showCategory: string;
|
||||
searchDocuments: SearchDocument[] =[];
|
||||
searchDocuments: SearchList[] =[];
|
||||
|
||||
showDocuments = false;
|
||||
showAdvanceSearch = false;
|
||||
@@ -85,7 +85,7 @@ export class SearchPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
selectItem(item: SearchDocument) {
|
||||
selectItem(item: SearchList) {
|
||||
if(this.select){
|
||||
this.modalController.dismiss({
|
||||
selected: item
|
||||
@@ -552,7 +552,7 @@ export class SearchPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
async viewDetail(searchDocument: SearchDocument) {
|
||||
async viewDetail(searchDocument: SearchList) {
|
||||
|
||||
const ApplicationType = searchDocument.ApplicationType.toString()
|
||||
const Id = searchDocument.Id
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import { EventPipe } from './event.pipe';
|
||||
|
||||
describe('EventPipe', () => {
|
||||
it('create an instance', () => {
|
||||
const pipe = new EventPipe();
|
||||
expect(pipe).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,32 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { SearchDocumentDetails, SearchFolderDetails, SearchList } from '../models/search-document';
|
||||
|
||||
@Pipe({
|
||||
name: 'event'
|
||||
})
|
||||
export class EventPipe implements PipeTransform {
|
||||
|
||||
transform(value: unknown, ...args: unknown[]): unknown {
|
||||
return null;
|
||||
}
|
||||
|
||||
AttactSearchResult(seachDocument: SearchList, eventId, {Source = '1'}): addAttachment {
|
||||
|
||||
return {
|
||||
SourceTitle: seachDocument.Assunto,
|
||||
ParentId: eventId,
|
||||
Source: Source,
|
||||
SourceId: seachDocument.Id,
|
||||
ApplicationId: seachDocument.ApplicationType.toString(),
|
||||
Id: '',
|
||||
Link: '',
|
||||
SerialNumber: ''
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
AttactSearchResultDetails(searchResult: SearchFolderDetails | SearchDocumentDetails, eventId, {Source = '1'}) {
|
||||
return {}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,10 +2,11 @@ import { NgModule } from '@angular/core';
|
||||
import { FilterPipe } from './filter.pipe';
|
||||
import { SearchDocumentPipe } from './search-document.pipe';
|
||||
import { CustomTaskPipe } from './custom-task.pipe';
|
||||
import { EventPipe } from './event.pipe';
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [FilterPipe, SearchDocumentPipe, CustomTaskPipe],
|
||||
declarations: [FilterPipe, SearchDocumentPipe, CustomTaskPipe, EventPipe],
|
||||
exports: [FilterPipe],
|
||||
imports: []
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { Attachments, SearchDocument } from '../models/search-document';
|
||||
import { Attachments, SearchList } from '../models/search-document';
|
||||
|
||||
@Pipe({
|
||||
name: 'searchDocument'
|
||||
@@ -10,7 +10,7 @@ export class SearchDocumentPipe implements PipeTransform {
|
||||
return null;
|
||||
}
|
||||
|
||||
transformToAttachment(document: SearchDocument): Attachments[] {
|
||||
transformToAttachment(document: SearchList): Attachments[] {
|
||||
const attachments = []
|
||||
|
||||
if(document.ApplicationType == 361) {
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EventService } from './event.service';
|
||||
|
||||
describe('EventService', () => {
|
||||
let service: EventService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(EventService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { PermissionService } from 'src/app/OtherService/permission.service';
|
||||
import { AttachmentsService } from '../attachments.service';
|
||||
import { EventsService } from '../events.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class EventService {
|
||||
|
||||
constructor(
|
||||
private eventService: EventsService,
|
||||
public p: PermissionService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
) { }
|
||||
|
||||
|
||||
create({body, calendar}) {
|
||||
|
||||
|
||||
if(this.p.userRole(['PR'])) {
|
||||
return this.eventService.postEventPr(body, calendar)
|
||||
} else {
|
||||
return this.eventService.postEventMd(body, calendar)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
addAttachment(attachment: addAttachment) {
|
||||
return this.attachmentsService.setEventAttachmentById(attachment)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import { AlertController, ModalController } from '@ionic/angular';
|
||||
import * as moment from 'moment';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
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 { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
@@ -443,7 +443,7 @@ export class EditEventToApprovePage implements OnInit {
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
if(res){
|
||||
|
||||
const data: SearchDocument = res.data.selected;
|
||||
const data: SearchList = res.data.selected;
|
||||
|
||||
const DocumentToSave: any = {
|
||||
SourceTitle: data.Assunto,
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Event } from 'src/app/models/event.model';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { SearchDocument } from "src/app/models/search-document";
|
||||
import { SearchList } from "src/app/models/search-document";
|
||||
import { EventAttachment } from 'src/app/models/attachment.model';
|
||||
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
@@ -86,7 +86,7 @@ export class NewEventPage implements OnInit {
|
||||
@Output() GoBackEditOrAdd = new EventEmitter<any>();
|
||||
@Output() cloneAllmobileComponent = new EventEmitter<any>();
|
||||
|
||||
documents:SearchDocument[] = [];
|
||||
documents:SearchList[] = [];
|
||||
|
||||
// minDate: string;
|
||||
|
||||
@@ -448,6 +448,7 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
const eventId: any = id;
|
||||
|
||||
|
||||
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||
return {
|
||||
SourceTitle: e.Assunto,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { AlertController, AnimationController, ModalController, NavParams } from '@ionic/angular';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
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 { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
@@ -382,7 +382,7 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
if(res){
|
||||
|
||||
const data: SearchDocument = res.data.selected;
|
||||
const data: SearchList = res.data.selected;
|
||||
|
||||
const DocumentToSave: any = {
|
||||
SourceTitle: data.Assunto,
|
||||
|
||||
@@ -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 ChatOptionsPopoverPage implements OnInit {
|
||||
|
||||
documents:SearchDocument[] = [];
|
||||
documents:SearchList[] = [];
|
||||
members: any;
|
||||
attendees: EventPerson[] = [];
|
||||
|
||||
|
||||
@@ -235,19 +235,19 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
Attachments: DocumentToSave,
|
||||
}
|
||||
|
||||
if(actionName == 'Executado'){
|
||||
if(actionName == 'Executado') {
|
||||
await this.executado(res.data.note, docs);
|
||||
}
|
||||
else if(actionName == 'Arquivar'){
|
||||
else if(actionName == 'Arquivar') {
|
||||
await this.arquivar(res.data.note, docs);
|
||||
}
|
||||
else if(actionName == 'Gerar Diploma'){
|
||||
else if(actionName == 'Gerar Diploma') {
|
||||
await this.generateDiploma(res.data.note, docs);
|
||||
}
|
||||
else if(actionName == 'Reexecução'){
|
||||
else if(actionName == 'Reexecução') {
|
||||
await this.reexecutar(res.data.note, docs);
|
||||
}
|
||||
else if(actionName == 'Concluido'){
|
||||
else if(actionName == 'Concluido') {
|
||||
await this.concluir(res.data.note, docs);
|
||||
}
|
||||
this.goBack();
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
||||
import { AnimationController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { SearchList } from 'src/app/models/search-document';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
@@ -32,7 +32,7 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
serialnumber: string;
|
||||
profile: string;
|
||||
|
||||
documents:SearchDocument[] = [];
|
||||
documents:SearchList[] = [];
|
||||
attachments:any;
|
||||
|
||||
showEnviarPendentes = false;
|
||||
|
||||
@@ -2,8 +2,8 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
||||
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { customTask, expedienteTask, fullTask } from 'src/app/models/dailyworktask.model';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { expedienteTask } from 'src/app/models/dailyworktask.model';
|
||||
import { SearchList } from 'src/app/models/search-document';
|
||||
import { PermissionService } from 'src/app/OtherService/permission.service';
|
||||
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
@@ -28,7 +28,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
|
||||
showEnviarPendentes = false
|
||||
searchDocumentPipe = new SearchDocumentPipe()
|
||||
documents:SearchDocument[] = [];
|
||||
documents:SearchList[] = [];
|
||||
|
||||
constructor(
|
||||
private popoverController: PopoverController,
|
||||
|
||||
Reference in New Issue
Block a user