This commit is contained in:
tiago.kayaya
2021-07-28 16:27:48 +01:00
19 changed files with 352 additions and 173 deletions
+4 -1
View File
@@ -409,6 +409,9 @@
(closeComponent)="approveEventDismissGoBack()"
(setIntervenient)="setIntervenient($event)"
(setIntervenientCC)="setIntervenientCC($event)"
(closeEventToApprove)="closeEventToApproveGoBack()"
></app-edit-event-to-approve>
<app-attendee-modal
@@ -429,4 +432,4 @@
</div>
</ion-content>
</ion-content>
+1 -9
View File
@@ -338,15 +338,7 @@ export class AgendaPage implements OnInit {
let classs = [];
events.forEach(element => {
const startTimeSamp = new Date(element.startTime).toLocaleDateString()
const endTimeSamp = new Date(element.endTime).toLocaleDateString()
const endMinutes = new Date(element.endTime).getMinutes()
const endHours = new Date(element.endTime).getHours()
const endDay: number = new Date(element.endTime).getDate()
const startDay = new Date(element.startTime).getDate()
const profile_ = element.profile == 'md'? 'mdgpr': 'pr';
const eventtype = element.event.CalendarName;
@@ -15,6 +15,7 @@ import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { ToastService } from 'src/app/services/toast.service';
import { EliminateEventPage } from 'src/app/modals/eliminate-event/eliminate-event.page';
import { Location } from '@angular/common'
@Component({
selector: 'app-view-event',
@@ -58,6 +59,7 @@ export class ViewEventPage implements OnInit {
private activatedRoute: ActivatedRoute,
private router: Router,
private toastService: ToastService,
private location: Location
)
{
this.isEventEdited = false;
@@ -109,14 +111,16 @@ export class ViewEventPage implements OnInit {
if(this.isModal) {
this.close()
} else {
this.activatedRoute.paramMap.subscribe(params => {
if(params["params"].caller == 'expediente'){
window.history.back();
}
else{
this.router.navigate(['/home',params["params"].caller]);
}
});
// this.activatedRoute.paramMap.subscribe(params => {
// if(params["params"].caller == 'expediente'){
// window.history.back();
// }
// else{
// this.router.navigate(['/home',params["params"].caller]);
// }
// });
this.location.back();
}
}
@@ -128,13 +132,17 @@ export class ViewEventPage implements OnInit {
/* this.today = new Date(res.StartDate);
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */
loader.remove()
}, ()=>{
}, (error)=>{
loader.remove()
this.toastService.badRequest('Este evento já não existe na sua agenda')
this.modalController.dismiss('Eevent not Foud');
this.router.navigate(['/home/agenda']);
if(error.status == 0) {
this.toastService.badRequest('não é possível vizualizar este event no modo offline')
} else {
this.toastService.badRequest('Este evento já não existe na sua agenda')
}
loader.remove()
this.modalController.dismiss('Eevent not Foud');
this.location.back();
});
}
@@ -15,6 +15,9 @@ import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { DespachosOptionsPage } from 'src/app/shared/popover/despachos-options/despachos-options.page';
import { ToastService } from 'src/app/services/toast.service';
import { DespachoMdService } from 'src/app/Rules/despacho-md.service'
import { NavigationService } from 'src/app/services/navigation.service';
import { Location } from '@angular/common'
@Component({
selector: 'app-despacho',
@@ -50,6 +53,10 @@ export class DespachoPage implements OnInit {
private router: Router,
private animationController: AnimationController,
private toastService: ToastService,
private despachoMdService: DespachoMdService,
private navigationService: NavigationService,
private location: Location
) {
this.activatedRoute.paramMap.subscribe(params => {
if(params["params"].SerialNumber) {
@@ -80,31 +87,35 @@ export class DespachoPage implements OnInit {
}
goBack() {
if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){
if (window.innerWidth < 801) {
this.router.navigate(['/home/gabinete-digital/pendentes']);
}
else {
let navigationExtras: NavigationExtras = {
queryParams: {
"pendentes": true,
}
}
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
}
else{
if (window.innerWidth < 801) {
this.router.navigate(['/home/gabinete-digital/despachos']);
} else {
let navigationExtras: NavigationExtras = {
queryParams: {
'despachos': true
}
}
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
}
//this.navigationService.back()
this.location.back();
// if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){
// if (window.innerWidth < 801) {
// this.router.navigate(['/home/gabinete-digital/pendentes']);
// }
// else {
// let navigationExtras: NavigationExtras = {
// queryParams: {
// "pendentes": true,
// }
// }
// this.router.navigate(['/home/gabinete-digital'], navigationExtras);
// }
// }
// else{
// if (window.innerWidth < 801) {
// this.router.navigate(['/home/gabinete-digital/despachos']);
// } else {
// let navigationExtras: NavigationExtras = {
// queryParams: {
// 'despachos': true
// }
// }
// this.router.navigate(['/home/gabinete-digital'], navigationExtras);
// }
// }
}
async LoadTaskDetail(serial: string) {
@@ -188,21 +199,12 @@ export class DespachoPage implements OnInit {
this.modalController.dismiss();
}
async executado(note:string, documents:any){
let body = {
"serialNumber": this.serialnumber,
"action": "Conhecimento",
"ActionTypeId": 104,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
async executado(note:string, documents:any) {
const loader = this.toastService.loading()
try {
await this.processes.CompleteTask(body).toPromise()
await this.despachoMdService.executado(note, documents, this.serialnumber)
this.toastService.successMessage('Processo criado')
this.close();
} catch(error) {
@@ -213,7 +215,7 @@ export class DespachoPage implements OnInit {
}
}
async arquivar(note:string, documents:any){
async arquivar(note:string, documents:any) {
let body = {
"serialNumber": this.serialnumber,
"action": "Arquivo",
@@ -236,6 +238,7 @@ export class DespachoPage implements OnInit {
loader.remove()
}
}
async reencaminhar(note:string, documents:any) {
@@ -296,13 +299,15 @@ export class DespachoPage implements OnInit {
}
async sendExpedienteToPending() {
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
this.despachoMdService.sendExpedienteToPending(this.serialnumber).subscribe(res=>{
this.goBack();
this.toastService.successMessage('Processo enviado para despacho')
},
error => {
this.toastService.badRequest("Processo não enviado para despacho")
});
}
async openAddNoteModal(actionName:string) {
@@ -270,7 +270,7 @@ export class ExpedienteDetailPage implements OnInit {
const loader = this.toastService.loading()
try {
await this.processes.CompleteTask(otherbody).toPromise()
await this.processes.CompleteTask(otherbody)
this.toastService.successMessage('Processo descartado');
this.goBack();
} catch (error) {