Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into developer

This commit is contained in:
Peter Maquiran
2021-07-01 11:27:14 +01:00
18 changed files with 124 additions and 171 deletions
+26
View File
@@ -154,6 +154,32 @@ const routes: Routes = [
}, },
] ]
}, },
{
path: 'despachos',
children: [
{
path: '',
loadChildren: ()=> import('../pages/gabinete-digital/despachos/despachos.module').then(m => m.DespachosPageModule),
},
{
path:':SerialNumber/:caller',
loadChildren: ()=> import('../pages/gabinete-digital/despachos/despacho/despacho.module').then(m => m.DespachoPageModule),
},
]
},
{
path: 'pedidos',
children: [
{
path: '',
loadChildren: ()=> import('../pages/gabinete-digital/pedidos/pedidos.module').then(m => m.PedidosPageModule),
},
{
path:':SerialNumber/:caller',
loadChildren: ()=> import('../pages/gabinete-digital/pedidos/pedido/pedido.module').then(m => m.PedidoPageModule),
},
]
},
{ {
path:'event-list', path:'event-list',
children: [ children: [
+1 -1
View File
@@ -1,5 +1,5 @@
export class PublicationFolder { export class PublicationFolder {
ProcessId: number; ProcessId: string;
Description: string; Description: string;
Detail: string; Detail: string;
DateBegin: string; DateBegin: string;
@@ -39,6 +39,7 @@ export class DespachoPage implements OnInit {
fulltask: any; fulltask: any;
eventsList: Event[] = []; eventsList: Event[] = [];
serialnumber: string; serialnumber: string;
caller:string;
profile: string; profile: string;
intervenientes: any; intervenientes: any;
cc: any = []; cc: any = [];
@@ -58,11 +59,16 @@ export class DespachoPage implements OnInit {
private toastService: ToastService, private toastService: ToastService,
) { ) {
this.activatedRoute.queryParams.subscribe(params => { this.activatedRoute.paramMap.subscribe(params => {
if(params["serialNumber"]) { console.log(params["params"]);
this.serialnumber = params["serialNumber"];
console.log(params["serialNumber"]); if(params["params"].SerialNumber) {
this.serialnumber = params["params"].SerialNumber;
} }
if(params["params"].caller) {
this.caller = params["params"].caller;
}
}); });
} }
@@ -88,15 +94,30 @@ export class DespachoPage implements OnInit {
} }
goBack() { goBack() {
if (window.innerWidth <= 800) { if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){
this.router.navigate(['/home/gabinete-digital/despachos']); if (window.innerWidth <= 800) {
} else { this.router.navigate(['/home/gabinete-digital/pendentes']);
let navigationExtras: NavigationExtras = { }
queryParams: { else {
'despachos': true let navigationExtras: NavigationExtras = {
} queryParams: {
"pendentes": true,
}
}
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
}
else{
if (window.innerWidth <= 800) {
this.router.navigate(['/home/gabinete-digital/despachos']);
} else {
let navigationExtras: NavigationExtras = {
queryParams: {
'despachos': true
}
}
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
} }
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
} }
} }
@@ -117,6 +138,7 @@ export class DespachoPage implements OnInit {
"WorkflowName": res.workflowDisplayName, "WorkflowName": res.workflowDisplayName,
"DeadlineType": res.workflowInstanceDataFields.DeadlineType, "DeadlineType": res.workflowInstanceDataFields.DeadlineType,
"activityInstanceName": res.activityInstanceName, "activityInstanceName": res.activityInstanceName,
"Status": res.workflowInstanceDataFields.Status,
} }
this.fulltask = res; this.fulltask = res;
console.log(this.task); console.log(this.task);
@@ -267,6 +289,8 @@ export class DespachoPage implements OnInit {
} }
async sendExpedienteToPending() { async sendExpedienteToPending() {
console.log(this.serialnumber);
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{ this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
console.log(res); console.log(res);
this.close(); this.close();
@@ -33,7 +33,7 @@
<ion-item <ion-item
class="expediente ion-no-padding cursor-pointer" class="expediente ion-no-padding cursor-pointer"
*ngFor = "let task of despachoList; let i = index" *ngFor = "let task of despachoList; let i = index"
(click)="viewExpedientDetail(task.SerialNumber)" (click)="GoToDespacho(task.SerialNumber)"
> >
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" --> <!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
<div class="item width-100"> <div class="item width-100">
@@ -146,16 +146,8 @@ export class DespachosPage implements OnInit {
}, 2000); }, 2000);
} }
async viewExpedientDetail(serialNumber:any) { async GoToDespacho(serialNumber:any) {
this.router.navigate(['/home/gabinete-digital/despachos',serialNumber,'gabinete-digital']);
let navigationExtras: NavigationExtras = {
queryParams: {
"serialNumber": serialNumber,
}
};
this.router.navigate(['/home/gabinete-digital/despachos/despacho'], navigationExtras);
} }
docIndex(index: number) { docIndex(index: number) {
@@ -58,14 +58,18 @@ export class PedidoPage implements OnInit {
private animationController: AnimationController, private animationController: AnimationController,
private toastService: ToastService,) { private toastService: ToastService,) {
this.loggeduser = authService.ValidatedUser; this.loggeduser = authService.ValidatedUser;
this.activatedRoute.queryParams.subscribe(params => {
if(params["serialNumber"]) { this.activatedRoute.paramMap.subscribe(params => {
this.serialnumber = params["serialNumber"]; console.log(params["params"]);
}
if(params["caller"]) { if(params["params"].SerialNumber) {
this.caller = params["caller"]; this.serialnumber = params["params"].SerialNumber;
} }
}); if(params["params"].caller) {
this.caller = params["params"].caller;
}
});
} }
ngOnInit() { ngOnInit() {
@@ -81,12 +81,7 @@ export class PedidosPage implements OnInit {
} }
goToPedido(serialNumber:any){ goToPedido(serialNumber:any){
let navigationExtras: NavigationExtras = { this.router.navigate(['/home/gabinete-digital/pedidos',serialNumber,'gabinete-digital']);
queryParams: {
"serialNumber": serialNumber,
}
};
this.router.navigate(['/home/gabinete-digital/pedidos/pedido'], navigationExtras);
} }
notImplemented(){ notImplemented(){
@@ -129,78 +129,17 @@ export class PendentesPage implements OnInit {
async viewTaskDetails(serialNumber:string, workflowName:string) { async viewTaskDetails(serialNumber:string, workflowName:string) {
if(workflowName == 'Despacho'){ if(workflowName == 'Despacho'){
this.goToDespacho(serialNumber); this.router.navigate(['/home/gabinete-digital/despachos',serialNumber,'gabinete-digital']);
} }
else if(workflowName == 'Pedido de Parecer' || workflowName == 'Pedido de Deferimento'){ else if(workflowName == 'Pedido de Parecer' || workflowName == 'Pedido de Deferimento'){
this.goToPedido(serialNumber); this.router.navigate(['/home/gabinete-digital/pedidos',serialNumber,'gabinete-digital']);
} }
else if(workflowName == 'Expediente'){ else if(workflowName == 'Expediente'){
this.goToExpediente(serialNumber); this.router.navigate(['/home/gabinete-digital/expediente',serialNumber,'gabinete-digital']);
} }
} }
goToDespacho(serialNumber:any){
let navigationExtras: NavigationExtras = {
queryParams: {
"serialNumber": serialNumber,
"from": "pendentes"
}
};
this.router.navigate(['/home/gabinete-digital/despachos/despacho'], navigationExtras);
}
goToPedido(serialNumber:any) {
let navigationExtras: NavigationExtras = {
queryParams: {
"serialNumber": serialNumber,
"from": "pendentes"
}
};
this.router.navigate(['/home/gabinete-digital/pedidos/pedido'], navigationExtras);
}
goToExpediente(serialNumber:any){
this.router.navigate(['/home/gabinete-digital/expediente',serialNumber,'gabinete-digital']);
}
async openDespacho(serialNumber:string){
const modal = await this.modalController.create({
component: DespachoPage,
componentProps:{
enterAnimation: "",
serialNumber: serialNumber,
profile: this.profile,
},
cssClass: 'modal modal-desktop',
});
await modal.present();
modal.onDidDismiss().then((res)=>{
console.log('refresh list');
this.LoadList();
});
}
async openPedido(serialNumber:string){
const modal = await this.modalController.create({
component: PedidoPage,
componentProps:{
enterAnimation: "",
serialNumber: serialNumber,
profile: this.profile,
},
cssClass: 'modal modal-desktop',
});
await modal.present();
modal.onDidDismiss().then((res)=>{
console.log('refresh list');
this.LoadList();
});
}
} }
@@ -124,6 +124,7 @@
<app-edit-action <app-edit-action
*ngIf="desktopComponent.showEditActions" *ngIf="desktopComponent.showEditActions"
[folderId]="folderId"
class="height-100 d-flex flex-column overflow-hidden background-white flex-grow-1" class="height-100 d-flex flex-column overflow-hidden background-white flex-grow-1"
(closeDesktopComponent)="closeDesktopComponent($event)" (closeDesktopComponent)="closeDesktopComponent($event)"
> >
@@ -280,6 +280,7 @@ export class PublicationsPage implements OnInit {
} }
async openOptions(id?: string) { async openOptions(id?: string) {
this.folderId = id;
const enterAnimation = (baseEl: any) => { const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create() const backdropAnimation = this.animationController.create()
.addElement(baseEl.querySelector('ion-backdrop')!) .addElement(baseEl.querySelector('ion-backdrop')!)
@@ -66,7 +66,7 @@ export class ViewPublicationsPage implements OnInit {
} }
getPublicationDetail(){ getPublicationDetail(){
this.publications.PresidentialAction(this.folderId).subscribe(res=>{ this.publications.GetPresidentialAction(this.folderId).subscribe(res=>{
console.log(res); console.log(res);
this.item = res; this.item = res;
}); });
+10 -1
View File
@@ -29,7 +29,7 @@ export class PublicationsService {
return this.http.get<any>(`${geturl}`, options); return this.http.get<any>(`${geturl}`, options);
} }
PresidentialAction(id:any){ GetPresidentialAction(id:any){
const geturl = environment.apiURL + 'presidentialActions/'+id; const geturl = environment.apiURL + 'presidentialActions/'+id;
let options = { let options = {
@@ -38,6 +38,15 @@ export class PublicationsService {
return this.http.get<any>(`${geturl}`, options); return this.http.get<any>(`${geturl}`, options);
} }
UpdatePresidentialAction(body:any){
const geturl = environment.apiURL + 'presidentialActions';
let options = {
headers: this.headers,
};
return this.http.put<any>(`${geturl}`, body, options);
}
CreatePublicationFolder(body:any){ CreatePublicationFolder(body:any){
const geturl = environment.apiURL + 'presidentialActions'; const geturl = environment.apiURL + 'presidentialActions';
let options = { let options = {
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams, PopoverController } from '@ionic/angular'; import { ModalController, NavParams } from '@ionic/angular';
import { PublicationsService } from 'src/app/services/publications.service'; import { PublicationsService } from 'src/app/services/publications.service';
@Component({ @Component({
@@ -12,7 +12,6 @@ export class ActionsOptionsPage implements OnInit {
id:string; id:string;
constructor( constructor(
private popoverController: PopoverController,
private modalController: ModalController, private modalController: ModalController,
private navParams: NavParams, private navParams: NavParams,
private publicationsService: PublicationsService, private publicationsService: PublicationsService,
@@ -21,8 +20,6 @@ export class ActionsOptionsPage implements OnInit {
} }
ngOnInit() { ngOnInit() {
console.log(this.id);
} }
close () { close () {
@@ -1,20 +1,10 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
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 { ActivatedRoute, NavigationExtras, Router } from '@angular/router'; import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { formatDate } from '@angular/common'; import { AnimationController, ModalController, NavParams, PopoverController } from '@ionic/angular';
import { AnimationController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service';
import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
import { momentG } from 'src/plugin/momentG'
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page'; import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
import { DelegarPage } from 'src/app/modals/delegar/delegar.page'; import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page';
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page'; import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page'; import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
@@ -30,45 +20,26 @@ export class DespachosOptionsPage implements OnInit {
task: any; task: any;
fulltask: any; fulltask: any;
serialnumber: string; serialnumber: string;
profile: string
constructor(private activateRoute: ActivatedRoute, constructor(private activateRoute: ActivatedRoute,
private processes: ProcessesService, private processes: ProcessesService,
private iab: InAppBrowser,
private attachmentsService: AttachmentsService,
private events: EventsService,
private menu: MenuController,
private router: Router, private router: Router,
private modalController: ModalController, private modalController: ModalController,
private alertService: AlertService,
public popoverController: PopoverController, public popoverController: PopoverController,
private activatedRoute: ActivatedRoute,
private animationController: AnimationController, private animationController: AnimationController,
private navParams: NavParams, private navParams: NavParams,
private toastService: ToastService) { private toastService: ToastService) {
this.task = this.navParams.get('task') this.task = this.navParams.get('task')
this.fulltask = this.navParams.get('fulltask') this.fulltask = this.navParams.get('fulltask')
} }
ngOnInit() { ngOnInit() {
this.profile = "mdgpr";
this.activatedRoute.queryParams.subscribe(params => {
if(params["serialNumber"]) {
this.serialnumber = params["serialNumber"];
console.log(params["serialNumber"]);
}
});
} }
close () { close () {
this.goBack() this.goBack()
} }
async openExpedientActionsModal(taskAction: any, task: any) { async openExpedientActionsModal(taskAction: any, task: any) {
this.popoverController.dismiss(); this.popoverController.dismiss();
let classs; let classs;
@@ -82,7 +53,6 @@ export class DespachosOptionsPage implements OnInit {
componentProps: { componentProps: {
taskAction: taskAction, taskAction: taskAction,
task: task, task: task,
profile: this.profile,
}, },
cssClass: classs, cssClass: classs,
}); });
@@ -91,16 +61,14 @@ export class DespachosOptionsPage implements OnInit {
console.log(res['data']); console.log(res['data']);
if(res['data']=='openDiscart'){ if(res['data']=='openDiscart'){
console.log('open discart'); console.log('open discart');
this.distartExpedientModal(); this.distartExpedientModal();
} }
}); });
} }
sendExpedienteToPending(){ sendExpedienteToPending(){
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{ this.popoverController.dismiss();
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
console.log(res); console.log(res);
this.close(); this.close();
}); });
@@ -124,11 +92,7 @@ export class DespachosOptionsPage implements OnInit {
modal.onDidDismiss().then(res=>{ modal.onDidDismiss().then(res=>{
if(res['data']=='close'){ if(res['data']=='close'){
this.close(); this.close();
/* console.log('2Expedient Discard closed2');
this.close();
this.openMenu(); */
} }
}); });
} }
@@ -310,7 +274,6 @@ export class DespachosOptionsPage implements OnInit {
} }
goBack() { goBack() {
let navigationExtras: NavigationExtras = { let navigationExtras: NavigationExtras = {
@@ -82,14 +82,14 @@
<ion-footer class="ion-no-border"> <ion-footer class="ion-no-border">
<ion-toolbar class="footer-toolbar width-100 justify-space-between d-flex px-20"> <ion-toolbar class="footer-toolbar width-100 justify-space-between d-flex px-20">
<ion-buttons slot="start"> <ion-buttons slot="start">
<ion-button class="btn-cancel" fill="clear" color="#061b52" (click)="close()"> <button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<ion-label>Cancelar</ion-label> <ion-label>Cancelar</ion-label>
</ion-button> </button>
</ion-buttons> </ion-buttons>
<ion-buttons slot="end"> <ion-buttons slot="end">
<ion-button class="btn-ok" fill="clear" color="#fff" (click)="save()"> <button class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Criar</ion-label> <ion-label>Gravar</ion-label>
</ion-button> </button>
</ion-buttons> </ion-buttons>
</ion-toolbar> </ion-toolbar>
</ion-footer> </ion-footer>
@@ -62,14 +62,13 @@
padding: 0 !important; padding: 0 !important;
} }
.div-title{ .div-title{
width: 180px; width: fit-content;
/* padding: 0!important; */ float: left;
float: left; margin: 2.5px 0 0 5px;
margin: 2.5px 0 0 5px;
} }
.title{ .title{
font-size: 25px; font-size: 25px;
} }
.container-div{ .container-div{
margin-bottom: 15px; margin-bottom: 15px;
overflow: auto; overflow: auto;
@@ -1,6 +1,7 @@
import { Component, EventEmitter, OnInit, Output } from '@angular/core'; import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { PublicationFolder } from 'src/app/models/publicationfolder'; import { PublicationFolder } from 'src/app/models/publicationfolder';
import { PublicationsService } from 'src/app/services/publications.service'; import { PublicationsService } from 'src/app/services/publications.service';
import { ToastService } from 'src/app/services/toast.service';
@Component({ @Component({
selector: 'app-edit-action', selector: 'app-edit-action',
@@ -9,47 +10,49 @@ import { PublicationsService } from 'src/app/services/publications.service';
}) })
export class EditActionPage implements OnInit { export class EditActionPage implements OnInit {
folderId:string;
folder: PublicationFolder; folder: PublicationFolder;
@Input() folderId: string;
@Output() closeDesktopComponent= new EventEmitter<any>(); @Output() closeDesktopComponent= new EventEmitter<any>();
constructor( constructor(
private publicationsService: PublicationsService, private publicationsService: PublicationsService,
private toastService: ToastService,
) { ) {
this.folder = new PublicationFolder(); this.folder = new PublicationFolder();
} }
ngOnInit() { ngOnInit() {
this.getPublicationDetail();
} }
close(){ close(){
this.closeDesktopComponent.emit(); this.closeDesktopComponent.emit();
} }
getPublicationDetail() { getPublicationDetail(){
this.publicationsService.PresidentialAction(this.folderId).subscribe(res=>{ this.publicationsService.GetPresidentialAction(this.folderId).subscribe(res=>{
console.log(res); this.folder = res;
}); });
} }
save(){ async save(){
/* this.folder = { let body = {
ProcessId: null, ProcessId: this.folderId,
Description: this.folder.Description, Description: this.folder.Description,
Detail: this.folder.Detail, Detail: this.folder.Detail,
DateBegin: this.folder.DateBegin, DateBegin: this.folder.DateBegin,
DateEnd: this.folder.DateEnd, DateEnd: this.folder.DateEnd,
ActionType: this.segment, ActionType: this.folder.ActionType,
} }
console.log(this.folder); console.log(body);
try { try {
await this.publication.CreatePublicationFolder(this.folder).toPromise() await this.publicationsService.UpdatePresidentialAction(body).toPromise()
this.close(); this.close();
this.toastService.successMessage('Acção presidencial criada') this.toastService.successMessage('Acção presidencial criada')
} catch (error) { } catch (error) {
this.toastService.badRequest('Não foi possivel criar a acção presidencial') this.toastService.badRequest('Não foi possivel criar a acção presidencial')
} */ }
} }
@@ -65,7 +65,7 @@ export class ViewPublicationsPage implements OnInit {
} }
getPublicationDetail() { getPublicationDetail() {
this.publications.PresidentialAction(this.folderId).subscribe(res=>{ this.publications.GetPresidentialAction(this.folderId).subscribe(res=>{
console.log(res); console.log(res);
this.item = res; this.item = res;
}); });