mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
improvements in despacho
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-add-note',
|
||||
@@ -7,12 +9,14 @@ import { ModalController } from '@ionic/angular';
|
||||
styleUrls: ['./add-note.page.scss'],
|
||||
})
|
||||
export class AddNotePage implements OnInit {
|
||||
emendMessage: string = '';
|
||||
note: string = '';
|
||||
documents:SearchDocument[] = [];
|
||||
loadedAttachments:any;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
) {
|
||||
this.emendMessage = '';
|
||||
this.note = '';
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -21,7 +25,36 @@ export class AddNotePage implements OnInit {
|
||||
this.modalController.dismiss('');
|
||||
}
|
||||
save(){
|
||||
this.modalController.dismiss(this.emendMessage);
|
||||
let body = {
|
||||
"note":this.note,
|
||||
"documents":this.documents,
|
||||
}
|
||||
this.modalController.dismiss(body);
|
||||
}
|
||||
|
||||
async getDoc(){
|
||||
const modal = await this.modalController.create({
|
||||
component: SearchPage,
|
||||
cssClass: 'modal-width-100-width-background modal',
|
||||
componentProps: {
|
||||
type: 'AccoesPresidenciais & ArquivoDespachoElect',
|
||||
showSearchInput: true,
|
||||
select: true
|
||||
}
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
if(res){
|
||||
const data = res.data;
|
||||
this.documents.push(data.selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
removeAttachment(index: number){
|
||||
|
||||
this.documents = this.documents.filter( (e, i) => index != i);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user