add popup message

This commit is contained in:
Peter Maquiran
2023-09-22 15:17:25 +01:00
parent 97d33370fc
commit 1df6c308b2
23 changed files with 360 additions and 101 deletions
@@ -14,15 +14,15 @@
<button (click)="openAddNoteModal('Solicitar alteração')" class="btn-cancel" shape="round" >Solicitar alteração</button>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar despacho</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<div class="solid"></div>
</div>
<div class="buttons width-100" *ngIf="task.activityInstanceName == 'Diploma Assinado'">
<button (click)="openAddNoteModal('Concluir diploma')" class="btn-cancel" shape="round" >Concluir</button>
</div>
<div class="buttons width-100" *ngIf="task.activityInstanceName == 'Assinar Diploma'">
<button (click)="openAddNoteModal('AssinarNew')" class="btn-cancel" shape="round" >Assinar</button>
<button (click)="AssinarNew()" class="btn-cancel" shape="round" >Assinar</button>
</div>
<div class="buttons width-100">
<button (click)="openAddNoteModal('Arquivo')" class="btn-cancel" shape="round" >Arquivar</button>
@@ -12,6 +12,7 @@ import { AttachmentList } from 'src/app/models/Excludetask';
import { DespachoService } from 'src/app/Rules/despacho.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { TaskService } from 'src/app/services/task.service'
import { PopupQuestionPage } from 'src/app/modals/popup-question/popup-question.page';
@Component({
selector: 'app-deploma-options',
@@ -137,7 +138,7 @@ export class DiplomaOptionsPage implements OnInit {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
@@ -195,7 +196,7 @@ export class DiplomaOptionsPage implements OnInit {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
@@ -205,7 +206,7 @@ export class DiplomaOptionsPage implements OnInit {
}
async sign(note:string, documents:any) {
async sign(note?:string, documents?:any) {
let body = {
"serialNumber": this.serialNumber,
"action": "Assinado",
@@ -236,26 +237,48 @@ export class DiplomaOptionsPage implements OnInit {
} finally {}
}
async AssinarNew(note, doc) {
let body = {
"InstanceId": this.task.InstanceID,
"FolderId": this.task.FolderID,
"DraftIds": this.DraftIds,
"OriginalFileName": this.DraftNames
}
const loader = this.toastService.loading()
async AssinarNew(note?, doc?) {
try {
await this.processes.presidentialActionsSignature(body).toPromise()
await this.sign(note, doc)
this.TaskService.loadDiplomas()
this.goBack();
} catch (error) {
this.httpErroHandle.httpStatusHandle(error)
}
finally {
loader.remove()
}
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.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()
}
}
}, (error) => {
console.log(error)
});
await modal.present();
}
@@ -281,7 +304,7 @@ export class DiplomaOptionsPage implements OnInit {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
}
@@ -329,7 +352,7 @@ export class DiplomaOptionsPage implements OnInit {
cssClass: classs,
});
modal.onDidDismiss().then(async (res) => {
if (res['data'] == 'openDiscart') {
await this.distartExpedientModal();
@@ -346,7 +369,7 @@ export class DiplomaOptionsPage implements OnInit {
}
async distartExpedientModal() {
const modal = await this.modalController.create({
component: DiscartExpedientModalPage,
componentProps: {
@@ -361,7 +384,7 @@ export class DiplomaOptionsPage implements OnInit {
modal.onDidDismiss().then(res => {
if (res['data'] == 'close') {
this.close();
/*
/*
this.close();
this.openMenu(); */
}