mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
test-1
This commit is contained in:
@@ -273,14 +273,13 @@ export class DespachoService {
|
||||
|
||||
let despachosPr;
|
||||
let despachos = this.sortService.sortArrayByDate(result);
|
||||
switch (SessionStore.user.Profile) {
|
||||
case 'MDGPR':
|
||||
despachosPr = despachos.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||
break;
|
||||
case 'PR':
|
||||
despachosPr = despachos.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
||||
break;
|
||||
|
||||
if(SessionStore.user.Profile != 'PR') {
|
||||
despachosPr = despachos.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||
} else if(SessionStore.user.Profile == 'PR') {
|
||||
despachosPr = despachos.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* sortArrayISODate(myArray: any) {
|
||||
|
||||
@@ -370,7 +370,7 @@ export class CreateProcessPage implements OnInit {
|
||||
} catch (error) {
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
} finally {
|
||||
//loader.remove();
|
||||
loader.remove();
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
||||
@@ -122,13 +122,11 @@ export class DespachosPrPage implements OnInit {
|
||||
|
||||
let despachosPr;
|
||||
let despachos = this.sortService.sortArrayByDate(result);
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
despachosPr = await despachos.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||
break;
|
||||
case 'PR':
|
||||
despachosPr = await despachos.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
||||
break;
|
||||
|
||||
if(this.loggeduser.Profile != "PR") {
|
||||
despachosPr = await despachos.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||
} else if (this.loggeduser.Profile == "PR") {
|
||||
despachosPr = await despachos.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
||||
}
|
||||
|
||||
|
||||
@@ -174,15 +172,11 @@ export class DespachosPrPage implements OnInit {
|
||||
|
||||
|
||||
let despachosPr;
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
despachosPr = await process.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||
break;
|
||||
case 'PR':
|
||||
|
||||
|
||||
despachosPr = await process.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
||||
break;
|
||||
if(this.loggeduser.Profile != 'PR') {
|
||||
despachosPr = await process.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||
} else if (this.loggeduser.Profile == 'PR') {
|
||||
despachosPr = await process.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
||||
}
|
||||
|
||||
despachosPr = despachosPr.filter(data => JSON.parse(data.workflowInstanceDataFields).Status == "Active");
|
||||
|
||||
+195
-9
@@ -298,8 +298,196 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
this.dispatchFolder.SubjectTypes = this.selectedTypes;
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
// switch (this.loggeduser.Profile) {
|
||||
// case 'MDGPR':
|
||||
// if(this.taskParticipants.length > 0) {
|
||||
// switch (this.taskType) {
|
||||
// case '0': // Despacho
|
||||
// this.postData = {
|
||||
// DistributionType: "Paralelo",
|
||||
// CountryCode: 'AO',
|
||||
// Priority: this.postData.Priority,
|
||||
// UserEmail: this.loggeduser.Email,
|
||||
// UsersSelected: attendees,
|
||||
// DispatchFolder: this.dispatchFolder,
|
||||
// AttachmentList: docs,
|
||||
// }
|
||||
|
||||
// let action_despacho = {
|
||||
// "serialNumber": this.task.serialNumber,
|
||||
// "action": "Tratado",
|
||||
// "ActionTypeId": 94,
|
||||
// "dataFields": {
|
||||
// "Note": "",
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// try {
|
||||
|
||||
// this.taskResult = await this.processes.postDespatcho(this.postData).toPromise();
|
||||
// await this.toastService._successMessage('Processo efetuado');
|
||||
// this.modalController.dismiss(action_despacho);
|
||||
|
||||
// } catch (error) {
|
||||
// await this.toastService._badRequest('Processo não efetuado')
|
||||
// } finally {
|
||||
// loader.remove()
|
||||
// }
|
||||
|
||||
|
||||
// break;
|
||||
|
||||
// case '1': // Parecer
|
||||
// this.postData = {
|
||||
// DistributionType: "Paralelo",
|
||||
// CountryCode: 'AO',
|
||||
// Priority: this.postData.Priority,
|
||||
// UserEmail: this.loggeduser.Email,
|
||||
// UsersSelected: attendees,
|
||||
// DispatchFolder: this.dispatchFolder,
|
||||
// AttachmentList: docs
|
||||
// }
|
||||
|
||||
// let action_parecer = {
|
||||
// "serialNumber": this.task.serialNumber,
|
||||
// "action": "Tratado",
|
||||
// "ActionTypeId": 92,
|
||||
// "dataFields": {
|
||||
// "Note": "",
|
||||
// }
|
||||
// }
|
||||
|
||||
// try {
|
||||
// this.taskResult = await this.processes.postParecer(this.postData).toPromise();
|
||||
// await this.toastService._successMessage('Pedido enviado');
|
||||
// this.modalController.dismiss(action_parecer);
|
||||
|
||||
// } catch (error) {
|
||||
// await this.toastService._badRequest('Processo não efetuado')
|
||||
// } finally {
|
||||
// loader.remove()
|
||||
// }
|
||||
// break;
|
||||
// case '2': // Deferimento
|
||||
// this.postData = {
|
||||
// DistributionType: "Paralelo",
|
||||
// CountryCode: 'AO',
|
||||
// Priority: this.postData.Priority,
|
||||
// UserEmail: this.loggeduser.Email,
|
||||
// UsersSelected: attendees,
|
||||
// DispatchFolder: this.dispatchFolder,
|
||||
// AttachmentList: docs
|
||||
// }
|
||||
// //
|
||||
// let action_deferimento = {
|
||||
// "serialNumber": this.task.serialNumber,
|
||||
// "action": "Tratado",
|
||||
// "ActionTypeId": 93,
|
||||
// "dataFields": {
|
||||
// "Note": "",
|
||||
// }
|
||||
// }
|
||||
|
||||
// try {
|
||||
|
||||
// this.taskResult = await this.processes.postDeferimento(this.postData).toPromise();
|
||||
// this.toastService._successMessage('Processo efetuado');
|
||||
// this.modalController.dismiss(action_deferimento);
|
||||
// } catch (error) {
|
||||
// await this.toastService._badRequest('Processo não efetuado')
|
||||
// } finally {
|
||||
// loader.remove()
|
||||
// }
|
||||
|
||||
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// this.alertController.presentAlert("Lista de i-ntervenientes vazia. Por favor, adicione 1 ou mais intervenientes.");
|
||||
// }
|
||||
// break;
|
||||
// case 'PR':
|
||||
// switch (this.taskType) {
|
||||
// case '0': // despacho
|
||||
// this.postData = {
|
||||
// DistributionType: "Paralelo",
|
||||
// CountryCode: 'AO',
|
||||
// Priority: this.postData.Priority,
|
||||
// UserEmail: this.loggeduser.Email,
|
||||
// UsersSelected: attendees,
|
||||
// DispatchFolder: this.dispatchFolder,
|
||||
// AttachmentList: docs,
|
||||
// }
|
||||
|
||||
|
||||
// let action_despacho_pr = {
|
||||
// "serialNumber": this.task.serialNumber,
|
||||
// "action": "Tratado",
|
||||
// "ActionTypeId": 99999881 ,
|
||||
// "dataFields": {
|
||||
// "Note": "",
|
||||
// }
|
||||
// }
|
||||
|
||||
// if(this.postData.DispatchFolder.Message){
|
||||
// try {
|
||||
// this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
|
||||
// await this.toastService._successMessage('Processo efetuado');
|
||||
// this.modalController.dismiss(action_despacho_pr);
|
||||
// } catch (error) {
|
||||
|
||||
// await this.toastService._badRequest('Processo não efetuado')
|
||||
// } finally {
|
||||
// //loader.remove()
|
||||
// }
|
||||
// }
|
||||
// else{
|
||||
// this.validateField = true;
|
||||
// this.toastService._badRequest('Por favor adicione uma descrição');
|
||||
// }
|
||||
// loader.remove();
|
||||
// break;
|
||||
|
||||
// case '1': // parecer
|
||||
// this.postData = {
|
||||
// DistributionType: "Paralelo",
|
||||
// CountryCode: 'AO',
|
||||
// Priority: this.postData.Priority,
|
||||
// UserEmail: this.loggeduser.Email,
|
||||
// UsersSelected: attendees,
|
||||
// DispatchFolder: this.dispatchFolder,
|
||||
// AttachmentList: docs
|
||||
// }
|
||||
|
||||
// let action_parecer_pr = {
|
||||
// "serialNumber": this.task.serialNumber,
|
||||
// "action": "Tratado",
|
||||
// "ActionTypeId": 99999881,
|
||||
// "dataFields": {
|
||||
// "Note": "",
|
||||
// }
|
||||
// }
|
||||
|
||||
// try {
|
||||
// this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
|
||||
// await this.toastService._successMessage('Pedido enviado');
|
||||
// this.modalController.dismiss(action_parecer_pr);
|
||||
// } catch (error) {
|
||||
|
||||
// await this.toastService._badRequest('Processo não efetuado')
|
||||
// } finally {
|
||||
// loader.remove()
|
||||
// }
|
||||
|
||||
// break;
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
|
||||
if(this.loggeduser.Profile != 'PR') {
|
||||
if(this.taskParticipants.length > 0) {
|
||||
switch (this.taskType) {
|
||||
case '0': // Despacho
|
||||
@@ -405,11 +593,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.alertController.presentAlert("Lista de i-ntervenientes vazia. Por favor, adicione 1 ou mais intervenientes.");
|
||||
}
|
||||
break;
|
||||
case 'PR':
|
||||
} else if (this.loggeduser.Profile == 'PR') {
|
||||
switch (this.taskType) {
|
||||
case '0': // despacho
|
||||
this.postData = {
|
||||
@@ -484,9 +668,11 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
getAttachments() {
|
||||
this.attachmentsService.getAttachmentsBySerial(this.task.serialNumber).subscribe(res=>{
|
||||
|
||||
@@ -615,17 +615,14 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
let despachospr = await this.processesbackend.GetTasksList("Despacho do Presidente da República", false).toPromise();
|
||||
let despachosPr;
|
||||
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
despachosPr = despachospr.filter(data => data.activityInstanceName == "Tarefa de Despacho").filter(data => data.workflowInstanceDataFields.Status == "Active");
|
||||
this.count_de_pr = Object.keys(despachosPr).length;
|
||||
this.despachoprstore.count = this.count_de_pr;
|
||||
break;
|
||||
case 'PR':
|
||||
despachosPr = despachospr.filter(data => data.activityInstanceName == "Concluir Despacho").filter(data => data.workflowInstanceDataFields.Status == "Active")
|
||||
this.count_de_pr = Object.keys(despachosPr).length;
|
||||
this.despachoprstore.count = this.count_de_pr;
|
||||
break;
|
||||
if(this.loggeduser.Profile != 'PR') {
|
||||
despachosPr = despachospr.filter(data => data.activityInstanceName == "Tarefa de Despacho").filter(data => data.workflowInstanceDataFields.Status == "Active");
|
||||
this.count_de_pr = Object.keys(despachosPr).length;
|
||||
this.despachoprstore.count = this.count_de_pr;
|
||||
} else if(this.loggeduser.Profile == 'PR') {
|
||||
despachosPr = despachospr.filter(data => data.activityInstanceName == "Concluir Despacho").filter(data => data.workflowInstanceDataFields.Status == "Active")
|
||||
this.count_de_pr = Object.keys(despachosPr).length;
|
||||
this.despachoprstore.count = this.count_de_pr;
|
||||
}
|
||||
|
||||
let mdEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial MDGPR', false).toPromise();
|
||||
@@ -721,30 +718,28 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
openExpedientListPage() {
|
||||
this.closeAllDesktopComponents();
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
if (window.innerWidth < 701) {
|
||||
//this.openExpedientList();
|
||||
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||
}
|
||||
else {
|
||||
this.selectedElement = 'Correspondence'
|
||||
let navigationExtras: NavigationExtras = { queryParams: { "expedientes": true, } };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
this.showExpedients = true;
|
||||
}
|
||||
break;
|
||||
case 'PR':
|
||||
if (window.innerWidth < 701) {
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr']);
|
||||
}
|
||||
else {
|
||||
this.selectedElement = 'ExpedientesPr'
|
||||
let navigationExtras: NavigationExtras = { queryParams: { "expedientes": true, } };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
this.showExpedientesPr = true;
|
||||
}
|
||||
break;
|
||||
|
||||
if(this.loggeduser.Profile != 'PR') {
|
||||
if (window.innerWidth < 701) {
|
||||
//this.openExpedientList();
|
||||
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||
}
|
||||
else {
|
||||
this.selectedElement = 'Correspondence'
|
||||
let navigationExtras: NavigationExtras = { queryParams: { "expedientes": true, } };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
this.showExpedients = true;
|
||||
}
|
||||
} else if(this.loggeduser.Profile == 'PR') {
|
||||
if (window.innerWidth < 701) {
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr']);
|
||||
}
|
||||
else {
|
||||
this.selectedElement = 'ExpedientesPr'
|
||||
let navigationExtras: NavigationExtras = { queryParams: { "expedientes": true, } };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
this.showExpedientesPr = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -56,13 +56,12 @@ constructor (
|
||||
let despachoList = [];
|
||||
|
||||
let despachosPr;
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
despachosPr = result.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||
break;
|
||||
case 'PR':
|
||||
despachosPr = result.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
||||
break;
|
||||
|
||||
|
||||
if(this.loggeduser.Profile != 'PR') {
|
||||
despachosPr = result.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||
} else if(this.loggeduser.Profile != 'PR') {
|
||||
despachosPr = result.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
||||
}
|
||||
|
||||
despachosPr = despachosPr.filter(data => data.workflowInstanceDataFields.Status == "Active");
|
||||
|
||||
@@ -66,7 +66,7 @@ export class EventsToApprovePage implements OnInit {
|
||||
this.showLoader = true;
|
||||
|
||||
this.getFromDB();
|
||||
if(this.segment == 'MDGPR'){
|
||||
if(this.segment != 'PR') {
|
||||
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);
|
||||
@@ -79,7 +79,7 @@ export class EventsToApprovePage implements OnInit {
|
||||
|
||||
//this.eventaprovacaostore.resetmd(this.sortService.sortDate(this.eventsMDGPRList, 'CreateDate'));
|
||||
}
|
||||
else if(this.segment == 'PR'){
|
||||
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);
|
||||
@@ -109,7 +109,7 @@ export class EventsToApprovePage implements OnInit {
|
||||
return new Date(e).toDateString()
|
||||
}
|
||||
|
||||
goToEventDetail(event){
|
||||
goToEventDetail(event) {
|
||||
this.router.navigate(['/home/gabinete-digital/event-list/approve-event',event.serialNumber, 'gabinete-digital'])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user