lot of changes

This commit is contained in:
Eudes Inácio
2023-10-19 16:51:12 +01:00
parent ff52c56cde
commit 57f51903bc
51 changed files with 43514 additions and 1079 deletions
@@ -371,7 +371,7 @@
<ion-footer class="background-whit">
<div class="buttons">
<button class="btn-cancel cursor-pointer" shape="round" (click)="close()">Cancelar</button>
<button class="btn-ok cursor-pointer" shape="round" (click)="gravasAction()">Gravar</button>
<button class="btn-cancel cursor-pointer" shape="round" (click)="close()">Cancelar</button>
</div>
</ion-footer>
@@ -316,15 +316,15 @@
<ion-footer class="ion-no-border">
<ion-toolbar class="width-100 d-flex justify-space-between px-20">
<ion-buttons slot="start">
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<ion-label>Cancelar</ion-label>
</button>
</ion-buttons>
<ion-title></ion-title>
<ion-buttons slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Gravar</ion-label>
</button>
</ion-buttons>
<ion-title></ion-title>
<ion-buttons slot="end">
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<ion-label>Cancelar</ion-label>
</button>
</ion-buttons>
</ion-toolbar>
</ion-footer>
@@ -343,17 +343,19 @@
</ion-content>
<ion-footer class="ion-no-border">
<ion-toolbar class="footer-toolbar">
<ion-buttons slot="start">
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<ion-label>Cancelar</ion-label>
</button>
</ion-buttons>
<ion-title></ion-title>
<ion-buttons slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Gravar</ion-label>
</button>
</ion-buttons>
<ion-title></ion-title>
<ion-buttons slot="end">
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<ion-label>Cancelar</ion-label>
</button>
</ion-buttons>
<!-- <app-new-event
[loggedAttend]="loggedAttend"
@@ -171,16 +171,16 @@ export class ViewEventPage implements OnInit {
header: 'Eliminar evento?',
message: '',
buttons: [
{
text: 'Não',
handler: () => {
}
},
{
text: 'Sim',
handler: () => {
this.deleteEvent();
}
},
{
text: 'Não',
handler: () => {
}
}
]
}).then(res => {
@@ -81,14 +81,14 @@
<ion-footer class="ion-no-border" *ngIf="footer" >
<ion-toolbar class="width-100 d-flex justify-space-between px-20">
<ion-buttons slot="start">
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<ion-label>Cancelar</ion-label>
</button>
</ion-buttons>
<ion-buttons slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Gravar</ion-label>
</button>
</ion-buttons>
<ion-buttons slot="end">
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<ion-label>Cancelar</ion-label>
</button>
</ion-buttons>
</ion-toolbar>
</ion-footer>
@@ -8,6 +8,7 @@ import { ViewChild } from '@angular/core';
import { Searchbar } from 'ionic-angular';
import { LoginUserRespose } from 'src/app/models/user.model';
import { SessionStore } from 'src/app/store/session.service';
import { Router } from '@angular/router';
@Component({
selector: 'app-attendee-modal',
@@ -31,8 +32,8 @@ export class AttendeePage implements OnInit {
@Output() dynamicSetIntervenient = new EventEmitter<any>();
@Input() taskParticipants:EventPerson[] = [];
@Input() taskParticipantsCc:EventPerson[] = [];
@Input() taskParticipants: EventPerson[] = [];
@Input() taskParticipantsCc: EventPerson[] = [];
@Input() loggedAttendSon: boolean;
@Input() footer: boolean;
@@ -40,49 +41,67 @@ export class AttendeePage implements OnInit {
@Input() selectLogUser: boolean = true;
@ViewChild('Searchbar') searchbar: Searchbar;
@Input() taskType: any;
LtaskParticipants: EventPerson[] = [];
LtaskParticipantsCc: EventPerson[] = [];
loggeduser: LoginUserRespose;
listOfNotAllowdRoute = ['/home/gabinete-digital/despachos/', ]
constructor(
private modalCtrl: ModalController,
private modalCtrl: ModalController,
private contactsService: ContactsService,
public ThemeService: ThemeService ) {
public ThemeService: ThemeService,
private router: Router,) {
this.LtaskParticipants = removeDuplicate(this.taskParticipants);
this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
this.loggeduser = SessionStore.user;
this.LtaskParticipants = removeDuplicate(this.taskParticipants);
this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
this.loggeduser = SessionStore.user;
}
ngOnChanges() {
this.LtaskParticipants = removeDuplicate(this.taskParticipants);
this.LtaskParticipants = removeDuplicate(this.taskParticipants);
this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
console.log('PARTE PARTE',this.loggedAttendSon)
console.log('PARTE PARTE', this.loggedAttendSon)
}
currentPath = window.location.pathname;
@Input() adding: "intervenient" | "CC";
ngOnInit() {
console.log('TASK TYPE',this.taskType);
console.log('Pesquisa de contactos current path3', this.router.url)
setTimeout(() => {
console.log('PARTE PARTE',this.loggedAttendSon)
});
console.log('PARTE PARTE', this.loggedAttendSon)
});
this.fetchContacts("");
if(this.LtaskParticipants == null || this.LtaskParticipants == undefined) {
if (this.LtaskParticipants == null || this.LtaskParticipants == undefined) {
this.LtaskParticipants = [];
}
if(this.LtaskParticipantsCc == null || this.LtaskParticipantsCc == undefined) {
if (this.LtaskParticipantsCc == null || this.LtaskParticipantsCc == undefined) {
this.LtaskParticipantsCc = [];
}
}
removeIdfromRoute(route: string) {
let lastIndex: number = route.lastIndexOf('/');
if (lastIndex !== -1) {
let modifiedString: string = route.slice(0, lastIndex + 1);
console.log(modifiedString);
} else {
console.log("No '/' found in the string.");
}
}
save() {
this.setIntervenient.emit(removeDuplicate(this.LtaskParticipants));
@@ -94,10 +113,10 @@ export class AttendeePage implements OnInit {
setContactWithClose() {
if(this.currentPath == '/home/gabinete-digital') {
if (this.currentPath == '/home/gabinete-digital') {
this.setIntervenient.emit(this.LtaskParticipants);
this.setIntervenientCC.emit(this.LtaskParticipantsCc);
}
}
this.dynamicSetIntervenient.emit({
taskParticipants: this.LtaskParticipants,
@@ -108,19 +127,19 @@ export class AttendeePage implements OnInit {
async selectContact(itm: EventPerson) {
if(this.adding == "intervenient") {
if (this.adding == "intervenient") {
itm.IsRequired = true;
this.LtaskParticipants.push(itm);
} else if (this.adding == "CC") {
itm.IsRequired = false;
this.LtaskParticipantsCc.push(itm);
} else {
//
}
// run only in gabinete digital
this.setContactWithClose();
@@ -136,115 +155,116 @@ export class AttendeePage implements OnInit {
filterSearchList(itm: EventPerson): boolean {
const result = this.LtaskParticipants.concat(this.LtaskParticipantsCc).find((contact, index)=>{
const result = this.LtaskParticipants.concat(this.LtaskParticipantsCc).find((contact, index) => {
if(this.checkStringNull(contact.Name) == this.checkStringNull(itm.Name) && this.checkStringNull(contact.EmailAddress) == this.checkStringNull(itm.EmailAddress)){
if (this.checkStringNull(contact.Name) == this.checkStringNull(itm.Name) && this.checkStringNull(contact.EmailAddress) == this.checkStringNull(itm.EmailAddress)) {
index = index;
return contact;
}
});
// if to show
if(undefined != result){
if (undefined != result) {
return false;
}
const result2 = this.LtaskParticipantsCc.find((contact, index)=>{
if(this.checkStringNull(contact.Name) == itm.Name && this.checkStringNull(contact.EmailAddress) == this.checkStringNull(itm.EmailAddress)){
const result2 = this.LtaskParticipantsCc.find((contact, index) => {
if (this.checkStringNull(contact.Name) == itm.Name && this.checkStringNull(contact.EmailAddress) == this.checkStringNull(itm.EmailAddress)) {
index = index;
return contact;
}
});
// if to show
if(undefined != result2) {
if (undefined != result2) {
return false;
}
// don't show
return true;
}
remove(itm: EventPerson) {
if(this.adding == "intervenient"){
if (this.adding == "intervenient") {
this.LtaskParticipants = this.LtaskParticipants.filter((contact, index) =>{
this.LtaskParticipants = this.LtaskParticipants.filter((contact, index) => {
if(contact.Name.toLocaleLowerCase() != itm.Name.toLocaleLowerCase() && contact.EmailAddress.toLocaleLowerCase() != itm.EmailAddress.toLocaleLowerCase()){
if (contact.Name.toLocaleLowerCase() != itm.Name.toLocaleLowerCase() && contact.EmailAddress.toLocaleLowerCase() != itm.EmailAddress.toLocaleLowerCase()) {
return contact;
}
return false;
});
} else if (this.adding == "CC") {
this.LtaskParticipantsCc = this.LtaskParticipantsCc.filter((contact, index) =>{
this.LtaskParticipantsCc = this.LtaskParticipantsCc.filter((contact, index) => {
if(contact.Name.toLocaleLowerCase() != itm.Name.toLocaleLowerCase() && contact.EmailAddress.toLocaleLowerCase() != itm.EmailAddress.toLocaleLowerCase()){
if (contact.Name.toLocaleLowerCase() != itm.Name.toLocaleLowerCase() && contact.EmailAddress.toLocaleLowerCase() != itm.EmailAddress.toLocaleLowerCase()) {
return contact;
}
return false;
});
}
this.setContactWithClose();
}
sort(data: []) {
return data.sort(function (a: any, b: any) {
if (a.Name > b.Name) {
return -1;
return -1;
}
if (b.Name > a.Name) {
return 1;
return 1;
}
return 0;
}).reverse()
}).reverse()
}
async fetchContacts(filter: string) {
this.showLoader = true;
this.contactsService.getContacts(filter).subscribe(result =>
{
if (this.eventPersons != null)
{
this.eventPersons.forEach(attendee => {
const index: number = result.findIndex((cont) => {
return this.checkStringNull(cont.EmailAddress) == this.checkStringNull(attendee.EmailAddress)
});
result.splice(index, 1);
this.contactsService.getContacts(filter).subscribe(result => {
if (this.eventPersons != null) {
this.eventPersons.forEach(attendee => {
const index: number = result.findIndex((cont) => {
return this.checkStringNull(cont.EmailAddress) == this.checkStringNull(attendee.EmailAddress)
});
}
if(this.loggedAttendSon) {
this.contacts = this.sort(result as any);
this.showLoader = false;
} else {
this.contacts = this.sort(result as any);
console.log('Attendes Email',this.loggeduser.Email)
result.splice(index, 1);
});
}
if (this.loggedAttendSon) {
this.contacts = this.sort(result as any);
this.showLoader = false;
} else {
this.contacts = this.sort(result as any);
console.log('Attendes Email', this.loggeduser.Email)
let filterLoggedUserEmail = this.contacts.filter(item => item.EmailAddress.toLocaleLowerCase() != this.loggeduser.Email.toLocaleLowerCase())
if(this.taskType == 0 || this.taskType == 1){
filterLoggedUserEmail = this.contacts.filter(item => item.IsPR == false)
}
console.log('Attendes Email', filterLoggedUserEmail)
let filterEmptyEmail = filterLoggedUserEmail.filter(item => item.EmailAddress.toLocaleLowerCase() != "")
this.contacts = filterEmptyEmail;
console.log('Attendes Email', this.contacts)
this.showLoader = false;
}
}
}
);
}
checkStringNull(value: string) {
if(value) {
if (value) {
return value.toLowerCase();
} else {
return value
@@ -323,7 +323,8 @@
<ion-footer class="background-whit">
<div class="buttons">
<button class="btn-cancel cursor-pointer" shape="round" (click)="close()">Cancelar</button>
<button class="btn-ok cursor-pointer" shape="round" (click)="save()">Gravar</button>
<button class="btn-cancel cursor-pointer" shape="round" (click)="close()">Cancelar</button>
</div>
</ion-footer>
+4 -4
View File
@@ -187,21 +187,21 @@
<!-- <div class="icon" (click)="basicSearch()">
<ion-icon class="icon-z" slot="end" name="search"></ion-icon>
</div> -->
<div class="input-text d-flex ion-align-items-center">
<!-- <div class="input-text d-flex ion-align-items-center">
<ion-input (keyup.enter)="basicSearch()" [(ngModel)]='searchSubject' (ngModelChange)="dynamicSearch()"
class="search-input text-black" type="search" placeholder="Pesquisar assunto"></ion-input>
</div>
</div> -->
<!-- <div class="icon" (click)="clearSearchInput()">
<ion-icon title="Limpar" *ngIf="ThemeService.currentTheme == 'default' "name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
<ion-icon title="Limpar" *ngIf="ThemeService.currentTheme == 'doneIt' "name="restaurant-outline" src="assets/images/theme/doneIt/icons-search.svg"></ion-icon>
<ion-icon title="Limpar" *ngIf="ThemeService.currentTheme == 'gov' " name="restaurant-outline" src="assets/images/theme/gov/icons-search-close.svg"></ion-icon>
</div> -->
<div (click)="basicSearch()" class="d-flex align-center icon">
<!-- <div (click)="basicSearch()" class="d-flex align-center icon">
<ion-icon class="icon-z" slot="end" src="assets/images/theme/gov/search.svg"></ion-icon>
</div>
</div> -->
</div>
</div>
</div>
@@ -27,7 +27,8 @@ export class DiplomaOptionsPage implements OnInit {
task: any
fulltask: any
DraftIds = ""
DraftNames= ""
DraftNames = ""
asDrat: boolean;
constructor(
@@ -41,42 +42,43 @@ export class DiplomaOptionsPage implements OnInit {
private despachoService: DespachoService,
private httpErroHandle: HttpErrorHandle,
public TaskService: TaskService) {
this.serialNumber = this.navParams.get('serialNumber');
this.task = this.navParams.get('task');
this.fulltask = this.navParams.get('fulltask');
this.serialNumber = this.navParams.get('serialNumber');
this.task = this.navParams.get('task');
this.fulltask = this.navParams.get('fulltask');
this.DraftIds = this.navParams.get("DraftIds");
this.DraftNames = this.navParams.get("DraftNames");
this.DraftIds = this.navParams.get("DraftIds");
this.DraftNames = this.navParams.get("DraftNames");
this.asDrat = this.navParams.get('asDrat');
console.log('this.task', this.task)
console.log('this.task', this.task)
}
}
ngOnInit() {
console.log(this.task.activityInstanceName)
}
async openAddNoteModal(actionName:string) {
async openAddNoteModal(actionName: string) {
// this.popoverController.dismiss();
let classs;
if( window.innerWidth <= 800) {
if (window.innerWidth <= 800) {
classs = 'modal modal-desktop'
} else {
} else {
classs = 'modal modal-desktop'
}
const modal = await this.modalController.create({
component: AddNotePage,
componentProps:{
actionName:actionName
componentProps: {
actionName: actionName
},
cssClass: classs,
backdropDismiss: true
});
modal.onDidDismiss().then(async (res) => {
if(res.data) {
if (res.data) {
const DocumentToSave = res.data.documents.map((e) => {
@@ -91,22 +93,22 @@ export class DiplomaOptionsPage implements OnInit {
Attachments: DocumentToSave,
}
if(actionName == 'Solicitar assinatura') {
if (actionName == 'Solicitar assinatura') {
await this.askSignature(res.data.note, docs);
this.goBack();
} else if(actionName == 'Solicitar alteração') {
} else if (actionName == 'Solicitar alteração') {
await this.askToChange(res.data.note, docs);
this.goBack();
} else if (actionName == 'Assinar Diploma') {
await this.sign(res.data.note, docs);
this.goBack();
} else if(actionName == 'Concluir diploma'){
} else if (actionName == 'Concluir diploma') {
await this.finish(res.data.note, docs);
this.goBack();
} else if (actionName == 'Arquivo') {
await this.arquivar(res.data.note, docs);
this.goBack();
} else if (actionName =='AssinarNew') {
} else if (actionName == 'AssinarNew') {
await this.AssinarNew(res.data.note, docs)
}
}
@@ -117,7 +119,7 @@ export class DiplomaOptionsPage implements OnInit {
await modal.present();
}
async askToChange(note:string, documents:any){
async askToChange(note: string, documents: any) {
let body = {
"serialNumber": this.serialNumber,
"action": "Retificar",
@@ -125,7 +127,7 @@ export class DiplomaOptionsPage implements OnInit {
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
"AttachmentList": documents,
}
const loader = this.toastService.loading()
@@ -135,13 +137,13 @@ export class DiplomaOptionsPage implements OnInit {
this.close();
this.toastService._successMessage()
} catch (error) {
if(error.status == 0) {
if (error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
} finally {
loader.remove()
}
@@ -151,23 +153,23 @@ export class DiplomaOptionsPage implements OnInit {
async openBookMeetingModal(task: any) {
this.popoverController.dismiss();
let classs;
if( window.innerWidth <= 800){
if (window.innerWidth <= 800) {
classs = 'book-meeting-modal modal modal-desktop'
} else {
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: BookMeetingModalPage,
componentProps: {
task: this.task,
fulltask:this.fulltask
fulltask: this.fulltask
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then(
()=> {},
() => { },
(error) => {
console.log(error)
}
@@ -175,7 +177,7 @@ export class DiplomaOptionsPage implements OnInit {
}
async askSignature(note:string, documents:any) {
async askSignature(note: string, documents: any) {
let body = {
"serialNumber": this.serialNumber,
"action": "Aprovar",
@@ -183,7 +185,7 @@ export class DiplomaOptionsPage implements OnInit {
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
"AttachmentList": documents,
}
const loader = this.toastService.loading()
@@ -193,20 +195,20 @@ export class DiplomaOptionsPage implements OnInit {
this.close();
this.toastService._successMessage()
} catch (error) {
if(error.status == 0) {
if (error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
} finally {
loader.remove()
}
}
async sign(note?:string, documents?:any) {
async sign(note?: string, documents?: any) {
let body = {
"serialNumber": this.serialNumber,
"action": "Assinado",
@@ -217,7 +219,7 @@ export class DiplomaOptionsPage implements OnInit {
"InstanceIDNew": this.task.InstanceID,
"DraftIds": "",
},
"AttachmentList" : {
"AttachmentList": {
"ProcessInstanceID": this.task.InstanceID,
"DraftIds": null,
"Attachments": []
@@ -229,61 +231,65 @@ export class DiplomaOptionsPage implements OnInit {
await this.processes.CompleteTask(body).toPromise()
this.httpErroHandle.httpsSucessMessagge('Assinado')
} catch (error) {
if(error.status == 0) {
if (error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {}
} finally { }
}
async AssinarNew(note?, doc?) {
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' */
if (this.asDrat) {
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
});
},
cssClass: "popup-question discart-expedient-modal",
backdropDismiss: true
});
modal.onDidDismiss().then(async (res) => {
const data = res.data
if(data == "Yes") {
let body = {
"InstanceId": this.task.InstanceID,
"FolderId": this.task.FolderID,
"DraftIds": this.DraftIds,
"OriginalFileName": this.DraftNames
modal.onDidDismiss().then(async (res) => {
const data = res.data
if (data == "Yes") {
let body = {
"InstanceId": this.task.InstanceID,
"FolderId": this.task.FolderID,
"DraftIds": this.DraftIds,
"OriginalFileName": this.DraftNames
}
const loader = this.toastService.loading()
try {
await this.processes.presidentialActionsSignature(body).toPromise()
await this.sign()
this.TaskService.loadDiplomas()
this.goBack();
} catch (error) {
this.httpErroHandle.httpStatusHandle(error)
}
finally {
loader.remove()
}
}
const loader = this.toastService.loading()
try {
await this.processes.presidentialActionsSignature(body).toPromise()
await this.sign()
this.TaskService.loadDiplomas()
this.goBack();
} catch (error) {
this.httpErroHandle.httpStatusHandle(error)
}
finally {
loader.remove()
}
}
}, (error) => {
console.log(error)
});
}, (error) => {
console.log(error)
});
await modal.present();
await modal.present();
} else {
this.httpErroHandle.validationMessagge("diplomaAsDraft");
}
}
async finish(note:string, documents:any){
async finish(note: string, documents: any) {
let body = {
"serialNumber": this.serialNumber,
@@ -292,7 +298,7 @@ export class DiplomaOptionsPage implements OnInit {
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
"AttachmentList": documents,
}
const loader = this.toastService.loading()
@@ -301,11 +307,11 @@ export class DiplomaOptionsPage implements OnInit {
await this.processes.CompleteTask(body).toPromise();
this.toastService._successMessage('Processo concluído')
} catch (error) {
if(error.status == 0) {
if (error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
this.toastService._badRequest()
}
}
finally {
@@ -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>
@@ -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();
}
}
@@ -113,14 +113,15 @@
<ion-footer class="ion-no-border">
<ion-toolbar class="footer-toolbar width-100 justify-space-between d-flex px-20">
<ion-buttons slot="start">
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<ion-label>Cancelar</ion-label>
</button>
</ion-buttons>
<ion-buttons slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Gravar</ion-label>
</button>
</ion-buttons>
<ion-buttons slot="end">
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<ion-label>Cancelar</ion-label>
</button>
</ion-buttons>
</ion-toolbar>
</ion-footer>
@@ -118,14 +118,15 @@
<ion-footer class="ion-no-border">
<ion-toolbar class="footer-toolbar width-100 justify-space-between d-flex">
<ion-buttons slot="start">
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<ion-label>Cancelar</ion-label>
</button>
</ion-buttons>
<ion-buttons slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Criar</ion-label>
</button>
</ion-buttons>
<ion-buttons slot="end">
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<ion-label>Cancelar</ion-label>
</button>
</ion-buttons>
</ion-toolbar>
</ion-footer>
@@ -107,14 +107,15 @@
<ion-footer class="ion-no-border">
<ion-toolbar class="footer-toolbar width-100 px-20">
<ion-buttons slot="start">
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<ion-label>Cancelar</ion-label>
</button>
</ion-buttons>
<ion-buttons slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Gravar</ion-label>
</button>
</ion-buttons>
<ion-buttons slot="end">
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<ion-label>Cancelar</ion-label>
</button>
</ion-buttons>
</ion-toolbar>
</ion-footer>
@@ -259,7 +259,7 @@ export class ViewPublicationsPage implements OnInit {
backdropDismiss: true,
componentProps: {
title: 'Deseja arquivar este acção?',
description: 'Nota: Ao Efetuar esta operação, o tratamento deste acção não poderá ser realizado a partir da lista de acções'
/* description: 'Nota: Ao Efetuar esta operação, o tratamento deste acção não poderá ser realizado a partir da lista de acções' */
},
});