mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Improve rules
This commit is contained in:
@@ -6,12 +6,26 @@ import { ProcessesService } from '../services/processes.service';
|
||||
})
|
||||
export class DeplomaService {
|
||||
|
||||
activityInstanceName = {
|
||||
'Revisar Diploma': [
|
||||
'Solicitar assinatura do Presidente',
|
||||
'Solicitar alteração',
|
||||
'Marcar Reunião'
|
||||
],
|
||||
'Diploma Assinado': [
|
||||
'Concluir'
|
||||
],
|
||||
'Assinar Diploma': [
|
||||
'Assinado'
|
||||
]
|
||||
}
|
||||
|
||||
constructor(
|
||||
private processes: ProcessesService,
|
||||
) { }
|
||||
|
||||
|
||||
async askSignature({note, documents, serialNumber}) {
|
||||
async askSignature({note, documents, serialNumber, activityInstanceName}) {
|
||||
let body = {
|
||||
"serialNumber": serialNumber,
|
||||
"action": "Aprovar",
|
||||
@@ -25,7 +39,7 @@ export class DeplomaService {
|
||||
return this.processes.CompleteTask(body)
|
||||
}
|
||||
|
||||
async askToChange({note, documents, serialNumber}) {
|
||||
async askToChange({note, documents, serialNumber, activityInstanceName}) {
|
||||
let body = {
|
||||
"serialNumber": serialNumber,
|
||||
"action": "Retificar",
|
||||
@@ -40,7 +54,7 @@ export class DeplomaService {
|
||||
|
||||
}
|
||||
|
||||
async finish({note, documents, serialNumber}) {
|
||||
async finish({note, documents, serialNumber, activityInstanceName}) {
|
||||
|
||||
let body = {
|
||||
"serialNumber": serialNumber,
|
||||
@@ -55,4 +69,18 @@ export class DeplomaService {
|
||||
return this.processes.CompleteTask(body);
|
||||
}
|
||||
|
||||
async sign({note, documents, serialNumber, activityInstanceName}) {
|
||||
let body = {
|
||||
"serialNumber": serialNumber,
|
||||
"action": "Assinado",
|
||||
"ActionTypeId": 99999842,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
|
||||
return this.processes.CompleteTask(body)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import { SuccessMessagePage } from '../success-message/success-message.page';
|
||||
export class DeplomaOptionsPage implements OnInit {
|
||||
|
||||
|
||||
serialnumber: string;
|
||||
serialNumber: string;
|
||||
profile: string;
|
||||
task: any
|
||||
fulltask: any
|
||||
@@ -31,20 +31,19 @@ export class DeplomaOptionsPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
private router: Router,
|
||||
private deplomaService: DeplomaService) {
|
||||
this.serialnumber = this.navParams.get('serialNumber');
|
||||
this.serialNumber = this.navParams.get('serialNumber');
|
||||
this.task = this.navParams.get('task');
|
||||
this.fulltask = this.navParams.get('fulltask');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.serialnumber);
|
||||
console.log(this.serialNumber);
|
||||
}
|
||||
|
||||
|
||||
async openAddNoteModal(actionName:string) {
|
||||
this.popoverController.dismiss();
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
if( window.innerWidth <= 800) {
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
classs = 'modal modal-desktop'
|
||||
@@ -84,6 +83,9 @@ export class DeplomaOptionsPage implements OnInit {
|
||||
} else if (actionName == 'Assinar Diploma') {
|
||||
await this.sign(res.data.note, docs);
|
||||
this.goBack();
|
||||
} else if(actionName == 'Concluir diploma'){
|
||||
await this.finish(res.data.note, docs);
|
||||
this.goBack();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -91,7 +93,7 @@ export class DeplomaOptionsPage implements OnInit {
|
||||
|
||||
async askToChange(note:string, documents:any){
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Retificar",
|
||||
"ActionTypeId": 99999841,
|
||||
"dataFields": {
|
||||
@@ -138,7 +140,7 @@ export class DeplomaOptionsPage implements OnInit {
|
||||
|
||||
async askSignature(note:string, documents:any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Aprovar",
|
||||
"ActionTypeId": 99999840,
|
||||
"dataFields": {
|
||||
@@ -164,7 +166,7 @@ export class DeplomaOptionsPage implements OnInit {
|
||||
|
||||
async sign(note:string, documents:any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Assinado",
|
||||
"ActionTypeId": 99999842,
|
||||
"dataFields": {
|
||||
@@ -187,6 +189,32 @@ export class DeplomaOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
async finish(note:string, documents:any){
|
||||
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Concluir",
|
||||
"ActionTypeId": 95,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.toastService.successMessage('Processo concluído')
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
goBack() {
|
||||
this.router.navigate(['/home/gabinete-digital/diplomas-assinar']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user