mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -103,8 +103,8 @@
|
|||||||
|
|
||||||
<div *ngIf="task" class="aside-right flex-column height-100">
|
<div *ngIf="task" class="aside-right flex-column height-100">
|
||||||
<div *ngIf="loggeduser.Profile =='MDGPR' " class="buttons">
|
<div *ngIf="loggeduser.Profile =='MDGPR' " class="buttons">
|
||||||
<button class="btn-cancel" shape="round" >Aprovar</button>
|
<button (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Aprovar</button>
|
||||||
<button class="btn-cancel" shape="round" >Mandar para arevisão</button>
|
<button (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="distartExpedientModal(fulltask)" class="btn-cancel" shape="round" >Descartar</button>
|
<button (click)="distartExpedientModal(fulltask)" class="btn-cancel" shape="round" >Descartar</button>
|
||||||
<div hidden class="solid"></div>
|
<div hidden class="solid"></div>
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ import { ExpedientTaskModalPage } from '../../expediente/expedient-task-modal/ex
|
|||||||
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
|
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
|
||||||
import { User } from 'src/app/models/user.model';
|
import { User } from 'src/app/models/user.model';
|
||||||
import { AuthService } from 'src/app/services/auth.service';
|
import { AuthService } from 'src/app/services/auth.service';
|
||||||
|
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||||
|
import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component';
|
||||||
|
import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-expediente-pr',
|
selector: 'app-expediente-pr',
|
||||||
@@ -174,6 +177,89 @@ export class ExpedientePrPage implements OnInit {
|
|||||||
this.modalController.dismiss();
|
this.modalController.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async approve(note:string, documents:any){
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialnumber,
|
||||||
|
"action": "Aprovar",
|
||||||
|
"ActionTypeId": 100000004 ,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body);
|
||||||
|
this.close();
|
||||||
|
this.successMessage()
|
||||||
|
} catch(error) {
|
||||||
|
this.badRequest()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async sendToReview(note:string, documents:any){
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialnumber,
|
||||||
|
"action": "Retificar",
|
||||||
|
"ActionTypeId": 99999877,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body);
|
||||||
|
this.close();
|
||||||
|
this.successMessage()
|
||||||
|
} catch(error) {
|
||||||
|
this.badRequest()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async openAddNoteModal(actionName:string) {
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
}
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: AddNotePage,
|
||||||
|
componentProps:{
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: true
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(res => {
|
||||||
|
console.log(res);
|
||||||
|
if(res.data){
|
||||||
|
const DocumentToSave = res.data.documents.map((e) => {
|
||||||
|
return {
|
||||||
|
ApplicationId: e.ApplicationType,
|
||||||
|
SourceId: e.Id,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let docs = {
|
||||||
|
ProcessInstanceID: "",
|
||||||
|
Attachments: DocumentToSave,
|
||||||
|
}
|
||||||
|
|
||||||
|
if(actionName == 'Aprovar'){
|
||||||
|
this.approve(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Revisão'){
|
||||||
|
this.sendToReview(res.data.note, docs);
|
||||||
|
}
|
||||||
|
this.goBack();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async openExpedientActionsModal(taskAction: any, task: any) {
|
async openExpedientActionsModal(taskAction: any, task: any) {
|
||||||
//this.modalController.dismiss();
|
//this.modalController.dismiss();
|
||||||
let classs;
|
let classs;
|
||||||
@@ -314,5 +400,43 @@ export class ExpedientePrPage implements OnInit {
|
|||||||
translucent: true
|
translucent: true
|
||||||
});
|
});
|
||||||
return await popover.present();
|
return await popover.present();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async successMessage(message?: string) {
|
||||||
|
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: SuccessMessageComponent,
|
||||||
|
componentProps: {
|
||||||
|
message: message || 'Processo efetuado' ,
|
||||||
|
},
|
||||||
|
cssClass: 'modal modal-desktop'
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.present()
|
||||||
|
|
||||||
|
setTimeout(()=>{
|
||||||
|
modal.dismiss()
|
||||||
|
},3000)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async badRequest() {
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: BadRequestComponent,
|
||||||
|
componentProps: {
|
||||||
|
message: 'hello',
|
||||||
|
},
|
||||||
|
cssClass: 'modal modal-desktop'
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.present()
|
||||||
|
|
||||||
|
setTimeout(()=>{
|
||||||
|
modal.dismiss()
|
||||||
|
},1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user