This commit is contained in:
tiago.kayaya
2021-06-28 10:49:33 +01:00
parent 989e734b34
commit 2d3f5f0eee
7 changed files with 31 additions and 172 deletions
@@ -54,7 +54,6 @@ export class CreateProcessPage implements OnInit {
taskDate: Date; taskDate: Date;
taskDescription: string; taskDescription: string;
user: string;
loadedAttachments:any; loadedAttachments:any;
subjectTypes:any; subjectTypes:any;
selectedTypes: string[]=[]; selectedTypes: string[]=[];
@@ -91,7 +90,6 @@ export class CreateProcessPage implements OnInit {
private toastService: ToastService, private toastService: ToastService,
) { ) {
this.loggeduser = userAuth.ValidatedUser; this.loggeduser = userAuth.ValidatedUser;
this.user = environment.defaultuser +'@'+ environment.domain;
this.task = this.navParams.get('task'); this.task = this.navParams.get('task');
console.log('task', this.task) console.log('task', this.task)
@@ -180,6 +178,8 @@ export class CreateProcessPage implements OnInit {
} }
let attendees = this.taskParticipants.concat(this.taskParticipantsCc); let attendees = this.taskParticipants.concat(this.taskParticipantsCc);
console.log(attendees);
attendees = attendees.map(function(val) { attendees = attendees.map(function(val) {
return { return {
UserEmail: val.EmailAddress, UserEmail: val.EmailAddress,
@@ -187,6 +187,8 @@ export class CreateProcessPage implements OnInit {
}; };
}); });
console.log(attendees);
const DocumentToSave = this.documents.map((e) => { const DocumentToSave = this.documents.map((e) => {
return { return {
ApplicationId: e.ApplicationType, ApplicationId: e.ApplicationType,
@@ -204,14 +206,14 @@ export class CreateProcessPage implements OnInit {
DistributionType: "Paralelo", DistributionType: "Paralelo",
CountryCode: 'AO', CountryCode: 'AO',
Priority: this.postData.Priority, Priority: this.postData.Priority,
UserEmail: this.user, UserEmail: this.loggeduser.Email,
UsersSelected: attendees, UsersSelected: attendees,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
} }
console.log('this.postData', this.postData, this.taskType); console.log('this.postData', this.postData, this.taskType);
try { try {
await this.processes.postDespatcho(this.postData).toPromise(); //await this.processes.postDespatcho(this.postData).toPromise();
this.FinalizarDespacho('Despacho criado'); this.FinalizarDespacho('Despacho criado');
} catch (error) { } catch (error) {
this.toastService.badRequest('Processo não efectuado'); this.toastService.badRequest('Processo não efectuado');
@@ -223,14 +225,14 @@ export class CreateProcessPage implements OnInit {
DistributionType: "Paralelo", DistributionType: "Paralelo",
CountryCode: 'AO', CountryCode: 'AO',
Priority: this.postData.Priority, Priority: this.postData.Priority,
UserEmail: this.user, UserEmail: this.loggeduser.Email,
UsersSelected: attendees, UsersSelected: attendees,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
} }
console.log(this.postData); console.log(this.postData);
try { try {
await this.processes.postParecer(this.postData).toPromise(); //await this.processes.postParecer(this.postData).toPromise();
this.FinalizarParecer('Pedido de Parecer enviado'); this.FinalizarParecer('Pedido de Parecer enviado');
} }
catch (error) { catch (error) {
@@ -243,7 +245,7 @@ export class CreateProcessPage implements OnInit {
DistributionType: "Paralelo", DistributionType: "Paralelo",
CountryCode: 'AO', CountryCode: 'AO',
Priority: this.postData.Priority, Priority: this.postData.Priority,
UserEmail: this.user, UserEmail: this.loggeduser.Email,
UsersSelected: attendees, UsersSelected: attendees,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
} }
@@ -273,7 +275,7 @@ export class CreateProcessPage implements OnInit {
DistributionType: "Paralelo", DistributionType: "Paralelo",
CountryCode: 'AO', CountryCode: 'AO',
Priority: this.postData.Priority, Priority: this.postData.Priority,
UserEmail: this.user, UserEmail: this.loggeduser.Email,
UsersSelected: attendees, UsersSelected: attendees,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
} }
@@ -292,7 +294,7 @@ export class CreateProcessPage implements OnInit {
DistributionType: "Paralelo", DistributionType: "Paralelo",
CountryCode: 'AO', CountryCode: 'AO',
Priority: this.postData.Priority, Priority: this.postData.Priority,
UserEmail: this.user, UserEmail: this.loggeduser.Email,
UsersSelected: attendees, UsersSelected: attendees,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
} }
@@ -313,7 +315,7 @@ export class CreateProcessPage implements OnInit {
DistributionType: "Paralelo", DistributionType: "Paralelo",
CountryCode: 'AO', CountryCode: 'AO',
Priority: this.postData.Priority, Priority: this.postData.Priority,
UserEmail: this.user, UserEmail: this.loggeduser.Email,
UsersSelected: attendees, UsersSelected: attendees,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
} }
@@ -30,6 +30,7 @@ constructor(
private activatedRoute: ActivatedRoute, private activatedRoute: ActivatedRoute,
) { ) {
this.activatedRoute.queryParams.subscribe(params => { this.activatedRoute.queryParams.subscribe(params => {
console.log('Cria');
if(params['segment'] == 'validar') { if(params['segment'] == 'validar') {
this.segment = 'validar'; this.segment = 'validar';
@@ -42,12 +43,15 @@ constructor(
} }
ngOnInit() { ngOnInit() {
this.LoadList();
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == this.router.url) { if(event instanceof NavigationEnd && event.url == this.router.url) {
console.log('Atualiza');
this.LoadList(); this.LoadList();
} }
}); });
console.log('Init');
this.LoadList();
} }
segmentChanged(ev: any) { segmentChanged(ev: any) {
@@ -60,7 +60,6 @@ export class ExpedientTaskModalPage implements OnInit {
taskDate: Date; taskDate: Date;
taskDescription: string; taskDescription: string;
user: string;
loadedAttachments:any; loadedAttachments:any;
documents:SearchDocument[] = []; documents:SearchDocument[] = [];
@@ -105,7 +104,6 @@ export class ExpedientTaskModalPage implements OnInit {
) { ) {
this.loggeduser = userAuth.ValidatedUser; this.loggeduser = userAuth.ValidatedUser;
this.user = environment.defaultuser +'@'+ environment.domain;
this.task = this.navParams.get('task'); this.task = this.navParams.get('task');
console.log('task', this.task) console.log('task', this.task)
@@ -230,7 +228,7 @@ export class ExpedientTaskModalPage implements OnInit {
DistributionType: "Paralelo", DistributionType: "Paralelo",
CountryCode: 'AO', CountryCode: 'AO',
Priority: this.postData.Priority, Priority: this.postData.Priority,
UserEmail: this.user, UserEmail: this.loggeduser.Email,
UsersSelected: attendees, UsersSelected: attendees,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
AttachmentList: docs, AttachmentList: docs,
@@ -261,7 +259,7 @@ export class ExpedientTaskModalPage implements OnInit {
DistributionType: "Paralelo", DistributionType: "Paralelo",
CountryCode: 'AO', CountryCode: 'AO',
Priority: this.postData.Priority, Priority: this.postData.Priority,
UserEmail: this.user, UserEmail: this.loggeduser.Email,
UsersSelected: attendees, UsersSelected: attendees,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
AttachmentList: docs AttachmentList: docs
@@ -289,7 +287,7 @@ export class ExpedientTaskModalPage implements OnInit {
DistributionType: "Paralelo", DistributionType: "Paralelo",
CountryCode: 'AO', CountryCode: 'AO',
Priority: this.postData.Priority, Priority: this.postData.Priority,
UserEmail: this.user, UserEmail: this.loggeduser.Email,
UsersSelected: attendees, UsersSelected: attendees,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
AttachmentList: docs AttachmentList: docs
@@ -325,7 +323,7 @@ export class ExpedientTaskModalPage implements OnInit {
DistributionType: "Paralelo", DistributionType: "Paralelo",
CountryCode: 'AO', CountryCode: 'AO',
Priority: this.postData.Priority, Priority: this.postData.Priority,
UserEmail: this.user, UserEmail: this.loggeduser.Email,
UsersSelected: attendees, UsersSelected: attendees,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
AttachmentList: docs, AttachmentList: docs,
@@ -356,7 +354,7 @@ export class ExpedientTaskModalPage implements OnInit {
DistributionType: "Paralelo", DistributionType: "Paralelo",
CountryCode: 'AO', CountryCode: 'AO',
Priority: this.postData.Priority, Priority: this.postData.Priority,
UserEmail: this.user, UserEmail: this.loggeduser.Email,
UsersSelected: attendees, UsersSelected: attendees,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
AttachmentList: docs AttachmentList: docs
@@ -150,15 +150,14 @@
<app-empty-container [texto]="emptyTextDescription" *ngIf="showEmptyContainer" class="d-flex height-100 flex-column"></app-empty-container> <app-empty-container [texto]="emptyTextDescription" *ngIf="showEmptyContainer" class="d-flex height-100 flex-column"></app-empty-container>
<app-events-to-approve [profile]="'MDGPR'" *ngIf="showEventsToApprove" class="d-flex height-100 flex-column"></app-events-to-approve> <app-events-to-approve [profile]="'MDGPR'" *ngIf="showEventsToApprove" class="d-flex height-100 flex-column"></app-events-to-approve>
<app-expedients (openExpedientDetail)="openExpedientPage($event)" [profile]="profile" class="d-flex height-100 flex-column" *ngIf="showExpedients"></app-expedients> <app-expedients [profile]="profile" class="d-flex height-100 flex-column" *ngIf="showExpedients"></app-expedients>
<app-expediente (openExpedientList)="openExpedientListPage()" [profile]="profile" [serialNumber]="serialNumber" class="d-flex height-100 flex-column" *ngIf="showExpedientDetail"></app-expediente> <app-pedidos [profile]="profile" [segment]="segment" [serialNumber]="serialNumber" class="d-flex height-100 flex-column" *ngIf="showPedidos"></app-pedidos>
<app-pedidos (openPedido)="openExpedientPage($event)" [profile]="profile" [segment]="segment" [serialNumber]="serialNumber" class="d-flex height-100 flex-column" *ngIf="showPedidos"></app-pedidos> <app-despachos [profile]="profile" class="d-flex height-100 flex-column" *ngIf="showDespachos"></app-despachos>
<app-despachos (openExpedientDetail)="openExpedientPage($event)" [profile]="profile" class="d-flex height-100 flex-column" *ngIf="showDespachos"></app-despachos> <app-despachos-pr [profile]="profile" class="d-flex height-100 flex-column" *ngIf="showDespachosPr"></app-despachos-pr>
<app-despachos-pr (openExpedientDetail)="openExpedientPage($event)" [profile]="profile" class="d-flex height-100 flex-column" *ngIf="showDespachosPr"></app-despachos-pr> <app-pendentes [profile]="profile" class="d-flex height-100 flex-column" *ngIf="showPendentes"></app-pendentes>
<app-pendentes (openExpedientDetail)="openExpedientPage($event)" [profile]="profile" class="d-flex height-100 flex-column" *ngIf="showPendentes"></app-pendentes>
<app-diplomas (openExpedientDetail)="openExpedientesPrPage($event)" [profile]="profile" [segment]="segment" class="d-flex height-100 flex-column" *ngIf="showDiplomas"></app-diplomas> <app-diplomas (openExpedientDetail)="openExpedientesPrPage($event)" [profile]="profile" [segment]="segment" class="d-flex height-100 flex-column" *ngIf="showDiplomas"></app-diplomas>
<app-diplomas-assinar class="d-flex height-100 flex-column" *ngIf="showDiplomasAssinar"></app-diplomas-assinar> <app-diplomas-assinar class="d-flex height-100 flex-column" *ngIf="showDiplomasAssinar"></app-diplomas-assinar>
<app-expedientes-pr (openExpedientDetail)="openExpedientPage($event)" [profile]="profile" class="d-flex height-100 flex-column" *ngIf="showExpedientesPr"></app-expedientes-pr> <app-expedientes-pr [profile]="profile" class="d-flex height-100 flex-column" *ngIf="showExpedientesPr"></app-expedientes-pr>
<app-signed-diploma [profile]="profile" class="d-flex height-100 flex-column" *ngIf="showSignedDiploma"></app-signed-diploma> <app-signed-diploma [profile]="profile" class="d-flex height-100 flex-column" *ngIf="showSignedDiploma"></app-signed-diploma>
</div> </div>
</div> </div>
@@ -334,26 +334,6 @@ export class GabineteDigitalPage implements OnInit {
} }
} }
async openEventsToApproveList(profile:any) {
this.closeAllDesktopComponent();
//if( window.innerWidth <= 1024){
const modal = await this.modalController.create({
component: EventListPage,
componentProps:{
profile: profile,
},
cssClass: 'modal modal-desktop',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
//} else {
//this.desktopComponent.showEventList = true;
//}
}
openExpedientListPage() { openExpedientListPage() {
this.closeAllDesktopComponents(); this.closeAllDesktopComponents();
switch(this.loggeduser.Profile){ switch(this.loggeduser.Profile){
@@ -385,23 +365,9 @@ export class GabineteDigitalPage implements OnInit {
} }
openExpedientPage(data){
console.log(data);
this.closeAllDesktopComponents();
if( window.innerWidth <= 800){
//this.openExpedientList();
}
else{
this.serialNumber = data;
this.showExpedientDetail = true;
}
}
openPedidosPage(segment:string) { openPedidosPage(segment:string) {
this.closeAllDesktopComponents(); this.closeAllDesktopComponents();
if( window.innerWidth <= 800) { if( window.innerWidth <= 800) {
//this.openPedidoList();
let navigationExtras: NavigationExtras; let navigationExtras: NavigationExtras;
@@ -424,7 +390,6 @@ export class GabineteDigitalPage implements OnInit {
openDespachosPage(segment?:string) { openDespachosPage(segment?:string) {
this.closeAllDesktopComponents(); this.closeAllDesktopComponents();
if( window.innerWidth <= 800){ if( window.innerWidth <= 800){
//this.openDespachoList();
this.router.navigate(['/home/gabinete-digital/despachos']); this.router.navigate(['/home/gabinete-digital/despachos']);
} }
else{ else{
@@ -437,7 +402,6 @@ export class GabineteDigitalPage implements OnInit {
openDespachosPrPage(segment?:string) { openDespachosPrPage(segment?:string) {
this.closeAllDesktopComponents(); this.closeAllDesktopComponents();
if( window.innerWidth <= 800){ if( window.innerWidth <= 800){
//this.openDespachoListPr();
this.router.navigate(['/home/gabinete-digital/despachos-pr']); this.router.navigate(['/home/gabinete-digital/despachos-pr']);
} }
else{ else{
@@ -450,7 +414,6 @@ export class GabineteDigitalPage implements OnInit {
openPendentesPage(segment?:string){ openPendentesPage(segment?:string){
this.closeAllDesktopComponents(); this.closeAllDesktopComponents();
if( window.innerWidth <= 800){ if( window.innerWidth <= 800){
//this.openPendenteList();
this.router.navigate(['/home/gabinete-digital/pendentes']); this.router.navigate(['/home/gabinete-digital/pendentes']);
} }
else{ else{
@@ -463,7 +426,6 @@ export class GabineteDigitalPage implements OnInit {
openExpedientesPrPage(segment?:string){ openExpedientesPrPage(segment?:string){
this.closeAllDesktopComponents(); this.closeAllDesktopComponents();
if( window.innerWidth <= 800) { if( window.innerWidth <= 800) {
//this.openExpedientList();
this.router.navigate(['/home/gabinete-digital/expedientes-pr']); this.router.navigate(['/home/gabinete-digital/expedientes-pr']);
} }
else { else {
@@ -479,7 +441,6 @@ export class GabineteDigitalPage implements OnInit {
this.closeAllDesktopComponents(); this.closeAllDesktopComponents();
if( window.innerWidth <= 800){ if( window.innerWidth <= 800){
//this.openDeploma();
let navigationExtras: NavigationExtras = { queryParams: {"segment": segment}}; let navigationExtras: NavigationExtras = { queryParams: {"segment": segment}};
this.router.navigate(['/home/gabinete-digital/diplomas'], navigationExtras); this.router.navigate(['/home/gabinete-digital/diplomas'], navigationExtras);
} }
@@ -496,7 +457,6 @@ export class GabineteDigitalPage implements OnInit {
if (this.loggeduser.Profile == 'MDGPR') { if (this.loggeduser.Profile == 'MDGPR') {
if( window.innerWidth <= 800){ if( window.innerWidth <= 800){
//this.openDeploma();
let navigationExtras: NavigationExtras = { queryParams: {"segment": 'assinados',}}; let navigationExtras: NavigationExtras = { queryParams: {"segment": 'assinados',}};
this.router.navigate(['/home/gabinete-digital/diplomas'], navigationExtras); this.router.navigate(['/home/gabinete-digital/diplomas'], navigationExtras);
} }
@@ -507,7 +467,6 @@ export class GabineteDigitalPage implements OnInit {
} }
} else { } else {
if( window.innerWidth <= 800){ if( window.innerWidth <= 800){
//this.openDeploma();
let navigationExtras: NavigationExtras = { queryParams: {"segment": 'assinados',}}; let navigationExtras: NavigationExtras = { queryParams: {"segment": 'assinados',}};
this.router.navigate(['/home/gabinete-digital/diplomas-assinar'], navigationExtras); this.router.navigate(['/home/gabinete-digital/diplomas-assinar'], navigationExtras);
} }
@@ -517,109 +476,6 @@ export class GabineteDigitalPage implements OnInit {
this.showDiplomasAssinar = true; this.showDiplomasAssinar = true;
} }
} }
}
openSignedDiploma(segment:string) {
this.closeAllDesktopComponents();
if( window.innerWidth <= 800){
this.openDeploma();
}
else{
this.segment = segment;
this.showSignedDiploma = true;
}
}
async openDeploma() {
const modal = await this.modalController.create({
component: DiplomasPage,
componentProps:{
profile: this.profile,
},
cssClass: 'modal modal-desktop',
//backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
}
async openExpedientList(){
this.closeAllDesktopComponent();
//if( window.innerWidth <= 1024){
const modal = await this.modalController.create({
component: ExpedientePage,
componentProps: {
profile: this.profile,
},
cssClass: 'modal modal-desktop',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
//} else {
console.log('show desktop modal')
//this.desktopComponent.showExpediente = true;
//}
}
/* async openPendenteList(){
this.closeAllDesktopComponent();
const modal = await this.modalController.create({
component: PendentesPage,
componentProps:{
profile: this.profile,
},
cssClass: 'modal modal-desktop',
});
await modal.present();
modal.onDidDismiss();
console.log('show desktop modal')
} */
async openDespachoList(){
this.closeAllDesktopComponent();
const modal = await this.modalController.create({
component: DespachosPage,
componentProps:{
profile: this.profile,
serialNumber: this.serialNumber
},
cssClass: 'modal modal-desktop',
});
await modal.present();
modal.onDidDismiss();
console.log('show desktop modal')
}
async openDespachoListPr(){
this.closeAllDesktopComponent();
const modal = await this.modalController.create({
component: DespachosPrPage,
componentProps:{
profile: this.profile,
},
cssClass: 'modal modal-desktop',
});
await modal.present();
modal.onDidDismiss();
console.log('show desktop modal')
}
async openPedidoList(){
this.closeAllDesktopComponent();
const modal = await this.modalController.create({
component: PedidosPage,
componentProps:{
profile: this.profile,
},
cssClass: 'modal modal-desktop',
});
await modal.present();
modal.onDidDismiss();
console.log('show desktop modal')
} }
} }
@@ -18,7 +18,7 @@
</ion-refresher-content> </ion-refresher-content>
</ion-refresher> </ion-refresher>
<div class="width-100 overflow-y-auto height-100" *ngIf="taskslist.length >= 1"> <div class="width-100 overflow-y-auto height-100" *ngIf="taskslist">
<ion-list> <ion-list>
<ion-item <ion-item
class="expediente ion-no-padding cursor-pointer" class="expediente ion-no-padding cursor-pointer"
@@ -29,7 +29,7 @@
</ion-refresher> </ion-refresher>
<div class="width-100" [ngSwitch]="segment"> <div class="width-100" [ngSwitch]="segment">
<div *ngIf="parecerList.length >= 1" class="overflow-y-auto height-100"> <div *ngIf="parecerList" class="overflow-y-auto height-100">
<ion-list *ngSwitchCase="'parecer'"> <ion-list *ngSwitchCase="'parecer'">
<!-- *ngFor = "let task of parecerList; let i = index" <!-- *ngFor = "let task of parecerList; let i = index"
(click)="viewExpedientDetail(task.SerialNumber)" --> (click)="viewExpedientDetail(task.SerialNumber)" -->
@@ -64,7 +64,7 @@
</ion-list> </ion-list>
</div> </div>
<div *ngIf="deferimentoList.length >= 1" class="overflow-y-auto height-100"> <div *ngIf="deferimentoList" class="overflow-y-auto height-100">
<ion-list *ngSwitchCase="'deferimento'"> <ion-list *ngSwitchCase="'deferimento'">
<ion-item <ion-item
class="expediente ion-no-padding cursor-pointer" class="expediente ion-no-padding cursor-pointer"