mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
All changes i made
This commit is contained in:
@@ -25,6 +25,7 @@ import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-despacho-pr',
|
||||
@@ -66,6 +67,7 @@ export class DespachoPrPage implements OnInit {
|
||||
public ThemeService: ThemeService,
|
||||
private RouteService: RouteService,
|
||||
public p: PermissionService,
|
||||
private httpErroHandle: HttpErrorHandle
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
if (params["params"].SerialNumber) {
|
||||
@@ -157,7 +159,7 @@ export class DespachoPrPage implements OnInit {
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
}
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
|
||||
}
|
||||
});
|
||||
@@ -272,14 +274,9 @@ export class DespachoPrPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.toastService._successMessage()
|
||||
this.httpErroHandle.httpsSucessMessagge('Executado')
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -302,14 +299,9 @@ export class DespachoPrPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.toastService._successMessage('Processo arquivado')
|
||||
this.httpErroHandle.httpsSucessMessagge('Arquivar')
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não arquivado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -329,14 +321,9 @@ export class DespachoPrPage implements OnInit {
|
||||
documents
|
||||
}).toPromise()
|
||||
|
||||
this.toastService._successMessage('Processo criado')
|
||||
this.httpErroHandle.httpsSucessMessagge('Gerar Diploma')
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não criado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -359,14 +346,9 @@ export class DespachoPrPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.toastService._successMessage('')
|
||||
this.httpErroHandle.httpsSucessMessagge('Concluir')
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -389,14 +371,9 @@ export class DespachoPrPage implements OnInit {
|
||||
const loader = this.toastService.loading()
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.toastService._successMessage()
|
||||
this.httpErroHandle.httpsSucessMessagge('Reexecução')
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -412,17 +389,12 @@ export class DespachoPrPage implements OnInit {
|
||||
const loader = this.toastService.loading()
|
||||
this.processes.SetTaskToPending(this.serialNumber).subscribe(res => {
|
||||
this.popoverController.dismiss('close')
|
||||
this.toastService._successMessage('Processo enviado para pendentes')
|
||||
this.httpErroHandle.httpsSucessMessagge('Enviar para Pendentes')
|
||||
this.goBack()
|
||||
loader.remove()
|
||||
}, (error) => {
|
||||
loader.remove()
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
|
||||
<div class="option-desc" *ngIf="task.WorkflowName == 'Despacho do Presidente da República' "> <div>Responder ao PR</div> </div>
|
||||
<button (click)="tstemethod(executadoText)" class="btn-cancel" shape="round" >Executado</button>
|
||||
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
||||
<div class="option-desc" *ngIf="task.WorkflowName == 'Despacho do Presidente da República' ">Reencaminhar para Área Jurídica</div>
|
||||
<button (click)="openAddNoteModal('Gerar Diploma')" *ngIf="task.WorkflowName == 'Despacho do Presidente da República'" class="btn-cancel" style="margin-bottom: 0px !important;" shape="round" >Gerar Diploma </button>
|
||||
<div class="option-desc" *ngIf="task.WorkflowName == 'Despacho do Presidente da República' " >Outras opções</div>
|
||||
@@ -140,7 +140,7 @@
|
||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||
</div>
|
||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Reexecutar Despacho'">
|
||||
<button (click)="tstemethod('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
||||
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
||||
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||
|
||||
@@ -23,6 +23,7 @@ import { Platform } from '@ionic/angular';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -66,6 +67,7 @@ export class DespachoPage implements OnInit {
|
||||
private platform: Platform,
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService,
|
||||
private httpErrorHandle: HttpErrorHandle
|
||||
|
||||
|
||||
) {
|
||||
@@ -154,7 +156,7 @@ export class DespachoPage implements OnInit {
|
||||
} catch (e) {
|
||||
this.RouteService.goBack();
|
||||
}
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -279,15 +281,10 @@ export class DespachoPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.despachoService.executado(note, documents, this.serialnumber).toPromise();
|
||||
this.toastService._successMessage('Processo criado')
|
||||
this.httpErrorHandle.httpsSucessMessagge('Executado')
|
||||
this.close();
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest("Processo não criado")
|
||||
}
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -300,15 +297,10 @@ export class DespachoPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.despachoService.arquivar(note, documents, this.serialnumber).toPromise()
|
||||
this.toastService._successMessage('Processo descartado')
|
||||
this.httpErrorHandle.httpsSucessMessagge('Arquivar')
|
||||
this.close();
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest("Processo não descartado")
|
||||
}
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -331,16 +323,11 @@ export class DespachoPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.toastService._successMessage()
|
||||
this.httpErrorHandle.httpsSucessMessagge('Reexecução')
|
||||
this.close();
|
||||
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -363,15 +350,10 @@ export class DespachoPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.toastService._successMessage()
|
||||
this.httpErrorHandle.httpsSucessMessagge('Gerar Diploma')
|
||||
this.close();
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
this.httpErrorHandle.httpStatusHandle(error);
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -388,17 +370,17 @@ export class DespachoPage implements OnInit {
|
||||
this.despachoService.sendExpedienteToPending(this.serialnumber).subscribe(res => {
|
||||
this.goBack();
|
||||
loader.remove()
|
||||
this.toastService.successMessage()
|
||||
this.httpErrorHandle.httpsSucessMessagge('Enviar para Pendentes')
|
||||
},
|
||||
error => {
|
||||
loader.remove()
|
||||
this.toastService.badRequest("Processo não enviado para despacho")
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
});
|
||||
// loader.remove()
|
||||
}
|
||||
|
||||
tstemethod(value: string) {
|
||||
alert(value)
|
||||
|
||||
}
|
||||
|
||||
async openAddNoteModal(actionName: string) {
|
||||
|
||||
+7
-19
@@ -9,6 +9,7 @@ import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
import {HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-diploma-assinar',
|
||||
@@ -36,7 +37,8 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private toastService: ToastService,
|
||||
private RouteService: RouteService,
|
||||
public ThemeService: ThemeService
|
||||
public ThemeService: ThemeService,
|
||||
private httpErroHandle: HttpErrorHandle
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
if(params["params"].SerialNumber) {
|
||||
@@ -110,21 +112,12 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
|
||||
}, (error)=>{
|
||||
try {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
this.goBack()
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
} finally {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Não é possível visualizar este processo no modo offline')
|
||||
} else {
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}
|
||||
});
|
||||
|
||||
@@ -177,16 +170,11 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
|
||||
this.toastService._successMessage(false, ()=>{
|
||||
this.httpErroHandle.httpsSucessMessagge('Assinado',() => {
|
||||
this.goBack();
|
||||
})
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
|
||||
+7
-14
@@ -13,6 +13,7 @@ import { DespachoService } from 'src/app/Rules/despacho.service'
|
||||
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { DiplomasGerarOptionsPage } from 'src/app/shared/popover/diplomas-gerar-options/diplomas-gerar-options.page';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'
|
||||
|
||||
@Component({
|
||||
selector: 'app-diplomas-gerar',
|
||||
@@ -43,7 +44,8 @@ export class DiplomasGerarPage implements OnInit {
|
||||
private RouteService: RouteService,
|
||||
public ThemeService: ThemeService,
|
||||
private despachoService: DespachoService,
|
||||
) {
|
||||
private httpErroHandle: HttpErrorHandle
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
if(params["params"].SerialNumber) {
|
||||
this.serialnumber = params["params"].SerialNumber;
|
||||
@@ -118,16 +120,12 @@ export class DiplomasGerarPage implements OnInit {
|
||||
|
||||
}, (error)=>{
|
||||
try {
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
this.goBack()
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
} finally {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Não é possível visualizar este processo no modo offline')
|
||||
} else {
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}
|
||||
});
|
||||
|
||||
@@ -250,15 +248,10 @@ export class DiplomasGerarPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.modalController.dismiss('sucess');
|
||||
this.toastService._successMessage();
|
||||
this.httpErroHandle.httpsSucessMessagge('Gerar Diploma')
|
||||
this.goBack()
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest();
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -79,6 +79,8 @@
|
||||
|
||||
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Revisar Diploma'">
|
||||
<button (click)="tempMethod('Arquivo')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||
<button (click)="tempMethod('Despacho')" class="btn-cancel" shape="round" >Efectuar Despacho</button>
|
||||
<button (click)="openAddNoteModal('Solicitar assinatura')" class="btn-cancel" shape="round" >Solicitar assinatura do Presidente</button>
|
||||
<button (click)="openAddNoteModal('Solicitar alteração')" class="btn-cancel" shape="round" >Solicitar alteração</button>
|
||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
|
||||
@@ -15,6 +15,7 @@ import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -50,7 +51,8 @@ export class DiplomaPage implements OnInit {
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
private platform: Platform,
|
||||
public ThemeService: ThemeService
|
||||
public ThemeService: ThemeService,
|
||||
private httpErrorHandle: HttpErrorHandle
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
//
|
||||
@@ -162,12 +164,7 @@ export class DiplomaPage implements OnInit {
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
}
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
}
|
||||
});
|
||||
|
||||
@@ -286,17 +283,12 @@ export class DiplomaPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
|
||||
this.toastService._successMessage(false, () => {
|
||||
this.httpErrorHandle.httpsSucessMessagge('Solicitar Assinatura',() => {
|
||||
this.close();
|
||||
})
|
||||
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -317,14 +309,9 @@ export class DiplomaPage implements OnInit {
|
||||
const loader = this.toastService.loading()
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.toastService._successMessage()
|
||||
this.httpErrorHandle.httpsSucessMessagge('Solicitar alteração')
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -348,14 +335,9 @@ export class DiplomaPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.toastService._successMessage('Processo concluído')
|
||||
this.httpErrorHandle.httpsSucessMessagge('Concluir')
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -441,5 +423,9 @@ export class DiplomaPage implements OnInit {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
tempMethod(actionname) {
|
||||
console.log(actionname)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import { OfflineManagerService } from 'src/app/services/offline-manager.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import config from 'capacitor.config';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-approve-event',
|
||||
@@ -58,7 +59,8 @@ export class ApproveEventPage implements OnInit {
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService,
|
||||
private offlineManager: OfflineManagerService,
|
||||
private storage: Storage
|
||||
private storage: Storage,
|
||||
private httpErrorHandle: HttpErrorHandle
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
//
|
||||
@@ -216,7 +218,11 @@ export class ApproveEventPage implements OnInit {
|
||||
}
|
||||
|
||||
}, (error) => {
|
||||
this.getProcessFromDB();
|
||||
if(error.status == 0) {
|
||||
this.getProcessFromDB();
|
||||
} else {
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -229,15 +235,10 @@ export class ApproveEventPage implements OnInit {
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
this.goBack();
|
||||
this.toastService._successMessage('Evento aprovado')
|
||||
this.httpErrorHandle.httpsSucessMessagge('Evento aprovação')
|
||||
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Evento não aprovado')
|
||||
}
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -280,15 +281,10 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
this.offlineManager.storeRequestData('event-listRever', body);
|
||||
});
|
||||
this.toastService._successMessage('Evento enviado para revisão');
|
||||
this.httpErrorHandle.httpsSucessMessagge('Rever')
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Evento não enviado para revisão');
|
||||
}
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -308,15 +304,10 @@ export class ApproveEventPage implements OnInit {
|
||||
const loader = this.toastService.loading()
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise();
|
||||
await this.toastService._successMessage('Processo rejeitado');
|
||||
this.httpErrorHandle.httpsSucessMessagge('Rejeitar')
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Evento não rejeitado')
|
||||
}
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<!-- <ion-segment-button value="MDGPR">
|
||||
Minha agenda
|
||||
</ion-segment-button> -->
|
||||
<ion-segment-button *ngFor="let calendars of eventService.calendarNamesAry; let i index" [value]="i === 'Meu calendario' ? 'MDGPR' : 'PR'">
|
||||
<ion-segment-button *ngFor="let calendars of eventService.calendarNamesAry; let i index" [value]="i === 'Meu calendario' ? 'Meu calendario' : i.OwnerUserId">
|
||||
<div *ngIf="calendars == 'Meu calendario'"> Minha agenda </div>
|
||||
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Presidente da República'"> Agenda do PR </div>
|
||||
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
|
||||
@@ -40,14 +40,14 @@
|
||||
<div class="main-content d-flex height-100" >
|
||||
|
||||
<div class="content height-100 d-flex flex-column">
|
||||
<div [ngSwitch]="segment">
|
||||
<ion-list class="width-100 height-100" *ngSwitchCase="'MDGPR'">
|
||||
<div *ngIf="eventoaprovacaostore.listmd" class="overflow-y-auto height-100">
|
||||
<div >
|
||||
<ion-list class="width-100 height-100" >
|
||||
<div class="overflow-y-auto height-100">
|
||||
<ion-item-sliding>
|
||||
<ion-item class="Rectangle cursor-pointer" lines="none"
|
||||
*ngFor="let event of eventoaprovacaostore.listmd" (click)="goToEventToApproveDetail(event.serialNumber)">
|
||||
*ngFor="let event of eventoaprovacaostore.get(segment)" (click)="goToEventToApproveDetail(event.serialNumber)">
|
||||
|
||||
<div class="content-mdgpr-{{event.workflowInstanceDataFields.Agenda}} width-100">
|
||||
<div class="content-{{color}}-{{event.workflowInstanceDataFields.Agenda}} width-100">
|
||||
<div class="approve-event-time">
|
||||
<p>{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}</p>
|
||||
<p>{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
|
||||
@@ -65,51 +65,19 @@
|
||||
</ion-item-sliding>
|
||||
</div>
|
||||
</ion-list>
|
||||
<ion-label></ion-label>
|
||||
|
||||
<ion-list *ngSwitchCase="'PR'">
|
||||
<div *ngIf="eventoaprovacaostore.listpr" class="overflow-y-auto height-100">
|
||||
<ion-item-sliding>
|
||||
<ion-item class="Rectangle cursor-pointer" lines="none"
|
||||
*ngFor="let event of eventoaprovacaostore.listpr" (click)="goToEventToApproveDetail(event.serialNumber)">
|
||||
<div class="content-pr-{{event.workflowInstanceDataFields.Agenda}} width-100">
|
||||
<div class="approve-event-time">
|
||||
<p>{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}</p>
|
||||
<p>{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
|
||||
</div>
|
||||
<div class="approve-event-detail">
|
||||
<p *ngIf="event.workflowInstanceDataFields.StartDate != event.workflowInstanceDataFields.EndDate">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}</p>
|
||||
<p *ngIf="event.workflowInstanceDataFields.StartDate == event.workflowInstanceDataFields.EndDate">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}</p>
|
||||
<h3>{{event.workflowInstanceDataFields.Subject}}</h3>
|
||||
<div *ngIf="event.activityInstanceName">
|
||||
<div class="label-event-type"> {{ event.activityInstanceName }} </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-item>
|
||||
</ion-item-sliding>
|
||||
</div>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
<div class="height-100" [ngSwitch]="segment">
|
||||
<div *ngSwitchCase="'MDGPR'" class="d-flex height-100 align-center justify-content-center" >
|
||||
<div class="height-100" >
|
||||
<div class="d-flex height-100 align-center justify-content-center" >
|
||||
<div
|
||||
*ngIf="!skeletonLoader && (!eventoaprovacaostore.listmd || eventoaprovacaostore.listmd.length == 0)"
|
||||
*ngIf="!skeletonLoader && (eventoaprovacaostore.get(segment).length == 0)"
|
||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||
>
|
||||
<span>Lista vazia</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngSwitchCase="'PR'" class="d-flex height-100 align-center justify-content-center">
|
||||
<div
|
||||
*ngIf="!skeletonLoader && (!eventoaprovacaostore.listmd || eventoaprovacaostore.listmd.length == 0)"
|
||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||
>
|
||||
<span>Lista vazia</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -16,6 +16,7 @@ import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-event-list',
|
||||
@@ -36,8 +37,9 @@ export class EventListPage implements OnInit {
|
||||
serialnumber: string;
|
||||
|
||||
skeletonLoader = true
|
||||
eventaprovacaostore = EventoAprovacaoStore;
|
||||
eventoaprovacaostore = EventoAprovacaoStore;
|
||||
eventsList: any = []
|
||||
color: 'pr' | 'mdgpr'
|
||||
|
||||
constructor(
|
||||
private processes: ProcessesService,
|
||||
@@ -56,7 +58,13 @@ export class EventListPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.segment = 'MDGPR';
|
||||
if(!this.segment) {
|
||||
if(this.eventService.calendarNamesAry.includes('Meu calendario')) {
|
||||
this.segment = 'Meu calendario';
|
||||
} else {
|
||||
this.segment = this.eventService.calendarNamesAry[0].OwnerUserId
|
||||
}
|
||||
}
|
||||
|
||||
const location = window.location
|
||||
const pathname = location.pathname + location.search
|
||||
@@ -150,47 +158,53 @@ export class EventListPage implements OnInit {
|
||||
}
|
||||
|
||||
async LoadToApproveEvents() {
|
||||
// this.processes.GetTasksList('Agenda Oficial MDGPR', false).subscribe(async res => {
|
||||
this.showLoader = true;
|
||||
this.skeletonLoader = true
|
||||
this.showLoader = true;
|
||||
this.skeletonLoader = true
|
||||
|
||||
const segment = this.segment
|
||||
|
||||
if(this.segment == 'Meu calendario') {
|
||||
// color
|
||||
if(SessionStore.user.Profile == 'PR') {
|
||||
this.color = 'pr'
|
||||
} else {
|
||||
this.color = 'mdgpr'
|
||||
}
|
||||
|
||||
let genericEvents = await this.processes.GetTasksList('Agendar Evento', false).toPromise();
|
||||
try {
|
||||
this.eventsList = this.sortService.sortArrayByDate(genericEvents).reverse();
|
||||
} catch (error) {
|
||||
this.eventsList = [];
|
||||
}
|
||||
|
||||
this.eventoaprovacaostore.save(segment, this.eventsList)
|
||||
|
||||
if (this.segment != 'PR') {
|
||||
let mdEventsOficial = await this.processes.GetTasksList('Agenda Oficial MDGPR,Agenda Pessoal MDGPR', false).toPromise();
|
||||
this.eventsMDGPRList = mdEventsOficial
|
||||
} else {
|
||||
|
||||
this.eventsMDGPRList = this.sortService.sortDate(this.eventsMDGPRList, 'taskStartDate')
|
||||
this.eventsMDGPRList = this.sortService.sortArrayByDate(this.eventsMDGPRList)
|
||||
this.eventoaprovacaostore.resetmd(this.eventsMDGPRList);
|
||||
|
||||
this.storage.set('event-to-aproveMD',this.eventsMDGPRList).then(() => {
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
else if (this.segment == 'PR') {
|
||||
let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR,Agenda Pessoal PR', false).toPromise();
|
||||
this.color = 'pr'
|
||||
|
||||
this.eventsPRList = prEventsOficial
|
||||
|
||||
this.eventsPRList = this.sortService.sortDate(this.eventsPRList, 'taskStartDate')
|
||||
this.eventsPRList = this.sortService.sortArrayByDate(this.eventsPRList)
|
||||
this.eventoaprovacaostore.resetpr(this.eventsPRList);
|
||||
|
||||
this.storage.set('event-to-aprovePR',this.eventsPRList).then(() => {
|
||||
|
||||
})
|
||||
|
||||
let allEvents = await this.processes.eventsToApprove(segment).toPromise()
|
||||
try {
|
||||
this.eventsList = this.sortService.sortArrayByDate(allEvents).reverse();
|
||||
} catch(error) {
|
||||
this.eventsList = []
|
||||
}
|
||||
|
||||
this.eventsList = this.eventsList
|
||||
this.eventsList = this.eventsList
|
||||
this.showLoader = false;
|
||||
this.skeletonLoader = false
|
||||
this.eventoaprovacaostore.save(segment, this.eventsList)
|
||||
}
|
||||
|
||||
this.showLoader = false;
|
||||
this.skeletonLoader = false
|
||||
|
||||
// }, (error) => {
|
||||
// this.getEventToAproveFromDB();
|
||||
// })
|
||||
}
|
||||
|
||||
|
||||
toDateString(e) {
|
||||
return new Date(e).toDateString()
|
||||
}
|
||||
|
||||
async openApproveModal(eventSerialNumber, event) {
|
||||
const modal = await this.modalController.create({
|
||||
|
||||
+2
-2
@@ -61,7 +61,7 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('Location')?.invalid && validateFrom ">
|
||||
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Localização*" [(ngModel)]="postData.Location"></ion-input>
|
||||
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Localização" [(ngModel)]="postData.Location"></ion-input>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -314,7 +314,7 @@
|
||||
<ion-footer>
|
||||
<div class="buttons">
|
||||
<button class="btn-cancel" shape="round" (click)="close()">Cancelar</button>
|
||||
<button class="btn-ok" shape="round" (click)="saveTask()">Enviar</button>
|
||||
<button class="btn-ok" shape="round" (click)="saveTask()">Gravar</button>
|
||||
</div>
|
||||
</ion-footer>
|
||||
|
||||
|
||||
+7
-14
@@ -20,6 +20,7 @@ import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-pick
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { RoleIdService } from 'src/app/services/role-id.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
|
||||
|
||||
const moment = _rollupMoment || _moment;
|
||||
@@ -120,7 +121,8 @@ export class BookMeetingModalPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
public ThemeService: ThemeService,
|
||||
public eventService: EventsService,
|
||||
public RoleIdService: RoleIdService
|
||||
public RoleIdService: RoleIdService,
|
||||
private httpErroHandle: HttpErrorHandle
|
||||
|
||||
|
||||
) {
|
||||
@@ -304,15 +306,10 @@ export class BookMeetingModalPage implements OnInit {
|
||||
await this.calendarService.genericPostExpedientEvent(this.task.DocId, this.postData, "",this.task.SerialNumber, this.task.FsId, CalendarId).toPromise();
|
||||
|
||||
this.modalController.dismiss();
|
||||
this.toastService._successMessage('Reunião criada');
|
||||
this.httpErroHandle.httpsSucessMessagge('Marcar Reunião')
|
||||
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Reunião não criada')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -329,14 +326,10 @@ export class BookMeetingModalPage implements OnInit {
|
||||
await this.calendarService.genericCreateTaskEvent(this.task.FolderID | this.task.FolderId, this.postData, "",this.task.SerialNumber, this.task.FsId, CalendarId).toPromise();
|
||||
|
||||
this.close();
|
||||
this.toastService._successMessage('Reunião criada');
|
||||
this.httpErroHandle.httpsSucessMessagge('Marcar Reunião')
|
||||
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
+13
-35
@@ -24,6 +24,7 @@ import { SearchDocumentPipe } from 'src/app/pipes/search-document.pipe';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
@@ -111,6 +112,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
private despachoService: DespachoService,
|
||||
public ThemeService: ThemeService,
|
||||
public p: PermissionService,
|
||||
private httpErroHandle: HttpErrorHandle,
|
||||
) {
|
||||
|
||||
this.loggeduser = SessionStore.user;
|
||||
@@ -325,16 +327,11 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
try {
|
||||
|
||||
this.taskResult = await this.processes.postDespatcho(this.postData).toPromise();
|
||||
await this.toastService._successMessage('Processo efetuado');
|
||||
await this.httpErroHandle.httpsSucessMessagge('Efetuar Despacho')
|
||||
this.modalController.dismiss(action_despacho);
|
||||
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
await this.toastService._badRequest('Processo não efetuado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -364,16 +361,12 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
|
||||
try {
|
||||
this.taskResult = await this.processes.postParecer(this.postData).toPromise();
|
||||
await this.toastService._successMessage('Pedido enviado');
|
||||
await this.httpErroHandle.httpsSucessMessagge('Solicitar Parecer')
|
||||
|
||||
this.modalController.dismiss(action_parecer);
|
||||
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
await this.toastService._badRequest('Processo não efetuado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -401,15 +394,10 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
try {
|
||||
|
||||
this.taskResult = await this.processes.postDeferimento(this.postData).toPromise();
|
||||
this.toastService._successMessage('Processo efetuado');
|
||||
this.httpErroHandle.httpsSucessMessagge('Pedido de Deferimento')
|
||||
this.modalController.dismiss(action_deferimento);
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
await this.toastService._badRequest('Processo não efetuado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -444,15 +432,10 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
if(this.postData.DispatchFolder.Message){
|
||||
try {
|
||||
this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
|
||||
await this.toastService._successMessage('Processo efetuado');
|
||||
await this.httpErroHandle.httpsSucessMessagge('Efetuar Despacho')
|
||||
this.modalController.dismiss(action_despacho_pr);
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
await this.toastService._badRequest('Processo não efetuado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
//loader.remove()
|
||||
}
|
||||
@@ -486,15 +469,10 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
|
||||
try {
|
||||
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
|
||||
await this.toastService._successMessage('Pedido enviado');
|
||||
await this.httpErroHandle.httpsSucessMessagge('Solicitar Parecer')
|
||||
this.modalController.dismiss(action_parecer_pr);
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
await this.toastService._badRequest('Processo não efetuado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
+9
-27
@@ -35,6 +35,7 @@ import { Storage } from '@ionic/storage';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente-detail',
|
||||
@@ -88,6 +89,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
private dataService: DataService,
|
||||
private storage: Storage,
|
||||
private userAuth: AuthService,
|
||||
private httpErroHandle: HttpErrorHandle
|
||||
) {
|
||||
this.loggeduser = SessionStore.user
|
||||
console.log('SessionStore', SessionStore)
|
||||
@@ -242,14 +244,9 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.close();
|
||||
this.toastService._successMessage('Processo aprovado')
|
||||
this.httpErroHandle.httpsSucessMessagge('Avaliação Superiror')
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não aprovado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -272,14 +269,9 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.toastService._successMessage()
|
||||
this.httpErroHandle.httpsSucessMessagge('Rever')
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -402,17 +394,12 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
this.getFromDB();
|
||||
} else {
|
||||
try {
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
this.goBack()
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
}
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}
|
||||
});
|
||||
|
||||
@@ -545,12 +532,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não descartado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.pag
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente-pr',
|
||||
@@ -60,7 +61,8 @@ export class ExpedientePrPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private RouteService: RouteService,
|
||||
public ThemeService: ThemeService
|
||||
public ThemeService: ThemeService,
|
||||
private httpErroHandle: HttpErrorHandle
|
||||
|
||||
) {
|
||||
this.loggeduser = SessionStore.user;
|
||||
@@ -137,18 +139,13 @@ export class ExpedientePrPage implements OnInit {
|
||||
const loader = this.toastService.loading()
|
||||
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
|
||||
|
||||
this.toastService._successMessage('Processo enviado para pendentes')
|
||||
this.httpErroHandle.httpsSucessMessagge('Enviar para Pendente')
|
||||
this.goBack();
|
||||
loader.remove()
|
||||
},
|
||||
(error)=>{
|
||||
loader.remove()
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não enviado para pendentes')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -193,16 +190,12 @@ export class ExpedientePrPage implements OnInit {
|
||||
|
||||
}, (error)=>{
|
||||
try {
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
this.goBack()
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
} finally {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Não é possível visualizar este processo no modo offline')
|
||||
} else {
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -312,14 +305,9 @@ export class ExpedientePrPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.close();
|
||||
this.toastService._successMessage('Processo aprovado')
|
||||
this.httpErroHandle.httpsSucessMessagge('Aprovar')
|
||||
} catch(error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não aprovado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -342,14 +330,9 @@ export class ExpedientePrPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.toastService._successMessage()
|
||||
this.httpErroHandle.httpsSucessMessagge('Rever')
|
||||
} catch(error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -468,15 +451,10 @@ export class ExpedientePrPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
this.toastService._successMessage('Processo descartado');
|
||||
this.httpErroHandle.httpsSucessMessagge('Arquivar')
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não descartado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@
|
||||
<ion-icon src="assets/images/icons-agenda.svg"></ion-icon>
|
||||
</div>
|
||||
<p class="text-center exp-card-title ">Eventos para Aprovação</p>
|
||||
<p class="text-center exp-card-content"> {{eventoaprovacaostore.countMd + eventoaprovacaostore.countPr}} <span class="title1">Documentos</span></p>
|
||||
<p class="text-center exp-card-content"> {{eventoaprovacaostore.countAll}} <span class="title1">Documentos</span></p>
|
||||
</div>
|
||||
|
||||
<!-- List -->
|
||||
|
||||
@@ -33,6 +33,8 @@ import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { NotificationsService } from 'src/app/services/notifications.service'
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
@Component({
|
||||
selector: 'app-gabinete-digital',
|
||||
templateUrl: './gabinete-digital.page.html',
|
||||
@@ -126,7 +128,9 @@ export class GabineteDigitalPage implements OnInit {
|
||||
private sortService: SortService,
|
||||
private storage: Storage,
|
||||
public p: PermissionService,
|
||||
public NotificationsService: NotificationsService
|
||||
public NotificationsService: NotificationsService,
|
||||
public eventService: EventsService,
|
||||
private httpErroHandle: HttpErrorHandle
|
||||
) {
|
||||
|
||||
// this.workerList = new Worker(new URL('./list.worker.js', import.meta.url));
|
||||
@@ -598,7 +602,7 @@ export class GabineteDigitalPage implements OnInit {
|
||||
|
||||
updateAllProcess = () => {
|
||||
this.AllProcess = this.expedientegbstore.list.concat(this.pedidosstore.listparecer).concat(this.pedidosstore.listdeferimento)
|
||||
.concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr).concat(this.despachoStore.list)
|
||||
.concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.contactList).concat(this.despachoStore.list)
|
||||
.concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.deplomasStore.DiplomaGerarList).concat(this.pendentesstore.list)
|
||||
|
||||
// try{
|
||||
@@ -732,21 +736,48 @@ export class GabineteDigitalPage implements OnInit {
|
||||
this.updateAllProcess()
|
||||
}
|
||||
|
||||
let mdEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial MDGPR,Agenda Pessoal MDGPR', false).toPromise();
|
||||
let eventsMDGPRList = mdEventsOficial
|
||||
|
||||
eventsMDGPRList = eventsMDGPRList.filter((item) => item.activityInstanceName != 'Editar Evento')
|
||||
for(let calendar of this.eventService.calendarNamesAry) {
|
||||
if(calendar == 'Meu calendario') {
|
||||
// color
|
||||
let genericEvents = await this.processesbackend.GetTasksList('Agendar Evento', false).toPromise();
|
||||
let eventsList
|
||||
try {
|
||||
eventsList = this.sortService.sortArrayByDate(genericEvents).reverse();
|
||||
} catch (error) {
|
||||
eventsList = [];
|
||||
}
|
||||
|
||||
this.eventoaprovacaostore.save(calendar, eventsList)
|
||||
|
||||
} else {
|
||||
|
||||
let allEvents = await this.processesbackend.eventsToApprove(calendar.OwnerUserId).toPromise()
|
||||
let eventsList
|
||||
try {
|
||||
eventsList = this.sortService.sortArrayByDate(allEvents).reverse();
|
||||
} catch(error) {
|
||||
eventsList = []
|
||||
}
|
||||
|
||||
this.eventoaprovacaostore.save(calendar, eventsList)
|
||||
}
|
||||
}
|
||||
// let mdEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial MDGPR,Agenda Pessoal MDGPR', false).toPromise();
|
||||
// let eventsMDGPRList = mdEventsOficial
|
||||
|
||||
// eventsMDGPRList = eventsMDGPRList.filter((item) => item.activityInstanceName != 'Editar Evento')
|
||||
|
||||
this.eventoaprovacaostore.countMd = eventsMDGPRList.length
|
||||
this.eventoaprovacaostore.resetmd(eventsMDGPRList);
|
||||
this.updateAllProcess()
|
||||
// this.eventoaprovacaostore.countMd = eventsMDGPRList.length
|
||||
// this.eventoaprovacaostore.resetmd(eventsMDGPRList);
|
||||
// this.updateAllProcess()
|
||||
|
||||
let prEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial PR,Agenda Pessoal PR', false).toPromise();
|
||||
let eventsPRList = prEventsOficial
|
||||
eventsPRList = eventsPRList.filter((item) => item.activityInstanceName != 'Editar Evento')
|
||||
// let prEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial PR,Agenda Pessoal PR', false).toPromise();
|
||||
// let eventsPRList = prEventsOficial
|
||||
// eventsPRList = eventsPRList.filter((item) => item.activityInstanceName != 'Editar Evento')
|
||||
|
||||
this.eventoaprovacaostore.countPr = eventsPRList.length
|
||||
this.eventoaprovacaostore.resetpr(eventsPRList);
|
||||
// this.eventoaprovacaostore.countPr = eventsPRList.length
|
||||
// this.eventoaprovacaostore.resetpr(eventsPRList);
|
||||
this.updateAllProcess()
|
||||
|
||||
let diplomasValidar = depachoAPI.filter(data => data.activityInstanceName == "Revisar Diploma");
|
||||
|
||||
@@ -29,6 +29,7 @@ import { DataService } from 'src/app/services/data.service';
|
||||
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-pedido',
|
||||
@@ -68,7 +69,7 @@ export class PedidoPage implements OnInit {
|
||||
private platform: Platform,
|
||||
public ThemeService: ThemeService,
|
||||
private dataService: DataService,
|
||||
) {
|
||||
private htppErroHandle: HttpErrorHandle ) {
|
||||
this.loggeduser = SessionStore.user;
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
@@ -178,9 +179,8 @@ export class PedidoPage implements OnInit {
|
||||
}, (error) => {
|
||||
if (error.status == 0) {
|
||||
this.getfromDb();
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
this.htppErroHandle.httpsSucessMessagge(error)
|
||||
try {
|
||||
this.goBack()
|
||||
this.close()
|
||||
@@ -358,7 +358,6 @@ export class PedidoPage implements OnInit {
|
||||
this.goBack()
|
||||
}
|
||||
|
||||
// alert(JSON.stringify(res)+' nada')
|
||||
|
||||
}))
|
||||
}
|
||||
@@ -379,15 +378,10 @@ export class PedidoPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
|
||||
this.toastService._successMessage()
|
||||
this.htppErroHandle.httpsSucessMessagge('Solicitar alteração')
|
||||
this.close();
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
this.htppErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -404,15 +398,10 @@ export class PedidoPage implements OnInit {
|
||||
note
|
||||
}).toPromise()
|
||||
|
||||
this.toastService._successMessage()
|
||||
this.htppErroHandle.httpsSucessMessagge('Arquivar')
|
||||
this.close();
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
this.htppErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -456,12 +445,7 @@ export class PedidoPage implements OnInit {
|
||||
loader.remove()
|
||||
}, (error) => {
|
||||
loader.remove()
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}
|
||||
this.htppErroHandle.httpStatusHandle(error)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import { Platform } from '@ionic/angular';
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -49,7 +50,8 @@ export class PendentesPage implements OnInit {
|
||||
private platform: Platform,
|
||||
private backgroundservices: BackgroundService,
|
||||
private sortService: SortService,
|
||||
private storage: Storage
|
||||
private storage: Storage,
|
||||
private httpErroHandle: HttpErrorHandle
|
||||
) {
|
||||
this.loggeduser = SessionStore.user;
|
||||
this.profile = 'mdgpr';
|
||||
@@ -116,6 +118,8 @@ export class PendentesPage implements OnInit {
|
||||
}, (error) => {
|
||||
if(error.status == 0) {
|
||||
this.getFromDb();
|
||||
} else {
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user