mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
merge with branchBug
This commit is contained in:
@@ -90,7 +90,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="content overflow-y-auto flex-grow-1 height-100">
|
<div class="content overflow-y-auto flex-grow-1 height-100">
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor = "let task of expedienteGdStore.list"
|
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor = "let task of listToPresentexpediente"
|
||||||
(click)="goToExpediente(task.SerialNumber)">
|
(click)="goToExpediente(task.SerialNumber)">
|
||||||
<div class="item-exp d-flex">
|
<div class="item-exp d-flex">
|
||||||
<div class="schedule-date">
|
<div class="schedule-date">
|
||||||
|
|||||||
@@ -67,9 +67,8 @@ export class EventsPage implements OnInit {
|
|||||||
toDayEventStorage = ToDayEventStorage
|
toDayEventStorage = ToDayEventStorage
|
||||||
expedienteGdStore = ExpedienteGdStore
|
expedienteGdStore = ExpedienteGdStore
|
||||||
|
|
||||||
|
listToPresent = [];
|
||||||
pdfSrc = "https://www.tabularium.pt/file-upload/FSovLiyEa8Hqy2iDA/TK-Justificativo.pdf";
|
listToPresentexpediente =[]
|
||||||
listToPresent
|
|
||||||
|
|
||||||
expedienteTaskPipe = new ExpedienteTaskPipe()
|
expedienteTaskPipe = new ExpedienteTaskPipe()
|
||||||
|
|
||||||
@@ -120,18 +119,6 @@ export class EventsPage implements OnInit {
|
|||||||
this.segment = "Combinada";
|
this.segment = "Combinada";
|
||||||
this.profile = "mdgpr";
|
this.profile = "mdgpr";
|
||||||
|
|
||||||
this.showGreeting();
|
|
||||||
|
|
||||||
this.router.events.forEach((event) => {
|
|
||||||
if (event instanceof NavigationEnd && event.url == '/home/events') {
|
|
||||||
this.RefreshEvents();
|
|
||||||
setTimeout(()=>{
|
|
||||||
this.LoadList();
|
|
||||||
}, 1500)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.hideSearch();
|
|
||||||
|
|
||||||
this.getEventsFromLocalDb();
|
this.getEventsFromLocalDb();
|
||||||
|
|
||||||
//this.checkScreenOrientation();
|
//this.checkScreenOrientation();
|
||||||
@@ -199,17 +186,16 @@ export class EventsPage implements OnInit {
|
|||||||
const list = mdOficialEvents.concat(mdPessoalEvents);
|
const list = mdOficialEvents.concat(mdPessoalEvents);
|
||||||
console.log("getAllMdOficialPessoalEvents", list)
|
console.log("getAllMdOficialPessoalEvents", list)
|
||||||
this.SqliteAddEvent(list);
|
this.SqliteAddEvent(list);
|
||||||
this.listToPresent = this.toDayEventStorage.eventsList
|
this.listToPresent = list
|
||||||
this.toDayEventStorage.reset(list)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (this.toDayEventStorage.eventsList.length > 0) {
|
if (list.length > 0) {
|
||||||
this.currentEvent = this.toDayEventStorage.eventsList[0].Subject;
|
this.currentEvent = list[0].Subject;
|
||||||
this.currentHoursMinutes = this.toDayEventStorage.eventsList[0].StartDate;
|
this.currentHoursMinutes = list[0].StartDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.totalEvent = this.toDayEventStorage.eventsList.length;
|
this.totalEvent = list.length;
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -221,15 +207,14 @@ export class EventsPage implements OnInit {
|
|||||||
const list = prOficialEvents.concat(prPessoalEvents);
|
const list = prOficialEvents.concat(prPessoalEvents);
|
||||||
console.log("getAllPrOficialPessoalEvents", list)
|
console.log("getAllPrOficialPessoalEvents", list)
|
||||||
this.SqliteAddEvent(list);
|
this.SqliteAddEvent(list);
|
||||||
this.toDayEventStorage.reset(list)
|
|
||||||
|
|
||||||
if (this.toDayEventStorage.eventsList.length > 0) {
|
if (list.length > 0) {
|
||||||
this.currentEvent = this.toDayEventStorage.eventsList[0].Subject;
|
this.currentEvent = list[0].Subject;
|
||||||
this.currentHoursMinutes = this.toDayEventStorage.eventsList[0].StartDate;
|
this.currentHoursMinutes = list[0].StartDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.listToPresent = this.toDayEventStorage.eventsList;
|
this.listToPresent = list;
|
||||||
this.totalEvent = this.toDayEventStorage.eventsList.length;
|
this.totalEvent = list.length;
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -339,32 +324,50 @@ export class EventsPage implements OnInit {
|
|||||||
|
|
||||||
getEventsFromLocalDb() {
|
getEventsFromLocalDb() {
|
||||||
|
|
||||||
synchro.registerCallback('Online', () => {
|
if (synchro.connected === true) {
|
||||||
|
this.showGreeting();
|
||||||
|
|
||||||
this.router.events.forEach((event) => {
|
this.router.events.forEach((event) => {
|
||||||
if (event instanceof NavigationEnd && event.url == '/home/events') {
|
if (event instanceof NavigationEnd && event.url == '/home/events') {
|
||||||
this.RefreshEvents();
|
this.RefreshEvents();
|
||||||
|
setTimeout(() => {
|
||||||
this.LoadList();
|
this.LoadList();
|
||||||
|
}, 1500)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log('Onlineee')
|
this.hideSearch();
|
||||||
|
} else {
|
||||||
})
|
this.sqliteservice.getAllEvents().then((event:any[]) => {
|
||||||
|
|
||||||
|
|
||||||
synchro.registerCallback('Offline', () => {
|
|
||||||
this.platform.ready().then(() => {
|
|
||||||
this.sqliteservice.getAllEvents().then((event) => {
|
|
||||||
this.listToPresent = event
|
this.listToPresent = event
|
||||||
this.totalEvent = this.listToPresent.length
|
this.totalEvent = this.listToPresent.length
|
||||||
this.currentEvent = this.listToPresent[0].Subject
|
this.currentEvent = this.listToPresent[0].Subject
|
||||||
this.currentHoursMinutes = this.listToPresent[0].StartDate
|
this.currentHoursMinutes = this.listToPresent[0].StartDate
|
||||||
console.log("All events from local,", event)
|
console.log("All events from local,", event)
|
||||||
})
|
})
|
||||||
console.log('Offlineee')
|
|
||||||
|
this.sqliteservice.getprocessByworkflow("Expediente").then((process: any[]) => {
|
||||||
|
var expedientlist = [];
|
||||||
|
process.forEach((element) => {
|
||||||
|
let task = {
|
||||||
|
CreateDate: element.taskStartDate,
|
||||||
|
DocumentsQty: element.totalDocuments,
|
||||||
|
Senders: JSON.parse(element.workflowInstanceDataFields).Sender,
|
||||||
|
SerialNumber: element.serialNumber,
|
||||||
|
Status: JSON.parse(element.workflowInstanceDataFields).Status,
|
||||||
|
Subject: JSON.parse(element.workflowInstanceDataFields).Subject,
|
||||||
|
WorkflowName: element.workflowDisplayName,
|
||||||
|
activityInstanceName: element.activityInstanceName,
|
||||||
|
taskStartDate: element.taskStartDate,
|
||||||
|
}
|
||||||
|
expedientlist.push(task);
|
||||||
})
|
})
|
||||||
|
const ExpedienteTask = expedientlist.map(e => this.expedienteTaskPipe.transform(e))
|
||||||
|
this.listToPresentexpediente = ExpedienteTask;
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -421,10 +424,13 @@ export class EventsPage implements OnInit {
|
|||||||
LoadList() {
|
LoadList() {
|
||||||
this.processes.GetTaskListExpediente(false).subscribe(result => {
|
this.processes.GetTaskListExpediente(false).subscribe(result => {
|
||||||
console.log("Expediente", result);
|
console.log("Expediente", result);
|
||||||
|
this.sqliteservice.addProcess(result)
|
||||||
|
|
||||||
const ExpedienteTask = result.map(e => this.expedienteTaskPipe.transform(e))
|
const ExpedienteTask = result.map(e => this.expedienteTaskPipe.transform(e))
|
||||||
|
|
||||||
this.expedienteGdStore.reset(ExpedienteTask)
|
console.log("Expediente 2", ExpedienteTask);
|
||||||
|
|
||||||
|
this.listToPresentexpediente = ExpedienteTask;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ import { ToastService } from 'src/app/services/toast.service';
|
|||||||
import { Location } from '@angular/common'
|
import { Location } from '@angular/common'
|
||||||
import { DespachoService } from 'src/app/Rules/despacho.service';
|
import { DespachoService } from 'src/app/Rules/despacho.service';
|
||||||
|
|
||||||
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
|
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-despacho-pr',
|
selector: 'app-despacho-pr',
|
||||||
templateUrl: './despacho-pr.page.html',
|
templateUrl: './despacho-pr.page.html',
|
||||||
@@ -51,7 +54,8 @@ export class DespachoPrPage implements OnInit {
|
|||||||
private activatedRoute: ActivatedRoute,
|
private activatedRoute: ActivatedRoute,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private location: Location,
|
private location: Location,
|
||||||
private despachoService: DespachoService
|
private despachoService: DespachoService,
|
||||||
|
private sqliteservice: SqliteService
|
||||||
) {
|
) {
|
||||||
this.activatedRoute.paramMap.subscribe(params => {
|
this.activatedRoute.paramMap.subscribe(params => {
|
||||||
if (params["params"].SerialNumber) {
|
if (params["params"].SerialNumber) {
|
||||||
@@ -68,17 +72,7 @@ export class DespachoPrPage implements OnInit {
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.profile = "mdgpr";
|
this.profile = "mdgpr";
|
||||||
console.log(this.serialNumber);
|
console.log(this.serialNumber);
|
||||||
|
this.getFromDB();
|
||||||
this.activateRoute.paramMap.subscribe(paramMap => {
|
|
||||||
if (!paramMap.has('SerialNumber')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
/* this.serialNumber = paramMap.get('SerialNumber'); */
|
|
||||||
this.LoadTaskDetail(this.serialNumber);
|
|
||||||
// this.LoadRelatedEvents(this.serialNumber);
|
|
||||||
});
|
|
||||||
this.LoadTaskDetail(this.serialNumber);
|
|
||||||
// this.LoadRelatedEvents(this.serialNumber);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
@@ -111,12 +105,16 @@ export class DespachoPrPage implements OnInit {
|
|||||||
console.log(this.task);
|
console.log(this.task);
|
||||||
|
|
||||||
console.log('GetTask', res);
|
console.log('GetTask', res);
|
||||||
|
this.sqliteservice.updateProcess(res)
|
||||||
|
|
||||||
let thedate = new Date(this.task.CreateDate);
|
let thedate = new Date(this.task.CreateDate);
|
||||||
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||||
|
|
||||||
|
|
||||||
this.processes.GetTaskParticipants(this.task.FolderId).subscribe(users => {
|
this.processes.GetTaskParticipants(this.task.FolderId).subscribe(users => {
|
||||||
|
this.sqliteservice.updateProcessInterveners(JSON.stringify(this.serialNumber), JSON.stringify(users)).then(() => {
|
||||||
|
console.log('internen despacho pr ')
|
||||||
|
})
|
||||||
this.intervenientes = users.filter(user => {
|
this.intervenientes = users.filter(user => {
|
||||||
return user.Type == 'I';
|
return user.Type == 'I';
|
||||||
});
|
});
|
||||||
@@ -145,6 +143,71 @@ export class DespachoPrPage implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getFromDB() {
|
||||||
|
if (synchro.connected === true) {
|
||||||
|
this.activateRoute.paramMap.subscribe(paramMap => {
|
||||||
|
if (!paramMap.has('SerialNumber')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/* this.serialNumber = paramMap.get('SerialNumber'); */
|
||||||
|
this.LoadTaskDetail(this.serialNumber);
|
||||||
|
// this.LoadRelatedEvents(this.serialNumber);
|
||||||
|
});
|
||||||
|
this.LoadTaskDetail(this.serialNumber);
|
||||||
|
// this.LoadRelatedEvents(this.serialNumber);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.sqliteservice.getProcessById(this.serialNumber).then((process: any[]) => {
|
||||||
|
console.log('OFFLINE', process)
|
||||||
|
this.task = {
|
||||||
|
"SerialNumber": process[0].serialNumber,
|
||||||
|
"Folio": JSON.parse(process[0].workflowInstanceDataFields).Subject,
|
||||||
|
"Senders": JSON.parse(process[0].originator).email,
|
||||||
|
"CreateDate": momentG(new Date(process[0].taskStartDate), 'yyyy-MM-dd HH:mm:ss'),
|
||||||
|
"DocumentURL": JSON.parse(process[0].workflowInstanceDataFields).ViewerRequest,
|
||||||
|
"Remetente": JSON.parse(process[0].workflowInstanceDataFields).Sender,
|
||||||
|
"Note": JSON.parse(process[0].workflowInstanceDataFields).TaskMessage || JSON.parse(process[0].workflowInstanceDataFields).Note,
|
||||||
|
"FolderId": JSON.parse(process[0].workflowInstanceDataFields).FolderID,
|
||||||
|
"FsId": '361',
|
||||||
|
"DocId": JSON.parse(process[0].workflowInstanceDataFields).DispatchDocId,
|
||||||
|
"WorkflowName": process[0].workflowDisplayName,
|
||||||
|
"DeadlineType": JSON.parse(process[0].workflowInstanceDataFields).DeadlineType,
|
||||||
|
"activityInstanceName": process[0].activityInstanceName,
|
||||||
|
}
|
||||||
|
console.log("OFFLINE TASK", this.task)
|
||||||
|
let fulltak = {
|
||||||
|
Documents: JSON.parse(process[0].Documents),
|
||||||
|
actions: JSON.parse(process[0].actions),
|
||||||
|
activityInstanceName: process[0].activityInstanceName,
|
||||||
|
formURL: process[0].formURL,
|
||||||
|
originator: JSON.parse(process[0].originator),
|
||||||
|
serialNumber: process[0].serialNumber,
|
||||||
|
taskStartDate: process[0].taskStartDate,
|
||||||
|
totalDocuments: process[0].totalDocuments,
|
||||||
|
workflowDisplayName: process[0].workflowDisplayName,
|
||||||
|
workflowID: process[0].workflowID,
|
||||||
|
workflowInstanceDataFields: JSON.parse(process[0].workflowInstanceDataFields),
|
||||||
|
workflowInstanceFolio: process[0].workflowInstanceFolio,
|
||||||
|
workflowInstanceID: process[0].workflowInstanceID,
|
||||||
|
workflowName: process[0].workflowName
|
||||||
|
}
|
||||||
|
this.fulltask = fulltak;
|
||||||
|
console.log(this.task);
|
||||||
|
|
||||||
|
let thedate = new Date(this.task.CreateDate);
|
||||||
|
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||||
|
|
||||||
|
this.intervenientes = JSON.parse(process[0].interveners).filter(user => {
|
||||||
|
return user.Type == 'I';
|
||||||
|
});
|
||||||
|
this.cc = JSON.parse(process[0].interveners).filter(user => {
|
||||||
|
return user.Type == 'CC';
|
||||||
|
});
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
viewDocument(docId: string) {
|
viewDocument(docId: string) {
|
||||||
this.processes.GetDocumentUrl(docId, '361').subscribe(res => {
|
this.processes.GetDocumentUrl(docId, '361').subscribe(res => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<ion-list>
|
<ion-list>
|
||||||
<div
|
<div
|
||||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||||
*ngFor = "let task of despachoprstore.list; let i = index"
|
*ngFor = "let task of listToPresent; let i = index"
|
||||||
(click)="goToDespachoPr(task.SerialNumber)"
|
(click)="goToDespachoPr(task.SerialNumber)"
|
||||||
>
|
>
|
||||||
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
|
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
|
||||||
@@ -67,13 +67,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
*ngIf="!skeletonLoader && despachoprstore.list.length == 0"
|
*ngIf="!skeletonLoader && listToPresent.length == 0"
|
||||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||||
>
|
>
|
||||||
<span>Lista vazia</span>
|
<span>Lista vazia</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="skeletonLoader && despachoprstore.list.length == 0">
|
<div *ngIf="skeletonLoader && listToPresent.length == 0">
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-thumbnail slot="end">
|
<ion-thumbnail slot="end">
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ import { NavigationEnd, NavigationExtras, NavigationStart, Router } from '@angul
|
|||||||
import { __awaiter } from 'tslib';
|
import { __awaiter } from 'tslib';
|
||||||
import { DespachosprStore } from 'src/app/store/despachospr-store.service';
|
import { DespachosprStore } from 'src/app/store/despachospr-store.service';
|
||||||
|
|
||||||
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
|
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-despachos-pr',
|
selector: 'app-despachos-pr',
|
||||||
templateUrl: './despachos-pr.page.html',
|
templateUrl: './despachos-pr.page.html',
|
||||||
@@ -48,6 +51,7 @@ export class DespachosPrPage implements OnInit {
|
|||||||
loggeduser: LoginUserRespose;
|
loggeduser: LoginUserRespose;
|
||||||
skeletonLoader = true
|
skeletonLoader = true
|
||||||
despachoprstore = DespachosprStore
|
despachoprstore = DespachosprStore
|
||||||
|
listToPresent = [];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private processes: ProcessesService,
|
private processes: ProcessesService,
|
||||||
@@ -55,6 +59,7 @@ export class DespachosPrPage implements OnInit {
|
|||||||
private alertService: AlertService,
|
private alertService: AlertService,
|
||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
|
private sqliteservice: SqliteService
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.loggeduser = authService.ValidatedUser;
|
this.loggeduser = authService.ValidatedUser;
|
||||||
@@ -65,22 +70,7 @@ export class DespachosPrPage implements OnInit {
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
//Inicializar segment
|
//Inicializar segment
|
||||||
this.segment = "despachos";
|
this.segment = "despachos";
|
||||||
|
this.getFromDB();
|
||||||
const location = window.location
|
|
||||||
const pathname = location.pathname + location.search
|
|
||||||
|
|
||||||
this.LoadList()
|
|
||||||
|
|
||||||
this.router.events.forEach((event) => {
|
|
||||||
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
|
|
||||||
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
|
||||||
this.doRefresh()
|
|
||||||
} else {
|
|
||||||
this.LoadList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
segmentChanged(ev: any) {
|
segmentChanged(ev: any) {
|
||||||
@@ -146,10 +136,74 @@ export class DespachosPrPage implements OnInit {
|
|||||||
this.despachoList.push(task);
|
this.despachoList.push(task);
|
||||||
console.log(this.despachoList);
|
console.log(this.despachoList);
|
||||||
});
|
});
|
||||||
this.despachoprstore.reset(this.despachoList);
|
this.listToPresent = this.despachoList
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getFromDB() {
|
||||||
|
if (synchro.connected === true) {
|
||||||
|
const location = window.location
|
||||||
|
const pathname = location.pathname + location.search
|
||||||
|
|
||||||
|
this.LoadList()
|
||||||
|
|
||||||
|
this.router.events.forEach((event) => {
|
||||||
|
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
|
||||||
|
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||||
|
this.doRefresh()
|
||||||
|
} else {
|
||||||
|
this.LoadList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.sqliteservice.getAllProcess().then((all) => {
|
||||||
|
console.log('DESPACHO PR ALL', all)
|
||||||
|
})
|
||||||
|
this.sqliteservice.getprocessByworkflow('Despacho do Presidente da República').then(async (process: any[]) => {
|
||||||
|
console.log('DESPACHO PR', process)
|
||||||
|
|
||||||
|
let despachosPr;
|
||||||
|
switch (this.loggeduser.Profile) {
|
||||||
|
case 'MDGPR':
|
||||||
|
despachosPr = await process.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||||
|
break;
|
||||||
|
case 'PR':
|
||||||
|
console.log(process);
|
||||||
|
|
||||||
|
despachosPr = await process.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
despachosPr = despachosPr.filter(data => JSON.parse(data.workflowInstanceDataFields).Status == "Active");
|
||||||
|
despachosPr.forEach((element, index) => {
|
||||||
|
|
||||||
|
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": JSON.parse(element.workflowInstanceDataFields).Subject,
|
||||||
|
"Senders": JSON.parse(element.workflowInstanceDataFields).Sender,
|
||||||
|
"CreateDate": taskDate,
|
||||||
|
"DocumentURL": JSON.parse(element.workflowInstanceDataFields).ViewerRequest,
|
||||||
|
"Remetente": JSON.parse(element.workflowInstanceDataFields).Remetente,
|
||||||
|
"DocumentsQty": element.totalDocuments,
|
||||||
|
"DocId": JSON.parse(element.workflowInstanceDataFields).DocIdDiferimento,
|
||||||
|
"WorkflowName": element.workflowDisplayName,
|
||||||
|
"activityInstanceName": element.activityInstanceName,
|
||||||
|
}
|
||||||
|
|
||||||
|
this.despachoList.push(task);
|
||||||
|
console.log(this.despachoList);
|
||||||
|
});
|
||||||
|
this.listToPresent = this.despachoList;
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sortArrayISODate(myArray: any) {
|
sortArrayISODate(myArray: any) {
|
||||||
return myArray.sort(function (a, b) {
|
return myArray.sort(function (a, b) {
|
||||||
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
||||||
|
|||||||
@@ -33,8 +33,8 @@
|
|||||||
<h5 *ngIf="intervenientes">Intervenientes</h5>
|
<h5 *ngIf="intervenientes">Intervenientes</h5>
|
||||||
<ion-item class="ion-no-margin ion-no-padding">
|
<ion-item class="ion-no-margin ion-no-padding">
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<div *ngFor="let interveniente of intervenientes">
|
<div *ngFor="let task of intervenientes">
|
||||||
<p>{{interveniente.Name}}</p>
|
<p>{{task.Name}}</p>
|
||||||
</div>
|
</div>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|||||||
@@ -18,6 +18,10 @@ import { fullTask } from 'src/app/models/dailyworktask.model';
|
|||||||
import { AttachmentList } from 'src/app/models/Excludetask';
|
import { AttachmentList } from 'src/app/models/Excludetask';
|
||||||
import { PermissionService } from 'src/app/OtherService/permission.service';
|
import { PermissionService } from 'src/app/OtherService/permission.service';
|
||||||
|
|
||||||
|
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||||
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
|
import { Platform } from '@ionic/angular';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-despacho',
|
selector: 'app-despacho',
|
||||||
templateUrl: './despacho.page.html',
|
templateUrl: './despacho.page.html',
|
||||||
@@ -41,6 +45,8 @@ export class DespachoPage implements OnInit {
|
|||||||
intervenientes: any;
|
intervenientes: any;
|
||||||
cc: any = [];
|
cc: any = [];
|
||||||
|
|
||||||
|
synch = synchro;
|
||||||
|
|
||||||
constructor(private activateRoute: ActivatedRoute,
|
constructor(private activateRoute: ActivatedRoute,
|
||||||
private processes: ProcessesService,
|
private processes: ProcessesService,
|
||||||
private iab: InAppBrowser,
|
private iab: InAppBrowser,
|
||||||
@@ -51,8 +57,12 @@ export class DespachoPage implements OnInit {
|
|||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private despachoService: DespachoService,
|
private despachoService: DespachoService,
|
||||||
private location: Location,
|
private location: Location,
|
||||||
public p: PermissionService) {
|
public p: PermissionService,
|
||||||
|
private sqliteservice: SqliteService,
|
||||||
|
private platform: Platform
|
||||||
|
|
||||||
|
|
||||||
|
) {
|
||||||
this.activatedRoute.paramMap.subscribe(params => {
|
this.activatedRoute.paramMap.subscribe(params => {
|
||||||
if (params["params"].SerialNumber) {
|
if (params["params"].SerialNumber) {
|
||||||
this.serialnumber = params["params"].SerialNumber;
|
this.serialnumber = params["params"].SerialNumber;
|
||||||
@@ -70,8 +80,8 @@ export class DespachoPage implements OnInit {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
this.getFromDb()
|
||||||
|
|
||||||
this.LoadTaskDetail(this.serialnumber)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
@@ -112,6 +122,7 @@ export class DespachoPage implements OnInit {
|
|||||||
|
|
||||||
async LoadTaskDetail(serial: string) {
|
async LoadTaskDetail(serial: string) {
|
||||||
this.processes.GetTask(serial).subscribe((res: fullTask) => {
|
this.processes.GetTask(serial).subscribe((res: fullTask) => {
|
||||||
|
console.log('despacho detail', res)
|
||||||
this.task = {
|
this.task = {
|
||||||
"SerialNumber": res.serialNumber,
|
"SerialNumber": res.serialNumber,
|
||||||
"Folio": res.workflowInstanceDataFields.Subject,
|
"Folio": res.workflowInstanceDataFields.Subject,
|
||||||
@@ -129,17 +140,23 @@ export class DespachoPage implements OnInit {
|
|||||||
"activityInstanceName": res.activityInstanceName,
|
"activityInstanceName": res.activityInstanceName,
|
||||||
"Status": res.workflowInstanceDataFields.Status,
|
"Status": res.workflowInstanceDataFields.Status,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.sqliteservice.updateProcess(res);
|
||||||
this.fulltask = res;
|
this.fulltask = res;
|
||||||
|
|
||||||
let thedate = new Date(this.task.CreateDate);
|
let thedate = new Date(this.task.CreateDate);
|
||||||
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||||
|
|
||||||
this.processes.GetTaskParticipants(this.task.FolderID).subscribe(users => {
|
this.processes.GetTaskParticipants(this.task.FolderID).subscribe(users => {
|
||||||
|
this.sqliteservice.updateProcessInterveners(JSON.stringify(this.serialnumber), JSON.stringify(users))
|
||||||
|
console.log('interveniers online', users)
|
||||||
|
|
||||||
this.intervenientes = users.filter(user => {
|
this.intervenientes = users.filter(user => {
|
||||||
|
console.log('interveniers online 2', users)
|
||||||
return user.Type == 'I';
|
return user.Type == 'I';
|
||||||
});
|
});
|
||||||
this.cc = users.filter(user => {
|
this.cc = users.filter(user => {
|
||||||
|
console.log('interveniers online 3', users)
|
||||||
return user.Type == 'CC';
|
return user.Type == 'CC';
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -158,10 +175,84 @@ export class DespachoPage implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getFromDb() {
|
||||||
|
if (synchro.connected === true) {
|
||||||
|
this.LoadTaskDetail(this.serialnumber)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (synchro.connected === false) {
|
||||||
|
this.platform.ready().then(() => {
|
||||||
|
this.sqliteservice.getProcessById(this.serialnumber).then((process) => {
|
||||||
|
|
||||||
|
var workflow = JSON.parse(process[0].workflowInstanceDataFields);
|
||||||
|
var intervine = JSON.parse(process[0].interveners)
|
||||||
|
var origina
|
||||||
|
if (process[0].originator === "undefined") {
|
||||||
|
origina = ""
|
||||||
|
} else {
|
||||||
|
origina = JSON.parse(process[0].originator)
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('sqlite', process)
|
||||||
|
|
||||||
|
this.task = {
|
||||||
|
"SerialNumber": process[0].serialNumber,
|
||||||
|
"Folio": workflow.Subject,
|
||||||
|
"Senders": origina.email || process[0].originator,
|
||||||
|
"CreateDate": momentG(new Date(process[0].taskStartDate), 'yyyy-MM-dd HH:mm:ss'),
|
||||||
|
"DocumentURL": workflow.ViewerRequest,
|
||||||
|
"Remetente": workflow.Sender,
|
||||||
|
"Note": workflow.TaskMessage || workflow.Note,
|
||||||
|
"FolderId": workflow.FolderID,
|
||||||
|
"FsId": workflow.FsId,
|
||||||
|
"DocId": workflow.DocID,
|
||||||
|
"DocumentsQty": process[0].DocumentsQty,
|
||||||
|
"WorkflowName": process[0].workflowDisplayName,
|
||||||
|
"DeadlineType": workflow.DeadlineType,
|
||||||
|
"activityInstanceName": process[0].activityInstanceName,
|
||||||
|
"Status": workflow.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
let thedate = new Date(this.task.CreateDate);
|
||||||
|
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||||
|
|
||||||
|
let fulltak = {
|
||||||
|
Documents: JSON.parse(process[0].Documents),
|
||||||
|
actions: JSON.parse(process[0].actions),
|
||||||
|
activityInstanceName: process[0].activityInstanceName,
|
||||||
|
formURL: process[0].formURL,
|
||||||
|
originator: JSON.parse(process[0].originator),
|
||||||
|
serialNumber: process[0].serialNumber,
|
||||||
|
taskStartDate: process[0].taskStartDate,
|
||||||
|
totalDocuments: process[0].totalDocuments,
|
||||||
|
workflowDisplayName: process[0].workflowDisplayName,
|
||||||
|
workflowID: process[0].workflowID,
|
||||||
|
workflowInstanceDataFields: JSON.parse(process[0].workflowInstanceDataFields),
|
||||||
|
workflowInstanceFolio: process[0].workflowInstanceFolio,
|
||||||
|
workflowInstanceID: process[0].workflowInstanceID,
|
||||||
|
workflowName: process[0].workflowName
|
||||||
|
}
|
||||||
|
this.fulltask = fulltak;
|
||||||
|
|
||||||
|
console.log('interveniers offline', intervine)
|
||||||
|
this.intervenientes = intervine.filter(user => {
|
||||||
|
console.log('interveniers offline 2', user)
|
||||||
|
return user.Type == 'I';
|
||||||
|
});
|
||||||
|
this.cc = intervine.filter(user => {
|
||||||
|
console.log('interveniers offline 3', user)
|
||||||
|
return user.Type == 'CC';
|
||||||
|
});
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
viewDocument(docId: string) {
|
viewDocument(docId: string) {
|
||||||
this.processes.GetDocumentUrl(docId, '361').subscribe(res => {
|
this.processes.GetDocumentUrl(docId, '361').subscribe(res => {
|
||||||
const url: string = res.replace("webTRIX.Viewer", "webTRIX.Viewer.Branch1");
|
const url: string = res.replace("webTRIX.Viewer", "webTRIX.Viewer.Branch1");
|
||||||
const browser = this.iab.create('https://equilibrium.dyndns.info/FileShare/pdfjs/web/viewer.html?file=https://equilibrium.dyndns.info/FileShare/merged_fastview.pdf', "_blank", 'location=yes,x=0,y=200,width=437,height=650,fullscreen=no');
|
const browser = this.iab.create(url, "_blank");
|
||||||
browser.show();
|
browser.show();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<ion-list>
|
<ion-list>
|
||||||
<div
|
<div
|
||||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||||
*ngFor = "let task of despachoStore.list; let i = index"
|
*ngFor = "let task of listToPresent; let i = index"
|
||||||
(click)="GoToDespacho(task.SerialNumber)"
|
(click)="GoToDespacho(task.SerialNumber)"
|
||||||
>
|
>
|
||||||
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
|
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
|
||||||
@@ -68,13 +68,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
*ngIf="!skeletonLoader && despachoStore.list.length == 0"
|
*ngIf="!skeletonLoader && listToPresent.length == 0"
|
||||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||||
>
|
>
|
||||||
<span>Lista vazia</span>
|
<span>Lista vazia</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="skeletonLoader && despachoStore.list.length == 0">
|
<div *ngIf="skeletonLoader && listToPresent.length == 0">
|
||||||
|
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
|
|||||||
@@ -3,6 +3,11 @@ import { NavigationStart, Router } from '@angular/router';
|
|||||||
import { DespachoService } from 'src/app/Rules/despacho.service';
|
import { DespachoService } from 'src/app/Rules/despacho.service';
|
||||||
import { DespachoStore } from 'src/app/store/despacho-store.service';
|
import { DespachoStore } from 'src/app/store/despacho-store.service';
|
||||||
|
|
||||||
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
|
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||||
|
import { Platform } from '@ionic/angular';
|
||||||
|
import { isThisHour } from 'date-fns';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-despachos',
|
selector: 'app-despachos',
|
||||||
templateUrl: './despachos.page.html',
|
templateUrl: './despachos.page.html',
|
||||||
@@ -12,31 +17,21 @@ import { DespachoStore } from 'src/app/store/despacho-store.service';
|
|||||||
export class DespachosPage implements OnInit {
|
export class DespachosPage implements OnInit {
|
||||||
|
|
||||||
despachoStore = DespachoStore;
|
despachoStore = DespachoStore;
|
||||||
|
synch = synchro;
|
||||||
|
listToPresent = [];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private despachoRule: DespachoService
|
private despachoRule: DespachoService,
|
||||||
|
private sqliteservice: SqliteService,
|
||||||
|
private platform: Platform
|
||||||
) {
|
) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
const location = window.location
|
this.getFromDb()
|
||||||
const pathname = location.pathname + location.search
|
|
||||||
|
|
||||||
this.LoadList()
|
|
||||||
|
|
||||||
this.router.events.forEach((event) => {
|
|
||||||
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
|
|
||||||
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
|
||||||
this.refreshing()
|
|
||||||
} else {
|
|
||||||
this.LoadList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async refreshing() {
|
async refreshing() {
|
||||||
@@ -51,7 +46,60 @@ export class DespachosPage implements OnInit {
|
|||||||
|
|
||||||
async LoadList() {
|
async LoadList() {
|
||||||
|
|
||||||
await this.despachoRule.getList({updateStore: true})
|
await this.despachoRule.getList({ updateStore: true }).then((pre) => {
|
||||||
|
this.listToPresent = pre;
|
||||||
|
console.log('despachooo', pre)
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
getFromDb() {
|
||||||
|
if (synchro.connected === true) {
|
||||||
|
const location = window.location
|
||||||
|
const pathname = location.pathname + location.search
|
||||||
|
|
||||||
|
this.LoadList()
|
||||||
|
|
||||||
|
this.router.events.forEach((event) => {
|
||||||
|
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
|
||||||
|
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||||
|
this.refreshing()
|
||||||
|
} else {
|
||||||
|
this.LoadList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (synchro.connected === false) {
|
||||||
|
this.platform.ready().then(() => {
|
||||||
|
this.sqliteservice.getDespachosProcess('Tarefa de Despacho').then((process: any[]) => {
|
||||||
|
var listtopresent = [];
|
||||||
|
process.forEach(element => {
|
||||||
|
var workflow = JSON.parse(element.workflowInstanceDataFields);
|
||||||
|
let task = {
|
||||||
|
"CreateDate": element.taskStartDate,
|
||||||
|
"DocId": workflow.DispatchDocID,
|
||||||
|
"DocumentURL": undefined,
|
||||||
|
"DocumentsQty": element.totalDocuments,
|
||||||
|
"FolderID": workflow.FolderID,
|
||||||
|
"Folio": workflow.Subject,
|
||||||
|
"Remetente": undefined,
|
||||||
|
"Senders": workflow.Sender,
|
||||||
|
"SerialNumber": element.serialNumber,
|
||||||
|
"Status": workflow.Status,
|
||||||
|
"WorkflowName": element.workflowDisplayName
|
||||||
|
}
|
||||||
|
|
||||||
|
listtopresent.push(task);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
this.listToPresent = listtopresent;
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get skeletonLoader(): boolean {
|
get skeletonLoader(): boolean {
|
||||||
@@ -67,7 +115,6 @@ export class DespachosPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async GoToDespacho(serialNumber: any) {
|
async GoToDespacho(serialNumber: any) {
|
||||||
console.log('Despachos serial',serialNumber)
|
|
||||||
this.router.navigate(['/home/gabinete-digital/despachos', serialNumber, 'gabinete-digital']);
|
this.router.navigate(['/home/gabinete-digital/despachos', serialNumber, 'gabinete-digital']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ import { DeplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deplo
|
|||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
|
|
||||||
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
|
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-diploma',
|
selector: 'app-diploma',
|
||||||
templateUrl: './diploma.page.html',
|
templateUrl: './diploma.page.html',
|
||||||
@@ -42,6 +45,7 @@ export class DiplomaPage implements OnInit {
|
|||||||
private animationController: AnimationController,
|
private animationController: AnimationController,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private location: Location,
|
private location: Location,
|
||||||
|
private sqliteservice: SqliteService
|
||||||
) {
|
) {
|
||||||
this.activatedRoute.paramMap.subscribe(params => {
|
this.activatedRoute.paramMap.subscribe(params => {
|
||||||
// console.log(params["params"]);
|
// console.log(params["params"]);
|
||||||
@@ -59,7 +63,7 @@ export class DiplomaPage implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.profile = "mdgpr";
|
this.profile = "mdgpr";
|
||||||
this.LoadTaskDetail(this.serialNumber);
|
this.getFromDb();
|
||||||
}
|
}
|
||||||
|
|
||||||
goBack() {
|
goBack() {
|
||||||
@@ -125,11 +129,15 @@ export class DiplomaPage implements OnInit {
|
|||||||
"activityInstanceName": res.activityInstanceName,
|
"activityInstanceName": res.activityInstanceName,
|
||||||
}
|
}
|
||||||
this.fulltask = res;
|
this.fulltask = res;
|
||||||
|
this.sqliteservice.updateProcess(res)
|
||||||
|
|
||||||
let thedate = new Date(this.task.CreateDate);
|
let thedate = new Date(this.task.CreateDate);
|
||||||
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
|
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
|
||||||
|
|
||||||
this.processes.GetTaskParticipants(this.task.FolderId).subscribe(users=>{
|
this.processes.GetTaskParticipants(this.task.FolderId).subscribe(users=>{
|
||||||
|
this.sqliteservice.updateProcessInterveners(JSON.stringify(this.serialNumber), JSON.stringify(users)).then(() => {
|
||||||
|
console.log('internen diploma ')
|
||||||
|
})
|
||||||
this.intervenientes = users.filter(user=>{
|
this.intervenientes = users.filter(user=>{
|
||||||
return user.Type == 'I';
|
return user.Type == 'I';
|
||||||
});
|
});
|
||||||
@@ -155,6 +163,62 @@ export class DiplomaPage implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getFromDb() {
|
||||||
|
if(synchro.connected === true) {
|
||||||
|
this.LoadTaskDetail(this.serialNumber);
|
||||||
|
} else {
|
||||||
|
this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
|
||||||
|
|
||||||
|
this.task = {
|
||||||
|
"SerialNumber": process[0].serialNumber,
|
||||||
|
"Folio": JSON.parse(process[0].workflowInstanceDataFields).Subject,
|
||||||
|
"Senders": JSON.parse(process[0].originator).email,
|
||||||
|
"CreateDate": momentG(new Date(process[0].taskStartDate),'yyyy-MM-dd HH:mm:ss'),
|
||||||
|
"DocumentURL": JSON.parse(process[0].workflowInstanceDataFields).ViewerRequest,
|
||||||
|
"Remetente": JSON.parse(process[0].workflowInstanceDataFields).Sender,
|
||||||
|
"Note": JSON.parse(process[0].workflowInstanceDataFields).TaskMessage || JSON.parse(process[0].workflowInstanceDataFields).Note,
|
||||||
|
"FolderId": JSON.parse(process[0].workflowInstanceDataFields).FolderID,
|
||||||
|
"FsId": '361',
|
||||||
|
"DocId": JSON.parse(process[0].workflowInstanceDataFields).DispatchDocId,
|
||||||
|
"WorkflowName": process[0].workflowDisplayName,
|
||||||
|
"DeadlineType": JSON.parse(process[0].workflowInstanceDataFields).DeadlineType,
|
||||||
|
"activityInstanceName": process[0].activityInstanceName,
|
||||||
|
}
|
||||||
|
|
||||||
|
let fulltak = {
|
||||||
|
Documents: JSON.parse(process[0].Documents),
|
||||||
|
actions: JSON.parse(process[0].actions),
|
||||||
|
activityInstanceName: process[0].activityInstanceName,
|
||||||
|
formURL: process[0].formURL,
|
||||||
|
originator: JSON.parse(process[0].originator),
|
||||||
|
serialNumber: process[0].serialNumber,
|
||||||
|
taskStartDate: process[0].taskStartDate,
|
||||||
|
totalDocuments: process[0].totalDocuments,
|
||||||
|
workflowDisplayName: process[0].workflowDisplayName,
|
||||||
|
workflowID: process[0].workflowID,
|
||||||
|
workflowInstanceDataFields: JSON.parse(process[0].workflowInstanceDataFields),
|
||||||
|
workflowInstanceFolio: process[0].workflowInstanceFolio,
|
||||||
|
workflowInstanceID: process[0].workflowInstanceID,
|
||||||
|
workflowName: process[0].workflowName
|
||||||
|
}
|
||||||
|
this.fulltask = fulltak
|
||||||
|
|
||||||
|
let thedate = new Date(this.task.CreateDate);
|
||||||
|
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
|
||||||
|
|
||||||
|
this.intervenientes = JSON.parse(process[0].interveners).filter(user=>{
|
||||||
|
return user.Type == 'I';
|
||||||
|
});
|
||||||
|
this.cc = JSON.parse(process[0].interveners).filter(user=>{
|
||||||
|
return user.Type == 'CC';
|
||||||
|
});
|
||||||
|
|
||||||
|
this.attachments = JSON.parse(process[0].Documents)
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
viewDocument(docId:string){
|
viewDocument(docId:string){
|
||||||
this.processes.GetDocumentUrl(docId, '361').subscribe(res=>{
|
this.processes.GetDocumentUrl(docId, '361').subscribe(res=>{
|
||||||
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ import { ActivatedRoute, NavigationEnd, NavigationError, NavigationExtras, Navig
|
|||||||
import { DailyWorkTask } from '../../../models/dailyworktask.model';
|
import { DailyWorkTask } from '../../../models/dailyworktask.model';
|
||||||
import { ProcessesService } from 'src/app/services/processes.service';
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
|
|
||||||
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
|
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-diplomas',
|
selector: 'app-diplomas',
|
||||||
templateUrl: './diplomas.page.html',
|
templateUrl: './diplomas.page.html',
|
||||||
@@ -24,6 +27,7 @@ export class DiplomasPage implements OnInit, OnDestroy {
|
|||||||
private processes: ProcessesService,
|
private processes: ProcessesService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private activatedRoute: ActivatedRoute,
|
private activatedRoute: ActivatedRoute,
|
||||||
|
private sqliteservice: SqliteService
|
||||||
) {
|
) {
|
||||||
this.diplomasList = [];
|
this.diplomasList = [];
|
||||||
//Inicializar segment
|
//Inicializar segment
|
||||||
@@ -50,20 +54,7 @@ export class DiplomasPage implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const location = window.location
|
this.getFromDb()
|
||||||
const pathname = location.pathname + location.search
|
|
||||||
|
|
||||||
this.LoadList()
|
|
||||||
|
|
||||||
this.router.events.forEach((event) => {
|
|
||||||
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
|
|
||||||
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
|
||||||
this.refreshing()
|
|
||||||
} else {
|
|
||||||
this.LoadList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,6 +183,49 @@ export class DiplomasPage implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getFromDb() {
|
||||||
|
if (synchro.connected === true) {
|
||||||
|
const location = window.location
|
||||||
|
const pathname = location.pathname + location.search
|
||||||
|
|
||||||
|
this.LoadList()
|
||||||
|
|
||||||
|
this.router.events.forEach((event) => {
|
||||||
|
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
|
||||||
|
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||||
|
this.refreshing()
|
||||||
|
} else {
|
||||||
|
this.LoadList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.sqliteservice.getprocessByworkflow("Despacho do Presidente da República").then((process: any[]) => {
|
||||||
|
|
||||||
|
let diplomasValidar = process.filter(data => data.activityInstanceName == "Revisar Diploma");
|
||||||
|
let diplomasList = [];
|
||||||
|
diplomasValidar.forEach(async element => {
|
||||||
|
|
||||||
|
let task = this.pipeTaskOffline(element)
|
||||||
|
diplomasList.push(task);
|
||||||
|
|
||||||
|
});
|
||||||
|
this.diplomasList = this.sortArrayISODate(diplomasList.reverse());
|
||||||
|
|
||||||
|
let diplomasAssinados = process.reverse().filter(data => data.activityInstanceName == "Diploma Assinado");
|
||||||
|
let diplomasAssinadoList = []
|
||||||
|
diplomasAssinados.forEach(async element => {
|
||||||
|
|
||||||
|
let task = this.pipeTaskOffline(element)
|
||||||
|
diplomasAssinadoList.push(task);
|
||||||
|
});
|
||||||
|
console.log('diplomasAssinados', diplomasAssinados)
|
||||||
|
this.diplomasAssinadoList = this.sortArrayISODate(diplomasAssinadoList).reverse();
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pipeTask(element) {
|
pipeTask(element) {
|
||||||
let date = new Date(element.taskStartDate);
|
let date = new Date(element.taskStartDate);
|
||||||
date.setMonth(date.getMonth() + 1);
|
date.setMonth(date.getMonth() + 1);
|
||||||
@@ -212,6 +246,26 @@ export class DiplomasPage implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pipeTaskOffline(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();
|
||||||
|
return {
|
||||||
|
"SerialNumber": element.serialNumber,
|
||||||
|
"Folio": JSON.parse(element.workflowInstanceDataFields).Subject,
|
||||||
|
"Senders": JSON.parse(element.workflowInstanceDataFields).Sender,
|
||||||
|
"CreateDate": taskDate,
|
||||||
|
"DocumentURL": JSON.parse(element.workflowInstanceDataFields).ViewerRequest,
|
||||||
|
"Remetente": JSON.parse(element.workflowInstanceDataFields).Remetente,
|
||||||
|
"DocumentsQty": element.totalDocuments,
|
||||||
|
"DocId": JSON.parse(element.workflowInstanceDataFields).DocIdDiferimento,
|
||||||
|
"WorkflowName": element.workflowDisplayName,
|
||||||
|
"activityInstanceName": element.activityInstanceName,
|
||||||
|
"Status": JSON.parse(element.workflowInstanceDataFields).Status,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sortArrayISODate(myArray: any) {
|
sortArrayISODate(myArray: any) {
|
||||||
return myArray.sort(function (a, b) {
|
return myArray.sort(function (a, b) {
|
||||||
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
||||||
|
|||||||
@@ -79,8 +79,7 @@ export class ApproveEventPage implements OnInit {
|
|||||||
console.log(this.serialNumber);
|
console.log(this.serialNumber);
|
||||||
console.log(this.caller);
|
console.log(this.caller);
|
||||||
this.getProcessFromDB();
|
this.getProcessFromDB();
|
||||||
console.log("Aprove enet")
|
|
||||||
//this.getTask();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
goBack() {
|
goBack() {
|
||||||
@@ -106,6 +105,10 @@ export class ApproveEventPage implements OnInit {
|
|||||||
|
|
||||||
getProcessFromDB() {
|
getProcessFromDB() {
|
||||||
|
|
||||||
|
if (synchro.connected === true) {
|
||||||
|
this.getTask();
|
||||||
|
}
|
||||||
|
|
||||||
synchro.registerCallback('Offline', () => {
|
synchro.registerCallback('Offline', () => {
|
||||||
this.platform.ready().then(() => {
|
this.platform.ready().then(() => {
|
||||||
|
|
||||||
|
|||||||
@@ -46,13 +46,24 @@ export class EventListPage implements OnInit {
|
|||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
this.segment = 'MDGPR';
|
this.segment = 'MDGPR';
|
||||||
|
|
||||||
const location = window.location
|
|
||||||
const pathname = location.pathname + location.search
|
|
||||||
|
|
||||||
this.getEventToAproveFromDB();
|
this.getEventToAproveFromDB();
|
||||||
|
|
||||||
|
window.onresize = (event) => {
|
||||||
|
// if not mobile remove all component
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
this.modalController.dismiss();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
getEventToAproveFromDB() {
|
||||||
|
|
||||||
|
if( synchro.connected === true) {
|
||||||
|
const location = window.location
|
||||||
|
const pathname = location.pathname + location.search
|
||||||
|
|
||||||
this.LoadToApproveEvents()
|
this.LoadToApproveEvents()
|
||||||
|
|
||||||
@@ -65,18 +76,7 @@ export class EventListPage implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
window.onresize = (event) => {
|
|
||||||
// if not mobile remove all component
|
|
||||||
if( window.innerWidth <= 800){
|
|
||||||
this.modalController.dismiss();
|
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
getEventToAproveFromDB() {
|
|
||||||
|
|
||||||
synchro.registerCallback('Offline', () => {
|
synchro.registerCallback('Offline', () => {
|
||||||
this.platform.ready().then(() => {
|
this.platform.ready().then(() => {
|
||||||
|
|||||||
+10
-8
@@ -86,9 +86,6 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.getFromDB();
|
this.getFromDB();
|
||||||
if(this.onlinecheck) {
|
|
||||||
this.LoadTaskDetail(this.serialNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,9 +99,9 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
|
|
||||||
getFromDB() {
|
getFromDB() {
|
||||||
|
|
||||||
synchro.registerCallback('Online', () => {
|
if(synchro.connected === true) {
|
||||||
this.onlinecheck = true;
|
this.LoadTaskDetail(this.serialNumber);
|
||||||
})
|
}
|
||||||
|
|
||||||
|
|
||||||
synchro.registerCallback('Offline', () => {
|
synchro.registerCallback('Offline', () => {
|
||||||
@@ -114,12 +111,17 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
console.log("expedient ditail", process)
|
console.log("expedient ditail", process)
|
||||||
|
|
||||||
var workflow = JSON.parse(process[0].workflowInstanceDataFields);
|
var workflow = JSON.parse(process[0].workflowInstanceDataFields);
|
||||||
var origina = JSON.parse(process[0].originator)
|
var origina
|
||||||
|
if (process[0].originator === "undefined") {
|
||||||
|
origina = ""
|
||||||
|
} else {
|
||||||
|
origina = JSON.parse(process[0].originator)
|
||||||
|
}
|
||||||
|
|
||||||
this.task = {
|
this.task = {
|
||||||
"SerialNumber": process[0].serialNumber,
|
"SerialNumber": process[0].serialNumber,
|
||||||
"Folio": workflow.Subject,
|
"Folio": workflow.Subject,
|
||||||
"Senders": origina.email,
|
"Senders": origina.email || process[0].originator,
|
||||||
"CreateDate": momentG(new Date(process[0].taskStartDate), 'yyyy-MM-dd HH:mm:ss'),
|
"CreateDate": momentG(new Date(process[0].taskStartDate), 'yyyy-MM-dd HH:mm:ss'),
|
||||||
"DocumentURL": workflow.ViewerRequest,
|
"DocumentURL": workflow.ViewerRequest,
|
||||||
"Remetente": workflow.Sender,
|
"Remetente": workflow.Sender,
|
||||||
|
|||||||
@@ -39,12 +39,10 @@ export class ExpedientePage implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
const location = window.location
|
|
||||||
const pathname = location.pathname + location.search
|
|
||||||
|
|
||||||
this.getEventsFromLocalDb();
|
this.getEventsFromLocalDb();
|
||||||
console.log("segrsgre")
|
console.log("segrsgre")
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
this.LoadList()
|
this.LoadList()
|
||||||
|
|
||||||
@@ -58,6 +56,8 @@ export class ExpedientePage implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
=======
|
||||||
|
>>>>>>> branchBug
|
||||||
}
|
}
|
||||||
|
|
||||||
async LoadList() {
|
async LoadList() {
|
||||||
@@ -74,6 +74,7 @@ export class ExpedientePage implements OnInit {
|
|||||||
|
|
||||||
let task = this.expedienteTaskPipe.transform(element)
|
let task = this.expedienteTaskPipe.transform(element)
|
||||||
this.taskslist.push(task);
|
this.taskslist.push(task);
|
||||||
|
this.sqliteservice.addProcess(task);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.listToPresent = this.taskslist
|
this.listToPresent = this.taskslist
|
||||||
@@ -136,17 +137,25 @@ export class ExpedientePage implements OnInit {
|
|||||||
|
|
||||||
getEventsFromLocalDb() {
|
getEventsFromLocalDb() {
|
||||||
|
|
||||||
synchro.registerCallback('Online', () => {
|
if (synchro.connected === true) {
|
||||||
this.onlinecheck = true;
|
const location = window.location
|
||||||
})
|
const pathname = location.pathname + location.search
|
||||||
|
|
||||||
|
this.LoadList()
|
||||||
|
|
||||||
|
this.router.events.forEach((event) => {
|
||||||
synchro.registerCallback('Offline', () => {
|
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
|
||||||
this.platform.ready().then(() => {
|
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||||
this.onlinecheck = false;
|
this.refreshing()
|
||||||
|
} else {
|
||||||
|
this.LoadList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
this.taskslist = new Array();
|
this.taskslist = new Array();
|
||||||
this.sqliteservice.getprocessByworkflow("Expediente").then((expediente: any[]) => {
|
this.sqliteservice.getprocessByworkflow("Expediente").then((expediente: any[]) => {
|
||||||
|
console.log("All expedientes from local,", expediente)
|
||||||
|
|
||||||
expediente.forEach((element) => {
|
expediente.forEach((element) => {
|
||||||
|
|
||||||
@@ -168,12 +177,9 @@ export class ExpedientePage implements OnInit {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.listToPresent = this.taskslist
|
this.listToPresent = this.taskslist
|
||||||
console.log("All expedientes from local,", expediente)
|
|
||||||
})
|
|
||||||
console.log('Offlineee')
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,33 +176,9 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
|||||||
this.segmentVista = "boxview"
|
this.segmentVista = "boxview"
|
||||||
}
|
}
|
||||||
|
|
||||||
const pathname = window.location.pathname
|
|
||||||
|
|
||||||
this.getAllProcessFromDB()
|
this.getAllProcessFromDB()
|
||||||
|
|
||||||
|
|
||||||
this.router.events.forEach((event) => {
|
|
||||||
if (event instanceof NavigationEnd && event.url == pathname) {
|
|
||||||
|
|
||||||
this.waitForDomService.selector({
|
|
||||||
selector: 'app-gabinete-digital ion-content .aside-wrapper',
|
|
||||||
callback: () => {
|
|
||||||
this.checkRoutes();
|
|
||||||
this.LoadCounts();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.hideRefreshButton();
|
|
||||||
|
|
||||||
this.waitForDomService.selector({
|
|
||||||
selector: 'app-gabinete-digital ion-content .aside-wrapper',
|
|
||||||
callback: () => {
|
|
||||||
this.loadAllProcesses();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async loadAllProcesses() {
|
async loadAllProcesses() {
|
||||||
@@ -247,7 +223,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
|||||||
this.allProcessesList = removeDuplicate(this.allProcessesList)
|
this.allProcessesList = removeDuplicate(this.allProcessesList)
|
||||||
this.allProcessesList = this.sortArrayISODate(this.allProcessesList).reverse();
|
this.allProcessesList = this.sortArrayISODate(this.allProcessesList).reverse();
|
||||||
|
|
||||||
this.totalDocumentStore.resetCount(this.allProcessesList.length)
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -283,14 +259,31 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
|||||||
|
|
||||||
getAllProcessFromDB() {
|
getAllProcessFromDB() {
|
||||||
|
|
||||||
synchro.registerCallback('Online', () => {
|
if (synchro.connected === true ) {
|
||||||
this.platform.ready().then(() => {
|
const pathname = window.location.pathname
|
||||||
this.loadAllProcesses();
|
this.router.events.forEach((event) => {
|
||||||
})
|
if (event instanceof NavigationEnd && event.url == pathname) {
|
||||||
})
|
|
||||||
|
|
||||||
synchro.registerCallback('Offline', () => {
|
this.waitForDomService.selector({
|
||||||
this.platform.ready().then(() => {
|
selector: 'app-gabinete-digital ion-content .aside-wrapper',
|
||||||
|
callback: () => {
|
||||||
|
this.checkRoutes();
|
||||||
|
this.LoadCounts();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.hideRefreshButton();
|
||||||
|
|
||||||
|
this.waitForDomService.selector({
|
||||||
|
selector: 'app-gabinete-digital ion-content .aside-wrapper',
|
||||||
|
callback: () => {
|
||||||
|
this.loadAllProcesses();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.hideRefreshButton();
|
||||||
|
|
||||||
this.sqliteservice.getAllProcess().then((allprocess: any[]) => {
|
this.sqliteservice.getAllProcess().then((allprocess: any[]) => {
|
||||||
allprocess.forEach(element => {
|
allprocess.forEach(element => {
|
||||||
@@ -299,7 +292,6 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
|||||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||||
|
|
||||||
var workflowInstanceDataFields = JSON.parse(element.workflowInstanceDataFields);
|
var workflowInstanceDataFields = JSON.parse(element.workflowInstanceDataFields);
|
||||||
console.log("WORKFLOW all process", workflowInstanceDataFields)
|
|
||||||
|
|
||||||
let task = {
|
let task = {
|
||||||
"SerialNumber": element.serialNumber,
|
"SerialNumber": element.serialNumber,
|
||||||
@@ -322,14 +314,10 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
|||||||
this.allProcessesList = removeDuplicate(this.allProcessesList)
|
this.allProcessesList = removeDuplicate(this.allProcessesList)
|
||||||
this.allProcessesList = this.sortArrayISODate(this.allProcessesList).reverse();
|
this.allProcessesList = this.sortArrayISODate(this.allProcessesList).reverse();
|
||||||
|
|
||||||
this.totalDocumentStore.resetCount(this.allProcessesList.length)
|
|
||||||
|
|
||||||
});
|
});
|
||||||
console.log("All process from db ", allprocess)
|
console.log("All process from db ", allprocess)
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
console.log('Offlineee')
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sortArrayISODate(myArray: any) {
|
sortArrayISODate(myArray: any) {
|
||||||
@@ -547,7 +535,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
|||||||
|
|
||||||
let allPreocesses_ = await this.processesbackend.GetTasksList("", false).toPromise();
|
let allPreocesses_ = await this.processesbackend.GetTasksList("", false).toPromise();
|
||||||
let count_all_processes = Object.keys(allPreocesses_).length;
|
let count_all_processes = Object.keys(allPreocesses_).length;
|
||||||
this.totalDocumentStore.resetCount(count_all_processes)
|
|
||||||
|
|
||||||
let expedientes = await this.processesbackend.GetTaskListExpediente(false).toPromise();
|
let expedientes = await this.processesbackend.GetTaskListExpediente(false).toPromise();
|
||||||
expedientes = expedientes.filter(data => data.workflowInstanceDataFields.Status == "Active")
|
expedientes = expedientes.filter(data => data.workflowInstanceDataFields.Status == "Active")
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ import { PermissionService } from 'src/app/OtherService/permission.service';
|
|||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
import { PedidoService } from 'src/app/Rules/pedido.service';
|
import { PedidoService } from 'src/app/Rules/pedido.service';
|
||||||
|
|
||||||
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
|
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-pedido',
|
selector: 'app-pedido',
|
||||||
@@ -55,7 +58,8 @@ export class PedidoPage implements OnInit {
|
|||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
public p: PermissionService,
|
public p: PermissionService,
|
||||||
private location: Location,
|
private location: Location,
|
||||||
private pedidoService: PedidoService
|
private pedidoService: PedidoService,
|
||||||
|
private sqliteservice: SqliteService,
|
||||||
) {
|
) {
|
||||||
this.loggeduser = authService.ValidatedUser;
|
this.loggeduser = authService.ValidatedUser;
|
||||||
|
|
||||||
@@ -73,7 +77,7 @@ export class PedidoPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.LoadTaskDetail(this.serialnumber);
|
this.getfromDb()
|
||||||
}
|
}
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
@@ -91,6 +95,7 @@ export class PedidoPage implements OnInit {
|
|||||||
this.processes.GetTask(this.serialnumber).subscribe(res => {
|
this.processes.GetTask(this.serialnumber).subscribe(res => {
|
||||||
|
|
||||||
this.fulltask = res
|
this.fulltask = res
|
||||||
|
console.log('FULLTAK ONLINe', this.fulltask);
|
||||||
|
|
||||||
if (res.workflowDisplayName == 'Pedido de Parecer' || res.workflowDisplayName == 'Pedido de Parecer do Presidente') {
|
if (res.workflowDisplayName == 'Pedido de Parecer' || res.workflowDisplayName == 'Pedido de Parecer do Presidente') {
|
||||||
|
|
||||||
@@ -116,6 +121,7 @@ export class PedidoPage implements OnInit {
|
|||||||
"Status": res.workflowInstanceDataFields.Status,
|
"Status": res.workflowInstanceDataFields.Status,
|
||||||
}
|
}
|
||||||
console.log(this.task);
|
console.log(this.task);
|
||||||
|
this.sqliteservice.updateProcess(res);
|
||||||
}
|
}
|
||||||
else if (res.workflowDisplayName == 'Pedido de Deferimento') {
|
else if (res.workflowDisplayName == 'Pedido de Deferimento') {
|
||||||
|
|
||||||
@@ -140,12 +146,16 @@ export class PedidoPage implements OnInit {
|
|||||||
"activityInstanceName": res.activityInstanceName,
|
"activityInstanceName": res.activityInstanceName,
|
||||||
"Status": res.workflowInstanceDataFields.Status,
|
"Status": res.workflowInstanceDataFields.Status,
|
||||||
}
|
}
|
||||||
|
this.sqliteservice.updateProcess(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
let thedate = new Date(res.taskStartDate);
|
let thedate = new Date(res.taskStartDate);
|
||||||
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||||
|
|
||||||
this.processes.GetTaskParticipants(res.workflowInstanceDataFields.FolderID).subscribe(users => {
|
this.processes.GetTaskParticipants(res.workflowInstanceDataFields.FolderID).subscribe(users => {
|
||||||
|
this.sqliteservice.updateProcessInterveners(JSON.stringify(this.serialnumber), JSON.stringify(users)).then(() =>{
|
||||||
|
console.log('Pedido ')
|
||||||
|
})
|
||||||
this.intervenientes = users.filter(user => {
|
this.intervenientes = users.filter(user => {
|
||||||
return user.Type == 'I';
|
return user.Type == 'I';
|
||||||
});
|
});
|
||||||
@@ -171,10 +181,104 @@ export class PedidoPage implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getfromDb() {
|
||||||
|
if (synchro.connected === true) {
|
||||||
|
this.LoadTaskDetail(this.serialnumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (synchro.connected === false) {
|
||||||
|
this.sqliteservice.getProcessById(this.serialnumber).then((process) => {
|
||||||
|
|
||||||
|
console.log('PROCESS BY ID', process,this.serialnumber )
|
||||||
|
|
||||||
|
let fulltak = {
|
||||||
|
Documents: JSON.parse(process[0].Documents),
|
||||||
|
actions: JSON.parse(process[0].actions),
|
||||||
|
activityInstanceName: process[0].activityInstanceName,
|
||||||
|
formURL: process[0].formURL,
|
||||||
|
originator: JSON.parse(process[0].originator),
|
||||||
|
serialNumber: process[0].serialNumber,
|
||||||
|
taskStartDate: process[0].taskStartDate,
|
||||||
|
totalDocuments: process[0].totalDocuments,
|
||||||
|
workflowDisplayName: process[0].workflowDisplayName,
|
||||||
|
workflowID: process[0].workflowID,
|
||||||
|
workflowInstanceDataFields: JSON.parse(process[0].workflowInstanceDataFields),
|
||||||
|
workflowInstanceFolio: process[0].workflowInstanceFolio,
|
||||||
|
workflowInstanceID: process[0].workflowInstanceID,
|
||||||
|
workflowName: process[0].workflowName
|
||||||
|
}
|
||||||
|
|
||||||
|
this.fulltask = fulltak;
|
||||||
|
console.log('FULLTAK OFFLINE', this.fulltask);
|
||||||
|
|
||||||
|
if (process[0].workflowDisplayName == 'Pedido de Parecer' || process[0].workflowDisplayName == 'Pedido de Parecer do Presidente') {
|
||||||
|
let date = new Date(process[0].taskStartDate);
|
||||||
|
date.setMonth(date.getMonth() + 1);
|
||||||
|
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||||
|
|
||||||
|
this.task = {
|
||||||
|
"SerialNumber": process[0].serialNumber,
|
||||||
|
"Folio": JSON.parse(process[0].workflowInstanceDataFields).Subject,
|
||||||
|
"Senders": JSON.parse(process[0].workflowInstanceDataFields).Sender,
|
||||||
|
"CreateDate": taskDate,
|
||||||
|
"DocumentURL": JSON.parse(process[0].workflowInstanceDataFields).ViewerRequest,
|
||||||
|
"Remetente": JSON.parse(process[0].workflowInstanceDataFields).Sender,
|
||||||
|
"Note": JSON.parse(process[0].workflowInstanceDataFields).TaskMessage,
|
||||||
|
"FolderId": JSON.parse(process[0].workflowInstanceDataFields).FolderID,
|
||||||
|
"FsId": '361',
|
||||||
|
"DocId": JSON.parse(process[0].workflowInstanceDataFields).DocIdDeferimento,
|
||||||
|
"WorkflowName": process[0].workflowDisplayName,
|
||||||
|
"DeadlineType": JSON.parse(process[0].workflowInstanceDataFields).DeadlineType,
|
||||||
|
"ProcessInstanceID": JSON.parse(process[0].workflowInstanceDataFields).InstanceID,
|
||||||
|
"activityInstanceName": process[0].activityInstanceName,
|
||||||
|
"Status": JSON.parse(process[0].workflowInstanceDataFields).Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
this.attachments = JSON.parse(process[0].Documents);
|
||||||
|
} else if (process[0].workflowDisplayName == 'Pedido de Deferimento') {
|
||||||
|
|
||||||
|
let date = new Date(process[0].taskStartDate);
|
||||||
|
date.setMonth(date.getMonth() + 1);
|
||||||
|
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||||
|
this.task = {
|
||||||
|
"SerialNumber": process[0].serialNumber,
|
||||||
|
"Folio": JSON.parse(process[0].workflowInstanceDataFields).Subject,
|
||||||
|
"Senders": JSON.parse(process[0].workflowInstanceDataFields).Sender,
|
||||||
|
"CreateDate": taskDate,
|
||||||
|
"DocumentURL": JSON.parse(process[0].workflowInstanceDataFields).ViewerRequest,
|
||||||
|
"Remetente": JSON.parse(process[0].workflowInstanceDataFields).Sender,
|
||||||
|
"Note": JSON.parse(process[0].workflowInstanceDataFields).TaskMessage,
|
||||||
|
"FolderId": JSON.parse(process[0].workflowInstanceDataFields).FolderID,
|
||||||
|
"FsId": '361',
|
||||||
|
"DocId": JSON.parse(process[0].workflowInstanceDataFields).DocIdDeferimento,
|
||||||
|
"WorkflowName": process[0].workflowDisplayName,
|
||||||
|
"DeadlineType": JSON.parse(process[0].workflowInstanceDataFields).DeadlineType,
|
||||||
|
"ProcessInstanceID": JSON.parse(process[0].workflowInstanceDataFields).InstanceID,
|
||||||
|
"activityInstanceName": process[0].activityInstanceName,
|
||||||
|
"Status": JSON.parse(process[0].workflowInstanceDataFields).Status,
|
||||||
|
}
|
||||||
|
this.attachments = JSON.parse(process[0].Documents);
|
||||||
|
}
|
||||||
|
|
||||||
|
let thedate = new Date(process[0].taskStartDate);
|
||||||
|
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||||
|
|
||||||
|
this.intervenientes = JSON.parse(process[0].interveners).filter(user => {
|
||||||
|
return user.Type == 'I';
|
||||||
|
});
|
||||||
|
this.cc = JSON.parse(process[0].interveners).filter(user => {
|
||||||
|
return user.Type == 'CC';
|
||||||
|
});
|
||||||
|
this.getDocumentDetails(JSON.parse(process[0].workflowInstanceDataFields).FolderID, '361');
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
getDocumentDetails(forlderId: string, applicationId: string) {
|
getDocumentDetails(forlderId: string, applicationId: string) {
|
||||||
this.processes.GetDocumentDetails(forlderId, applicationId).subscribe(res => {
|
this.processes.GetDocumentDetails(forlderId, applicationId).subscribe(res => {
|
||||||
this.attachments = res.Documents;
|
this.attachments = res.Documents;
|
||||||
// console.log(res['Documents']);
|
console.log('Attachment',this.attachments);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,7 +351,8 @@ export class PedidoPage implements OnInit {
|
|||||||
const loader = this.toastService.loading()
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.pedidoService.arquivar({serialNumber: this.serialnumber,
|
await this.pedidoService.arquivar({
|
||||||
|
serialNumber: this.serialnumber,
|
||||||
documents,
|
documents,
|
||||||
note
|
note
|
||||||
}).toPromise()
|
}).toPromise()
|
||||||
|
|||||||
@@ -38,13 +38,13 @@
|
|||||||
|
|
||||||
<div class="width-100" [ngSwitch]="segment">
|
<div class="width-100" [ngSwitch]="segment">
|
||||||
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
|
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
|
||||||
<div *ngIf="pedidosstorage.listparecer">
|
<div *ngIf="listToPresentparecerList">
|
||||||
<ion-list *ngSwitchCase="'parecer'">
|
<ion-list *ngSwitchCase="'parecer'">
|
||||||
<!-- *ngFor = "let task of pedidosstorage.listparecer; let i = index"
|
<!-- *ngFor = "let task of pedidosstorage.listparecer; let i = index"
|
||||||
(click)="viewExpedientDetail(task.SerialNumber)" -->
|
(click)="viewExpedientDetail(task.SerialNumber)" -->
|
||||||
<div
|
<div
|
||||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||||
*ngFor = "let task of pedidosstorage.listparecer"
|
*ngFor = "let task of listToPresentparecerList"
|
||||||
(click)="goToPedido(task.SerialNumber)"
|
(click)="goToPedido(task.SerialNumber)"
|
||||||
>
|
>
|
||||||
<!-- (click)="viewExpedientDetail(task.SerialNumber)" -->
|
<!-- (click)="viewExpedientDetail(task.SerialNumber)" -->
|
||||||
@@ -77,11 +77,11 @@
|
|||||||
</ion-list>
|
</ion-list>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="pedidosstorage.listdeferimento">
|
<div *ngIf="listToPresentdeferimentoList">
|
||||||
<ion-list *ngSwitchCase="'deferimento'">
|
<ion-list *ngSwitchCase="'deferimento'">
|
||||||
<div
|
<div
|
||||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||||
*ngFor = "let task of pedidosstorage.listdeferimento"
|
*ngFor = "let task of listToPresentdeferimentoList"
|
||||||
(click)="goToPedido(task.SerialNumber)"
|
(click)="goToPedido(task.SerialNumber)"
|
||||||
>
|
>
|
||||||
<!-- (click)="viewExpedientDetail(task.SerialNumber)" -->
|
<!-- (click)="viewExpedientDetail(task.SerialNumber)" -->
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ import { ModalController, NavParams } from '@ionic/angular';
|
|||||||
import { AlertService } from 'src/app/services/alert.service';
|
import { AlertService } from 'src/app/services/alert.service';
|
||||||
import { PedidosStore } from 'src/app/store/pedidos-store.service';
|
import { PedidosStore } from 'src/app/store/pedidos-store.service';
|
||||||
import { ModalService } from 'src/app/services/modal.service';
|
import { ModalService } from 'src/app/services/modal.service';
|
||||||
|
|
||||||
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
|
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-pedidos',
|
selector: 'app-pedidos',
|
||||||
templateUrl: './pedidos.page.html',
|
templateUrl: './pedidos.page.html',
|
||||||
@@ -18,6 +22,8 @@ export class PedidosPage implements OnInit {
|
|||||||
|
|
||||||
taskslist:DailyWorkTask[] = [];
|
taskslist:DailyWorkTask[] = [];
|
||||||
parecerList:any[] = [];
|
parecerList:any[] = [];
|
||||||
|
listToPresentparecerList: any[] = [];
|
||||||
|
listToPresentdeferimentoList: any[] = [];
|
||||||
fulltask:any;
|
fulltask:any;
|
||||||
|
|
||||||
parecerListResult:customTask[] = [];
|
parecerListResult:customTask[] = [];
|
||||||
@@ -38,7 +44,8 @@ export class PedidosPage implements OnInit {
|
|||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
private alertService: AlertService,
|
private alertService: AlertService,
|
||||||
private activatedRoute: ActivatedRoute,
|
private activatedRoute: ActivatedRoute,
|
||||||
private modalService: ModalService
|
private modalService: ModalService,
|
||||||
|
private sqliteservice: SqliteService
|
||||||
) {
|
) {
|
||||||
//Inicializar segment
|
//Inicializar segment
|
||||||
this.segment = 'parecer';
|
this.segment = 'parecer';
|
||||||
@@ -57,21 +64,7 @@ export class PedidosPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.getFromDb();
|
||||||
this.LoadList()
|
|
||||||
|
|
||||||
this.router.events.forEach((event) => {
|
|
||||||
if(event instanceof NavigationStart && '/home/gabinete-digital/pedidos?parecer=true'.startsWith(event.url) ||
|
|
||||||
event instanceof NavigationStart && '/home/gabinete-digital/pedidos?deferimento=true'.startsWith(event.url)
|
|
||||||
) {
|
|
||||||
|
|
||||||
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
|
||||||
this.refreshing()
|
|
||||||
} else {
|
|
||||||
this.LoadList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
goBack() {
|
goBack() {
|
||||||
@@ -141,7 +134,8 @@ export class PedidosPage implements OnInit {
|
|||||||
}
|
}
|
||||||
this.parecerList.push(task);
|
this.parecerList.push(task);
|
||||||
});
|
});
|
||||||
this.pedidosstorage.resetparecer(this.parecerList);
|
this.sqliteservice.addProcess(this.parecerList);
|
||||||
|
this.listToPresentparecerList = this.parecerList
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(this.segment == 'deferimento') {
|
else if(this.segment == 'deferimento') {
|
||||||
@@ -181,7 +175,8 @@ export class PedidosPage implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
this.pedidosstorage.resetdeferimento(this.deferimentoList);
|
this.sqliteservice.addProcess(this.deferimentoList);
|
||||||
|
this.listToPresentdeferimentoList = this.deferimentoList
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -189,6 +184,83 @@ export class PedidosPage implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getFromDb() {
|
||||||
|
if(synchro.connected === true) {
|
||||||
|
this.LoadList()
|
||||||
|
|
||||||
|
this.router.events.forEach((event) => {
|
||||||
|
if(event instanceof NavigationStart && '/home/gabinete-digital/pedidos?parecer=true'.startsWith(event.url) ||
|
||||||
|
event instanceof NavigationStart && '/home/gabinete-digital/pedidos?deferimento=true'.startsWith(event.url)
|
||||||
|
) {
|
||||||
|
|
||||||
|
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||||
|
this.refreshing()
|
||||||
|
} else {
|
||||||
|
this.LoadList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if(synchro.connected === false) {
|
||||||
|
let parecerlist = [];
|
||||||
|
let deferimentolist = []
|
||||||
|
this.sqliteservice.getprocessByworkflowpedido("Pedido de Parecer", "Pedido de Parecer do Presidente").then((process: any[]) => {
|
||||||
|
|
||||||
|
process.forEach((element) => {
|
||||||
|
if(JSON.parse(element.workflowInstanceDataFields).Status == "Active") {
|
||||||
|
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": JSON.parse(element.workflowInstanceDataFields).Subject,
|
||||||
|
"Senders": JSON.parse(element.workflowInstanceDataFields).Sender,
|
||||||
|
"CreateDate": taskDate,
|
||||||
|
"DocumentURL": JSON.parse(element.workflowInstanceDataFields).ViewerRequest,
|
||||||
|
"Remetente": JSON.parse(element.workflowInstanceDataFields).Remetente,
|
||||||
|
"DocumentsQty": element.totalDocuments,
|
||||||
|
"DocId": JSON.parse(element.workflowInstanceDataFields).DocIdDiferimento,
|
||||||
|
"WorkflowName": element.workflowDisplayName,
|
||||||
|
"activityInstanceName": element.activityInstanceName,
|
||||||
|
}
|
||||||
|
parecerlist.push(task)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.listToPresentparecerList = parecerlist;
|
||||||
|
console.log('parecer',process)
|
||||||
|
})
|
||||||
|
|
||||||
|
this.sqliteservice.getprocessByworkflow("Pedido de Deferimento").then((process: any[]) => {
|
||||||
|
process.forEach((element) => {
|
||||||
|
if(JSON.parse(element.workflowInstanceDataFields).Status == "Active") {
|
||||||
|
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": JSON.parse(element.workflowInstanceDataFields).Subject,
|
||||||
|
"Senders": JSON.parse(element.workflowInstanceDataFields).Sender,
|
||||||
|
"CreateDate": taskDate,
|
||||||
|
"DocumentURL": JSON.parse(element.workflowInstanceDataFields).ViewerRequest,
|
||||||
|
"Remetente": JSON.parse(element.workflowInstanceDataFields).Remetente,
|
||||||
|
"DocumentsQty": element.totalDocuments,
|
||||||
|
"DocId": JSON.parse(element.workflowInstanceDataFields).DocIdDiferimento,
|
||||||
|
"WorkflowName": element.workflowDisplayName,
|
||||||
|
"activityInstanceName": element.activityInstanceName,
|
||||||
|
}
|
||||||
|
deferimentolist.push(task)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.listToPresentdeferimentoList = deferimentolist;
|
||||||
|
console.log('deferimento',process)
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
segmentChanged(ev: any) {
|
segmentChanged(ev: any) {
|
||||||
this.LoadList();
|
this.LoadList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
</ion-refresher>
|
</ion-refresher>
|
||||||
|
|
||||||
<app-task-list class="height-100"
|
<app-task-list class="height-100"
|
||||||
[taskList] = pendentesstore.list
|
[taskList] = listToPresent
|
||||||
[skeletonLoader] = skeletonLoader
|
[skeletonLoader] = skeletonLoader
|
||||||
(viewTaskDetail)="viewTaskDetails($event)"
|
(viewTaskDetail)="viewTaskDetails($event)"
|
||||||
> </app-task-list>
|
> </app-task-list>
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ import { LoginUserRespose } from 'src/app/models/user.model';
|
|||||||
import { AuthService } from 'src/app/services/auth.service';
|
import { AuthService } from 'src/app/services/auth.service';
|
||||||
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
|
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
|
||||||
|
|
||||||
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
|
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||||
|
import { Platform } from '@ionic/angular';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-pendentes',
|
selector: 'app-pendentes',
|
||||||
@@ -30,6 +34,9 @@ export class PendentesPage implements OnInit {
|
|||||||
skeletonLoader = true
|
skeletonLoader = true
|
||||||
pendentesstore = PendentesStore;
|
pendentesstore = PendentesStore;
|
||||||
customTaskPipe = new CustomTaskPipe()
|
customTaskPipe = new CustomTaskPipe()
|
||||||
|
listToPresent = [];
|
||||||
|
|
||||||
|
synch = synchro
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private processes: ProcessesService,
|
private processes: ProcessesService,
|
||||||
@@ -37,6 +44,8 @@ export class PendentesPage implements OnInit {
|
|||||||
private router: Router,
|
private router: Router,
|
||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
private activatedRoute: ActivatedRoute,
|
private activatedRoute: ActivatedRoute,
|
||||||
|
private sqliteservice: SqliteService,
|
||||||
|
private platform: Platform
|
||||||
) {
|
) {
|
||||||
this.loggeduser = authService.ValidatedUser;
|
this.loggeduser = authService.ValidatedUser;
|
||||||
this.profile = 'mdgpr';
|
this.profile = 'mdgpr';
|
||||||
@@ -45,21 +54,7 @@ export class PendentesPage implements OnInit {
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
//Inicializar segment
|
//Inicializar segment
|
||||||
this.segment = "despachos";
|
this.segment = "despachos";
|
||||||
|
this.getFromDb();
|
||||||
const location = window.location
|
|
||||||
const pathname = location.pathname + location.search
|
|
||||||
|
|
||||||
this.LoadList()
|
|
||||||
|
|
||||||
this.router.events.forEach((event) => {
|
|
||||||
if (event instanceof NavigationEnd && event.url.startsWith(pathname)) {
|
|
||||||
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
|
||||||
this.refreshing()
|
|
||||||
} else {
|
|
||||||
this.LoadList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,8 +84,7 @@ export class PendentesPage implements OnInit {
|
|||||||
|
|
||||||
pendentesList = removeDuplicate(pendentesList)
|
pendentesList = removeDuplicate(pendentesList)
|
||||||
pendentesList = this.sortArrayISODate(pendentesList);
|
pendentesList = this.sortArrayISODate(pendentesList);
|
||||||
|
this.listToPresent = pendentesList;
|
||||||
this.pendentesstore.reset(pendentesList);
|
|
||||||
this.skeletonLoader = false;
|
this.skeletonLoader = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -101,6 +95,56 @@ export class PendentesPage implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getFromDb() {
|
||||||
|
|
||||||
|
if (synchro.connected === true) {
|
||||||
|
const location = window.location
|
||||||
|
const pathname = location.pathname + location.search
|
||||||
|
|
||||||
|
this.LoadList()
|
||||||
|
|
||||||
|
this.router.events.forEach((event) => {
|
||||||
|
if (event instanceof NavigationEnd && event.url.startsWith(pathname)) {
|
||||||
|
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||||
|
this.refreshing()
|
||||||
|
} else {
|
||||||
|
this.LoadList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
synchro.registerCallback('Offline', () => {
|
||||||
|
this.platform.ready().then(() => {
|
||||||
|
this.sqliteservice.getAllProcess().then((process: any[]) => {
|
||||||
|
var pendingList = []
|
||||||
|
process.forEach(element => {
|
||||||
|
var workflow = JSON.parse(element.workflowInstanceDataFields);
|
||||||
|
if (workflow.Status === "Pending") {
|
||||||
|
let task = {
|
||||||
|
"CreateDate": element.taskStartDate,
|
||||||
|
"DocumentsQty": element.totalDocuments,
|
||||||
|
"FolderID": workflow.FolderID,
|
||||||
|
"Folio": workflow.Subject,
|
||||||
|
"Senders": workflow.Sender,
|
||||||
|
"SerialNumber": element.serialNumber,
|
||||||
|
"Status": workflow.Status,
|
||||||
|
"WorkflowName": element.workflowDisplayName
|
||||||
|
|
||||||
|
}
|
||||||
|
pendingList.push(task)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
pendingList = this.sortArrayISODate(pendingList);
|
||||||
|
this.listToPresent = pendingList;
|
||||||
|
console.log('pendentes', pendingList)
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
async refreshing() {
|
async refreshing() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.LoadList();
|
this.LoadList();
|
||||||
|
|||||||
@@ -85,21 +85,17 @@ class SynchroService {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//if(!this._connected) {
|
if(!this._connected === true) {
|
||||||
|
|
||||||
this.BackgroundService.online()
|
this.BackgroundService.online()
|
||||||
|
console.log('Online',this._connected)
|
||||||
this.callBacks.forEach((e)=>{
|
this.callBacks.forEach((e)=>{
|
||||||
if(e.type == 'Online') {
|
if(e.type == 'Online') {
|
||||||
e.funx()
|
e.funx()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
//}
|
|
||||||
|
|
||||||
console.log('open ======================= welcome to socket server')
|
console.log('open ======================= welcome to socket server')
|
||||||
this.eventtrigger.publishSomeData({
|
|
||||||
internet: "online"
|
|
||||||
})
|
|
||||||
|
|
||||||
this._connected = true
|
this._connected = true
|
||||||
|
|
||||||
@@ -185,14 +181,15 @@ class SynchroService {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if(this._connected){
|
if(this._connected === false){
|
||||||
this.BackgroundService.offline();
|
this.BackgroundService.offline();
|
||||||
|
console.log('Offline',this._connected)
|
||||||
this.callBacks.forEach((e)=>{
|
this.callBacks.forEach((e)=>{
|
||||||
if(e.type == 'Offline') {
|
if(e.type == 'Offline') {
|
||||||
e.funx()
|
e.funx()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
//}
|
}
|
||||||
|
|
||||||
|
|
||||||
// status
|
// status
|
||||||
|
|||||||
@@ -94,7 +94,8 @@ export class SqliteService {
|
|||||||
workflowID INTERGER,
|
workflowID INTERGER,
|
||||||
workflowInstanceDataFields Text,
|
workflowInstanceDataFields Text,
|
||||||
workflowInstanceID INTERGER,
|
workflowInstanceID INTERGER,
|
||||||
workflowName varchar(255)
|
workflowName varchar(255),
|
||||||
|
interveners Text
|
||||||
)`, [])
|
)`, [])
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log("Sucess AllProcess Table created: ", res)
|
console.log("Sucess AllProcess Table created: ", res)
|
||||||
@@ -168,6 +169,13 @@ export class SqliteService {
|
|||||||
console.log("process attachment updated")
|
console.log("process attachment updated")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//updateAttachment
|
||||||
|
updateProcessInterveners(id, interveners,) {
|
||||||
|
let data = [document];
|
||||||
|
return this.dbInstance.executeSql(`UPDATE ${this.allprocess} SET interveners = ? WHERE serialNumber = ${id}`, [interveners]).then(() => {
|
||||||
|
console.log("process interveners updated")
|
||||||
|
})
|
||||||
|
}
|
||||||
//getAllEvents
|
//getAllEvents
|
||||||
getAllEvents() {
|
getAllEvents() {
|
||||||
var hashattachment = false;
|
var hashattachment = false;
|
||||||
@@ -264,6 +272,21 @@ export class SqliteService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//getDespachosProcess
|
||||||
|
getDespachosProcess(process) {
|
||||||
|
return this.dbInstance.executeSql(`SELECT * FROM ${this.allprocess} WHERE activityInstanceName = ?`, [process]).then((res) => {
|
||||||
|
this.ALLPROCESS = [];
|
||||||
|
if (res.rows.length > 0) {
|
||||||
|
for (var i = 0; i < res.rows.length; i++) {
|
||||||
|
this.ALLPROCESS.push(res.rows.item(i));
|
||||||
|
}
|
||||||
|
return this.ALLPROCESS;
|
||||||
|
}
|
||||||
|
}, (e) => {
|
||||||
|
console.log(" Get all process error", JSON.stringify(e));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//getprocessByworkflow
|
//getprocessByworkflow
|
||||||
getprocessByworkflow(process) {
|
getprocessByworkflow(process) {
|
||||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.allprocess} WHERE workflowDisplayName = ? `, [process]).then((res) => {
|
return this.dbInstance.executeSql(`SELECT * FROM ${this.allprocess} WHERE workflowDisplayName = ? `, [process]).then((res) => {
|
||||||
@@ -279,6 +302,21 @@ export class SqliteService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//getprocessByworkflowpedido
|
||||||
|
getprocessByworkflowpedido(process, process2) {
|
||||||
|
return this.dbInstance.executeSql(`SELECT * FROM ${this.allprocess} WHERE workflowDisplayName = ? OR workflowDisplayName = ? `, [process, process2]).then((res) => {
|
||||||
|
this.ALLPROCESS = [];
|
||||||
|
if (res.rows.length > 0) {
|
||||||
|
for (var i = 0; i < res.rows.length; i++) {
|
||||||
|
this.ALLPROCESS.push(res.rows.item(i));
|
||||||
|
}
|
||||||
|
return this.ALLPROCESS;
|
||||||
|
}
|
||||||
|
}, (e) => {
|
||||||
|
console.log(" Get all process error", JSON.stringify(e));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
getProcessById(serial) {
|
getProcessById(serial) {
|
||||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.allprocess} WHERE serialNumber = ? `, [serial]).then((res) => {
|
return this.dbInstance.executeSql(`SELECT * FROM ${this.allprocess} WHERE serialNumber = ? `, [serial]).then((res) => {
|
||||||
this.PROCESS = [];
|
this.PROCESS = [];
|
||||||
|
|||||||
@@ -33,38 +33,7 @@ export class AllProcessesPage implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
this.sqliteservice.getAllProcess().then((allprocess: any[]) => {
|
this.getAllProcessFromDB()
|
||||||
this.allProcessesList = allprocess;
|
|
||||||
console.log("All process from db ", allprocess)
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
/* synchro.registerCallback('Online', () => {
|
|
||||||
this.platform.ready().then(() => {
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
synchro.registerCallback('Offline', () => {
|
|
||||||
this.platform.ready().then(() => {
|
|
||||||
|
|
||||||
this.sqliteservice.getAllProcess().then((allprocess: any[]) => {
|
|
||||||
this.allProcessesList = allprocess;
|
|
||||||
console.log("All process from db ", allprocess)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
console.log('Offlineee')
|
|
||||||
}) */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
doRefresh() {
|
doRefresh() {
|
||||||
@@ -150,8 +119,7 @@ export class AllProcessesPage implements OnInit {
|
|||||||
|
|
||||||
getAllProcessFromDB() {
|
getAllProcessFromDB() {
|
||||||
|
|
||||||
synchro.registerCallback('Online', () => {
|
if(synchro.connected === true) {
|
||||||
this.platform.ready().then(() => {
|
|
||||||
this.loadAllProcesses();
|
this.loadAllProcesses();
|
||||||
|
|
||||||
this.router.events.forEach((event) => {
|
this.router.events.forEach((event) => {
|
||||||
@@ -163,12 +131,7 @@ export class AllProcessesPage implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
} else {
|
||||||
})
|
|
||||||
|
|
||||||
synchro.registerCallback('Offline', () => {
|
|
||||||
this.platform.ready().then(() => {
|
|
||||||
|
|
||||||
this.sqliteservice.getAllProcess().then((allprocess: any[]) => {
|
this.sqliteservice.getAllProcess().then((allprocess: any[]) => {
|
||||||
allprocess.forEach(element => {
|
allprocess.forEach(element => {
|
||||||
let date = new Date(element.taskStartDate);
|
let date = new Date(element.taskStartDate);
|
||||||
@@ -176,7 +139,6 @@ export class AllProcessesPage implements OnInit {
|
|||||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||||
|
|
||||||
var workflowInstanceDataFields = JSON.parse(element.workflowInstanceDataFields);
|
var workflowInstanceDataFields = JSON.parse(element.workflowInstanceDataFields);
|
||||||
console.log("WORKFLOW all process", workflowInstanceDataFields)
|
|
||||||
|
|
||||||
let task = {
|
let task = {
|
||||||
"SerialNumber": element.serialNumber,
|
"SerialNumber": element.serialNumber,
|
||||||
@@ -206,9 +168,7 @@ export class AllProcessesPage implements OnInit {
|
|||||||
this.allProcessesList = allprocess;
|
this.allProcessesList = allprocess;
|
||||||
console.log("All process from db ", allprocess)
|
console.log("All process from db ", allprocess)
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
console.log('Offlineee')
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sortArrayISODate(myArray: any) {
|
sortArrayISODate(myArray: any) {
|
||||||
|
|||||||
Reference in New Issue
Block a user