mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
save
This commit is contained in:
@@ -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