Git pull made

This commit is contained in:
Eudes Inácio
2023-02-02 18:28:17 +01:00
107 changed files with 1262 additions and 525 deletions
+16 -15
View File
@@ -87,7 +87,8 @@ export class HomePage implements OnInit {
private NativeNotificationService: NativeNotificationService,
private sqliteservice: SqliteService,
private RochetChatConnectorService: RochetChatConnectorService,
private NetworkServiceService: NetworkServiceService
private NetworkServiceService: NetworkServiceService,
public eventService: EventsService,
) {
if (SessionStore.exist) {
this.user = SessionStore.user;
@@ -169,15 +170,22 @@ export class HomePage implements OnInit {
this.updateList()
// var myWorker = new Worker(new URL('./nice.worker.js', import.meta.url));
// myWorker.onmessage = function (oEvent) {
// console.log('Worker said : ' + oEvent.data);
// }
// myWorker.postMessage('ali');
this.clearTabButtonSelection();
setTimeout(() => {
if(this.p.userPermission([this.p.permissionList.Gabinete.md_tasks]) && this.p.userPermission([this.p.permissionList.Gabinete.pr_tasks])) {
throw(SessionStore.user.FullName + 'cant have MD and PR authorization at same time');
}
if(this.p.userPermission([this.p.permissionList.Chat.access]) && !SessionStore.user?.ChatData?.data) {
throw('Chat temporarily unavailable for '+SessionStore.user.FullName + '. No ChatData');
}
if(this.p.userPermission([this.p.permissionList.Agenda.access]) && !this.eventService.hasAnyCalendar) {
throw('User '+SessionStore.user.FullName + 'has No calendar');
}
}, 1000)
}
clearTabButtonSelection() {
@@ -220,13 +228,6 @@ export class HomePage implements OnInit {
updateList() {
// this.notificationsService.registerCallback(
// 'despachos',
// () => {
// // this.despachoRule.getList({ updateStore: true })
// }
// )
document.addEventListener('pause', function () {
// console.log('App going to background');
});
@@ -70,7 +70,7 @@
appearance="fill"
class="width-100 d-block"
appearance="none">
<mat-select [(ngModel)]="selectedTypes" multiple placeholder="Selecione o tipo de evento*">
<mat-select [(ngModel)]="selectedTypes" multiple placeholder="Selecione o tipo de assunto*">
<mat-option *ngFor="let type of subjectTypes" value="{{type.Code}}">{{type.Description}}</mat-option>
</mat-select>
</mat-form-field>
@@ -292,7 +292,12 @@ export class CreateProcessPage implements OnInit {
this.modalController.dismiss();
this.toastService._successMessage('Despacho criado');
} catch (error) {
this.toastService._badRequest('Processo não efectuado');
if(error?.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não efectuado');
}
} finally {
loader.remove()
@@ -324,7 +329,12 @@ export class CreateProcessPage implements OnInit {
this.toastService._successMessage('Pedido de Parecer enviado');
}
catch (error) {
this.toastService._badRequest('Processo não efectuado');
if(error?.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não efectuado');
}
} finally {
loader.remove()
}
@@ -349,7 +359,12 @@ export class CreateProcessPage implements OnInit {
this.toastService._successMessage('Pedido de Deferimento criado');
}
catch (error) {
this.toastService._badRequest('Processo não efectuado');
if(error?.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não efectuado');
}
}
finally {
loader.remove()
@@ -377,7 +392,12 @@ export class CreateProcessPage implements OnInit {
this.modalController.dismiss();
this.toastService._successMessage('Despacho criado');
} catch (error) {
this.toastService._badRequest('Processo não efectuado');
if(error?.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não efectuado');
}
} finally {
loader.remove();
}
@@ -413,7 +433,12 @@ export class CreateProcessPage implements OnInit {
this.toastService._successMessage('Pedido de Parecer criado');
}
catch (error) {
this.toastService._badRequest('Processo não efectuado');
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não efectuado');
}
} finally {
loader.remove()
}
@@ -438,7 +463,12 @@ export class CreateProcessPage implements OnInit {
this.toastService._successMessage('Pedido de Deferimento criado');
}
catch (error) {
this.toastService._badRequest('Processo não efectuado');
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não efectuado');
}
} finally {
loader.remove()
}
@@ -493,7 +523,12 @@ export class CreateProcessPage implements OnInit {
await this.processes.CompleteTask(body).toPromise();
this.toastService._successMessage(message);
} catch (error) {
this.toastService._badRequest('Processo não efectuado');
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não efectuado');
}
} finally {
loader.remove()
}
@@ -68,7 +68,11 @@ export class DarParecerPage implements OnInit {
this.modalController.dismiss('sucess');
this.toastService._successMessage('Parecer enviado');
} catch (error) {
this.toastService._badRequest("Parecer não solicitado");
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest("Parecer não solicitado");
}
} finally {
loader.remove()
}
+4
View File
@@ -107,7 +107,11 @@ export class DelegarPage implements OnInit {
this.close();
},
(error)=>{
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest("Processo não delegado")
}
},
()=>{
loader.remove()
@@ -83,7 +83,7 @@
<button (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('1')" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2')" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button *ngIf="!p.userRole(['PR']) && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openExpedientActionsModal('2')" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
</div>
</div>
@@ -230,7 +230,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.docs.push({
ApplicationId: e.ApplicationId || e.ApplicationType,
Source: 1,
SourceId: e.DocId || e.docID || e.docId || e.SourceId,
SourceId: e.DocId || e.docID || e.docId || e.SourceId || e.Id,
SourceName: e.Assunto
})
})
@@ -239,7 +239,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.docs.push({
ApplicationId: this.document.ApplicationId || this.document.ApplicationType,
Source: 1,
SourceId: this.document.DocId || this.document.docID || this.document.docId || this.document.SourceId,
SourceId: this.document.DocId || this.document.docID || this.document.docId || this.document.SourceId || this.document.Id,
SourceName: this.document.Assunto
})
}
@@ -249,7 +249,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
Subject: this.postData.Subject,
Body: this.postData.Body.Text,
Location: this.postData.Location,
CalendarId: this.postData.CalendarName,
CalendarId: this.selectedCalendarId(),
CalendarName: this.postData.CalendarName,
StartDate: this.postData.StartDate,
EndDate: this.postData.EndDate,
@@ -277,7 +277,12 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.modalController.dismiss()
}, (error) => {
laoder.remove()
this.toastService._badRequest('Não foi possível marcar a reunião');
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Não foi possível marcar a reunião');
}
}, ()=>{
laoder.remove()
});
@@ -369,6 +374,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
modal.onDidDismiss().then((res)=> {
if(res){
const data = res.data;
console.log('data', data)
this.attachments.push(data.selected);
}
});
@@ -378,13 +384,27 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.attachments = this.attachments.filter( (e, i) => index != i);
}
validateFormInputs(){
validateFormInputs() {
let formLocation = this.postData.Location.trim();
if(!this.postData.Location && formLocation.length <= 0){
this.formLocationSatus = true;
}
}
selectedCalendarId () {
if (this._eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postData.CalendarName == 'Oficial') {
return this._eventService.calendarNamesType[this.CalendarName]['OficialId']
} else if (this._eventService.calendarNamesType[this.CalendarName]?.['Pessoal'] && this.postData.CalendarName == 'Pessoal') {
return this._eventService.calendarNamesType[this.CalendarName]['PessoalId']
} else {
return '11:11'
}
}
dynamicSetIntervenient({taskParticipants, taskParticipantsCc}) {
this.taskParticipants = taskParticipants;
this.taskParticipantsCc = taskParticipantsCc;
+7 -2
View File
@@ -147,11 +147,16 @@ export class ForwardPage implements OnInit {
"AttachmentList" :docs,
}
this.processes.CompleteParecerPrTask(body).subscribe(res=>{
this.toastService._successMessage('Processo delegado');
this.toastService._successMessage('Processo Reencaminhado');
this.goBack();
},
(error)=>{
this.toastService._badRequest("Processo não delegado")
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest("Processo não delegado")
}
});
}
}
+1 -5
View File
@@ -1,15 +1,11 @@
import { Component, OnInit } from '@angular/core';
import { AlertController, ModalController, PopoverController, Platform, NavParams } from '@ionic/angular';
import { EventBody } from 'src/app/models/eventbody.model';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { EventsService } from 'src/app/services/events.service';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { ProcessesService } from 'src/app/services/processes.service';
import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page';
import { ActivatedRoute, Router } from '@angular/router';
import { ProcessesService } from 'src/app/services/processes.service';import { ActivatedRoute, Router } from '@angular/router';
import { ToastService } from 'src/app/services/toast.service';
import { EliminateEventPage } from 'src/app/modals/eliminate-event/eliminate-event.page';
import { Location } from '@angular/common'
import { SqliteService } from 'src/app/services/sqlite.service';
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting/document-set-up-meeting.page';
+1 -1
View File
@@ -365,7 +365,7 @@
</div>
<div class="schedule-details">
<div class="description">
<p class="m-0">{{event.event.Subject}} ....</p>
<p class="m-0">{{event.event.Subject}}</p>
</div>
<div class="location">{{event.event.Location}}</div>
@@ -352,8 +352,12 @@ export class EditEventPage implements OnInit {
this.toastService._successMessage();
}, error => {
if(error.status != 0)
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
});
} else {
this.eventsService.editEvent(this.postEvent, 2, 3, this.postEvent.CalendarId).subscribe(async () => {
@@ -376,8 +380,12 @@ export class EditEventPage implements OnInit {
this.toastService._successMessage();
}, error => {
if(error.status != 0)
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
});
}
@@ -176,7 +176,7 @@ export class NewEventPage implements OnInit {
}
window.onresize = (event) => {
if( window.innerWidth >= 1024){
if( window.innerWidth >= 1024) {
this.modalController.dismiss();
}
};
@@ -186,7 +186,6 @@ export class NewEventPage implements OnInit {
}
setDefaultTime() {
console.log(this.CalendarDate)
this.postEvent.StartDate = this.roundTimeQuarterHour(this.CalendarDate);
this.postEvent.EndDate = this.postEvent.StartDate;
}
@@ -446,7 +445,12 @@ export class NewEventPage implements OnInit {
this.modalController.dismiss(data);
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -85,7 +85,7 @@
<div *ngIf="loadedEvent.Body.Text">
<h5>Detalhes</h5>
<ion-item lines="none" class="ion-no-margin ion-no-padding">
<div class="width-100 text" >{{ loadedEvent.Body.Text }}</div>
<pre class="width-100 text">{{ loadedEvent.Body.Text }} </pre>
</ion-item>
<div class="line"></div>
</div>
@@ -189,11 +189,7 @@ export class ViewEventPage implements OnInit {
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
this.eventsService.getEvent(this.eventId).subscribe(res => {
const div = document.createElement("div")
div.innerHTML = res.Body.Text
res.Body.Text = div.innerText
this.loadedEvent = res;
this.addEventToDb(res);
loader.remove()
+1 -1
View File
@@ -20,7 +20,7 @@
<!-- <ion-content class="main " ng-controller="AppController"> -->
<ion-content ng-controller="AppController">
<ion-refresher slot="fixed" (ionRefresh)="doRefresh()">
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content>
</ion-refresher-content>
</ion-refresher>
+8 -2
View File
@@ -126,13 +126,19 @@ export class EventsPage implements OnInit {
}
}
doRefresh() {
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
}, 2000);
}
this.RefreshEvents();
this.LoadList();
}
onSegmentChange() {
this.doRefresh();
this.RefreshEvents();
this.LoadList();
}
@@ -126,11 +126,6 @@ export class DespachoPrPage implements OnInit {
"activityInstanceName": res.activityInstanceName,
}
this.fulltask = res;
this.updateProcessOnDB(res);
let thedate = new Date(this.task.CreateDate);
@@ -279,7 +274,12 @@ export class DespachoPrPage implements OnInit {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage()
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -304,7 +304,12 @@ export class DespachoPrPage implements OnInit {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage('Processo arquivado')
} catch (error) {
this.toastService._badRequest('Processo não arquivado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não arquivado')
}
}
finally {
loader.remove()
@@ -326,7 +331,12 @@ export class DespachoPrPage implements OnInit {
this.toastService._successMessage('Processo criado')
} catch (error) {
this.toastService._badRequest('Processo não criado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não criado')
}
}
finally {
loader.remove()
@@ -351,7 +361,12 @@ export class DespachoPrPage implements OnInit {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage('')
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -376,7 +391,12 @@ export class DespachoPrPage implements OnInit {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage()
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -395,9 +415,14 @@ export class DespachoPrPage implements OnInit {
this.toastService._successMessage('Processo enviado para pendentes')
this.goBack()
loader.remove()
}, () => {
}, (error) => {
loader.remove()
this.toastService._badRequest('Processo não encontrado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não encontrado')
}
});
}
@@ -10,7 +10,7 @@
<ion-label *ngIf="loggeduser.Profile =='PR'" >Despachos</ion-label>
</div>
<div class="theicon btn-refresh">
<button class="btn-no-color" (click)="doRefresh()">
<button class="btn-no-color" (click)="doRefresh($event)">
<ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
</button>
</div>
@@ -20,7 +20,7 @@
</div> -->
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
@@ -35,7 +35,7 @@
<ion-list>
<div
class="expediente ion-no-padding ion-no-margin cursor-pointer"
*ngFor = "let task of listToPresent; let i = index"
*ngFor = "let task of despachoprstore.list; let i = index"
(click)="goToDespachoPr(task.SerialNumber)"
>
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
@@ -19,6 +19,7 @@ import { BackgroundService } from 'src/app/services/background.service';
import { SortService } from 'src/app/services/functions/sort.service';
import { ThemeService } from 'src/app/services/theme.service'
import { SessionStore } from 'src/app/store/session.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
@Component({
selector: 'app-despachos-pr',
@@ -53,6 +54,8 @@ export class DespachosPrPage implements OnInit {
despachoprstore = DespachosprStore
listToPresent = [];
customTaskPipe = new CustomTaskPipe()
constructor(
private processes: ProcessesService,
private modalController: ModalController,
@@ -65,7 +68,6 @@ export class DespachosPrPage implements OnInit {
public ThemeService: ThemeService
) {
this.loggeduser = SessionStore.user;
this.profile = 'mdgpr';
}
@@ -82,7 +84,7 @@ export class DespachosPrPage implements OnInit {
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.doRefresh()
this.LoadList()
} else {
this.LoadList()
}
@@ -113,8 +115,9 @@ export class DespachosPrPage implements OnInit {
async LoadList() {
this.processes.GetTasksList("Despacho do Presidente da República", false).subscribe(async res => {
this.skeletonLoader = true
this.skeletonLoader = true
try {
let result = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
this.despachoList = [];
@@ -124,7 +127,7 @@ export class DespachosPrPage implements OnInit {
let despachosPr;
let despachos = this.sortService.sortArrayByDate(result);
if(this.loggeduser.Profile != "PR") {
if(SessionStore.user.Profile != "PR") {
if(SessionStore.user.Profile != 'Consultant') {
@@ -132,9 +135,8 @@ export class DespachosPrPage implements OnInit {
} else {
despachosPr = await despachos.reverse().filter(data => data.activityInstanceName == "Gerar Diploma" || data.activityInstanceName == "Retificar Diploma");
}
} else if (this.loggeduser.Profile == "PR") {
} else if (SessionStore.user.Profile == "PR") {
despachosPr = await despachos.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
}
@@ -157,18 +159,24 @@ export class DespachosPrPage implements OnInit {
"DocumentsQty": element.totalDocuments,
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
"WorkflowName": element.workflowDisplayName,
"FolderID": element?.workflowInstanceDataFields?.FolderID,
"activityInstanceName": element.activityInstanceName,
"Status": element?.workflowInstanceDataFields?.Status,
}
this.despachoList.push(task);
});
this.despachoList = this.sortService.sortDate(this.despachoList, 'CreateDate')
this.listToPresent = this.despachoList
this.despachoprstore.reset(this.despachoList)
}, (error) => {
} catch(error) {
this.getFromDB()
})
}
this.skeletonLoader = false
}
@@ -181,9 +189,9 @@ export class DespachosPrPage implements OnInit {
let despachosPr;
if(this.loggeduser.Profile != 'PR') {
if(SessionStore.user.Profile != 'PR') {
despachosPr = await process.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
} else if (this.loggeduser.Profile == 'PR') {
} else if (SessionStore.user.Profile == 'PR') {
despachosPr = await process.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
}
@@ -215,8 +223,12 @@ export class DespachosPrPage implements OnInit {
})
}
doRefresh() {
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
}, 2000);
}
setTimeout(() => {
this.LoadList();
}, 1000)
@@ -279,7 +279,12 @@ export class DespachoPage implements OnInit {
this.toastService._successMessage('Processo criado')
this.close();
} catch (error) {
this.toastService._badRequest("Processo não criado")
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest("Processo não criado")
}
}
finally {
loader.remove()
@@ -295,7 +300,12 @@ export class DespachoPage implements OnInit {
this.toastService._successMessage('Processo descartado')
this.close();
} catch (error) {
this.toastService._badRequest("Processo não descartado")
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 {
loader.remove()
@@ -322,7 +332,12 @@ export class DespachoPage implements OnInit {
this.close();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -348,7 +363,12 @@ export class DespachoPage implements OnInit {
this.toastService._successMessage()
this.close();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -33,7 +33,7 @@
<ion-list>
<div
class="expediente ion-no-padding ion-no-margin cursor-pointer"
*ngFor = "let task of listToPresent; let i = index"
*ngFor = "let task of despachoStore.list; let i = index"
(click)="GoToDespacho(task.SerialNumber)"
>
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
@@ -110,7 +110,12 @@ export class DiplomaAssinarPage implements OnInit {
}, (error)=>{
try {
this.toastService._badRequest('Processo não encontrado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não encontrado')
}
this.goBack()
} catch (e) {
window.history.back();
@@ -176,7 +181,12 @@ export class DiplomaAssinarPage implements OnInit {
this.goBack();
})
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -73,19 +73,23 @@ export class DiplomasAssinarPage implements OnInit {
}, 1000);
}
async LoadList(){
async LoadList() {
this.skeletonLoader = true
let diplomas = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
try {
let diplomas = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
let diplomasAssinar = diplomas.filter(data => data.activityInstanceName == "Assinar Diploma");
let diplomasAssinar = diplomas.filter(data => data.activityInstanceName == "Assinar Diploma");
this.deplomasStore.resetDiplomasParaAssinar(diplomasAssinar)
this.diplomasList = this.sortService.sortDate(this.diplomasList, 'CreateDate')
} catch(error) {
this.deplomasStore.resetDiplomasParaAssinar(diplomasAssinar)
}
this.diplomasList = this.sortService.sortDate(this.diplomasList, 'CreateDate')
this.skeletonLoader = false
this.showLoader = false;
@@ -57,10 +57,9 @@ export class DiplomasGerarPage implements OnInit {
goToDiploma(serialNumber:any){
this.router.navigate(['/home/gabinete-digital/diplomas-gerar',serialNumber,'gabinete-digital']);
}
goToDiploma(serialNumber:any) {
this.router.navigate(['/home/gabinete-digital/diplomas-gerar',serialNumber,'gabinete-digital']);
}
async refreshing() {
setTimeout(() => {
@@ -77,24 +76,29 @@ export class DiplomasGerarPage implements OnInit {
async LoadList(){
this.skeletonLoader = true
let diplomas = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
this.diplomasList = [];
let gerarDiploma = diplomas.reverse().filter(data => data.activityInstanceName == "Gerar Diploma" || data.activityInstanceName == "Retificar Diploma");
gerarDiploma.forEach(element => {
let task: customTask = this.customTaskPipe.transform(element)
this.diplomasList.push(task);
});
this.diplomasList = this.sortService.sortDate(this.diplomasList, 'CreateDate');
this.deplomasStore.resetDiplomaGerar(this.diplomasList);
this.skeletonLoader = false
this.showLoader = false;
this.skeletonLoader = true
try {
let diplomas = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
this.diplomasList = [];
let gerarDiploma = diplomas.reverse().filter(data => data.activityInstanceName == "Gerar Diploma" || data.activityInstanceName == "Retificar Diploma");
gerarDiploma.forEach(element => {
let task: customTask = this.customTaskPipe.transform(element)
this.diplomasList.push(task);
});
this.diplomasList = this.sortService.sortDate(this.diplomasList, 'CreateDate');
this.deplomasStore.resetDiplomaGerar(this.diplomasList);
} catch(error) {
}
this.skeletonLoader = false
this.showLoader = false;
}
@@ -252,7 +252,12 @@ export class DiplomasGerarPage implements OnInit {
this.toastService._successMessage();
this.goBack()
} catch (error) {
this.toastService._badRequest();
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest();
}
} finally {
loader.remove()
}
@@ -314,7 +319,12 @@ export class DiplomasGerarPage implements OnInit {
this.goBack();
})
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -162,7 +162,12 @@ export class DiplomaPage implements OnInit {
} catch (e) {
window.history.back();
}
this.toastService._badRequest('Processo não encontrado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não encontrado')
}
}
});
@@ -286,7 +291,12 @@ export class DiplomaPage implements OnInit {
})
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -309,7 +319,12 @@ export class DiplomaPage implements OnInit {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage()
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -335,7 +350,12 @@ export class DiplomaPage implements OnInit {
await this.processes.CompleteTask(body).toPromise();
this.toastService._successMessage('Processo concluído')
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -8,6 +8,7 @@ import { BackgroundService } from 'src/app/services/background.service';
import { SortService } from 'src/app/services/functions/sort.service';
import { ThemeService } from 'src/app/services/theme.service'
import { PermissionService } from 'src/app/services/permission.service';
import { DeplomasStore } from 'src/app/store/deplomas.service';
@Component({
@@ -26,7 +27,8 @@ export class DiplomasPage implements OnInit, OnDestroy {
segment: string;
skeletonLoader = true
deplomasStore = DeplomasStore
constructor(
private processes: ProcessesService,
private router: Router,
@@ -100,9 +102,7 @@ export class DiplomasPage implements OnInit, OnDestroy {
}
async LoadList() {
this.processes.GetTasksList("Despacho do Presidente da República", false).subscribe(async res => {
try {
this.skeletonLoader = true
let diplomas = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
@@ -118,6 +118,8 @@ export class DiplomasPage implements OnInit, OnDestroy {
diplomasList.push(task);
});
this.deplomasStore.resetDiplomasReview(diplomasValidar)
this.diplomasList = this.sortService.sortDate(diplomasList, 'CreateDate');
@@ -132,12 +134,19 @@ export class DiplomasPage implements OnInit, OnDestroy {
});
this.diplomasAssinadoList = this.sortService.sortDate(diplomasAssinadoList, 'CreateDate')
this.deplomasStore.resetDiplomasAssinadoList(diplomasAssinados);
let diplomasAssinar = diplomas.filter(data => data.activityInstanceName == "Assinar Diploma");
this.deplomasStore.resetDiplomasParaAssinar(diplomasAssinar)
// console.log('DIPLOMAS ASSINADOS', this.diplomasAssinadoList)
}, (error) => {
} catch(error) {
this.skeletonLoader = false
this.getFromDb()
})
}
}
getFromDb() {
@@ -107,7 +107,12 @@ export class ApproveEventModalPage implements OnInit {
})
} catch (error) {
this.toastService._badRequest('Evento não aprovado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não aprovado')
}
}
finally {
loader.remove()
@@ -134,7 +139,12 @@ export class ApproveEventModalPage implements OnInit {
this.router.navigate(['/home/gabinete-digital/event-list']);
})
} catch (error) {
this.toastService._badRequest('Evento não rejeitado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não rejeitado')
}
}
finally {
loader.remove()
@@ -198,7 +208,12 @@ export class ApproveEventModalPage implements OnInit {
this.router.navigate(['/home/gabinete-digital/event-list']);
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()
}
this.router.navigate(['/home/gabinete-digital/event-list']);
}
finally {
@@ -218,7 +218,12 @@ export class ApproveEventPage implements OnInit {
this.goBack();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -264,7 +269,12 @@ export class ApproveEventPage implements OnInit {
this.toastService._successMessage('Pedido enviado');
this.goBack();
} catch (error) {
this.toastService._badRequest();
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest();
}
} finally {
loader.remove()
}
@@ -285,7 +295,12 @@ export class ApproveEventPage implements OnInit {
await this.toastService._successMessage('Processo rejeitado');
this.goBack();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -365,7 +380,12 @@ export class ApproveEventPage implements OnInit {
this.toastService._successMessage();
this.goBack();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest();
}
} finally {
loader.remove()
}
@@ -39,10 +39,10 @@
<div class="content height-100 d-flex flex-column">
<div [ngSwitch]="segment">
<ion-list class="width-100 height-100" *ngSwitchCase="'MDGPR'">
<div *ngIf="eventsMDGPRList" class="overflow-y-auto height-100">
<div *ngIf="eventoaprovacaostore.listmd" class="overflow-y-auto height-100">
<ion-item-sliding>
<ion-item class="Rectangle cursor-pointer" lines="none"
*ngFor="let event of eventsMDGPRList" (click)="goToEventToApproveDetail(event.serialNumber)">
*ngFor="let event of eventoaprovacaostore.listmd" (click)="goToEventToApproveDetail(event.serialNumber)">
<div class="content-mdgpr-{{event.workflowInstanceDataFields.Agenda}} width-100">
<div class="approve-event-time">
@@ -65,10 +65,10 @@
<ion-label></ion-label>
<ion-list *ngSwitchCase="'PR'">
<div *ngIf="eventsPRList" class="overflow-y-auto height-100">
<div *ngIf="eventoaprovacaostore.listpr" class="overflow-y-auto height-100">
<ion-item-sliding>
<ion-item class="Rectangle cursor-pointer" lines="none"
*ngFor="let event of eventsPRList" (click)="goToEventToApproveDetail(event.serialNumber)">
*ngFor="let event of eventoaprovacaostore.listpr" (click)="goToEventToApproveDetail(event.serialNumber)">
<div class="content-pr-{{event.workflowInstanceDataFields.Agenda}} width-100">
<div class="approve-event-time">
<p>{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}</p>
@@ -92,7 +92,7 @@
<div class="height-100" [ngSwitch]="segment">
<div *ngSwitchCase="'MDGPR'" class="d-flex height-100 align-center justify-content-center" >
<div
*ngIf="!skeletonLoader && (!eventsMDGPRList || eventsMDGPRList.length == 0)"
*ngIf="!skeletonLoader && (!eventoaprovacaostore.listmd || eventoaprovacaostore.listmd.length == 0)"
class="empty-list d-flex height-100 align-center justify-content-center"
>
<span>Lista vazia</span>
@@ -101,7 +101,7 @@
<div *ngSwitchCase="'PR'" class="d-flex height-100 align-center justify-content-center">
<div
*ngIf="!skeletonLoader && (!eventsMDGPRList || eventsMDGPRList.length == 0)"
*ngIf="!skeletonLoader && (!eventoaprovacaostore.listmd || eventoaprovacaostore.listmd.length == 0)"
class="empty-list d-flex height-100 align-center justify-content-center"
>
<span>Lista vazia</span>
@@ -36,6 +36,7 @@ export class EventListPage implements OnInit {
skeletonLoader = true
eventaprovacaostore = EventoAprovacaoStore;
eventoaprovacaostore = EventoAprovacaoStore;
constructor(
private processes: ProcessesService,
@@ -147,7 +148,7 @@ export class EventListPage implements OnInit {
}
async LoadToApproveEvents() {
this.processes.GetTasksList('Agenda Oficial MDGPR', false).subscribe(async res => {
// this.processes.GetTasksList('Agenda Oficial MDGPR', false).subscribe(async res => {
this.showLoader = true;
this.skeletonLoader = true
@@ -156,11 +157,10 @@ export class EventListPage implements OnInit {
let mdEventsOficial = await this.processes.GetTasksList('Agenda Oficial MDGPR', false).toPromise();
let mdEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal MDGPR', false).toPromise();
this.eventsMDGPRList = mdEventsOficial.concat(mdEventsPessoal);
this.eventsMDGPRList = this.sortService.sortDate(this.eventsMDGPRList, 'taskStartDate')
this.eventsMDGPRList = this.sortService.sortArrayByDate(this.eventsMDGPRList)
// this.eventsMDGPRList = ( this.eventsMDGPRList || []).filter(function(item) {
// return item.activityInstanceName != 'Editar Evento'
// })
this.eventoaprovacaostore.resetmd(this.eventsMDGPRList);
this.storage.set('event-to-aproveMD',this.eventsMDGPRList).then(() => {
@@ -171,11 +171,10 @@ export class EventListPage implements OnInit {
let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR', false).toPromise();
let prEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal PR', false).toPromise();
this.eventsPRList = prEventsOficial.concat(prEventsPessoal);
this.eventsPRList = this.sortService.sortDate(this.eventsPRList, 'taskStartDate')
this.eventsPRList = this.sortService.sortArrayByDate(this.eventsPRList)
// this.eventsPRList = (this.eventsPRList || []).filter(function(item) {
// return item.activityInstanceName != 'Editar Evento'
// })
this.eventoaprovacaostore.resetpr(this.eventsPRList);
this.storage.set('event-to-aprovePR',this.eventsPRList).then(() => {
@@ -185,9 +184,9 @@ export class EventListPage implements OnInit {
this.showLoader = false;
this.skeletonLoader = false
}, (error) => {
this.getEventToAproveFromDB();
})
// }, (error) => {
// this.getEventToAproveFromDB();
// })
}
@@ -150,12 +150,12 @@ export class BookMeetingModalPage implements OnInit {
this.postData.Category = 'Reunião'
if(!this.CalendarName) {
if(!this.CalendarOwnerName) {
if(this.eventService.calendarNamesAry.includes('Meu calendario')) {
this.CalendarName = 'Meu calendario';
this.CalendarOwnerName = 'Meu calendario';
console.log(this.eventService.calendarNamesAry)
} else {
this.CalendarName = this.eventService.calendarNamesAry[0]
this.CalendarOwnerName = this.eventService.calendarNamesAry[0]
}
}
@@ -176,6 +176,7 @@ export class BookMeetingModalPage implements OnInit {
this.getRecurrenceTypes();
}
getRecurrenceTypes() {
this.calendarService.getRecurrenceTypes().subscribe(res=>{
@@ -208,8 +209,8 @@ export class BookMeetingModalPage implements OnInit {
}
setDefaultTime() {
this.postData.StartDate = new Date()
this.postData.EndDate = (new Date(new Date().getTime() + 15 * 60000))
this.postData.StartDate = this.roundTimeQuarterHour();
this.postData.EndDate = (new Date(this.postData.StartDate.getTime() + 15 * 60000))
}
getAttachments() {
@@ -318,7 +319,12 @@ export class BookMeetingModalPage implements OnInit {
this.toastService._successMessage('Reunião criada');
} catch (error) {
this.toastService._badRequest('Reunião não criada')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Reunião não criada')
}
}
finally {
loader.remove()
@@ -338,7 +344,11 @@ export class BookMeetingModalPage implements OnInit {
this.toastService._successMessage('Reunião criada');
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -351,6 +361,7 @@ export class BookMeetingModalPage implements OnInit {
selectedCalendarId () {
if (this.calendarService.calendarNamesType[this.CalendarOwnerName]?.['Oficial'] && this.postData.CalendarName == 'Oficial') {
@@ -501,8 +512,8 @@ export class BookMeetingModalPage implements OnInit {
}
roundTimeQuarterHour() {
var timeToReturn = new Date();
roundTimeQuarterHour(timeToReturn?) {
var timeToReturn = timeToReturn || new Date();
var minutes = timeToReturn.getMinutes();
var hours = timeToReturn.getHours();
@@ -515,14 +526,14 @@ export class BookMeetingModalPage implements OnInit {
}
timeToReturn.setHours(h);
timeToReturn.setMinutes(m);
}else{
if(minutes > m){
} else {
if(minutes > m) {
m = m + 15;
timeToReturn.setHours(h);
timeToReturn.setMinutes(m);
}else {
} else {
timeToReturn.setHours(h);
timeToReturn.setMinutes(m);
}
@@ -534,7 +545,7 @@ export class BookMeetingModalPage implements OnInit {
return timeToReturn;
}
setStartDate(){
setStartDate() {
this.postData.StartDate = this.roundTimeQuarterHour();
}
@@ -109,7 +109,7 @@
appearance="fill"
class="width-100 d-block"
appearance="none">
<mat-select [(ngModel)]="selectedTypes" multiple placeholder="Selecione o tipo de evento*">
<mat-select [(ngModel)]="selectedTypes" multiple placeholder="Selecione o tipo de assunto*">
<mat-option *ngFor="let type of subjectTypes" value="{{type.Code}}">{{type.Description}}</mat-option>
</mat-select>
</mat-form-field>
@@ -320,7 +320,12 @@ export class ExpedientTaskModalPage implements OnInit {
this.modalController.dismiss(action_despacho);
} catch (error) {
await this.toastService._badRequest('Processo não efetuado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
await this.toastService._badRequest('Processo não efetuado')
}
} finally {
loader.remove()
}
@@ -354,7 +359,12 @@ export class ExpedientTaskModalPage implements OnInit {
this.modalController.dismiss(action_parecer);
} catch (error) {
await this.toastService._badRequest('Processo não efetuado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
await this.toastService._badRequest('Processo não efetuado')
}
} finally {
loader.remove()
}
@@ -385,7 +395,12 @@ export class ExpedientTaskModalPage implements OnInit {
this.toastService._successMessage('Processo efetuado');
this.modalController.dismiss(action_deferimento);
} catch (error) {
await this.toastService._badRequest('Processo não efetuado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
await this.toastService._badRequest('Processo não efetuado')
}
} finally {
loader.remove()
}
@@ -423,8 +438,12 @@ export class ExpedientTaskModalPage implements OnInit {
await this.toastService._successMessage('Processo efetuado');
this.modalController.dismiss(action_despacho_pr);
} catch (error) {
await this.toastService._badRequest('Processo não efetuado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
await this.toastService._badRequest('Processo não efetuado')
}
} finally {
//loader.remove()
}
@@ -461,8 +480,12 @@ export class ExpedientTaskModalPage implements OnInit {
await this.toastService._successMessage('Pedido enviado');
this.modalController.dismiss(action_parecer_pr);
} catch (error) {
await this.toastService._badRequest('Processo não efetuado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
await this.toastService._badRequest('Processo não efetuado')
}
} finally {
loader.remove()
}
@@ -92,8 +92,8 @@
<div class="aside-right flex-column height-100 overflow-y-auto">
<div class="buttons">
<div *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="option-desc"> <div *ngIf="loggeduser.Profile == 'MDGPR'">Enviar para o PR</div> </div>
<button *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks]) && loggeduser.Profile == 'MDGPR'" (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Avaliação Superior</button>
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc"> <div>Enviar para o PR</div> </div>
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Avaliação Superior</button>
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc"> <div>Solicitar revisão</div> </div>
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc"> <div>Outras opções</div> </div>
@@ -90,6 +90,8 @@ export class ExpedienteDetailPage implements OnInit {
private userAuth: AuthService,
) {
this.loggeduser = SessionStore.user
console.log('SessionStore', SessionStore)
this.activatedRoute.paramMap.subscribe(params => {
if (params["params"].SerialNumber) {
this.serialNumber = params["params"].SerialNumber;
@@ -242,7 +244,12 @@ export class ExpedienteDetailPage implements OnInit {
this.close();
this.toastService._successMessage('Processo aprovado')
} catch (error) {
this.toastService._badRequest('Processo não aprovado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não aprovado')
}
} finally {
loader.remove()
}
@@ -267,7 +274,12 @@ export class ExpedienteDetailPage implements OnInit {
this.close();
this.toastService._successMessage()
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -334,7 +346,12 @@ export class ExpedienteDetailPage implements OnInit {
},
(error) => {
loader.remove()
this.toastService._badRequest('Processo não enviado para pendentes')
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')
}
});
}
@@ -391,7 +408,12 @@ export class ExpedienteDetailPage implements OnInit {
} catch (e) {
window.history.back();
}
this.toastService._badRequest('Processo não encontrado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não encontrado')
}
}
});
@@ -482,8 +504,13 @@ export class ExpedienteDetailPage implements OnInit {
loader.remove()
await this.attachmentsService.AddAttachment(body).toPromise()
this.toastService._successMessage()
} catch(e) {
} catch(error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
}
});
}
@@ -519,7 +546,12 @@ export class ExpedienteDetailPage implements OnInit {
await this.processes.CompleteTask(body).toPromise();
this.goBack();
} catch (error) {
this.toastService._badRequest('Processo não descartado')
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 {
loader.remove()
}
@@ -553,7 +585,12 @@ export class ExpedienteDetailPage implements OnInit {
this.toastService._successMessage('Processo descartado');
this.goBack();
} catch (error) {
this.toastService._badRequest('Processo não descartado')
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 {
loader.remove()
}
@@ -572,7 +609,12 @@ export class ExpedienteDetailPage implements OnInit {
//this.toastService._successMessage('Processo descartado');
this.goBack();
} catch (error) {
this.toastService._badRequest('Processo não descartado')
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 {
loader.remove()
}
@@ -586,7 +628,12 @@ export class ExpedienteDetailPage implements OnInit {
this.toastService._successMessage();
this.goBack();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -36,7 +36,7 @@
<ion-list>
<div
class="expediente ion-no-padding ion-no-margin cursor-pointer"
*ngFor = "let task of listToPresent"
*ngFor = "let task of expedientegbstore.list"
(click)="goToExpediente(task.SerialNumber)"
>
<div class="item width-100">
@@ -9,7 +9,7 @@ import { Platform } from '@ionic/angular';
import { BackgroundService } from '../../../services/background.service';
import { ThemeService } from 'src/app/services/theme.service'
import { SortService } from 'src/app/services/functions/sort.service';
import {Storage } from '@ionic/storage';
import { Storage } from '@ionic/storage';
@Component({
selector: 'app-expediente',
@@ -73,7 +73,7 @@ export class ExpedientePage implements OnInit {
const result = res
this.taskslist = new Array();
let ress = result.filter((data: any) => data.workflowInstanceDataFields.Status == "Active");
let ress = result.filter((data: any) => data.workflowInstanceDataFields.Status == "" || data.workflowInstanceDataFields.Status == "Active");
ress.forEach((element: any) => {
@@ -86,7 +86,8 @@ export class ExpedientePage implements OnInit {
})
this.listToPresent = this.sortService.sortDate(this.taskslist, 'taskStartDate')
this.expedientegbstore.reset(this.listToPresent);
this.skeletonLoader = false;
}, (error) => {
this.getEventsFromLocalDb();
@@ -143,7 +143,12 @@ export class ExpedientePrPage implements OnInit {
},
(error)=>{
loader.remove()
this.toastService._badRequest('Processo não enviado para pendentes')
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')
}
});
}
@@ -309,7 +314,12 @@ export class ExpedientePrPage implements OnInit {
this.close();
this.toastService._successMessage('Processo aprovado')
} catch(error) {
this.toastService._badRequest('Processo não aprovado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não aprovado')
}
} finally {
loader.remove()
}
@@ -334,7 +344,12 @@ export class ExpedientePrPage implements OnInit {
this.close();
this.toastService._successMessage()
} catch(error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -455,7 +470,12 @@ export class ExpedientePrPage implements OnInit {
this.toastService._successMessage('Processo descartado');
this.goBack();
} catch (error) {
this.toastService._badRequest('Processo não descartado')
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 {
loader.remove()
}
@@ -492,7 +512,12 @@ export class ExpedientePrPage implements OnInit {
this.toastService._successMessage();
this.goBack();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -75,14 +75,12 @@ export class ExpedientesPrPage implements OnInit {
this.skeletonLoader = false
this.showLoader =false
this.taskslist = new Array();
let res = result.reverse().filter(data => data.workflowInstanceDataFields.Status == "Active");
res.forEach(element => {
let task = this.expedienteTaskPipe.transform(element)
this.taskslist.push(task);
});
let res = result.reverse().filter(data => data.workflowInstanceDataFields.Status == "" || data.workflowInstanceDataFields.Status == "Active");
this.taskslist = res.map((element) => this.expedienteTaskPipe.transform(element));
this.taskslist = this.sortService.sortDate(this.taskslist, 'CreateDate')
this.expedienteGdStore.reset(this.taskslist);
this.skeletonLoader = false
})
@@ -147,14 +147,14 @@
<fa-icon class="icon-selected" icon="align-justify"></fa-icon>
</div>
<p class="text-center exp-card-title ">Todas as tarefas</p>
<p class="text-center exp-card-content"> {{ getAllProcessCount }} <span class="title1">Documentos</span></p>
<p class="text-center exp-card-content"> {{ getAllProcessCount }} <span class="title1">Documentos</span></p>
</div>
<div *ngIf="p.userPermission([p.permissionList.Gabinete.aprove_event])" (click)="openEventsToApprovePage();selectedElement='approval'" [class.active]="selectedElement == 'approval'" class="box-hover exp-card d-flex flex-column">
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-agenda.svg"></ion-icon>
</div>
<p class="text-center exp-card-title ">Eventos para Aprovação</p>
<p class="text-center exp-card-content">{{eventoaprovacaostore.countMd + eventoaprovacaostore.countPr}} <span class="title1">Documentos</span></p>
<p class="text-center exp-card-content"> {{eventoaprovacaostore.countMd + eventoaprovacaostore.countPr}} <span class="title1">Documentos</span></p>
</div>
<div (click)="openExpedientListPage(); selectedElement='Correspondence'" [class.active]="selectedElement == 'Correspondence'" class="box-hover exp-card d-flex flex-column justify-center">
@@ -166,7 +166,7 @@
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'Correspondence'" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-correspondencia-hover.svg"></ion-icon>
</div>
<p class="text-center exp-card-title ">Expediente</p>
<p class="text-center exp-card-content">{{expedientegbstore.count}} <span class="title1">Documentos</span></p>
<p class="text-center exp-card-content"> {{expedientegbstore.count}} <span class="title1">Documentos</span></p>
</div>
<div [class.active]="selectedElementF('Pending')" (click)="openPendentesPage(); selectedElement='Pending'" class="box-hover exp-card d-flex flex-column justify-center" >
@@ -179,7 +179,7 @@
</div>
<p *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Pendentes</p>
<p *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Meus Pendentes</p>
<p class="text-center exp-card-content"><span class="number">{{pendentesstore.count}} </span> <span class="title1">Documentos</span></p>
<p class="text-center exp-card-content"> <span class="number">{{pendentesstore.count}} </span> <span class="title1">Documentos</span></p>
</div>
<div *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" [class.active]="selectedElement == 'Dispatches'" class="box-hover exp-card d-flex flex-column justify-center" (click)="openDespachosPage(); selectedElement='Dispatches'">
@@ -191,7 +191,7 @@
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'Dispatches'" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-despachos-presidente-hover.svg"></ion-icon>
</div>
<p class="text-center exp-card-title ">Despachos</p>
<p class="text-center exp-card-content">{{despachoStore.count}} <span class="title1">Documentos</span> </p>
<p class="text-center exp-card-content"> {{despachoStore.count}} <span class="title1">Documentos</span> </p>
</div>
<div (click)="openPedidosPage('parecer'); selectedElement='RequestsForOpinion'" [class.active]="selectedElement == 'RequestsForOpinion'" class="box-hover exp-card d-flex flex-column justify-center">
@@ -204,7 +204,7 @@
</div>
<p *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Pedidos de Parecer</p>
<p *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Pedidos de Parecer solicitados por mim</p>
<p class="text-center exp-card-content">{{pedidosstore.countparecer}} <span class="title1">Documentos</span></p>
<p class="text-center exp-card-content"> {{pedidosstore.countparecer}} <span class="title1">Documentos</span></p>
</div>
<div (click)="openPedidosPage('deferimento'); selectedElement = 'RequestForApproval'" [class.active]="selectedElement == 'RequestForApproval'" class="box-hover exp-card d-flex flex-column justify-center">
@@ -217,7 +217,7 @@
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'RequestForApproval'" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-deferimento-hover.svg"></ion-icon>
</div>
<p class="text-center exp-card-title ">Pedidos de Deferimento</p>
<p class="text-center exp-card-content">{{pedidosstore.countdeferimento}} <span class="title1">Documentos</span></p>
<p class="text-center exp-card-content"> {{pedidosstore.countdeferimento}} <span class="title1">Documentos</span></p>
</div>
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks, p.permissionList.Gabinete.pr_tasks])" (click)="openDespachosPrPage(); selectedElement='showDespachosPr'" [class.active]="selectedElement == 'showDespachosPr'" class="box-hover exp-card-long width-100 d-flex flex-column justify-center">
@@ -231,11 +231,12 @@
<!-- <p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])">Despacho do Presidente da República</p> -->
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])">Despacho do {{ environment.despachoLabel }}</p>
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks]) && !p.userPermission([p.permissionList.Gabinete.md_tasks])">Despachos criados por mim</p>
<p class="text-center exp-card-content">{{ despachoprstore.count }} <span class="title1">Documentos</span> </p>
<p class="text-center exp-card-content"> {{ despachoprstore.count }} <span class="title1">Documentos</span> </p>
</div>
</div>
</div>
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDiplomasPage('validar'); selectedElement='DiplomasPorValidar'" [class.active]="selectedElement == 'DiplomasPorValidar'" class="box-hover exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-diploma.svg"></ion-icon>
@@ -244,7 +245,7 @@
</div>
<p class="text-center exp-card-title " >Diplomas por Validar</p>
<!-- <p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])">Diplomas por Assinar</p> -->
<p class="text-center exp-card-content">{{ deplomasStore.deplomasReviewCount }} <span class="title1">Documentos</span> </p>
<p class="text-center exp-card-content"> {{ deplomasStore.deplomasReviewCount }} <span class="title1">Documentos</span> </p>
</div>
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks, p.permissionList.Gabinete.pr_tasks])" (click)="openDiplomasPage('assinados'); selectedElement='DiplomasAssinados'" [class.active]="selectedElement == 'DiplomasAssinados'" class="box-hover exp-card d-flex flex-column justify-center">
@@ -255,7 +256,7 @@
</div>
<p class="text-center exp-card-title " *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])">Diplomas assinados PR</p>
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" >Diplomas</p>
<p class="text-center exp-card-content">{{ deplomasStore.countDiplomasAssinadoListCount }} <span class="title1">Documentos</span></p>
<p class="text-center exp-card-content"> {{ deplomasStore.countDiplomasAssinadoListCount }} <span class="title1">Documentos</span></p>
</div>
<div *ngIf="SessionStore.user.Profile == 'Consultant' && environment.presidencial" (click)="openDiplomaPorElaborar('gerarDiplomas'); selectedElement='gerarDiplomas'" [class.active]="selectedElement == 'gerarDiplomas'" class="box-hover exp-card d-flex flex-column justify-center">
@@ -268,7 +269,7 @@
</div>
<p class="text-center exp-card-title" >Diplomas por elaborar</p>
<p class="text-center exp-card-content">{{ deplomasStore.DiplomaGerarList.length }} <span class="title1">Documentos</span></p>
<p class="text-center exp-card-content"> {{ deplomasStore.DiplomaGerarList.length }} <span class="title1">Documentos</span></p>
</div>
@@ -281,8 +282,21 @@
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'DiplomasParaAssinar' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-diploma-hover.svg"></ion-icon>
</div>
<p class="text-center exp-card-title">Diplomas para Assinar</p>
<p class="text-center exp-card-content">{{ deplomasStore.diplomasParaAssinartCount }} <span class="title1">Documentos</span></p>
<p class="text-center exp-card-content"> {{ deplomasStore.diplomasParaAssinartCount }} <span class="title1">Documentos</span></p>
</div>
<!-- <div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDiplomasAssinarPage(); selectedElement='DiplomasParaAssinar'" [class.active]="selectedElement == 'DiplomasParaAssinar'" class="box-hover exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-diploma.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasParaAssinar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DiplomasParaAssinar' " src="assets/images/theme/gov/icons-expediente-diploma-hover.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-diploma.svg"></ion-icon>
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'DiplomasParaAssinar' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-diploma-hover.svg"></ion-icon>
</div>
<p class="text-center exp-card-title">Diplomas por Assinar </p>
<p class="text-center exp-card-content"> {{ deplomasStore.diplomasParaAssinartCount }} <span class="title1">Documentos</span></p>
</div> -->
</div>
<div *ngIf="!loadCount" class="width-100">
@@ -165,6 +165,8 @@ export class GabineteDigitalPage implements OnInit {
this.segmentVista = "boxview"
}
this.LoadCounts();
const pathname = window.location.pathname
this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && event.url == pathname) {
@@ -183,6 +185,7 @@ export class GabineteDigitalPage implements OnInit {
}
});
this.hideRefreshButton();
// this.waitForDomService.selector({
@@ -193,84 +196,87 @@ export class GabineteDigitalPage implements OnInit {
// }
// })
this.backgroundservice.registerBackService('Online', () => {
// this.loadAllProcesses();
});
setTimeout(() => {
this.backgroundservice.registerBackService('Online', () => {
// this.loadAllProcesses();
});
// this.NotificationsService.registerCallback({
// type:'despachos',
// funx:() => {
// // this.loadCount();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type:'despachos',
// funx:() => {
// // this.loadCount();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type:'*',
// funx:() => {
// // this.LoadCounts();
// console.log('refresh with notification *')
// }
// })
// this.NotificationsService.registerCallback({
// type:'*',
// funx:() => {
// // this.LoadCounts();
// console.log('refresh with notification *')
// }
// })
// this.NotificationsService.registerCallback({
// type:'despachos-pr',
// funx:() => {
// // this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type:'expediente',
// funx: () => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type:'gabinete-digital',
// funx:() => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type:'parecer',
// funx: () => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type: 'deferimento',
// funx: () => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type: 'diplomas-assinar',
// funx: () => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type: 'diplomas',
// funx: () => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type: 'expedientes-pr',
// funx: () => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type:'despachos-pr',
// funx:() => {
// // this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type:'expediente',
// funx: () => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type:'gabinete-digital',
// funx:() => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type:'parecer',
// funx: () => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type: 'deferimento',
// funx: () => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type: 'diplomas-assinar',
// funx: () => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type: 'diplomas',
// funx: () => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type: 'expedientes-pr',
// funx: () => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
}, 100);
}
async loadAllProcesses() {
@@ -614,7 +620,8 @@ export class GabineteDigitalPage implements OnInit {
loadNum = 0
async LoadCounts() {
this.updateAllProcess()
let expedientes;
this.showLoader = true
@@ -629,7 +636,7 @@ export class GabineteDigitalPage implements OnInit {
this.loadNum++;
expedientes = (expedientes || [] ).filter(data => data.workflowInstanceDataFields.Status == "Active")
expedientes = (expedientes || [] ).filter(data => data.workflowInstanceDataFields.Status == "" || data.workflowInstanceDataFields.Status == "Active")
expedientes = expedientes.filter((item) => {
return item.activityInstanceName != 'Retificar Expediente'
@@ -127,7 +127,7 @@
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button *ngIf="loggeduser.Profile == 'MDGPR' && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div>
@@ -136,7 +136,7 @@
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button *ngIf="loggeduser.Profile == 'MDGPR' && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div>
@@ -162,7 +162,7 @@
<button (click)="openAddNoteModal('Arquivar')" class="btn-cancel" shape="round" >Arquivar</button>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button *ngIf="loggeduser.Profile != 'PR'" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button *ngIf="loggeduser.Profile != 'PR' && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div>
@@ -162,7 +162,8 @@ export class PedidoPage implements OnInit {
let thedate = new Date(res.taskStartDate);
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
this.processes.GetTaskParticipants(res.workflowInstanceDataFields.FolderID).subscribe(users => {
this.processes.GetTaskParticipants(res.workflowInstanceDataFields.FolderID).subscribe((users = []) => {
this.updateProcessInterveners(users)
this.intervenientes = users.filter(user => {
return user.Type == 'I';
@@ -182,7 +183,12 @@ export class PedidoPage implements OnInit {
} catch (e) {
window.history.back();
}
this.toastService._badRequest('Processo não encontrado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não encontrado')
}
}
});
@@ -373,7 +379,12 @@ export class PedidoPage implements OnInit {
this.toastService._successMessage()
this.close();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -393,7 +404,12 @@ export class PedidoPage implements OnInit {
this.toastService._successMessage()
this.close();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -418,7 +434,12 @@ export class PedidoPage implements OnInit {
this.toastService._successMessage()
this.close();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -430,9 +451,14 @@ export class PedidoPage implements OnInit {
this.processes.SetTaskToPending(this.serialnumber).subscribe(res => {
this.goBack();
loader.remove()
}, () => {
}, (error) => {
loader.remove()
this.toastService._badRequest('Processo não encontrado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não encontrado')
}
});
}
@@ -38,13 +38,13 @@
<div class="width-100" [ngSwitch]="segment">
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
<div *ngIf="listToPresentparecerList">
<div *ngIf="pedidosstorage.listparecer">
<ion-list *ngSwitchCase="'parecer'">
<!-- *ngFor = "let task of pedidosstorage.listparecer; let i = index"
(click)="viewExpedientDetail(task.SerialNumber)" -->
<div
class="expediente ion-no-padding ion-no-margin cursor-pointer"
*ngFor = "let task of listToPresentparecerList"
*ngFor = "let task of pedidosstorage.listparecer"
(click)="goToPedido(task.SerialNumber)"
>
<!-- (click)="viewExpedientDetail(task.SerialNumber)" -->
@@ -78,11 +78,11 @@
</ion-list>
</div>
<div *ngIf="listToPresentdeferimentoList">
<div *ngIf="pedidosstorage.listdeferimento">
<ion-list *ngSwitchCase="'deferimento'">
<div
class="expediente ion-no-padding ion-no-margin cursor-pointer"
*ngFor = "let task of listToPresentdeferimentoList"
*ngFor = "let task of pedidosstorage.listdeferimento"
(click)="goToPedido(task.SerialNumber)"
>
<!-- (click)="viewExpedientDetail(task.SerialNumber)" -->
@@ -27,7 +27,7 @@
</ion-refresher>
<app-task-list class="height-100"
[taskList] = listToPresent
[taskList] = pendentesstore.list
[skeletonLoader] = skeletonLoader
(viewTaskDetail)="viewTaskDetails($event)"
> </app-task-list>
@@ -106,6 +106,7 @@ export class PendentesPage implements OnInit {
pendentesList = removeDuplicate(pendentesList)
pendentesList = this.sortService.sortDate(pendentesList, 'CreateDate');
this.pendentesstore.reset(pendentesList);
this.listToPresent = pendentesList;
this.storage.set('pendente-list',pendentesList).then(() => {
@@ -119,7 +119,12 @@ export class EditActionPage implements OnInit {
this.updateDesktopComponent.emit();
this.toastService._successMessage('Acção presidencial atualizada')
} catch (error) {
this.toastService._badRequest('Não foi possivel atualizar a acção presidencial')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Não foi possivel atualizar a acção presidencial')
}
} finally {
loader.remove()
}
@@ -255,8 +255,13 @@ export class PublicationsPage implements OnInit {
try {
await this.publications.DeletePresidentialAction(id).toPromise();
this.toastService._successMessage()
} catch (e) {
this.toastService._badRequest()
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
+5 -6
View File
@@ -1,13 +1,13 @@
import { Injectable } from '@angular/core';
import { Message } from 'src/app/models/chatMethod';
import { SessionStore } from 'src/app/store/session.service';
import { capitalizeTxt } from 'src/plugin/text'
import { NfService } from 'src/app/services/chat/nf.service'
import { capitalizeTxt } from 'src/plugin/text';
import { NfService } from 'src/app/services/chat/nf.service';
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
import { showDateDuration } from 'src/plugin/showDateDuration';
import { ChatMethodsService } from './chat-methods.service'
import { MessageModel } from '../../models/beast-orm'
import { AESEncrypt } from '../aesencrypt.service'
import { ChatMethodsService } from './chat-methods.service';
import { MessageModel } from '../../models/beast-orm';
import { AESEncrypt } from '../aesencrypt.service';
import { HttpEventType } from '@angular/common/http';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { NetworkServiceService , ConnectionStatus} from 'src/app/services/network-service.service';
@@ -182,7 +182,6 @@ export class MessageService {
async send(): Promise<any> {
if(this.messageSend) {
console.log('sended')
return new Promise((resolve, reject) => {
resolve('solve')
})
+7 -7
View File
@@ -110,7 +110,7 @@ export class EventsService {
if (SessionStore.user.Profile == 'MDGPR') {
for (let calendar of SessionStore.user.OwnerCalendars) {
this.hasAnyCalendar = false
this.hasAnyCalendar = true
if (calendar.CalendarName == 'Oficial') {
@@ -133,7 +133,7 @@ export class EventsService {
}
for (let sharedCalendar of SessionStore.user.SharedCalendars) {
this.hasAnyCalendar = false
this.hasAnyCalendar = true
if (sharedCalendar.CalendarName == 'Oficial') {
@@ -158,7 +158,7 @@ export class EventsService {
else if (SessionStore.user.Profile == 'PR') {
for (let calendar of SessionStore.user.OwnerCalendars) {
this.hasAnyCalendar = false
this.hasAnyCalendar = true
if (calendar.CalendarName == 'Oficial') {
this.hasOwnOficial = true
@@ -181,7 +181,7 @@ export class EventsService {
}
for (let calendar of SessionStore.user.OwnerCalendars) {
this.hasAnyCalendar = false
this.hasAnyCalendar = true
if(!this.usersCalendarIds.includes(calendar.OwnerUserId)) {
this.usersCalendarIds.push(calendar.OwnerUserId)
}
@@ -213,7 +213,7 @@ export class EventsService {
}
for (let sharedCalendar of SessionStore.user.SharedCalendars) {
this.hasAnyCalendar = false
this.hasAnyCalendar = true
if(!this.usersCalendarIds.includes(sharedCalendar.OwnerUserId)) {
this.usersCalendarIds.push(sharedCalendar.OwnerUserId)
@@ -246,7 +246,7 @@ export class EventsService {
for (let sharedCalendar of SessionStore.user.SharedCalendars) {
this.hasAnyCalendar = false
this.hasAnyCalendar = true
if(sharedCalendar?.OwnerUserId) {
this.GetCalendarName(sharedCalendar.OwnerUserId).subscribe((e)=> {
this.calendarNames[sharedCalendar.CalendarId] = e.FullName
@@ -266,7 +266,7 @@ export class EventsService {
}
for (let sharedCalendar of SessionStore.user.OwnerCalendars) {
this.hasAnyCalendar = false
this.hasAnyCalendar = true
this.calendarNames[sharedCalendar.CalendarId] = 'Meu calendario'
+28 -26
View File
@@ -12,6 +12,7 @@ import { EventTrigger } from '../services/eventTrigger.service';
import { SessionStore } from '../store/session.service';
import { ActionPerformed, PushNotificationSchema, PushNotifications, Token, } from '@capacitor/push-notifications';
import { notificationObject } from '../models/notifications';
import { v4 as uuidv4 } from 'uuid'
@Injectable({
providedIn: 'root'
@@ -38,43 +39,44 @@ export class NotificationsService {
private platform: Platform,
private router: Router,
private zone: NgZone,
private eventtrigger: EventTrigger,) {
private eventtrigger: EventTrigger,) {}
registerCallback({type, funx, id = uuidv4()} : {
type: notificationObject,
funx: Function
id?: string
}) {
this.callbacks[id] = { funx, id, type}
return id;
}
deleteCallback(id) {
delete this.callbacks[id]
}
// registerCallback({type, funx, id = uuidv4()} : {
// type: notificationObject,
// funx: Function
// id?: string
// }) {
// this.callbacks[id] = { funx, id, type}
// return id;
// }
private async runNotificationCallback(notification) {
for (const [key, value] of Object.entries(this.callbacks)) {
if(value.type == notification.data.Object) {
// private async runNotificationCallback(notification) {
const dontRepeat = await value.funx(notification)
// for (const [key, value] of Object.entries(this.callbacks)) {
// if(value.type == notification.data.Object) {
if(dontRepeat) {
delete this.callbacks[key]
}
// const dontRepeat = await value.funx(notification)
} else if (value.type == '*') {
const dontRepeat = await value.funx(notification)
// if(dontRepeat) {
// delete this.callbacks[key]
// }
if(dontRepeat) {
delete this.callbacks[key]
}
}
// } else if (value.type == '*') {
// const dontRepeat = await value.funx(notification)
}
// if(dontRepeat) {
// delete this.callbacks[key]
// }
// }
// }
// }
}
getTokenByUserIdAndId(user, userID) {
// const geturl = environment.apiURL + 'notifications/user/' + userID;
+6 -1
View File
@@ -21,9 +21,14 @@ export class EventService {
if(this.p.userRole(['PR'])) {
alert('pr')
return this.eventService.postEventPr(body, calendar)
} else {
} else if(this.p.userRole(['MDGPR'])) {
alert('md')
return this.eventService.postEventMd(body, calendar)
} else {
alert('other')
return this.eventService.postEventGeneric(body, calendar, body.CalendarId)
}
}
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { ServerConnectionService } from './server-connection.service';
describe('ServerConnectionService', () => {
let service: ServerConnectionService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(ServerConnectionService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,20 @@
import { Injectable } from '@angular/core';
import { environment } from 'src/environments/environment';
import { HttpClient } from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class ServerConnectionService {
constructor(private http: HttpClient,) { }
async BaseAPI(): Promise<boolean> {
try {
await this.http.get(environment.apiURL)
return true
} catch {
return false
}
}
}
@@ -192,7 +192,12 @@ export class ApproveEventPage implements OnInit {
this.toastService._successMessage('Evento enviado para revisão');
this.close();
} catch (error) {
this.toastService._badRequest();
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest();
}
} finally {
loader.remove()
}
@@ -415,7 +415,12 @@ export class EditEventToApprovePage implements OnInit {
this.toastService._successMessage();
this.goToApproveEventList();
} catch (error) {
this.toastService._badRequest();
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest();
}
} finally {
loader.remove()
}
@@ -59,7 +59,7 @@ export class EventListPage implements OnInit {
ngOnChanges() {
this.LoadToApproveEvents();
setTimeout(() => {
this.LoadToApproveEvents();
this.LoadToApproveEventsNoLoader();
}, 3000)
}
@@ -107,6 +107,43 @@ export class EventListPage implements OnInit {
}
}
async LoadToApproveEventsNoLoader() {
try {
if(this.segment == 'MDGPR') {
let mdEventsOficial = await this.processes.GetTasksList('Agenda Oficial MDGPR', false).toPromise();
let mdEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal MDGPR', false).toPromise();
let allEvents = mdEventsOficial.concat(mdEventsPessoal);
if(allEvents.length > 0) {
this.eventsMDGPRList = this.sortService.sortArrayByDate(allEvents).reverse();
}
this.showLoader = false;
}
else if(this.segment == 'PR') {
let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR', false).toPromise();
let prEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal PR', false).toPromise();
let allEvents = prEventsOficial.concat(prEventsPessoal);
if(allEvents.length > 0) {
this.eventsPRList = this.sortService.sortArrayByDate(allEvents).reverse();
}
this.showLoader = false;
} else {
let genericEvents = await this.processes.GetTasksList('Agendar Evento', false).toPromise();
if(genericEvents.length > 0) {
this.eventsGenericList = this.sortService.sortArrayByDate(genericEvents).reverse();
}
this.showLoader = false;
}
} catch(erro) {
this.showLoader = false;
}
}
async openApproveModal(eventSerialNumber, data) {
@@ -25,6 +25,7 @@ import { FormGroup, Validators } from '@angular/forms';
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
import { ThemeService } from 'src/app/services/theme.service'
import { ChatMethodsService } from 'src/app/services/chat/chat-methods.service';
import { ServerConnectionService } from 'src/app/services/server-connection.service';
import { SessionStore } from 'src/app/store/session.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
@@ -129,6 +130,7 @@ export class NewEventPage implements OnInit {
private dateAdapter: DateAdapter<any>,
public ThemeService: ThemeService,
private chatMethodService: ChatMethodsService,
private ServerConnectionService: ServerConnectionService
// private translate: TranslateService
) {
this.dateAdapter.setLocale('pt');
@@ -529,9 +531,15 @@ export class NewEventPage implements OnInit {
},
error => {
console.log(error, 'error')
loader.remove()
this.showLoader = false
this.toastService._badRequest('Evento não criado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não criado')
}
});
}
@@ -585,10 +593,19 @@ export class NewEventPage implements OnInit {
}
this.toastService._successMessage('Evento criado')
},()=>{
},(error) => {
//const connectionToServer = this.ServerConnectionService.BaseAPI()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não criado')
}
loader.remove()
this.showLoader = false
this.toastService._badRequest('Evento não criado')
});
} else {
@@ -641,10 +658,15 @@ export class NewEventPage implements OnInit {
this.chatMethodService.sendMessage(this.roomId,data);
}
this.toastService._successMessage('Evento criado')
},()=>{
},(error)=>{
loader.remove()
this.showLoader = false
this.toastService._badRequest('Evento não criado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não criado')
}
});
}
@@ -82,7 +82,7 @@
<div *ngIf="loadedEvent.Body.Text">
<h5>Detalhes</h5>
<ion-item lines="none" class="ion-no-margin ion-no-padding">
<div class="text"> {{ loadedEvent.Body.Text }} </div>
<pre class="text">{{ loadedEvent.Body.Text }} </pre>
</ion-item>
<div class="line"></div>
</div>
@@ -105,9 +105,6 @@ export class ViewEventPage implements OnInit {
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
this.eventsService.getEvent(this.eventId).subscribe(res => {
const div = document.createElement("div")
div.innerHTML = res.Body.Text
res.Body.Text = div.innerText
this.loadedEvent = res;
this.today = new Date(res.StartDate);
@@ -2,16 +2,16 @@
<!-- <ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar> -->
<div class="title">
<div class="thetitle"><ion-label >Todas as tarefas</ion-label></div>
<div class="theicon">
<!-- <div class="theicon">
<button title="Atualizar" class="btn-no-color" (click)="refreshing()">
<ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
</button>
</div>
</div> -->
</div>
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
@@ -59,8 +59,12 @@ export class AllProcessesPage implements OnInit {
});
}
doRefresh() {
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
}, 2000);
}
setTimeout(() => {
this.updateAllProcess();
}, 1000);
@@ -6,7 +6,7 @@
<ion-label *ngIf="loggeduser.Profile =='PR'" >Despachos</ion-label>
</div>
<div class="theicon">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh()">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh($event)">
<ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
</button>
</div>
@@ -14,7 +14,7 @@
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
@@ -86,8 +86,13 @@ constructor (
}, 1000);
}
doRefresh() {
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
}, 2000);
}
setTimeout(() => {
this.LoadList();
//event.target.complete();
@@ -11,7 +11,7 @@
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
@@ -26,7 +26,7 @@ export class DespachosPage implements OnInit {
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith('/home/gabinete-digital?despachos=true')) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.doRefresh()
this.LoadList()
} else {
this.LoadList()
}
@@ -45,8 +45,14 @@ export class DespachosPage implements OnInit {
await this.despachoRule.getList({updateStore: true})
this.skeletonLoader = false;
}
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
}, 2000);
}
doRefresh() {
setTimeout(() => {
this.LoadList();
}, 1000);
@@ -3,14 +3,14 @@
<div class="title">
<div class="thetitle"><ion-label >Diplomas para assinar</ion-label></div>
<div class="theicon">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh()">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh($event)">
<ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
</button>
</div>
</div>
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
@@ -36,7 +36,7 @@ export class DiplomasAssinarPage implements OnInit {
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && '/home/gabinete-digital?diplomasassinar=true'.startsWith(event.url)) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.doRefresh()
this.LoadList()
} else {
this.LoadList()
}
@@ -49,7 +49,13 @@ export class DiplomasAssinarPage implements OnInit {
this.router.navigate(['/home/gabinete-digital/diplomas-assinar',serialNumber,'gabinete-digital']);
}
doRefresh() {
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
}, 2000);
}
setTimeout(() => {
this.LoadList();
}, 1000);
@@ -3,14 +3,14 @@
<div class="title">
<div class="thetitle"><ion-label >Diplomas por gerar</ion-label></div>
<div class="theicon">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh()">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh($event)">
<ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
</button>
</div>
</div>
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
@@ -38,7 +38,13 @@ export class DiplomasGerarPage implements OnInit {
this.router.navigate(['/home/gabinete-digital/diplomas-gerar', serialNumber, 'gabinete-digital']);
}
doRefresh() {
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
}, 2000);
}
setTimeout(() => {
this.LoadList();
}, 1000);
@@ -3,14 +3,14 @@
<div class="title">
<div class="thetitle"><ion-label >Expediente</ion-label></div>
<div class="theicon">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh()">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh($event)">
<ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
</button>
</div>
</div>
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
@@ -44,7 +44,7 @@ export class ExpedientsPage implements OnInit {
if (event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?expedientes=true')) {
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.doRefresh()
this.LoadList()
} else {
this.LoadList()
}
@@ -94,8 +94,12 @@ export class ExpedientsPage implements OnInit {
})
}
doRefresh() {
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
}, 2000);
}
setTimeout(() => {
this.LoadList();
}, 1000)
@@ -3,7 +3,7 @@
<div class="title">
<div class="thetitle"><ion-label >Diplomas</ion-label></div>
<div class="theicon">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh()">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh($event)">
<ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
</button>
</div>
@@ -123,8 +123,14 @@ export class DiplomasPage implements OnInit {
this.LoadList();
}, 1000);
}
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
}, 2000);
}
doRefresh() {
this.LoadList();
}
@@ -312,7 +312,12 @@ export class EditEventToApproveComponent implements OnInit {
this.eventsService.postEventToApproveEdit(event).subscribe(()=>{
this.toastService._successMessage('Evento editado');
}, error =>{
this.toastService._badRequest('Evento não editado');
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não editado');
}
})
@@ -322,14 +327,24 @@ export class EditEventToApproveComponent implements OnInit {
this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{
this.toastService._successMessage();
}, error =>{
this.toastService._badRequest();
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest();
}
});
} else if(document['action'] == 'delete') {
delete document.action
this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{
this.toastService._successMessage()
}, error =>{
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
})
}
@@ -3,7 +3,7 @@
<div class="title width-100">
<div class="title-container d-flex justify-space-between">
<span class="text-center mt-0 aside-title px-20"><label>Eventos para Aprovação</label></span>
<button title="Atualizar" title="Atualizar" class="btn-no-color" (click)="doRefresh()">
<button title="Atualizar" title="Atualizar" class="btn-no-color" (click)="doRefresh($event)">
<ion-icon class="title-icon font-awesome" name="reload-circle"></ion-icon>
</button>
</div>
@@ -20,20 +20,20 @@
</div>
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content>
</ion-refresher-content>
</ion-refresher>
<div class="main-content overflow-y-auto height-100" [ngSwitch]="segment" *ngIf="eventsPRList">
<div class="main-content overflow-y-auto height-100" [ngSwitch]="segment" *ngIf="eventaprovacaostore.listpr">
<div *ngSwitchCase="'MDGPR'" class="height-100">
<div *ngIf="eventsMDGPRList">
<div *ngIf="eventaprovacaostore.listmd">
<ion-list class="width-100" *ngIf="eventsMDGPRList.length != 0" >
<ion-list class="width-100" *ngIf="eventaprovacaostore.listmd.length != 0" >
<div
class="expediente item-hover ion-no-padding ion-no-margin cursor-pointer"
*ngFor="let event of eventsMDGPRList"
*ngFor="let event of eventaprovacaostore.listmd"
(click)="goToEventDetail(event)"
>
<!-- (click)="openApproveModal(event)" -->
@@ -52,9 +52,9 @@
</ion-list>
</div>
<div *ngIf="eventsMDGPRList" class="centered-div">
<div *ngIf="eventaprovacaostore.listmd" class="centered-div">
<div *ngIf="eventsMDGPRList.length == 0">
<div *ngIf="eventaprovacaostore.listmd.length == 0">
<div *ngSwitchCase="'MDGPR'">
<div class="d-flex height-90 align-center justify-content-center"
>
@@ -65,12 +65,12 @@
</div>
</div>
<div *ngSwitchCase="'PR'">
<div *ngIf="eventsPRList.length != 0">
<div *ngIf="eventaprovacaostore.listpr.length != 0">
<ion-list class="width-100" *ngSwitchCase="'PR'">
<div class="width-100" *ngIf="eventsPRList">
<div class="width-100" *ngIf="eventaprovacaostore.listpr">
<div
class="expediente item-hover ion-no-padding ion-no-margin cursor-pointer"
*ngFor="let event of eventsPRList"
*ngFor="let event of eventaprovacaostore.listpr"
(click)="goToEventDetail(event)"
>
<div class="item event-pr-{{event.workflowInstanceDataFields.Agenda}} width-100">
@@ -90,10 +90,10 @@
</div>
<div *ngIf="eventsPRList.length == 0" class="centered-div d-flex height-90 align-center justify-content-center">
<div *ngIf="eventaprovacaostore.listpr.length == 0" class="centered-div d-flex height-90 align-center justify-content-center">
<div *ngSwitchCase="'PR'" >
<div class="d-flex align-center justify-content-center"
*ngIf="eventsPRList.length < 1">
*ngIf="eventaprovacaostore.listpr.length < 1">
Lista vazia
</div>
</div>
@@ -51,7 +51,7 @@ export class EventsToApprovePage implements OnInit {
'/home/gabinete-digital?eventos=true'.startsWith(event.url)) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.doRefresh()
this.LoadToApproveEvents()
} else {
this.LoadToApproveEvents()
}
@@ -81,7 +81,7 @@ export class EventsToApprovePage implements OnInit {
})
//this.eventaprovacaostore.resetmd(this.sortService.sortDate(this.eventsMDGPRList, 'CreateDate'));
this.eventaprovacaostore.resetmd(this.sortService.sortDate(this.eventsMDGPRList, 'CreateDate'));
}
else if(this.segment == 'PR') {
let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR', false).toPromise();
@@ -97,7 +97,7 @@ export class EventsToApprovePage implements OnInit {
this.storage.set('event-to-aprovePR',this.eventsPRList).then(() => {
})
//this.eventaprovacaostore.resetpr(this.sortService.sortDate(this.eventsPRList, 'CreateDate'));
this.eventaprovacaostore.resetpr(this.sortService.sortDate(this.eventsPRList, 'CreateDate'));
}
this.showLoader = false;
}
@@ -124,9 +124,13 @@ export class EventsToApprovePage implements OnInit {
this.router.navigate(['/home/gabinete-digital/event-list/approve-event',event.serialNumber, 'gabinete-digital'])
}
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
}, 2000);
}
doRefresh() {
setTimeout(()=>{
this.LoadToApproveEvents();
}, 1000)
@@ -66,11 +66,8 @@ export class ExpedientesPrPage implements OnInit {
this.processes.GetTaskListExpediente(false).subscribe(result => {
this.taskslist = [];
let res = result.reverse().filter(data => data.workflowInstanceDataFields.Status == "Active");
res.forEach(element => {
let task = this.expedienteTaskPipe.transform(element);
this.taskslist.push(task);
});
let res = result.reverse().filter(data => data.workflowInstanceDataFields.Status == "" || data.workflowInstanceDataFields.Status == "Active");
this.taskslist = res.map((element) => this.expedienteTaskPipe.transform(element));
this.taskslist = this.sortService.sortDate(this.taskslist, 'CreateDate')
@@ -3,14 +3,14 @@
<div class="title">
<div class="thetitle"><ion-label >Expediente</ion-label></div>
<div class="theicon">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh()">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh($event)">
<ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
</button>
</div>
</div>
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
@@ -44,7 +44,7 @@ export class ExpedientsPage implements OnInit {
if (event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?expedientes=true')) {
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.doRefresh()
this.LoadList()
} else {
this.LoadList()
}
@@ -65,17 +65,16 @@ export class ExpedientsPage implements OnInit {
this.taskslist = [];
this.skeletonLoader = false
let res = result.filter(data => data.workflowInstanceDataFields.Status == "Active");
res.forEach(element => {
let task = this.expedienteTaskPipe.transform(element)
this.taskslist.push(task);
let res = result.filter(data => data.workflowInstanceDataFields.Status == "" || data.workflowInstanceDataFields.Status == "Active");
});
this.taskslist = res.map((e) => this.expedienteTaskPipe.transform(e))
this.taskslist = this.sortService.sortDate(this.taskslist, 'CreateDate')
this.addProcessTODb(this.taskslist);
this.taskslist = this.taskslist.filter(function(item) {
return item.activityInstanceName != 'Retificar Expediente'
})
})
this.expedientegbstore.reset(this.taskslist);
}, (error) => {
this.getEventsFromLocalDb();
@@ -94,16 +93,21 @@ export class ExpedientsPage implements OnInit {
})
}
doRefresh() {
doRefresh(event) {
if (event) {
setTimeout(() => {
this.LoadList();
}, 1000)
event.target.complete();
}, 2000);
}
goToExpediente(serialNumber: any) {
this.router.navigate(['/home/gabinete-digital/expediente', serialNumber, 'gabinete-digital']);
}
setTimeout(() => {
this.LoadList();
}, 1000)
}
goToExpediente(serialNumber: any) {
this.router.navigate(['/home/gabinete-digital/expediente', serialNumber, 'gabinete-digital']);
}
}
@@ -3,7 +3,7 @@
<div class="title">
<div class="thetitle"><ion-label >Pedidos</ion-label></div>
<div class="theicon">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh()">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh($event)">
<ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
</button>
</div>
@@ -20,7 +20,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
@@ -59,7 +59,7 @@ export class PedidosPage implements OnInit {
) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.doRefresh()
this.LoadList()
} else {
this.LoadList()
}
@@ -121,7 +121,12 @@ export class PedidosPage implements OnInit {
this.skeletonLoader = false
}
doRefresh() {
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
}, 2000);
}
setTimeout(() => {
this.LoadList();
}, 1000);
@@ -3,14 +3,14 @@
<div class="title">
<div class="thetitle"><ion-label >Pendentes</ion-label></div>
<div class="theicon">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh()">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh($event)">
<ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
</button>
</div>
</div>
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
@@ -42,7 +42,7 @@ export class PendentesPage implements OnInit {
if (event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?pendentes=true')) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.doRefresh()
this.LoadList()
} else {
this.LoadList()
}
@@ -86,8 +86,14 @@ export class PendentesPage implements OnInit {
this.listToPresent =pendentes
})
}
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
}, 2000);
}
doRefresh() {
setTimeout(()=>{
this.LoadList();
}, 1000)
@@ -107,7 +107,12 @@ export class DeplomaOptionsPage implements OnInit {
this.close();
this.toastService._successMessage()
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -154,7 +159,12 @@ export class DeplomaOptionsPage implements OnInit {
this.close();
this.toastService._successMessage()
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -180,7 +190,11 @@ export class DeplomaOptionsPage implements OnInit {
this.close();
this.toastService._successMessage()
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -205,7 +219,12 @@ export class DeplomaOptionsPage implements OnInit {
await this.processes.CompleteTask(body).toPromise();
this.toastService._successMessage('Processo concluído')
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -19,7 +19,7 @@
</div>
<div class="flex-grow-1 width-50 pl-10">
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel width-100" shape="round" >Solicitar Parecer</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openTaskProcessModal('2',fulltask)" class="btn-cancel width-100" shape="round" >Pedido de Deferimento</button>
<button *ngIf="!p.userRole(['PR']) && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openTaskProcessModal('2',fulltask)" class="btn-cancel width-100" shape="round" >Pedido de Deferimento</button>
<button (click)="openDelegarModal(task)" class="btn-cancel width-100" shape="round" >Delegar</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel width-100" shape="round" >Enviar para Pendentes</button>
</div>
@@ -78,9 +78,14 @@ export class DespachosOptionsPage implements OnInit {
loader.remove()
this.close();
},()=>{
},(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 encontrado')
}
});
}
@@ -173,7 +178,12 @@ export class DespachosOptionsPage implements OnInit {
this.toastService._successMessage()
this.close();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -254,7 +264,12 @@ export class DespachosOptionsPage implements OnInit {
this.toastService._successMessage('Processo arquivado')
this.close();
} catch (error) {
this.toastService._badRequest('Processo não arquivado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não arquivado')
}
} finally {
loader.remove()
}
@@ -281,7 +296,12 @@ export class DespachosOptionsPage implements OnInit {
this.close();
this.toastService._successMessage()
} catch(error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -308,7 +328,12 @@ export class DespachosOptionsPage implements OnInit {
this.toastService._successMessage()
this.close();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -104,10 +104,14 @@ export class DespachosPrOptionsPage implements OnInit {
this.toastService._successMessage()
this.popoverController.dismiss('close')
loader.remove()
},()=>{
},(error)=>{
loader.remove()
this.toastService._badRequest('Processo não encontrado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não encontrado')
}
});
}
@@ -206,7 +210,12 @@ export class DespachosPrOptionsPage implements OnInit {
this.toastService._successMessage()
this.close();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -290,7 +299,12 @@ export class DespachosPrOptionsPage implements OnInit {
this.toastService._successMessage('')
this.close();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -92,7 +92,12 @@ export class DiplomasGerarOptionsPage implements OnInit {
this.toastService._successMessage();
this.goBack()
} catch (error) {
this.toastService._badRequest();
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest();
}
} finally {
loader.remove()
}
@@ -3,7 +3,7 @@
<button (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('1')" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2')" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button *ngIf="!p.userRole(['PR']) && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openExpedientActionsModal('2')" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button class="btn-cancel" shape="round" (click)="close()">Cancelar</button>
</div>
@@ -30,28 +30,19 @@
margin-bottom: 5px !important;
margin-top: 5px !important;
}
@media only screen and (max-width: 800px) {
.btn-ok, .btn-cancel, .btn-delete{
width: 100% !important;
}
.arrow-right{
display: flex;
justify-content: flex-end;
}
@media only screen and (min-width: 1024px) {
.arrow-right{
display: flex;
justify-content: flex-end;
}
.btn-cancel{
width: 100% !important;
margin-bottom: 10px !important;
}
.btn-delete, .btn-ok{
width: 100% !important;
margin-bottom: 10px !important;
margin-top: 10px !important;
}
/* .solid{
display: block;
} */
.btn-cancel{
width: 100% !important;
margin-bottom: 10px !important;
}
.btn-delete, .btn-ok{
width: 100% !important;
margin-bottom: 10px !important;
margin-top: 10px !important;
}
@@ -142,7 +142,12 @@ export class OptsExpedientePrPage implements OnInit {
this.close();
this.toastService._successMessage()
} catch(error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -180,7 +185,12 @@ export class OptsExpedientePrPage implements OnInit {
this.toastService._successMessage('Processo descartado');
this.goBack();
} catch (error) {
this.toastService._badRequest('Processo não descartado')
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 {
loader.remove()
}
@@ -199,7 +209,12 @@ export class OptsExpedientePrPage implements OnInit {
// this.toastService.successMessage('Processo descartado');
this.goBack();
} catch (error) {
this.toastService._badRequest('Processo não descartado');
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 {
loader.remove()
}
@@ -214,7 +229,12 @@ export class OptsExpedientePrPage implements OnInit {
this.toastService._successMessage();
this.goBack();
} catch (error) {
this.toastService._badRequest();
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest();
}
} finally {
loader.remove()
}
@@ -242,7 +262,12 @@ export class OptsExpedientePrPage implements OnInit {
this.close();
this.toastService._successMessage()
} catch(error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -255,9 +280,13 @@ export class OptsExpedientePrPage implements OnInit {
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
loader.remove()
this.close();
},()=>{
this.toastService._badRequest('Processo não encontrado')
}, (error) => {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não encontrado')
}
loader.remove()
});
}
@@ -295,7 +324,11 @@ export class OptsExpedientePrPage implements OnInit {
// this.toastService.successMessage('Processo descartado');
this.goBack();
} catch (error) {
this.toastService._badRequest('Processo não descartado');
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 {
loader.remove()
}
@@ -8,15 +8,15 @@
<div class="width-100">
<div class="d-flex width-100">
<div class="flex-grow-1">
<button *ngIf="loggeduser.Profile == 'MDGPR'" class="btn-cancel desk" shape="round"> Enviar para o PR </button>
<button *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Avaliação Superior</button>
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Enviar para o PR </button>
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Avaliação Superior</button>
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Solicitar revisão </button>
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round">Outras opções </button>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<!-- <button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button> -->
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button *ngIf="!p.userRole(['PR']) && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button>
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
@@ -17,7 +17,6 @@ import { PermissionService } from 'src/app/services/permission.service';
import { ThemeService } from 'src/app/services/theme.service'
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
import { RouteService } from 'src/app/services/route.service';
import { LoginUserRespose } from 'src/app/models/user.model';
import { SessionStore } from 'src/app/store/session.service';
@Component({
@@ -36,7 +35,7 @@ export class OptsExpedientePage implements OnInit {
searchDocumentPipe = new SearchDocumentPipe()
documents:SearchList[] = [];
loggeduser: LoginUserRespose;
SessionStore = SessionStore;
constructor(
private popoverController: PopoverController,
@@ -55,7 +54,7 @@ export class OptsExpedientePage implements OnInit {
}
ngOnInit() {
console.log('SessionStore', SessionStore)
}
async openNewGroupPage(){
@@ -171,8 +170,13 @@ export class OptsExpedientePage implements OnInit {
this.attachmentsService.AddAttachment(body).subscribe((res)=> {
this.toastService._successMessage()
},()=> {
this.toastService._badRequest()
}, (error) => {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
},()=> {
loader.remove()
});
@@ -249,7 +253,12 @@ export class OptsExpedientePage implements OnInit {
this.close();
this.toastService._successMessage()
} catch(error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -259,9 +268,13 @@ export class OptsExpedientePage implements OnInit {
this.close();
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
this.goBack();
},()=>{
this.toastService._badRequest('Processo não encontrado')
},(error)=>{
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não encontrado')
}
});
}
@@ -285,7 +298,12 @@ export class OptsExpedientePage implements OnInit {
this.close();
this.toastService._successMessage('Processo aprovado')
} catch(error) {
this.toastService._badRequest('Processo não aprovado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não aprovado')
}
} finally {
loader.remove()
}
@@ -341,7 +359,12 @@ export class OptsExpedientePage implements OnInit {
await this.processes.CompleteTask(body).toPromise();
this.goBack();
} catch (error) {
this.toastService._badRequest('Processo não descartado')
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 {
loader.remove()
}
@@ -376,7 +399,12 @@ export class OptsExpedientePage implements OnInit {
this.toastService._successMessage('Processo descartado');
this.goBack();
} catch (error) {
this.toastService._badRequest('Processo não descartado')
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 {
loader.remove()
}
@@ -396,7 +424,12 @@ export class OptsExpedientePage implements OnInit {
this.toastService._successMessage('Processo descartado');
this.goBack();
} catch (error) {
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 {
loader.remove()
}
@@ -410,8 +443,12 @@ export class OptsExpedientePage implements OnInit {
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
this.toastService._successMessage();
this.goBack();
} catch (error) {
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -5,7 +5,7 @@
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button *ngIf="!p.userRole(['PR']) && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
@@ -15,7 +15,7 @@
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button *ngIf="!p.userRole(['PR']) && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
@@ -46,7 +46,7 @@
<button (click)="openAddNoteModal('Arquivar')" class="btn-cancel" shape="round" >Arquivar</button>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button *ngIf="!p.userRole(['PR']) && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
@@ -191,7 +191,12 @@ export class RequestOptionsPage implements OnInit {
this.close();
this.toastService._successMessage()
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -260,7 +265,12 @@ export class RequestOptionsPage implements OnInit {
this.toastService._successMessage('Processo arquivado')
} catch (error) {
this.toastService._badRequest('Processo não arquivado')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não arquivado')
}
} finally {
loader.remove()
}
@@ -1,9 +1,7 @@
<ion-content class="container width-100 ">
<div class="buttons">
<button (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2')" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
</div>
</ion-content>
<div class="buttons pa-20">
<button (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button *ngIf="!p.userRole(['PR']) && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openExpedientActionsModal('2')" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
</div>
@@ -111,7 +111,11 @@ export class EditActionPage implements OnInit {
this.getActions.emit()
} catch (error) {
this.toastService._badRequest('Não foi possivel atualizar a acção presidencial')
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Não foi possivel atualizar a acção presidencial')
}
} finally {
loader.remove()
}
@@ -133,7 +133,12 @@ export class NewActionPage implements OnInit {
this.getActions.emit()
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Não foi possivel criar a acção presidencial')
}
} finally {
loader.remove()
}

Some files were not shown because too many files have changed in this diff Show More