This commit is contained in:
tiago.kayaya
2021-12-01 15:15:32 +01:00
212 changed files with 3517 additions and 1657 deletions
@@ -142,6 +142,10 @@ export class EditEventPage implements OnInit {
}
ngOnChanges(changes: any): void {
// this.loadedEventAttachments = this.loadedEventAttachments.concat(this.postEvent.Attachments)
}
close() {
this.closeComponent.emit();
this.setIntervenient.emit([]);
@@ -193,6 +197,7 @@ export class EditEventPage implements OnInit {
]),
})
}
openInicio() {
@@ -252,7 +257,8 @@ export class EditEventPage implements OnInit {
this.showLoader = true;
await this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
try {
await this.eventsService.editEvent(this.postEvent, 2, 3).toPromise()
if(this.initCalendarName != this.postEvent.CalendarName) {
let body = {
"EventId": this.postEvent.EventId,
@@ -265,11 +271,10 @@ export class EditEventPage implements OnInit {
}
this.showLoader = false;
this.toastService.successMessage()
},
error => {
} catch(error) {
this.showLoader = false
this.toastService.badRequest()
});
}
this.clearPostEvent.emit();
this.deleteTemporaryData();
@@ -282,7 +287,6 @@ export class EditEventPage implements OnInit {
async saveDocument() {
console.log(this.loadedEventAttachments)
await this.loadedEventAttachments.forEach( async (e)=>{
@@ -303,10 +307,10 @@ export class EditEventPage implements OnInit {
};
await this.attachmentsService.setEventAttachmentById(DocumentToSave).toPromise();
this.getAttachments(this.postEvent.EventId);
await this.getAttachments(this.postEvent.EventId);
} else if(remove) {
this.attachmentsService.deleteEventAttachmentById(e.Id).subscribe( res=> {})
await this.attachmentsService.deleteEventAttachmentById(e.Id).toPromise()
}
})
@@ -365,11 +369,9 @@ export class EditEventPage implements OnInit {
window['temp.path:/home/agenda/edit-event.component.ts'] = {}
}
getAttachments(eventId: string){
this.attachmentsService.getAttachmentsById(eventId).subscribe(res=>{
this.loadedEventAttachments = res;
console.log('res', res);
});
async getAttachments(eventId: string){
const rest: any = this.attachmentsService.getAttachmentsById(eventId).toPromise()
this.loadedEventAttachments = rest;
}
deleteAttachment(attachmentID: string, index) {
@@ -409,14 +409,14 @@ export class NewEventPage implements OnInit {
this.afterSave();
}
this.toastService.successMessage('Evento criado')
this.toastService._successMessage('Evento criado')
},
error => {
loader.remove()
this.showLoader = false
this.toastService.badRequest('Evento não criado')
this.toastService._badRequest('Evento não criado')
});
@@ -95,6 +95,7 @@ export class ViewEventPage implements OnInit {
}
loadEvent() {
this.eventsService.getEvent(this.eventId).subscribe(res => {
console.log(res);
this.loadedEvent = res;
@@ -44,7 +44,7 @@
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
</div>
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of messages; let last = last">
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of messages; let last = last" (click)="openPreview(msg)">
<div class="message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45" *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'ru'" >
<div class="message-item-options d-flex justify-content-end">
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
@@ -1,5 +1,5 @@
import { Component, OnChanges, OnInit, Input, SimpleChanges, Output, EventEmitter, ViewChild, ElementRef, AfterViewChecked, AfterViewInit, OnDestroy} from '@angular/core';
import { ActionSheetController, AnimationController, MenuController, ModalController, PopoverController } from '@ionic/angular';
import { Component, OnChanges, OnInit, Input, SimpleChanges,ChangeDetectorRef,Output, EventEmitter, ViewChild, ElementRef, AfterViewChecked, AfterViewInit, OnDestroy} from '@angular/core';
import { ActionSheetController, AnimationController, IonSlides, MenuController, ModalController, PopoverController } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service';
import { AuthService } from 'src/app/services/auth.service';
import { ChatService } from 'src/app/services/chat.service';
@@ -19,6 +19,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
import { FileService } from 'src/app/services/functions/file.service';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { ThemeService } from 'src/app/services/theme.service'
import { PreviewCameraPage } from 'src/app/modals/preview-camera/preview-camera.page';
/*
import * as pdfjsLib from 'pdfjs-dist';
@@ -86,7 +87,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
private fileToBase64Service: FileToBase64Service,
private processesService: ProcessesService,
private fileService: FileService,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private changeDetectorRef: ChangeDetectorRef
) {
this.loggedUserChat = authService.ValidatedUserChat['data'];
this.isGroupCreated = true;
@@ -767,7 +769,61 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}
}
sliderOpts = {
zoom: false,
slidesPerView: 1.5,
spaceBetween: 20,
centeredSlides: true
};
zoomActive = false;
zoomScale = 1;
sliderZoomOpts = {
allowSlidePrev: false,
allowSlideNext: false,
zoom: {
maxRatio: 5
},
on: {
zoomChange: (scale, imageEl, slideEl) => {
this.zoomActive = true;
this.zoomScale = scale/5;
this.changeDetectorRef.detectChanges();
}
}
}
async touchEnd(zoomslides: IonSlides, card) {
// Zoom back to normal
const slider = await zoomslides.getSwiper();
const zoom = slider.zoom;
zoom.out();
// Card back to normal
card.el.style['z-index'] = 9;
this.zoomActive = false;
this.changeDetectorRef.detectChanges();
}
touchStart(card) {
// Make card appear above backdrop
card.el.style['z-index'] = 11;
}
async openPreview(img) {
const modal = await this.modalController.create({
component: PreviewCameraPage,
cssClass: 'transparent-modal',
componentProps: {
image: img.attachments[0].image_url,
username: img.u.username,
_updatedAt: img._updatedAt
}
});
modal.present();
}
}
@@ -37,7 +37,7 @@
</ion-refresher-content>
</ion-refresher>
<div class="messages" #scrollMe>
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of chatMessageStore.message[roomId]; let last = last">
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of chatMessageStore.message[roomId]; let last = last" (click)="openPreview(msg)">
<div class='message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'>
<div class="message-item-options d-flex justify-content-end">
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
+60 -4
View File
@@ -1,5 +1,5 @@
import { AfterViewChecked, AfterViewInit, Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
import { AnimationController, GestureController, ModalController, PopoverController } from '@ionic/angular';
import { AfterViewChecked, AfterViewInit, Component, ElementRef,ChangeDetectorRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
import { AnimationController, GestureController, IonSlides, ModalController, PopoverController } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service';
import { AuthService } from 'src/app/services/auth.service';
import { ChatService } from 'src/app/services/chat.service';
@@ -16,6 +16,7 @@ import { FileService } from 'src/app/services/functions/file.service';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { ThemeService } from 'src/app/services/theme.service'
import { PreviewCameraPage } from 'src/app/modals/preview-camera/preview-camera.page';
@Component({
selector: 'app-messages',
@@ -71,7 +72,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
private fileService: FileService,
private gestureController: GestureController,
private http:HttpClient,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private changeDetectorRef: ChangeDetectorRef
) {
this.loggedUser = authService.ValidatedUserChat['data'];
@@ -553,7 +555,61 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.serverLongPull();
});
}sliderOpts = {
zoom: false,
slidesPerView: 1.5,
spaceBetween: 20,
centeredSlides: true
};
zoomActive = false;
zoomScale = 1;
sliderZoomOpts = {
allowSlidePrev: false,
allowSlideNext: false,
zoom: {
maxRatio: 5
},
on: {
zoomChange: (scale, imageEl, slideEl) => {
this.zoomActive = true;
this.zoomScale = scale/5;
this.changeDetectorRef.detectChanges();
}
}
}
async touchEnd(zoomslides: IonSlides, card) {
// Zoom back to normal
const slider = await zoomslides.getSwiper();
const zoom = slider.zoom;
zoom.out();
// Card back to normal
card.el.style['z-index'] = 9;
this.zoomActive = false;
this.changeDetectorRef.detectChanges();
}
touchStart(card) {
// Make card appear above backdrop
card.el.style['z-index'] = 11;
}
async openPreview(msg) {
const modal = await this.modalController.create({
component: PreviewCameraPage,
cssClass: 'transparent-modal',
componentProps: {
image: msg.attachments[0].image_url,
username: msg.u.username,
_updatedAt: msg._updatedAt
}
});
modal.present();
}
}
@@ -66,6 +66,8 @@ export class AllProcessesPage implements OnInit {
let allProcessesList = await this.processesService.GetTasksList("", false).toPromise();
//console.log(allProcessesList);
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Conhecimento')
this.skeletonLoader = true;
this.allProcessesList = [];
@@ -73,14 +75,11 @@ export class AllProcessesPage implements OnInit {
allProcessesList.forEach(element => {
let date = new Date(element.taskStartDate);
date.setMonth(date.getMonth() + 1);
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.workflowInstanceDataFields.Sender,
//"CreateDate": taskDate,
"CreateDate": new Date(element.taskStartDate),
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
@@ -93,10 +92,11 @@ export class AllProcessesPage implements OnInit {
"Agenda": element.workflowInstanceDataFields.Agenda,
"customDate": this.setFormatDate(new Date(element.workflowInstanceDataFields.StartDate), new Date(element.workflowInstanceDataFields.EndDate), element.workflowInstanceDataFields.IsAllDayEvent),
}
this.allProcessesList.push(task);
this.allProcessesList = removeDuplicate(this.allProcessesList)
//this.allProcessesList = this.sortArrayISODate(this.allProcessesList).reverse();
this.allProcessesList = this.sortService.sortArrayISODate(this.allProcessesList).reverse();
this.allProcessesList = this.sortService.sortDate(this.allProcessesList, 'CreateDate');
});
@@ -74,7 +74,7 @@ constructor (
despachoList.push(task);
});
despachoList = this.sortService.sortArrayISODate(despachoList).reverse()
despachoList = this.sortService.sortDate(despachoList, 'CreateDate')
this.despachosprstore.reset(despachoList);
this.skeletonLoader = false;
@@ -31,7 +31,7 @@ export class DiplomasAssinarPage implements OnInit {
private router: Router,
private sortService: SortService,
public ThemeService: ThemeService
) { }
) {}
ngOnInit() {
@@ -56,30 +56,30 @@ export class DiplomasAssinarPage implements OnInit {
doRefresh() {
setTimeout(() => {
this.LoadList();
//event.target.complete();
}, 1000);
}
async LoadList() {
this.skeletonLoader = true
let diplomas = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
this.diplomasList = new Array();
this.skeletonLoader = false
console.log(diplomas);
let diplomasAssinar = diplomas.reverse().filter(data => data.activityInstanceName == "Assinar Diploma");
console.log(diplomasAssinar);
diplomasAssinar.forEach(element => {
let task: customTask = this.customTaskPipe.transform(element)
this.diplomasList.push(task);
this.deplomasStore.resetDiplomasList(this.sortService.sortArrayByDate(this.diplomasList));
});
this.diplomasList = this.sortService.sortDate(this.diplomasList, 'CreateDate')
this.deplomasStore.resetDiplomasList(this.diplomasList);
}
}
@@ -8,6 +8,7 @@ import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
import { DeplomasStore } from 'src/app/store/deplomas.service';
import { ThemeService } from 'src/app/services/theme.service'
import { SortService } from 'src/app/services/functions/sort.service';
@Component({
selector: 'app-diplomas',
@@ -34,10 +35,9 @@ constructor(
private alertService: AlertService,
private router: Router,
private activatedRoute: ActivatedRoute,
public ThemeService: ThemeService
) {
}
public ThemeService: ThemeService,
private sortService: SortService,
) {}
ngOnInit() {
// update list
@@ -82,7 +82,7 @@ constructor(
diplomasList.push(task);
});
this.diplomasList = this.sortArrayISODate(diplomasList).reverse();
this.diplomasList = this.sortService.sortDate(diplomasList, 'CreateDate')
this.deplomasStore.resetDiplomasList(this.diplomasList)
let diplomasAssinadoList = []
@@ -93,7 +93,7 @@ constructor(
diplomasAssinadoList.push(task);
});
this.diplomasAssinadoList = this.sortArrayISODate(diplomasAssinadoList).reverse();
this.diplomasAssinadoList = this.sortService.sortDate(diplomasAssinadoList, 'CreateDate')
this.deplomasStore.resetDiplomasAssinadoList(this.diplomasAssinadoList)
this.showLoader = false;
@@ -120,12 +120,6 @@ constructor(
}
}
sortArrayISODate(myArray: any) {
return myArray.sort(function(a, b) {
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
});
}
async refreshing() {
setTimeout(() => {
this.LoadList();
@@ -69,13 +69,14 @@ export class EventsToApprovePage implements OnInit {
this.eventsMDGPRList = mdEventsOficial.concat(mdEventsPessoal);
console.log(this.sortService.sortArrayByDate(this.eventsMDGPRList));
this.eventaprovacaostore.resetmd(this.sortService.sortArrayByDate(this.eventsMDGPRList).reverse());
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();
let prEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal PR', false).toPromise();
this.eventsPRList = prEventsOficial.concat(prEventsPessoal);
this.eventaprovacaostore.resetpr(this.sortService.sortArrayByDate(this.eventsPRList).reverse());
this.eventaprovacaostore.resetpr(this.sortService.sortDate(this.eventsPRList, 'CreateDate'));
}
this.showLoader = false;
}
@@ -10,6 +10,7 @@ import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
import { ThemeService } from 'src/app/services/theme.service'
import { SortService } from 'src/app/services/functions/sort.service';
@Component({
@@ -35,7 +36,8 @@ export class ExpedientesPrPage implements OnInit {
private alertService: AlertService,
private authService: AuthService,
private router: Router,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private sortService: SortService,
) {
this.loggeduser = authService.ValidatedUser;
}
@@ -75,7 +77,8 @@ export class ExpedientesPrPage implements OnInit {
let task = this.expedienteTaskPipe.transform(element);
this.taskslist.push(task);
});
console.log(this.taskslist);
this.taskslist = this.sortService.sortDate(this.taskslist, 'CreateDate')
this.expedienteGdStore.reset(this.taskslist);
this.skeletonLoader = false;
@@ -5,6 +5,7 @@ import { AlertService } from 'src/app/services/alert.service';
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
import { ThemeService } from 'src/app/services/theme.service'
import { SortService } from 'src/app/services/functions/sort.service';
@Component({
selector: 'app-expedients',
@@ -27,7 +28,8 @@ export class ExpedientsPage implements OnInit {
private processes:ProcessesService,
private alertService: AlertService,
private router: Router,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private sortService: SortService,
) {
this.profile = 'mdgpr';
@@ -67,13 +69,14 @@ export class ExpedientsPage implements OnInit {
this.taskslist = [];
this.skeletonLoader = false
let res = result.reverse().filter(data => data.workflowInstanceDataFields.Status == "Active");
let res = result.filter(data => data.workflowInstanceDataFields.Status == "Active");
res.forEach(element => {
let task = this.expedienteTaskPipe.transform(element)
this.taskslist.push(task);
});
this.taskslist = this.sortService.sortDate(this.taskslist, 'CreateDate')
this.expedientegbstore.reset(this.taskslist);
});
}
@@ -110,7 +110,7 @@
<div *ngSwitchCase="'parecer'" class="centered-div" >
<div
*ngIf="!skeletonLoader && pedidosstore.listparecer.length == 0"
*ngIf=" pedidosstore.listparecer.length == 0"
class="empty-list d-flex height-100 align-center justify-content-center"
>
<span>Lista vazia</span>
@@ -119,7 +119,7 @@
<div *ngSwitchCase="'deferimento'" class="centered-div">
<div
*ngIf="!skeletonLoader && pedidosstore.listdeferimento.length == 0"
*ngIf="pedidosstore.listdeferimento.length == 0"
class="empty-list d-flex height-100 align-center justify-content-center"
>
<span>Lista vazia</span>
@@ -50,7 +50,7 @@ export class PedidosPage implements OnInit {
public ThemeService: ThemeService
) {
this.profile = 'mdgpr';
}
}
ngOnInit() {
@@ -96,7 +96,8 @@ export class PedidosPage implements OnInit {
let task: customTask = this.customTaskPipe.transform(element);
this.parecerList.push(task);
});
this.pedidosstore.resetparecer(this.sortService.sortArrayISODate(this.parecerList));
this.pedidosstore.resetparecer(this.sortService.sortDate(this.parecerList, 'CreateDate'));
}
else if(this.segment == 'deferimento') {
@@ -112,7 +113,9 @@ export class PedidosPage implements OnInit {
let task: customTask = this.customTaskPipe.transform(element);
this.deferimentoList.push(task);
});
this.pedidosstore.resetdeferimento(this.sortService.sortArrayISODate(this.deferimentoList));
this.pedidosstore.resetdeferimento(this.sortService.sortDate(this.deferimentoList, 'CreateDate'));
});
}
@@ -62,7 +62,7 @@ export class PendentesPage implements OnInit {
});
pendentesList = removeDuplicate( pendentesList)
pendentesList = this.sortService.sortArrayISODate(pendentesList);
pendentesList = this.sortService.sortDate(pendentesList, 'CreateDate')
this.pendentesstore.reset(pendentesList);
this.skeletonLoader = false;
+1 -1
View File
@@ -1,6 +1,6 @@
<div class="header-container">
<div class="main-tab pb-10 ion-toolbar text-white">
<div class="main-tab pb-10 ion-toolbar header-color">
<div class="mobile d-flex div-top-header justify-space-between">
<div *ngIf="!hideSearchBtn" class="div-search">
@@ -107,9 +107,9 @@ export class DeplomaOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
this.toastService.successMessage()
this.toastService._successMessage()
} catch (error) {
this.toastService.badRequest()
this.toastService._badRequest()
} finally {
loader.remove()
}
@@ -154,9 +154,9 @@ export class DeplomaOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
this.toastService.successMessage()
this.toastService._successMessage()
} catch (error) {
this.toastService.badRequest()
this.toastService._badRequest()
} finally {
loader.remove()
}
@@ -180,9 +180,9 @@ export class DeplomaOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
this.toastService.successMessage()
this.toastService._successMessage()
} catch (error) {
this.toastService.badRequest()
this.toastService._badRequest()
} finally {
loader.remove()
}
@@ -205,9 +205,9 @@ export class DeplomaOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise();
this.toastService.successMessage('Processo concluído')
this.toastService._successMessage('Processo concluído')
} catch (error) {
this.toastService.badRequest()
this.toastService._badRequest()
}
finally {
loader.remove()
@@ -11,7 +11,7 @@ import { ToastService } from 'src/app/services/toast.service';
import { customTask, fullTask } from 'src/app/models/dailyworktask.model';
import { PermissionService } from 'src/app/services/worker/permission.service';
import { ThemeService } from 'src/app/services/theme.service'
import { Location } from '@angular/common'
@Component({
selector: 'app-despachos-options',
@@ -32,7 +32,8 @@ export class DespachosOptionsPage implements OnInit {
private navParams: NavParams,
private toastService: ToastService,
public p: PermissionService,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private location: Location,
) {
this.task = this.navParams.get('task')
this.fulltask = this.navParams.get('fulltask')
@@ -74,12 +75,12 @@ export class DespachosOptionsPage implements OnInit {
sendExpedienteToPending(){
this.popoverController.dismiss();
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
this.toastService.successMessage()
this.toastService._successMessage()
console.log(res);
this.close();
},()=>{
this.toastService.badRequest('Processo não encontrado')
this.toastService._badRequest('Processo não encontrado')
});
}
@@ -143,8 +144,14 @@ export class DespachosOptionsPage implements OnInit {
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then(res=>{
this.goBack();
modal.onDidDismiss().then(res => {
if(res){
const data = res.data;
if(data == 'close') {
this.goBack();
}
}
});
}
@@ -163,10 +170,10 @@ export class DespachosOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService.successMessage()
this.toastService._successMessage()
this.close();
} catch (error) {
this.toastService.badRequest()
this.toastService._badRequest()
} finally {
loader.remove()
}
@@ -244,10 +251,10 @@ export class DespachosOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService.successMessage('Processo arquivado')
this.toastService._successMessage('Processo arquivado')
this.close();
} catch (error) {
this.toastService.badRequest('Processo não arquivado')
this.toastService._badRequest('Processo não arquivado')
} finally {
loader.remove()
}
@@ -272,9 +279,9 @@ export class DespachosOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
this.toastService.successMessage()
this.toastService._successMessage()
} catch(error) {
this.toastService.badRequest()
this.toastService._badRequest()
} finally {
loader.remove()
}
@@ -298,10 +305,10 @@ export class DespachosOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService.successMessage()
this.toastService._successMessage()
this.close();
} catch (error) {
this.toastService.badRequest()
this.toastService._badRequest()
} finally {
loader.remove()
}
@@ -309,7 +316,7 @@ export class DespachosOptionsPage implements OnInit {
}
goBack() {
this.router.navigate(['/home/gabinete-digital/despachos']);
this.location.back();
}
}
@@ -35,7 +35,8 @@ export class DespachosPrOptionsPage implements OnInit {
private toastService: ToastService,
private location: Location,
public p: PermissionService,
public ThemeService: ThemeService
public ThemeService: ThemeService,
) { }
ngOnInit() {
@@ -100,11 +101,11 @@ export class DespachosPrOptionsPage implements OnInit {
sendExpedienteToPending() {
this.processes.SetTaskToPending(this.serialNumber).subscribe(res=>{
console.log(res);
this.toastService.successMessage()
this.toastService._successMessage()
this.popoverController.dismiss('close')
},()=>{
this.toastService.badRequest('Processo não encontrado')
this.toastService._badRequest('Processo não encontrado')
});
}
@@ -174,7 +175,15 @@ export class DespachosPrOptionsPage implements OnInit {
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
modal.onDidDismiss().then(res => {
if(res){
const data = res.data;
if(data == 'close') {
this.goBack();
}
}
});
}
async generateDiploma(note:string, documents:any) {
@@ -192,10 +201,10 @@ export class DespachosPrOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService.successMessage()
this.toastService._successMessage()
this.close();
} catch (error) {
this.toastService.badRequest()
this.toastService._badRequest()
} finally {
loader.remove()
}
@@ -254,6 +263,7 @@ export class DespachosPrOptionsPage implements OnInit {
else if(actionName == 'Concluido') {
await this.concluir(res.data.note, docs);
}
this.goBack();
}
});
@@ -275,10 +285,10 @@ export class DespachosPrOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService.successMessage('')
this.toastService._successMessage('')
this.close();
} catch (error) {
this.toastService.badRequest()
this.toastService._badRequest()
}
finally {
loader.remove()
@@ -363,7 +373,7 @@ export class DespachosPrOptionsPage implements OnInit {
}
goBack() {
this.router.navigate(['/home/gabinete-digital/despachos-pr'])
this.location.back();
}
cancle() {
@@ -142,9 +142,9 @@ export class OptsExpedientePrPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
this.toastService.successMessage()
this.toastService._successMessage()
} catch(error) {
this.toastService.badRequest()
this.toastService._badRequest()
} finally {
loader.remove()
}
@@ -179,10 +179,10 @@ export class OptsExpedientePrPage implements OnInit {
try {
await this.processes.CompleteTask(otherbody).toPromise()
this.toastService.successMessage('Processo descartado');
this.toastService._successMessage('Processo descartado');
this.goBack();
} catch (error) {
this.toastService.badRequest('Processo não descartado')
this.toastService._badRequest('Processo não descartado')
} finally {
loader.remove()
}
@@ -201,7 +201,7 @@ export class OptsExpedientePrPage implements OnInit {
// this.toastService.successMessage('Processo descartado');
this.goBack();
} catch (error) {
this.toastService.badRequest('Processo não descartado');
this.toastService._badRequest('Processo não descartado');
} finally {
loader.remove()
}
@@ -213,10 +213,10 @@ export class OptsExpedientePrPage implements OnInit {
try {
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
this.toastService.successMessage();
this.toastService._successMessage();
this.goBack();
} catch (error) {
this.toastService.badRequest();
this.toastService._badRequest();
} finally {
loader.remove()
}
@@ -242,9 +242,9 @@ export class OptsExpedientePrPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise();
this.close();
this.toastService.successMessage()
this.toastService._successMessage()
} catch(error) {
this.toastService.badRequest()
this.toastService._badRequest()
} finally {
loader.remove()
}
@@ -258,7 +258,7 @@ export class OptsExpedientePrPage implements OnInit {
this.close();
},()=>{
this.toastService.badRequest('Processo não encontrado')
this.toastService._badRequest('Processo não encontrado')
});
}
@@ -295,7 +295,7 @@ export class OptsExpedientePrPage implements OnInit {
// this.toastService.successMessage('Processo descartado');
this.goBack();
} catch (error) {
this.toastService.badRequest('Processo não descartado');
this.toastService._badRequest('Processo não descartado');
} finally {
loader.remove()
}
@@ -166,9 +166,9 @@ export class OptsExpedientePage implements OnInit {
const loader = this.toastService.loading()
this.attachmentsService.AddAttachment(body).subscribe((res)=> {
this.toastService.successMessage()
this.toastService._successMessage()
},()=> {
this.toastService.badRequest()
this.toastService._badRequest()
},()=> {
loader.remove()
});
@@ -243,9 +243,9 @@ export class OptsExpedientePage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
this.toastService.successMessage()
this.toastService._successMessage()
} catch(error) {
this.toastService.badRequest()
this.toastService._badRequest()
} finally {
loader.remove()
}
@@ -257,7 +257,7 @@ export class OptsExpedientePage implements OnInit {
this.goBack();
},()=>{
this.toastService.badRequest('Processo não encontrado')
this.toastService._badRequest('Processo não encontrado')
});
}
@@ -279,9 +279,9 @@ export class OptsExpedientePage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise();
this.close();
this.toastService.successMessage('Processo aprovado')
this.toastService._successMessage('Processo aprovado')
} catch(error) {
this.toastService.badRequest('Processo não aprovado')
this.toastService._badRequest('Processo não aprovado')
} finally {
loader.remove()
}
@@ -337,7 +337,7 @@ export class OptsExpedientePage implements OnInit {
await this.processes.CompleteTask(body).toPromise();
this.goBack();
} catch (error) {
this.toastService.badRequest('Processo não descartado')
this.toastService._badRequest('Processo não descartado')
} finally {
loader.remove()
}
@@ -369,10 +369,10 @@ export class OptsExpedientePage implements OnInit {
try {
await this.expedienteService.discard({SerialNumber: this.task.SerialNumber}).toPromise()
this.toastService.successMessage('Processo descartado');
this.toastService._successMessage('Processo descartado');
this.goBack();
} catch (error) {
this.toastService.badRequest('Processo não descartado')
this.toastService._badRequest('Processo não descartado')
} finally {
loader.remove()
}
@@ -389,10 +389,10 @@ export class OptsExpedientePage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise();
this.toastService.successMessage('Processo descartado');
this.toastService._successMessage('Processo descartado');
this.goBack();
} catch (error) {
this.toastService.badRequest('Processo não descartado')
this.toastService._badRequest('Processo não descartado')
} finally {
loader.remove()
}
@@ -404,10 +404,10 @@ export class OptsExpedientePage implements OnInit {
try {
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
this.toastService.successMessage();
this.toastService._successMessage();
this.goBack();
} catch (error) {
this.toastService.badRequest()
this.toastService._badRequest()
} finally {
loader.remove()
}
@@ -83,11 +83,11 @@ export class RequestOptionsPage implements OnInit {
sendExpedienteToPending() {
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
console.log(res);
this.toastService.successMessage()
this.toastService._successMessage()
this.close();
},()=>{
this.toastService.badRequest('Processo não encontrado')
this.toastService._badRequest('Processo não encontrado')
});
}
@@ -186,9 +186,9 @@ export class RequestOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
this.toastService.successMessage()
this.toastService._successMessage()
} catch (error) {
this.toastService.badRequest()
this.toastService._badRequest()
}
finally {
loader.remove()
@@ -255,9 +255,9 @@ export class RequestOptionsPage implements OnInit {
note
}).toPromise()
this.toastService.successMessage('Processo arquivado')
this.toastService._successMessage('Processo arquivado')
} catch (error) {
this.toastService.badRequest('Processo não arquivado')
this.toastService._badRequest('Processo não arquivado')
} finally {
loader.remove()
}
@@ -202,11 +202,11 @@ export class NewPublicationPage implements OnInit {
try {
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.toastService.successMessage()
this.toastService._successMessage()
this.goBack();
} catch (error) {
this.toastService.badRequest()
this.toastService._badRequest()
} finally {
loader.remove()
}
@@ -230,11 +230,12 @@ export class NewPublicationPage implements OnInit {
try {
console.log(this.publication);
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.toastService.successMessage()
this.toastService._successMessage()
this.goBack();
} catch (error) {
this.toastService.badRequest()
this.toastService._badRequest()
} finally {
loader.remove()
}
@@ -258,11 +259,11 @@ export class NewPublicationPage implements OnInit {
try {
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.toastService.successMessage()
this.toastService._successMessage()
this.goBack();
} catch (error) {
this.toastService.badRequest()
this.toastService._badRequest()
} finally {
loader.remove()
}
@@ -289,11 +290,11 @@ export class NewPublicationPage implements OnInit {
try {
console.log(this.publication);
await this.publications.CreatePublication(this.folderId, this.publication).toPromise()
this.toastService.successMessage()
this.toastService._successMessage()
this.goBackToViewPublications.emit();
} catch (error) {
this.toastService.badRequest()
this.toastService._badRequest()
} finally {
loader.remove()
}
@@ -304,9 +305,11 @@ export class NewPublicationPage implements OnInit {
close(){
this.goBack();
}
clear(){
this.capturedImage = '';
}
setTitle(){
if(this.publicationType == '1') {
this.publicationTitle = 'Nova Publicação Rápida';
@@ -94,10 +94,10 @@ export class PublicationDetailPage implements OnInit {
try {
await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();
this.toastService.successMessage("Publicação eliminado")
this.toastService._successMessage("Publicação eliminado")
this.goBackToViewPublications.emit();
} catch (error) {
this.toastService.badRequest("Publicação não eliminado")
this.toastService._badRequest("Publicação não eliminado")
} finally {
laoder.remove()
}
@@ -1,12 +1,10 @@
<ion-header class="ion-no-border">
<div class="main-header">
<div class="title-content d-flex flex-end">
<!-- <div class="back-icon" (click)="goBack()">
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
</div> -->
<div class="div-title flex-grow-1">
<div *ngIf="item" class="div-title flex-grow-1">
<ion-label class="title">{{item.Description}}</ion-label>
<p class="item-content-detail">{{item.Detail}}</p>
<p class="item-content-date">{{ item.DateBegin | date: 'dd-MM-yy | HH:mm'}}</p>
@@ -34,7 +32,7 @@
<div class="main-container px-20">
<ion-list>
<!-- [routerLink]="['/home/publications/view-publications/publication-detail', publication.publicationId]" -->
<div class="post-item d-md-block mb-10"
<div class="post-item d-md-block mb-10 cursor-pointer"
*ngFor="let publication of publicationListStorage.documents[folderId]"
(click)="viewPublicationDetail(publication.DocumentId)">
<div *ngIf="publication.FileBase64.length > 30" class="mb-10 post-img width-md-100">
@@ -4,7 +4,7 @@ import { Publication } from 'src/app/models/publication';
import { PublicationFolder } from 'src/app/models/publicationfolder';
import { LoadingService } from 'src/app/services/loading.service';
import { PublicationsService } from 'src/app/services/publications.service';
import { PublicationDetailPage } from 'src/app/pages/publications/publication-detail/publication-detail.page';
import { NewPublicationPage } from 'src/app/pages/publications/new-publication/new-publication.page';
import { PublicationListStorage } from 'src/app/store/publication-list.service'
import { PublicationEventFolderStorage } from 'src/app/store/publication-event-folder.service';