mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
add popup message
This commit is contained in:
@@ -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(); */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user