a lot of changes

This commit is contained in:
Eudes Inácio
2023-09-06 21:23:21 +01:00
parent 9de3019446
commit fb1bd07ad0
25 changed files with 1187 additions and 482 deletions
@@ -22,11 +22,11 @@
</div>
<div class="buttons">
<button (click)="openAddNoteModal('Arquivo')" class="btn-cancel" shape="round" >Arquivar</button>
<div class="solid"></div>
<!-- <div class="solid"></div> -->
</div>
<div class="buttons">
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<div class="solid"></div>
<!-- <button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> -->
<!-- <div class="solid"></div> -->
</div>
</div>
@@ -113,5 +113,6 @@
<button class="btn-cancel cursor-pointer" shape="round" (click)="emendTask(loadedEvent.serialNumber)">Enviar para Revisão</button>
<button class="btn-no-color cursor-pointer" shape="round" (click)="openMenu()"> <ion-icon name="ellipsis-vertical-outline"></ion-icon></button>
<button class="btn-cancel cursor-pointer" shape="round" (click)="approveTask(loadedEvent.serialNumber)">Aprovar</button>
<button class="btn-cancel cursor-pointer" shape="round" (click)="rejectTask(loadedEvent.serialNumber)">Eliminar</button>
</div>
</ion-footer>
@@ -127,14 +127,14 @@ export class ApproveEventModalPage implements OnInit {
async rejectTask(serialNumber:string) {
let body = { "serialNumber": serialNumber, "action": "Descartar" }
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
const loader = this.toastService.loading()
try {
await this.processes.PostTaskAction(body).toPromise()
this.toastService._successMessage('Evento rejeitado', () =>{
this.toastService._successMessage('Evento Eliminado!', () =>{
this.router.navigate(['/home/gabinete-digital/event-list']);
})
} catch (error) {
@@ -62,7 +62,7 @@ export class ExpedienteDetailPage implements OnInit {
onlinecheck: boolean;
loggeduser: LoginUserRespose;
constructor(
private processes: ProcessesService,
private router: Router,
@@ -84,7 +84,7 @@ export class ExpedienteDetailPage implements OnInit {
) {
this.loggeduser = SessionStore.user
// console.log('SessionStore', SessionStore)
this.activatedRoute.paramMap.subscribe(params => {
if (params["params"].SerialNumber) {
this.serialNumber = params["params"].SerialNumber;
@@ -114,13 +114,13 @@ export class ExpedienteDetailPage implements OnInit {
// updateProcessDB(res) {
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
// this.storage.set('expediente_details',res).then(() =>{
// })
// } else {
// //this.sqliteservice.updateProcess(res)
// }
// }
// getFromDB() {
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
// this.storage.get('expediente_details').then((process) => {
@@ -165,7 +165,7 @@ export class ExpedienteDetailPage implements OnInit {
// this.platform.ready().then(() => {
// this.onlinecheck = false;
// this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
// var workflow = JSON.parse(process[0].workflowInstanceDataFields);
// var origina
@@ -229,7 +229,7 @@ export class ExpedienteDetailPage implements OnInit {
"AttachmentList": documents,
}
const loader = this.toastService.loading()
@@ -283,7 +283,7 @@ export class ExpedienteDetailPage implements OnInit {
component: AddNotePage,
componentProps: {
showAttachmentBtn: false,
actionName:actionName
actionName: actionName
},
cssClass: classs,
//backdropDismiss: true
@@ -292,7 +292,7 @@ export class ExpedienteDetailPage implements OnInit {
modal.onDidDismiss().then(res => {
if (res.data) {
const DocumentToSave = res.data.documents.map((e) => {
return {
@@ -337,7 +337,7 @@ export class ExpedienteDetailPage implements OnInit {
sendExpedienteToPending() {
const loader = this.toastService.loading()
this.processes.SetTaskToPending(this.serialNumber).subscribe(res => {
this.httpErroHandle.httpsSucessMessagge('Enviar para Pendentes')
this.TaskService.loadExpedientes()
this.goBack();
@@ -352,7 +352,7 @@ export class ExpedienteDetailPage implements OnInit {
async LoadTaskDetail(serial: string) {
this.processes.GetTask(serial).subscribe(res => {
this.TaskService.loadExpedientes();
this.task = {
@@ -444,11 +444,11 @@ export class ExpedienteDetailPage implements OnInit {
// }
getAttachments(serialNumber) {
this.attachmentsService.getAttachmentsBySerial(serialNumber).subscribe(res => {
this.attachments = res;
});
}
@@ -472,9 +472,10 @@ export class ExpedienteDetailPage implements OnInit {
if (res) {
const data = res.data;
this.documents.push(data.selected);
await this.documents.forEach( async (element: any) => {
let body
await this.documents.forEach(async (element: any) => {
let body = {
body = {
"InstanceID": this.task.InstanceID,
"WorkflowDisplayName": this.task.WorkflowName,
"FolderID": this.task.FolderId,
@@ -485,22 +486,22 @@ export class ExpedienteDetailPage implements OnInit {
const Attachments = this.searchDocumentPipe.transformToAttachment(element)
body.Attachments = Attachments;
const loader = this.toastService.loading()
try {
loader.remove()
await this.attachmentsService.AddAttachment(body).toPromise()
this.toastService._successMessage()
} catch(error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
}
});
const loader = this.toastService.loading()
try {
loader.remove()
await this.attachmentsService.AddAttachment(body).toPromise()
this.toastService._successMessage()
} catch (error) {
if (error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
}
}
setTimeout(() => {
this.LoadTaskDetail(this.serialNumber);
@@ -563,8 +564,8 @@ export class ExpedienteDetailPage implements OnInit {
});
modal.onDidDismiss().then(async (res) => {
if (body == 'descartar') {
this.TaskService.loadExpedientes()
@@ -577,10 +578,10 @@ export class ExpedienteDetailPage implements OnInit {
this.toastService._successMessage('Processo descartado');
this.goBack();
} catch (error) {
if(error.status == 0) {
if (error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não descartado')
}
} finally {
@@ -601,10 +602,10 @@ export class ExpedienteDetailPage implements OnInit {
//this.toastService._successMessage('Processo descartado');
this.goBack();
} catch (error) {
if(error.status == 0) {
if (error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não descartado')
}
} finally {
@@ -613,17 +614,17 @@ export class ExpedienteDetailPage implements OnInit {
}
else if (res['data'] == 'No') {
const loader = this.toastService.loading()
try {
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
this.toastService._successMessage();
this.goBack();
} catch (error) {
if(error.status == 0) {
if (error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
@@ -639,7 +640,7 @@ export class ExpedienteDetailPage implements OnInit {
}
async openBookMeetingModal(task: any) {
let classs;
if (window.innerWidth < 701) {
@@ -651,7 +652,7 @@ export class ExpedienteDetailPage implements OnInit {
component: BookMeetingModalPage,
componentProps: {
task: this.task,
fulltask:this.fulltask
fulltask: this.fulltask
},
cssClass: classs,
backdropDismiss: false
@@ -671,7 +672,7 @@ export class ExpedienteDetailPage implements OnInit {
}
async viewEventDetail(eventId: any) {
const modal = await this.modalController.create({
component: ViewEventPage,
@@ -722,7 +723,7 @@ export class ExpedienteDetailPage implements OnInit {
this.dataService.set("newGroupName", this.task.Folio);
this.dataService.set("documents", this.fulltask.Documents);
this.dataService.set("link", window.location.pathname);
setTimeout(()=> {
setTimeout(() => {
this.router.navigate(['/home/chat']);
}, 100)
}
@@ -739,12 +740,12 @@ export class ExpedienteDetailPage implements OnInit {
});
modal.onDidDismiss().then(
()=>{},
() => { },
(error) => {
console.log(error)
})
await modal.present();
await modal.present();
}
}