mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
save
This commit is contained in:
@@ -20,16 +20,34 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ion-item-container-no-border cursor-pointer">
|
||||
<ion-label>
|
||||
<div class="attach-icon">
|
||||
<div class="ion-item-container-no-border" (click)="getDoc()">
|
||||
<ion-label class="d-flex align-center">
|
||||
<div class="attach-icon d-flex align-center">
|
||||
<ion-icon src="assets/images/icons-attach-doc.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="attach-document">
|
||||
<div class="attach-document pl-10">
|
||||
<ion-label>Anexar Documentos</ion-label>
|
||||
</div>
|
||||
</ion-label>
|
||||
</div>
|
||||
|
||||
<div class="list " *ngFor="let document of documents; let i = index" >
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-label>
|
||||
<p class="d-flex ion-justify-content-between">
|
||||
<span class="attach-title-item">{{document.Assunto}}</span>
|
||||
<span class="app-name">{{document.appName}}</span>
|
||||
<span class="close-button text-black" (click)="removeAttachment(i)" >
|
||||
<ion-icon class="font-20" src="assets/images/icons-delete-25.svg"></ion-icon>
|
||||
</span>
|
||||
</p>
|
||||
<p><span class="span-left">{{document.EntidadeOrganicaNome}}</span><span class="span-right"> {{document.Data | date: 'dd-MM-yy'}} </span></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dar-parecer',
|
||||
@@ -8,12 +11,23 @@ import { ModalController } from '@ionic/angular';
|
||||
})
|
||||
export class DarParecerPage implements OnInit {
|
||||
note:string;
|
||||
serialNumber:string;
|
||||
instanceId: string;
|
||||
documents:SearchDocument[] = [];
|
||||
|
||||
constructor(
|
||||
private processes: ProcessesService,
|
||||
private modalController: ModalController,
|
||||
) { }
|
||||
private navParams: NavParams,
|
||||
) {
|
||||
this.serialNumber = this.navParams.get('serialNumber');
|
||||
this.instanceId = this.navParams.get('ProcessInstanceID');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.serialNumber
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
cancel(){
|
||||
@@ -21,6 +35,53 @@ export class DarParecerPage implements OnInit {
|
||||
}
|
||||
|
||||
save(){
|
||||
const DocumentToSave = this.documents.map((e) => {
|
||||
return {
|
||||
ApplicationId: e.ApplicationType,
|
||||
SourceId: e.Id,
|
||||
}
|
||||
});
|
||||
|
||||
let docs = {
|
||||
ProcessInstanceID: this.instanceId,
|
||||
Attachments: DocumentToSave,
|
||||
}
|
||||
|
||||
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Registar",
|
||||
"ActionTypeId": 104,
|
||||
"dataFields": {
|
||||
"ReviewUserComent": this.note,
|
||||
},
|
||||
"AttachmentList": docs,
|
||||
}
|
||||
console.log(body);
|
||||
this.processes.CompleteTask(body);
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
removeAttachment(index: number){
|
||||
this.documents = this.documents.filter( (e, i) => index != i);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user