mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
improve
This commit is contained in:
@@ -131,8 +131,7 @@ export class DespachosPrPage implements OnInit {
|
||||
if(SessionStore.user.Profile != 'Consultant') {
|
||||
despachosPr = await despachos.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||
} else {
|
||||
despachosPr = await despachos.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho" ||
|
||||
data.activityInstanceName == "Gerar Diploma");
|
||||
despachosPr = await despachos.reverse().filter(data => data.activityInstanceName == "Gerar Diploma" || data.activityInstanceName == "Retificar Diploma");
|
||||
}
|
||||
|
||||
|
||||
|
||||
+58
-19
@@ -12,6 +12,7 @@ import { RouteService } from 'src/app/services/route.service';
|
||||
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
import { DespachoService } from 'src/app/Rules/despacho.service'
|
||||
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-diplomas-gerar',
|
||||
@@ -196,28 +197,66 @@ export class DiplomasGerarPage implements OnInit {
|
||||
|
||||
|
||||
async enviarDiploma({note = '', documents = [], serialnumber}) {
|
||||
let body = {
|
||||
"serialNumber": serialnumber,
|
||||
"action": "Enviar diploma",
|
||||
"ActionTypeId": 104,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
|
||||
let classs;
|
||||
if (window.innerWidth <= 800) {
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
classs = 'add-note-modal-no-height'
|
||||
}
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: AddNotePage,
|
||||
componentProps: {
|
||||
showAttachmentBtn: true,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
cssClass: classs,
|
||||
backdropDismiss: true
|
||||
});
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
await modal.present();
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.modalController.dismiss('sucess');
|
||||
this.toastService._successMessage('Parecer enviado');
|
||||
this.goBack()
|
||||
} catch (error) {
|
||||
this.toastService._badRequest("Parecer não solicitado");
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
modal.onDidDismiss().then(async (res) => {
|
||||
if (res.data) {
|
||||
|
||||
const DocumentToSave = res.data.documents.map((e) => {
|
||||
return {
|
||||
ApplicationId: e.ApplicationType,
|
||||
SourceId: e.Id,
|
||||
}
|
||||
});
|
||||
|
||||
let docs = {
|
||||
ProcessInstanceID: "",
|
||||
Attachments: DocumentToSave,
|
||||
}
|
||||
|
||||
let body = {
|
||||
"serialNumber": serialnumber,
|
||||
"action": "Enviar diploma",
|
||||
"ActionTypeId": 104,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": res.data.note,
|
||||
},
|
||||
"AttachmentList" : docs,
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.modalController.dismiss('sucess');
|
||||
this.toastService._successMessage();
|
||||
this.goBack()
|
||||
} catch (error) {
|
||||
this.toastService._badRequest();
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -248,7 +248,7 @@
|
||||
</div>
|
||||
|
||||
<p class="text-center exp-card-title" >Diplomas por elaborar</p>
|
||||
<p class="text-center exp-card-content">{{ despachoprstore.count }} <span class="title1">Documentos</span></p>
|
||||
<p class="text-center exp-card-content">{{ deplomasStore.DiplomaGerarList.length }} <span class="title1">Documentos</span></p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -540,7 +540,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
get AllProcess() {
|
||||
return this.expedientegbstore.list.concat(this.pedidosstore.listparecer).concat(this.pedidosstore.listdeferimento)
|
||||
.concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr)
|
||||
.concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.despachoStore.list)
|
||||
.concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.despachoStore.list).concat(this.deplomasStore.DiplomaGerarList)
|
||||
}
|
||||
|
||||
get getAllProcessCount() {
|
||||
@@ -557,8 +557,6 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
} catch(error) {
|
||||
this.loadCount = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
expedientes = expedientes.filter(data => data.workflowInstanceDataFields.Status == "Active")
|
||||
|
||||
|
||||
@@ -51,14 +51,14 @@ export class AllProcessesPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.loadAllProcesses();
|
||||
// this.loadAllProcesses();
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationStart && event.url.startsWith('/home/gabinete-digital')) {
|
||||
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||
this.refreshing();
|
||||
} else {
|
||||
this.loadAllProcesses();
|
||||
// this.loadAllProcesses();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -67,7 +67,7 @@ export class AllProcessesPage implements OnInit {
|
||||
doRefresh() {
|
||||
|
||||
setTimeout(() => {
|
||||
this.loadAllProcesses();
|
||||
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
@@ -78,61 +78,6 @@ export class AllProcessesPage implements OnInit {
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
async loadAllProcesses() {
|
||||
let allProcessesList = await this.processesService.GetTasksList("", false).toPromise();
|
||||
//
|
||||
|
||||
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Conhecimento')
|
||||
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Revisar Diploma')
|
||||
|
||||
if(SessionStore.user.Profile != 'Consultant') {
|
||||
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Gerar Diploma')
|
||||
} else {
|
||||
console.log('!!//!!', allProcessesList.filter(element => element.activityInstanceName == 'Gerar Diploma'))
|
||||
}
|
||||
|
||||
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Prorrogar prazo')
|
||||
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Concluir Despacho por Delegação')
|
||||
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Tarefa de Despacho por Delegação')
|
||||
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Reexecutar Despacho por Delegação')
|
||||
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Editar Evento')
|
||||
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Retificar Expediente')
|
||||
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Agendar Reunião para o Ministro e Director')
|
||||
|
||||
this.skeletonLoader = true;
|
||||
|
||||
this.allProcessesList = [];
|
||||
|
||||
allProcessesList.forEach(element => {
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
|
||||
let task = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": element.workflowInstanceDataFields.Subject,
|
||||
"Senders": element.workflowInstanceDataFields.Sender,
|
||||
"CreateDate": new Date(element.taskStartDate),
|
||||
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": element.workflowInstanceDataFields.Remetente,
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
"DocId": element.workflowInstanceDataFields.DispatchDocId,
|
||||
"FolderID": element.workflowInstanceDataFields.FolderID,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
"Status": element.workflowInstanceDataFields.Status,
|
||||
"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.sortService.sortDate(this.allProcessesList, 'CreateDate');
|
||||
|
||||
});
|
||||
|
||||
this.skeletonLoader = false;
|
||||
}
|
||||
|
||||
get AllProcess() {
|
||||
return this.expedientegbstore.list.concat(this.pedidosstore.listparecer).concat(this.pedidosstore.listdeferimento)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<ion-list >
|
||||
<div
|
||||
class="expediente item-hover ion-no-padding ion-no-margin cursor-pointer"
|
||||
*ngFor = "let task of diplomasList"
|
||||
*ngFor = "let task of deplomasStore.DiplomaGerarList"
|
||||
(click)="goToDiploma(task.SerialNumber)"
|
||||
>
|
||||
<div class="item width-100">
|
||||
|
||||
@@ -55,7 +55,7 @@ export class DiplomasGerarPage implements OnInit {
|
||||
|
||||
this.skeletonLoader = false;
|
||||
|
||||
let gerarDiploma = diplomas.reverse().filter(data => data.activityInstanceName == "Gerar Diploma");
|
||||
let gerarDiploma = diplomas.reverse().filter(data => data.activityInstanceName == "Gerar Diploma" || data.activityInstanceName == "Retificar Diploma");
|
||||
|
||||
gerarDiploma.forEach(element => {
|
||||
let task: customTask = this.customTaskPipe.transform(element);
|
||||
|
||||
@@ -14,26 +14,26 @@ import { PermissionService } from 'src/app/services/permission.service';
|
||||
styleUrls: ['./diplomas.page.scss'],
|
||||
})
|
||||
export class DiplomasPage implements OnInit {
|
||||
//profile:string;
|
||||
diplomasList:DailyWorkTask[] = [];
|
||||
diplomasAssinadoList:DailyWorkTask[] = [];
|
||||
showLoader: boolean;
|
||||
serialNumber:string;
|
||||
skeletonLoader = false
|
||||
|
||||
@Input() segment:string;
|
||||
diplomasList:DailyWorkTask[] = [];
|
||||
diplomasAssinadoList:DailyWorkTask[] = [];
|
||||
showLoader: boolean;
|
||||
serialNumber:string;
|
||||
skeletonLoader = false
|
||||
|
||||
@Input() segment:string;
|
||||
|
||||
|
||||
deplomasStore = DeplomasStore
|
||||
customTaskPipe = new CustomTaskPipe()
|
||||
deplomasStore = DeplomasStore
|
||||
customTaskPipe = new CustomTaskPipe()
|
||||
|
||||
constructor(
|
||||
private processes:ProcessesService,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
public ThemeService: ThemeService,
|
||||
private sortService: SortService,
|
||||
public p: PermissionService,
|
||||
constructor(
|
||||
private processes:ProcessesService,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
public ThemeService: ThemeService,
|
||||
private sortService: SortService,
|
||||
public p: PermissionService,
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -93,6 +93,13 @@ export class DeplomasService {
|
||||
return this._diplomasReviewList
|
||||
}
|
||||
|
||||
// get list
|
||||
|
||||
|
||||
get DiplomaGerarList() {
|
||||
return this._diplomasGerarList
|
||||
}
|
||||
|
||||
resetDiplomasAssinadoList(value: any[]) {
|
||||
|
||||
this._diplomasAssinadoListCount = value.length
|
||||
|
||||
Reference in New Issue
Block a user