to many changes

This commit is contained in:
Eudes Inácio
2023-02-27 17:39:10 +01:00
parent fcd1989334
commit 46387d4977
30 changed files with 329 additions and 160 deletions
@@ -124,7 +124,6 @@ export class EventActionsPopoverPage implements OnInit {
this.goBack();
} catch (error) {
this.httpErrorHandle.httpStatusHandle(error)
this.toastService.badRequest();
}
finally {
loader.remove()
@@ -141,7 +140,7 @@ export class EventActionsPopoverPage implements OnInit {
}
async rejeitar() {
let body = { "serialNumber": this.serialNumber, "action": "Rejeitar" }
let body = { "serialNumber": this.serialNumber, "action": "Descartar" }
const loader = this.toastService.loading();
try {
@@ -395,20 +395,20 @@ export class NewEventPage implements OnInit {
if(this.loggeduser.Profile == 'MDGPR') {
eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise();
this.toastService._successMessage('Evento criado');
this.hhtpErrorHandle.httpsSucessMessagge('new event')
}
else if(this.loggeduser.Profile == 'PR') {
const CalendarId = this.selectedCalendarId()
eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise();
this.toastService._successMessage('Evento criado');
this.hhtpErrorHandle.httpsSucessMessagge('new event')
} else {
const CalendarId = this.selectedCalendarId()
eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise();
this.toastService._successMessage('Evento criado');
this.hhtpErrorHandle.httpsSucessMessagge('new event')
}
@@ -298,8 +298,10 @@ export class ViewEventPage implements OnInit {
alert.dismiss();
}, 1500);
this.goBack();
this.toastService._successMessage('Evento apagado');
}, () => { },
this.httpErrorHandle.httpsSucessMessagge('delete event')
}, (error) => {
this.httpErrorHandle.httpStatusHandle(error)
},
() => {
loader.remove();
});
@@ -81,6 +81,14 @@
<button (click)="Assinar()" class="btn-cancel" shape="round" >Assinado</button>
<div class="solid"></div>
</div>
<div class="buttons">
<button (click)="openAddNoteModal('Arquivo')" class="btn-cancel" shape="round" >Arquivar</button>
<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>
</div>
</div>
<div *ngIf="!task">
@@ -10,6 +10,11 @@ import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.pag
import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service';
import {HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { DespachoService } from 'src/app/Rules/despacho.service'
import { AttachmentList } from 'src/app/models/Excludetask';
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
@Component({
selector: 'app-diploma-assinar',
@@ -38,7 +43,8 @@ export class DiplomaAssinarPage implements OnInit {
private toastService: ToastService,
private RouteService: RouteService,
public ThemeService: ThemeService,
private httpErroHandle: HttpErrorHandle
private httpErroHandle: HttpErrorHandle,
private despachoService: DespachoService,
) {
this.activatedRoute.paramMap.subscribe(params => {
if(params["params"].SerialNumber) {
@@ -182,6 +188,133 @@ export class DiplomaAssinarPage implements OnInit {
}
async openAddNoteModal(actionName: string) {
let classs;
if (window.innerWidth <= 800) {
classs = 'modal modal-desktop'
} else {
classs = 'add-note-modal-no-height'
}
const modal = await this.modalController.create({
component: AddNotePage,
componentProps: {
showAttachmentBtn: true,
actionName: actionName
},
cssClass: classs,
backdropDismiss: true
});
await modal.present();
modal.onDidDismiss().then(async (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 == 'Executado') {
/* await this.executado(res.data.note, docs);
this.goBack(); */
}
else if (actionName == 'Arquivo') {
await this.arquivar(res.data.note, docs);
this.goBack();
}
else if (actionName == 'Reexecução') {
/* await this.reexecute(res.data.note, docs);
this.goBack(); */
} else if(actionName == 'Gerar Diploma') {
/* await this.generateDiploma(res.data.note, docs);
this.goBack(); */
}
}
});
}
async arquivar(note: string, documents: AttachmentList) {
const loader = this.toastService.loading()
try {
await this.despachoService.arquivar(note, documents, this.serialnumber).toPromise()
this.httpErroHandle.httpsSucessMessagge('Arquivar')
this.close();
} catch (error) {
this.httpErroHandle.httpStatusHandle(error)
}
finally {
loader.remove()
}
}
async openExpedientActionsModal(taskAction: any, task: any) {
let classs;
if (window.innerWidth <= 800) {
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: CreateProcessPage,
componentProps: {
taskAction: taskAction,
task: task,
profile: this.profile,
fulltask: this.fulltask
},
cssClass: classs,
});
await modal.present();
modal.onDidDismiss().then(async (res) => {
if (res['data'] == 'openDiscart') {
await this.distartExpedientModal();
}
this.goBack();
});
}
async distartExpedientModal() {
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
});
await modal.present();
modal.onDidDismiss().then(res => {
if (res['data'] == 'close') {
this.close();
/*
this.close();
this.openMenu(); */
}
});
}
toDateString(e) {
return new Date(e).toDateString()
}
@@ -185,12 +185,12 @@ export class DiplomasGerarPage implements OnInit {
const loader = this.toastService.loading()
this.despachoService.sendExpedienteToPending(this.serialnumber).subscribe(res => {
this.goBack();
this.toastService.successMessage()
this.httpErroHandle.httpsSucessMessagge('Enviar para Pendentes')
loader.remove()
},
error => {
loader.remove()
this.toastService.badRequest("Processo não enviado para despacho")
this.httpErroHandle.httpStatusHandle(error)
});
}
@@ -309,16 +309,11 @@ export class DiplomasGerarPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage(false, ()=>{
this.httpErroHandle.httpsSucessMessagge('Assinado',() => {
this.goBack();
})
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
this.httpErroHandle.httpStatusHandle(error)
}
finally {
loader.remove()
@@ -79,8 +79,8 @@
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
<div class="buttons" *ngIf="task.activityInstanceName == 'Revisar Diploma'">
<button (click)="tempMethod('Arquivo')" class="btn-cancel" shape="round" >Arquivar</button>
<button (click)="tempMethod('Despacho')" class="btn-cancel" shape="round" >Efectuar Despacho</button>
<button (click)="openAddNoteModal('Arquivo')" class="btn-cancel" shape="round" >Arquivar</button>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efectuar Despacho</button>
<button (click)="openAddNoteModal('Solicitar assinatura')" class="btn-cancel" shape="round" >Solicitar assinatura do Presidente</button>
<button (click)="openAddNoteModal('Solicitar alteração')" class="btn-cancel" shape="round" >Solicitar alteração</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
@@ -16,6 +16,10 @@ import { BackgroundService } from 'src/app/services/background.service';
import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { AttachmentList } from 'src/app/models/Excludetask';
import { DespachoService } from 'src/app/Rules/despacho.service'
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
@Component({
@@ -52,7 +56,8 @@ export class DiplomaPage implements OnInit {
private backgroundservice: BackgroundService,
private platform: Platform,
public ThemeService: ThemeService,
private httpErrorHandle: HttpErrorHandle
private httpErrorHandle: HttpErrorHandle,
private despachoService: DespachoService
) {
this.activatedRoute.paramMap.subscribe(params => {
//
@@ -395,6 +400,9 @@ export class DiplomaPage implements OnInit {
else if (actionName == 'Concluir diploma') {
await this.finish(res.data.note, docs);
this.goBack();
} else if (actionName == 'Arquivo') {
await this.arquivar(res.data.note, docs);
this.goBack();
}
}
});
@@ -419,6 +427,24 @@ export class DiplomaPage implements OnInit {
modal.onDidDismiss();
}
async arquivar(note: string, documents: AttachmentList) {
const loader = this.toastService.loading()
try {
await this.despachoService.arquivar(note, documents, this.serialNumber).toPromise()
this.httpErrorHandle.httpsSucessMessagge('Arquivar')
this.close();
} catch (error) {
this.httpErrorHandle.httpStatusHandle(error)
}
finally {
loader.remove()
}
}
close() {
this.modalController.dismiss();
}
@@ -427,5 +453,61 @@ export class DiplomaPage implements OnInit {
console.log(actionname)
}
async openExpedientActionsModal(taskAction: any, task: any) {
let classs;
if (window.innerWidth <= 800) {
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: CreateProcessPage,
componentProps: {
taskAction: taskAction,
task: task,
profile: this.profile,
fulltask: this.fulltask
},
cssClass: classs,
});
await modal.present();
modal.onDidDismiss().then(async (res) => {
if (res['data'] == 'openDiscart') {
await this.distartExpedientModal();
}
this.goBack();
});
}
async distartExpedientModal() {
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
});
await modal.present();
modal.onDidDismiss().then(res => {
if (res['data'] == 'close') {
this.close();
/*
this.close();
this.openMenu(); */
}
});
}
}
@@ -11,6 +11,7 @@ import { EventActionsPopoverPage } from '../../../agenda/event-actions-popover/e
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { ToastService } from 'src/app/services/toast.service';
import { ThemeService } from 'src/app/services/theme.service'
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-approve-event-modal',
@@ -40,7 +41,8 @@ export class ApproveEventModalPage implements OnInit {
private activatedRoute: ActivatedRoute,
private iab: InAppBrowser,
private toastService: ToastService,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private httpErrorHandle: HttpErrorHandle
) {
@@ -101,18 +103,13 @@ export class ApproveEventModalPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise()
this.toastService._successMessage('Evento aprovado', ()=>{
this.httpErrorHandle.httpsSucessMessagge('Aprovar', ()=>{
this.router.navigate(['/home/gabinete-digital/event-list']);
this.modalController.dismiss(null);
})
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não aprovado')
}
this.httpErrorHandle.httpStatusHandle(error)
}
finally {
loader.remove()
@@ -128,7 +125,7 @@ export class ApproveEventModalPage implements OnInit {
async rejectTask(serialNumber:string) {
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
let body = { "serialNumber": serialNumber, "action": "Descartar" }
const loader = this.toastService.loading()
@@ -299,7 +299,7 @@ export class ApproveEventPage implements OnInit {
}
async rejeitar(serialNumber: string) {
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
let body = { "serialNumber": serialNumber, "action": "Descartar" }
const loader = this.toastService.loading()
try {
@@ -384,16 +384,10 @@ export class ApproveEventPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise();
this.toastService._successMessage();
this.goBack();
this.toastService._successMessage('Evento enviado para revisão');
this.httpErrorHandle.httpsSucessMessagge('Rever')
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não enviado para revisão');
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -333,18 +333,13 @@ export class ExpedienteDetailPage implements OnInit {
const loader = this.toastService.loading()
this.processes.SetTaskToPending(this.serialNumber).subscribe(res => {
this.toastService._successMessage('Processo enviado para pendentes')
this.httpErroHandle.httpsSucessMessagge('Enviar para Pendentes')
this.goBack();
loader.remove()
},
(error) => {
loader.remove()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não enviado para pendentes')
}
this.httpErroHandle.httpStatusHandle(error)
});
}
@@ -115,7 +115,7 @@
</ion-buttons>
<ion-buttons slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Enviar</ion-label>
<ion-label>Gravar</ion-label>
</button>
</ion-buttons>
</ion-toolbar>
@@ -11,7 +11,7 @@
<div class="overflow-y-auto">
<div *ngIf="publicationType!='1'" class="ion-item-container" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="pub.Title" name="title" ngDefaultControl placeholder="Título" ></ion-input>
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="pub.Title" name="title" ngDefaultControl placeholder="Título*" ></ion-input>
</div>
<div *ngIf="publicationType!='1'" class="container-div">
@@ -20,7 +20,7 @@
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div>
<div class="ion-textarea-class" [class.input-error]="Form?.get('Message')?.invalid && validateFrom ">
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="pub.Message" name="description" ngDefaultControl rows="12" cols="20" placeholder="Corpo de texto..."></ion-textarea>
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="pub.Message" name="description" ngDefaultControl rows="12" cols="20" placeholder="Corpo de texto*"></ion-textarea>
</div>
</div>
</div>
@@ -101,8 +101,11 @@
</button>
</ion-buttons>
<ion-buttons slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Enviar</ion-label>
<button *ngIf="publicationType == '2'" class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Criar</ion-label>
</button>
<button *ngIf="publicationType == '3'" class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Gravar</ion-label>
</button>
</ion-buttons>
</ion-toolbar>
@@ -299,7 +299,7 @@ export class NewPublicationPage implements OnInit {
try {
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.httpErrorHandle.httpsSucessMessagge('Criar publicação')
this.httpErrorHandle.httpsSucessMessagge('Publicação Editada')
this.close();
} catch (error) {
@@ -10,6 +10,7 @@ import { BackgroundService } from 'src/app/services/background.service';
import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service';
import { PermissionService } from 'src/app/services/permission.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-publication-detail',
@@ -29,7 +30,8 @@ export class PublicationDetailPage implements OnInit {
private toastService: ToastService,
private RouteService: RouteService,
public ThemeService: ThemeService,
public p:PermissionService ) {
public p:PermissionService,
private httpErrorHandle: HttpErrorHandle ) {
this.publicationId = this.navParams.get('publicationId');
/* this.folderId = this.navParams.get('folderIdId'); */
@@ -95,13 +97,13 @@ export class PublicationDetailPage implements OnInit {
try {
await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();
this.toastService.successMessage('Publicação eliminado')
this.httpErrorHandle.httpsSucessMessagge('Eliminar publicação')
if(window['app-view-publications-page-doRefresh']) {
window['app-view-publications-page-doRefresh']()
}
this.close();
} catch (error) {
this.toastService.badRequest('Publicação não eliminado')
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}