mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
lot of changes
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@
|
||||
</div>
|
||||
<div *ngIf="content != ''" class="buttons header-fix">
|
||||
<!-- <button (click)="save(Document, content)" class="btn-cancel" shape="round" >Salvar</button> -->
|
||||
<button (click)="saveDraft(Document, content)" class="btn-cancel" shape="round" >Salvar Rascunho</button>
|
||||
<button (click)="AssinarDraft()" class="btn-cancel" shape="round" >Assinar</button>
|
||||
<button class="btn-cancel" shape="round" (click)="close()">Cancelar</button>
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
+100
-2
@@ -3,6 +3,10 @@ import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ProcessesService} from 'src/app/services/processes.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { TaskService } from 'src/app/services/task.service';
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
import { PopupQuestionPage } from 'src/app/modals/popup-question/popup-question.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-event-details-documents-options',
|
||||
@@ -13,20 +17,35 @@ export class EventDetailsDocumentsOptionsPage implements OnInit {
|
||||
|
||||
Document: any
|
||||
content: any = "";
|
||||
InstanceID:any
|
||||
FolderID:any
|
||||
DraftIds:any
|
||||
DraftNames:any
|
||||
serialnumber: any
|
||||
|
||||
constructor(
|
||||
public p: PermissionService,
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
private processService: ProcessesService,
|
||||
private erroHandler: HttpErrorHandle
|
||||
private erroHandler: HttpErrorHandle,
|
||||
|
||||
private processes: ProcessesService,
|
||||
private toastService: ToastService,
|
||||
public TaskService: TaskService,
|
||||
private RouteService: RouteService,
|
||||
) {
|
||||
this.Document = this.navParams.get('Document')
|
||||
this.content = this.navParams.get('content')
|
||||
this.InstanceID = this.navParams.get('InstanceId')
|
||||
this.FolderID = this.navParams.get('FolderId')
|
||||
this.DraftIds = this.navParams.get('DraftIds')
|
||||
this.DraftNames = this.navParams.get('OriginalFileName')
|
||||
this.serialnumber = this.navParams.get('Serialnumber');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.content)
|
||||
console.log(this.serialnumber)
|
||||
}
|
||||
|
||||
close() {
|
||||
@@ -86,4 +105,83 @@ export class EventDetailsDocumentsOptionsPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async Assinar() {
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
"action": "Assinado",
|
||||
"ActionTypeId": 99999842,
|
||||
"FolderId": this.FolderID,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": '',
|
||||
"InstanceIDNew": this.InstanceID,
|
||||
"DraftIds": "",
|
||||
},
|
||||
"AttachmentList": {
|
||||
"ProcessInstanceID": this.InstanceID,
|
||||
"DraftIds": null,
|
||||
"Attachments": []
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.erroHandler.httpsSucessMessagge('Assinado')
|
||||
} catch (error) {
|
||||
this.erroHandler.httpStatusHandle(error)
|
||||
}
|
||||
finally { }
|
||||
|
||||
}
|
||||
|
||||
async AssinarDraft() {
|
||||
const modal = await this.modalController.create({
|
||||
component: PopupQuestionPage,
|
||||
componentProps: {
|
||||
title: 'Deseja assinar este Diploma?',
|
||||
/* message: 'Nota: Ao Efetuar esta operação, o tratamento deste diploma não poderá ser realizado a partir da caixa de correspondência' */
|
||||
},
|
||||
cssClass: "popup-question discart-expedient-modal",
|
||||
backdropDismiss: true
|
||||
});
|
||||
|
||||
modal.onDidDismiss().then(async (res) => {
|
||||
const data = res.data
|
||||
if(data == "Yes") {
|
||||
let body = {
|
||||
"InstanceId": this.InstanceID,
|
||||
"FolderId": this.FolderID,
|
||||
"DraftIds": this.DraftIds,
|
||||
"OriginalFileName": this.DraftNames
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
|
||||
try {
|
||||
await this.processes.presidentialActionsSignature(body).toPromise()
|
||||
|
||||
await this.Assinar();
|
||||
this.TaskService.loadDiplomas();
|
||||
this.goBackRoute();
|
||||
} catch (error) {
|
||||
this.erroHandler.httpStatusHandle(error)
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
}
|
||||
}
|
||||
|
||||
}, (error) => {
|
||||
console.log(error)
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
}
|
||||
|
||||
goBackRoute() {
|
||||
this.RouteService.goBack();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user