mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
save
This commit is contained in:
@@ -11,13 +11,13 @@
|
||||
<button (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Aprovar</button>
|
||||
<button (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="distartExpedientModal(fulltask)" class="btn-cancel" shape="round" >Descartar</button>
|
||||
<button (click)="distartExpedientModal('descartar')" full class="btn-ok" shape="round" >Descartar</button>
|
||||
<div hidden class="solid"></div>
|
||||
<button hidden class="btn-cancel" shape="round" >Delegar</button>
|
||||
</div>
|
||||
<div *ngIf="loggeduser.Profile =='PR' " class="buttons">
|
||||
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-ok" shape="round" >Marcar para Despacho</button>
|
||||
<button (click)="distartExpedientModal(fulltask)" class="btn-cancel" shape="round" >Descartar</button>
|
||||
<button (click)="distartExpedientModal('descartar')" full class="btn-ok" shape="round" >Descartar</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
|
||||
@@ -33,6 +33,8 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
serialnumber: string;
|
||||
profile: string;
|
||||
|
||||
showEnviarPendentes = false;
|
||||
|
||||
loggeduser: User;
|
||||
|
||||
constructor(
|
||||
@@ -53,18 +55,21 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
this.fulltask = this.navParams.get('fulltask');
|
||||
|
||||
this.loggeduser = userAuth.ValidatedUser;
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
if(params["serialNumber"]) {
|
||||
this.serialnumber = params["serialNumber"];
|
||||
console.log(params["serialNumber"]);
|
||||
}
|
||||
});
|
||||
this.profile = "mdgpr";
|
||||
if(this.task.Status != 'Pending'){
|
||||
this.showEnviarPendentes = true;
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
|
||||
close(){
|
||||
if( window.innerWidth <= 1024){
|
||||
this.popoverController.dismiss();
|
||||
}
|
||||
else{
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
async openAddNoteModal(actionName:string) {
|
||||
@@ -112,6 +117,7 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
}
|
||||
|
||||
async approve(note:string, documents:any){
|
||||
this.popoverController.dismiss();
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
"action": "Aprovar",
|
||||
@@ -131,15 +137,11 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
async distartExpedientModal(body:any) {
|
||||
async distartExpedientModal(body:any){
|
||||
this.popoverController.dismiss();
|
||||
console.log(this.fulltask);
|
||||
const modal = await this.modalController.create({
|
||||
component: DiscartExpedientModalPage,
|
||||
componentProps: {
|
||||
serialNumber: this.fulltask.serialNumber,
|
||||
folderId: this.fulltask.workflowInstanceDataFields.FolderID,
|
||||
action: 'complete',
|
||||
},
|
||||
cssClass: 'discart-expedient-modal',
|
||||
backdropDismiss: false
|
||||
@@ -148,42 +150,53 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
console.log(res['data']);
|
||||
if(res['data']== 'Yes'){
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.toastService.successMessage()
|
||||
this.goBack();
|
||||
if(body == 'descartar'){
|
||||
if(res['data']== 'Yes'){
|
||||
let otherbody = {
|
||||
"serialNumber": this.task.SerialNumber,
|
||||
"action": "Passivo",
|
||||
"ActionTypeId": 99999877,
|
||||
"dataFields": {
|
||||
"Note": "",
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
|
||||
else if(res['data'] == 'No'){
|
||||
//Do nothing
|
||||
}
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
let otherbody = {
|
||||
"serialNumber": body.serialNumber,
|
||||
"action": "Passivo",
|
||||
"ActionTypeId": 99999877,
|
||||
"dataFields": {
|
||||
"Note": "",
|
||||
else{
|
||||
if(res['data']== 'Yes'){
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
}
|
||||
this.goBack();
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
console.log('Update');
|
||||
try {
|
||||
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
|
||||
this.toastService.successMessage();
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
this.toastService.successMessage()
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//Volta na lista principal
|
||||
this.goBack();
|
||||
this.modalController.dismiss();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -209,6 +222,7 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
}
|
||||
|
||||
sendExpedienteToPending(){
|
||||
this.popoverController.dismiss();
|
||||
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.close();
|
||||
@@ -270,16 +284,6 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
|
||||
close() {
|
||||
if( window.innerWidth <= 1024) {
|
||||
this.popoverController.dismiss();
|
||||
}
|
||||
else{
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
goBack() {
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
|
||||
Reference in New Issue
Block a user