mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Merge branch 'feature/viewer-attachment' of https://bitbucket.org/equilibriumito/gabinete-digital-fo into feature/viewer-attachment
This commit is contained in:
@@ -279,13 +279,13 @@
|
||||
<div class="container-div width-100">
|
||||
<div (click)="addParticipantsCC()" class="ion-item-class-2 cursor-pointer">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
||||
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height d-flex">
|
||||
<div class="list-people flex-grow-1">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
<ion-label *ngIf="taskParticipantsCc?.length < 1" class="list-people-title">Com Conhecimento*</ion-label>
|
||||
<ion-label *ngIf="taskParticipantsCc?.length < 1" class="list-people-title">Com Conhecimento</ion-label>
|
||||
<ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label>
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
@@ -377,7 +377,7 @@
|
||||
</button>
|
||||
</ion-buttons>
|
||||
<ion-buttons slot="end">
|
||||
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
|
||||
<button class="btn-cancel" fill="clear" color="#061b52" (click)="cancel()">
|
||||
<ion-label>Cancelar</ion-label>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
|
||||
@@ -203,6 +203,10 @@ export class EditEventPage implements OnInit {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
cancel() {
|
||||
this.modalController.dismiss({action:'cancel'});
|
||||
}
|
||||
|
||||
goBack() {
|
||||
|
||||
this.router.navigate(['/home', this.caller]);
|
||||
@@ -645,7 +649,7 @@ export class EditEventPage implements OnInit {
|
||||
if (horaMinuto[1] === '59') {
|
||||
horaMinuto[1] = '00';
|
||||
var novaString = partes[0] + ' ' + horaMinuto.join(':');
|
||||
|
||||
|
||||
return novaString;
|
||||
}
|
||||
return string;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
</div>
|
||||
<div class="middle d-flex align-center">
|
||||
<p class="title" style="font-size: 21.1px"><span>{{loadedEvent.Subject}}</span></p>
|
||||
<!-- Event details page -->
|
||||
</div>
|
||||
<div class="menu-options d-flex">
|
||||
<button class="btn-no-color" (click)="editEvent()">
|
||||
|
||||
@@ -247,6 +247,37 @@ export class ViewEventPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
loadEvent1() {
|
||||
|
||||
|
||||
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
|
||||
this.eventsService.getEvent(this.eventId).subscribe(res => {
|
||||
|
||||
res = this.dateService.fixDate(res as any)
|
||||
this.loadedEvent = res;
|
||||
this.setTimeZone()
|
||||
// this.addEventToDb(res);
|
||||
}, (error) => {
|
||||
});
|
||||
} else {
|
||||
|
||||
|
||||
if(this.CalendarId) {
|
||||
this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => {
|
||||
|
||||
res = this.dateService.fixDate(res as any)
|
||||
this.loadedEvent = res;
|
||||
this.setTimeZone()
|
||||
|
||||
}, (error) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
deleteYesOrNo() {
|
||||
this.alertController.create({
|
||||
header: 'Eliminar evento?',
|
||||
@@ -364,14 +395,13 @@ export class ViewEventPage implements OnInit {
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res) => {
|
||||
|
||||
|
||||
if (res) {
|
||||
setTimeout(() => {
|
||||
/* this.loadEvent(); */
|
||||
this.loadEvent()
|
||||
this.loadEvent1()
|
||||
}, 250);
|
||||
this.isEventEdited = true;
|
||||
console.log('res', res)
|
||||
console.log('res', res, res.data?.action, 'cancel')
|
||||
}
|
||||
});
|
||||
|
||||
@@ -399,7 +429,20 @@ export class ViewEventPage implements OnInit {
|
||||
modal.onDidDismiss().then((res) => {
|
||||
|
||||
|
||||
if (res) {
|
||||
if (res.data?.action == 'cancel') {
|
||||
setTimeout(() => {
|
||||
/* this.loadEvent(); */
|
||||
this.loadEvent1()
|
||||
|
||||
}, 250);
|
||||
this.isEventEdited = true;
|
||||
|
||||
if(res.data.Attendees?.length >= 1) {
|
||||
this.loadedEvent.HasAttachments = true
|
||||
this.getAttachments()
|
||||
}
|
||||
console.log('res', res)
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
/* this.loadEvent(); */
|
||||
this.loadEvent()
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<div style="color: black;">
|
||||
Evento Pendente de Aprovação
|
||||
</div>
|
||||
<!-- Events to approve details mobile -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -64,7 +65,7 @@
|
||||
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == 1">Semanal</span>
|
||||
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == 2">Mensal</span>
|
||||
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == 3">Anual</span>
|
||||
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == -1">(Não se repete)</span>
|
||||
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == -1">(Não se repete)</span>
|
||||
</p>
|
||||
</ion-label>
|
||||
</div>
|
||||
|
||||
@@ -61,7 +61,7 @@ export class ApproveEventPage implements OnInit {
|
||||
private attachmentsService: AttachmentsService,
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
//
|
||||
//
|
||||
|
||||
if (params["params"].serialNumber) {
|
||||
this.serialNumber = params["params"].serialNumber;
|
||||
@@ -72,7 +72,7 @@ export class ApproveEventPage implements OnInit {
|
||||
});
|
||||
|
||||
window['approve-event-getTask'] = () => {
|
||||
this.getTask1()
|
||||
this.getTask()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ export class ApproveEventPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
|
||||
this.getTask();
|
||||
this.backgroundservice.registerBackService('Online', () => {
|
||||
this.getTask();
|
||||
@@ -95,12 +95,12 @@ export class ApproveEventPage implements OnInit {
|
||||
}
|
||||
|
||||
addProcessToDB(data) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
getProcessFromDB() {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
getTask1 = () => {
|
||||
@@ -108,11 +108,11 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
this.loadedEvent = res
|
||||
this.addProcessToDB(this.loadedEvent)
|
||||
|
||||
|
||||
try {
|
||||
this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate);
|
||||
this.customDate = this.days[this.today.getDay()] + ", " + this.today.getDate() + " de " + (this.months[this.today.getMonth()]);
|
||||
|
||||
|
||||
} catch(error) {
|
||||
// console.log(this.loadedEvent)
|
||||
throw(error)
|
||||
@@ -133,11 +133,11 @@ export class ApproveEventPage implements OnInit {
|
||||
this.loadedEvent = res
|
||||
this.getAttachments();
|
||||
this.addProcessToDB(this.loadedEvent)
|
||||
|
||||
|
||||
try {
|
||||
this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate);
|
||||
this.customDate = this.days[this.today.getDay()] + ", " + this.today.getDate() + " de " + (this.months[this.today.getMonth()]);
|
||||
|
||||
|
||||
} catch(error) {
|
||||
// console.log(this.loadedEvent)
|
||||
throw(error)
|
||||
@@ -154,7 +154,7 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
async approveTask(serialNumber: string) {
|
||||
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
|
||||
|
||||
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
@@ -174,7 +174,7 @@ export class ApproveEventPage implements OnInit {
|
||||
}
|
||||
|
||||
async emendTask(serialNumber: string) {
|
||||
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: EmendMessageModalPage,
|
||||
@@ -188,9 +188,9 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
modal.onDidDismiss()
|
||||
.then(async (res) => {
|
||||
|
||||
if(res.data.option == 'save') {
|
||||
|
||||
|
||||
if(res.data.option == 'save') {
|
||||
|
||||
let body = {
|
||||
"serialNumber": serialNumber,
|
||||
"action": "Emendar",
|
||||
@@ -198,14 +198,14 @@ export class ApproveEventPage implements OnInit {
|
||||
"ReviewUserComment": res.data,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
.catch(() => {
|
||||
|
||||
|
||||
this.offlineManager.storeRequestData('event-listRever', body);
|
||||
});
|
||||
this.httpErrorHandle.httpsSucessMessagge('Rever')
|
||||
@@ -217,7 +217,7 @@ export class ApproveEventPage implements OnInit {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}, (error) => {
|
||||
console.log(error)
|
||||
@@ -229,7 +229,7 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
async rejeitar(serialNumber: string) {
|
||||
let body = { "serialNumber": serialNumber, "action": "Descartar" }
|
||||
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise();
|
||||
@@ -281,6 +281,7 @@ export class ApproveEventPage implements OnInit {
|
||||
});
|
||||
return await popover.present().then(() => {
|
||||
this.TaskService.loadEventosParaAprovacao()
|
||||
this.getTask();
|
||||
}, (error) => {
|
||||
console.log(error)
|
||||
})
|
||||
@@ -302,9 +303,9 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
|
||||
modal.onDidDismiss().then(async (res) => {
|
||||
|
||||
|
||||
if(res.data.option == 'save') {
|
||||
|
||||
|
||||
let body = {
|
||||
"serialNumber": serialNumber,
|
||||
"action": "Emendar",
|
||||
@@ -312,7 +313,7 @@ export class ApproveEventPage implements OnInit {
|
||||
"ReviewUserComment": res.data,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
@@ -327,7 +328,7 @@ export class ApproveEventPage implements OnInit {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
@@ -380,7 +381,7 @@ export class ApproveEventPage implements OnInit {
|
||||
} catch (error) {
|
||||
console.error('getAttchaments',error)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import { DeviceService } from "src/app/services/device.service"
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { HeaderSettingsService } from "src/app/services/header-settings.service"
|
||||
|
||||
@Component({
|
||||
selector: 'app-viewer-attachment',
|
||||
@@ -33,6 +34,7 @@ export class ViewerAttachmentPage implements OnInit {
|
||||
private erroHandler: HttpErrorHandle,
|
||||
public p: PermissionService,
|
||||
private processService: ProcessesService,
|
||||
private HeaderSettingsService: HeaderSettingsService
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
Reference in New Issue
Block a user