mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
merge with developer
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
<div class="buttons">
|
||||
<button hidden (click)="notImplemented()" full class="btn-cancel" shape="round" >Tirar Fotografia</button>
|
||||
<button hidden (click)="notImplemented()" class="btn-cancel" shape="round" >Digitalizar Documento</button>
|
||||
<button hidden (click)="notImplemented()" full class="btn-cancel" shape="round" >Anexar Fotografia</button>
|
||||
<button hidden (click)="getDoc()" class="btn-cancel" shape="round" >Anexar Documento</button>
|
||||
<button (click)="anexarFoto()" full class="btn-cancel" shape="round" >Anexar Fotografia</button>
|
||||
<button (click)="addDocGestaoDocumental()" class="btn-cancel" shape="round" >Anexar Documento (G.D.)</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="bookMeeting()" class="btn-cancel" shape="round" >Marcar reunião</button>
|
||||
<button (click)="close()" full class="btn-cancel mobile-only" shape="round" >Cancelar</button>
|
||||
|
||||
@@ -5,6 +5,9 @@ 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';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
import { FileLoaderService } from 'src/app/services/file/file-loader.service';
|
||||
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Component({
|
||||
@@ -18,11 +21,17 @@ export class ChatOptionsFeaturesPage implements OnInit {
|
||||
members: any;
|
||||
attendees: EventPerson[] = [];
|
||||
|
||||
capturedImage:any;
|
||||
capturedImageTitle:any;
|
||||
|
||||
constructor(
|
||||
private popoverController: PopoverController,
|
||||
private modalController: ModalController,
|
||||
private alertService: AlertService,
|
||||
private navParams: NavParams,
|
||||
private fileLoaderService: FileLoaderService,
|
||||
private fileToBase64Service: FileToBase64Service,
|
||||
private chatService: ChatService,
|
||||
) {
|
||||
|
||||
this.members = this.navParams.get('members');
|
||||
@@ -59,6 +68,77 @@ export class ChatOptionsFeaturesPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
anexarFoto(){
|
||||
this.modalController.dismiss('picture');
|
||||
}
|
||||
|
||||
addDocGestaoDocumental(){
|
||||
this.modalController.dismiss('documentoGestaoDocumental');
|
||||
}
|
||||
|
||||
laodPicture() {
|
||||
const input = this.fileLoaderService.createInput({
|
||||
accept: ['image/apng', 'image/jpeg', 'image/png']
|
||||
})
|
||||
|
||||
input.onchange = async () => {
|
||||
const file = this.fileLoaderService.getFirstFile(input)
|
||||
|
||||
console.log(file);
|
||||
|
||||
const imageData = await this.fileToBase64Service.convert(file)
|
||||
this.capturedImage = imageData;
|
||||
this.capturedImageTitle = file.name;
|
||||
|
||||
let body = {
|
||||
"message":
|
||||
{
|
||||
"rid": "J5WDHyrYWHQrybbno",
|
||||
"msg": "this.message",
|
||||
"attachments": [{
|
||||
"title": this.capturedImageTitle ,
|
||||
"text": "description",
|
||||
"title_link_download": false,
|
||||
"image_url": this.capturedImage,
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
this.chatService.sendMessage(body).subscribe(res=> {
|
||||
console.log(res);
|
||||
},(error) => {
|
||||
|
||||
});
|
||||
//console.log(this.capturedImage)
|
||||
};
|
||||
}
|
||||
|
||||
sendMessage(){
|
||||
let body = {
|
||||
"message":
|
||||
{
|
||||
"rid": "J5WDHyrYWHQrybbno",
|
||||
"msg": "this.message",
|
||||
/* "attachments": [{
|
||||
"color": "#ff0000",
|
||||
"text": "Yay for gruggy!",
|
||||
"title": "Attachment Example",
|
||||
"title_link": "https://youtube.com",
|
||||
"title_link_download": false,
|
||||
"image_url": "https://upload.wikimedia.org/wikipedia/commons/e/ee/Chain_link_icon.png",
|
||||
}] */
|
||||
}
|
||||
}
|
||||
|
||||
this.chatService.sendMessage(body).subscribe(res=> {
|
||||
console.log(res);
|
||||
|
||||
|
||||
},(error) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/* getGroupContacts(room:any){
|
||||
this.showLoader = true;
|
||||
//If group is private call getGroupMembers
|
||||
@@ -95,7 +175,6 @@ export class ChatOptionsFeaturesPage implements OnInit {
|
||||
const data = res.data;
|
||||
this.documents.push(data.selected);
|
||||
console.log(res.data);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ import { SearchDocumentDetails, SearchFolderDetails } from 'src/app/models/searc
|
||||
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';
|
||||
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
import { Location } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-document-detail',
|
||||
@@ -39,7 +41,8 @@ export class DocumentDetailPage implements OnInit {
|
||||
private menu: MenuController,
|
||||
private iab: InAppBrowser,
|
||||
public p: PermissionService,
|
||||
private popoverController: PopoverController
|
||||
private popoverController: PopoverController,
|
||||
private location: Location,
|
||||
) {
|
||||
this.docId = this.navParams.get('docId');
|
||||
this.applicationId = this.navParams.get('applicationId');
|
||||
@@ -51,6 +54,8 @@ export class DocumentDetailPage implements OnInit {
|
||||
|
||||
async LoadDocumentDetails() {
|
||||
this.processes.GetDocumentDetails(this.docId, this.applicationId).subscribe(res=>{
|
||||
console.log(res);
|
||||
|
||||
this.LoadedDocument = res;
|
||||
|
||||
this.LoadedDocument.Subject = this.LoadedDocument.Assunto
|
||||
@@ -63,7 +68,7 @@ export class DocumentDetailPage implements OnInit {
|
||||
let task: ExpedientTaskModalPageNavParamsTask
|
||||
let document: SearchDocumentDetails = this.LoadedDocument
|
||||
let folder: SearchFolderDetails = this.LoadedDocument
|
||||
|
||||
|
||||
if(this.LoadedDocument.ApplicationID == 361 || this.LoadedDocument.ApplicationId == 361) {
|
||||
task = {
|
||||
serialNumber: folder.DispatchNumber,
|
||||
@@ -95,7 +100,7 @@ export class DocumentDetailPage implements OnInit {
|
||||
} else {
|
||||
console.log('unexpected ApplicationID')
|
||||
}
|
||||
|
||||
|
||||
this.task = task
|
||||
console.log('this.task = task', this.task)
|
||||
|
||||
@@ -120,16 +125,16 @@ export class DocumentDetailPage implements OnInit {
|
||||
close() {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
|
||||
notImplemented() {
|
||||
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
|
||||
}
|
||||
|
||||
// efetuar despacho
|
||||
// efetuar despacho
|
||||
async openExpedientActionsModal( taskAction: any) {
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth <= 800) {
|
||||
if( window.innerWidth < 701) {
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
@@ -150,9 +155,10 @@ export class DocumentDetailPage implements OnInit {
|
||||
}
|
||||
|
||||
async openBookMeetingModal() {
|
||||
console.log(this.LoadedDocument);
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth <= 800) {
|
||||
if( window.innerWidth < 701) {
|
||||
classs = 'book-meeting-modal modal modal-desktop'
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
@@ -167,9 +173,34 @@ export class DocumentDetailPage implements OnInit {
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
//this.location.back();
|
||||
});
|
||||
}
|
||||
|
||||
/* async openBookMeetingModal() {
|
||||
//console.log(task);
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth < 701){
|
||||
classs = 'book-meeting-modal modal modal-desktop'
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
component: BookMeetingModalPage,
|
||||
componentProps: {
|
||||
task: this.task,
|
||||
},
|
||||
cssClass: classs,
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
this.location.back();
|
||||
});
|
||||
} */
|
||||
|
||||
async openOptions() {
|
||||
const popover = await this.popoverController.create({
|
||||
component: SearchedDocumentOptionsPage,
|
||||
@@ -193,5 +224,5 @@ export class DocumentDetailPage implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -86,8 +86,9 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
emptyTextDescription = "Sem intervenientes selecionados";
|
||||
|
||||
document: SearchFolderDetails | SearchDocumentDetails | any;
|
||||
subject: string
|
||||
|
||||
subject: string;
|
||||
docs:any[] = [];
|
||||
|
||||
eventPipe = new EventPipe()
|
||||
|
||||
constructor(
|
||||
@@ -118,6 +119,8 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
this.adding = "intervenient";
|
||||
this.setDefaultTime()
|
||||
this.getRecurrenceTypes();
|
||||
console.log(this.document);
|
||||
|
||||
}
|
||||
|
||||
getRecurrenceTypes() {
|
||||
@@ -178,8 +181,8 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
var Attachments: addAttachment[] = []
|
||||
let folder: SearchFolderDetails = this.document
|
||||
let document: SearchDocumentDetails = this.document
|
||||
|
||||
if(folder.Documents) {
|
||||
|
||||
/* if(folder.Documents) {
|
||||
this.document.Documents.forEach( (_folder: SearchFolderDetailsDocuments) => {
|
||||
Attachments.push({
|
||||
ApplicationId: 361,
|
||||
@@ -204,8 +207,28 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
SourceId: e.Id,
|
||||
SourceTitle: e.Assunto
|
||||
})
|
||||
})
|
||||
}) */
|
||||
|
||||
if(this.document.Documents){
|
||||
this.document.Documents.forEach((e)=> {
|
||||
this.docs.push({
|
||||
ApplicationId: e.ApplicationId || e.ApplicationType,
|
||||
Source: 1,
|
||||
SourceId: e.DocId || e.docID || e.docId,
|
||||
SourceName: e.Assunto
|
||||
})
|
||||
})
|
||||
}
|
||||
else{
|
||||
this.docs.push({
|
||||
ApplicationId: this.document.ApplicationId || this.document.ApplicationType,
|
||||
Source: 1,
|
||||
SourceId: this.document.DocId || this.document.docID || this.document.docId,
|
||||
SourceName: this.document.Assunto
|
||||
})
|
||||
}
|
||||
|
||||
console.log(this.docs);
|
||||
|
||||
let postEvent = {
|
||||
EventId: '',
|
||||
@@ -227,32 +250,34 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
HasAttachments: false,
|
||||
EventRecurrence: {
|
||||
Type: this.EventRecurrenceType,
|
||||
LastOccurrence: this.Occurrence
|
||||
LastOccurrence: this.Occurrence,
|
||||
},
|
||||
Attachments: this.docs,
|
||||
}
|
||||
|
||||
console.log(postEvent);
|
||||
|
||||
|
||||
const laoder = this.toastService.loading()
|
||||
|
||||
this.eventService.create({
|
||||
body: postEvent,
|
||||
calendar: this.postData.CalendarName
|
||||
}).subscribe(async (respose) => {
|
||||
|
||||
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) => {
|
||||
/* const DocumentToSave = this.attachments.map((e) => {
|
||||
return this.eventPipe.AttactSearchResult(e, eventId, {})
|
||||
});
|
||||
|
||||
await DocumentToSave.forEach(async (attachments, i) => {
|
||||
await this.eventService.addAttachment(attachments).toPromise();
|
||||
});
|
||||
}); */
|
||||
|
||||
this.toastService.successMessage('Reunião criada')
|
||||
laoder.remove()
|
||||
this.modalController.dismiss()
|
||||
|
||||
})
|
||||
},(error) => {
|
||||
this.toastService.badRequest('Não foi possível marcar a reunião');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user