This commit is contained in:
tiago.kayaya
2021-08-20 17:01:20 +01:00
14 changed files with 333 additions and 116 deletions
+13
View File
@@ -56,6 +56,19 @@ export class PedidoService {
return this.processes.CompleteTask(body)
}
arquivar({note = "", serialNumber, documents= [] }) {
let body = {
"serialNumber": serialNumber,
"action": "Arquivo",
"ActionTypeId": 95,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
return this.processes.CompleteTask(body)
}
}
+8 -1
View File
@@ -76,7 +76,7 @@ export class DelegarPage implements OnInit {
}
close() {
this.modalController.dismiss(null);
this.modalController.dismiss('close');
}
cancelTask() {
@@ -100,13 +100,20 @@ export class DelegarPage implements OnInit {
"DelegatedUserEmail": this.taskParticipants[0].EmailAddress,
}
console.log(body);
const loader = this.toastService.loading()
this.processes.DelegateTask(body).subscribe(res=>{
console.log(res);
this.toastService.successMessage('Processo delegado')
this.close();
},
(error)=>{
this.toastService.badRequest("Processo não delegado")
},
()=>{
loader.remove()
});
}
}
+11 -6
View File
@@ -40,17 +40,22 @@
<div class="notification-item">
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'agenda'" src="assets/images/icons-default-agenda.svg" >
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'gabinete-digital'" src="assets/images/icons-correspondencias.svg" >
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'accoes'" src="assets/images/icons-nav-actions.svg" >
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'accoes'" src="assets/images/icons-nav-accoes-active.svg" >
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'chat'" src="assets/images/icons-nav-agenda-active.svg" >
</div>
<div class="approve-event-time">
<p>{{item.dateInit}}</p>
<p>{{item.dateEnd}}</p>
<p *ngIf = "item.Service == 'agenda'">{{item.dateInit}}</p>
<p *ngIf = "item.Service == 'agenda'">{{item.dateEnd}}</p>
</div>
<div class="approve-event-detail">
<p>{{item.Location}}</p>
<h3>{{item.alert}}</h3>
<p *ngIf = "item.Service == 'agenda'">{{item.Location}}</p>
<h3 id="profile-title">{{item.alert}}</h3>
<p *ngIf = "item.Service != 'agenda'">{{item.desc}}</p>
</div>
<div class="notification-label"></div>
<div class="notification-label-MD-official" *ngIf = "item.Service == 'agenda' && item.TypeAgenda == 'official' && item.Role == '100000011'" ></div>
<div class="notification-label-MD-pessoal" *ngIf = "item.Service == 'agenda' && item.TypeAgenda == 'pessoal' && item.Role == '100000011'" ></div>
<div class="notification-label-PR-official" *ngIf = "item.Service == 'agenda' && item.TypeAgenda == 'official' && item.Role == '100000014'" ></div>
<div class="notification-label-PR-pessoal" *ngIf = "item.Service == 'agenda' && item.TypeAgenda == 'pessoal' && item.Role == '100000014'" ></div>
</div>
</div>
+26 -1
View File
@@ -96,14 +96,39 @@ ion-list{
.approve-event-detail{
width: calc(100% - 115px) !important;
float: left;
#profile-title{
width: 250px;
}
}
.notification-label{
.notification-label-MD-official{
float: right;
width: 5px;
height: 100%;
border-radius: 0% 100% 100% 0%;
background-color: #ffb703;
}
.notification-label-MD-pessoal{
float: right;
width: 5px;
height: 100%;
border-radius: 0% 100% 100% 0%;
background-color: #ff0303;
}
.notification-label-PR-official{
float: right;
width: 5px;
height: 100%;
border-radius: 0% 100% 100% 0%;
background-color: #03d838;
}
.notification-label-PR-pessoal{
float: right;
width: 5px;
height: 100%;
border-radius: 0% 100% 100% 0%;
background-color: #8b0ae0;
}
}
}
+20 -10
View File
@@ -53,7 +53,7 @@ export class ProfilePage implements OnInit {
notImplemented() { }
async getNotificationData(){
this.notificationservice.tempClearArray();
this.storageservice.get("Notifications").then((value) => {
console.log("Init get store", value)
@@ -72,10 +72,11 @@ export class ProfilePage implements OnInit {
IdObject: payload.IdObject,
FolderId: payload.FolderId,
desc: payload.desc,
dateInit: payload.dateInit,
dateEnd: payload.dateEnd,
dateInit: this.getFormatedTime(payload.dateInit),
dateEnd: this.getFormatedTime(payload.dateEnd),
Location: payload.Location,
TypeAgenda: payload.TypeAgenda,
Role: payload.Role,
Status: payload.Status
}
} else {
@@ -87,10 +88,11 @@ export class ProfilePage implements OnInit {
IdObject: element.IdObject,
FolderId: element.FolderId,
desc: element.desc,
dateInit: element.dateInit,
dateEnd: element.dateEnd,
dateInit: this.getFormatedTime(element.dateInit),
dateEnd: this.getFormatedTime(element.dateEnd),
Location: element.Location,
TypeAgenda: element.TypeAgenda,
Role: element.Role,
Status: element.Status
}
}
@@ -107,7 +109,18 @@ export class ProfilePage implements OnInit {
console.log('Timer badge count')
}
getFormatedTime(dateString){
var date = new Date(dateString);
var hours = date.getHours() > 12 ? date.getHours() - 12 : date.getHours();
var am_pm = date.getHours() >= 12 ? "pm" : "am";
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
let time = hours + ":" + minutes /* + " " + am_pm */;
console.log('Formate',time)
return time;
}
notificatinsRoutes = (index, Service, Object, IdObject, FolderId) => {
if (Service === "agenda") {
this.zone.run(() => this.router.navigate(['/home/agenda', IdObject, 'agenda']));
}
@@ -115,7 +128,8 @@ export class ProfilePage implements OnInit {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', IdObject, 'gabinete-digital']));
}
else if (Service === "gabinete-digital" && Object === "event-list") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event', IdObject, 'gabinete-digital']));
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'gabinete-digital']));
} else if (Service === "gabinete-digital" && Object === "despachos") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos', IdObject, 'gabinete-digital'], { replaceUrl: true }));
@@ -162,10 +176,6 @@ export class ProfilePage implements OnInit {
console.log("Delete notification first stata", this.notificationdata)
this.notificationdata = this.notificationdata.filter(item=>item.index !=index );
if(typeof(this.notificationdata) != 'object' ) {
console.log('=_+_+_+_+_+_+_+_+_+_++_+_+_+_+_+_+_+_+_+_+_+_ not an object')
}
this.storageservice.store("Notifications",JSON.stringify(this.notificationdata)).then(() =>{
this.storageservice.get("Notifications").then((value) =>{
console.log("notfication state", value, )
+11
View File
@@ -0,0 +1,11 @@
interface BookMeetingModalPagecomponentProps {
task: any
}
interface BookMeetingModalPageReturn {}
interface ExpedientTaskModalPageComponentProps {
taskAction: any
task: any
profile: any
}
interface ExpedientTaskModalPageReturn {}
@@ -29,9 +29,24 @@
<div class="overflow-y-auto">
<div class="upper-content ml-45">
<div class="content-location">
<p><span class="date">{{loadedEvent.Location}}</span><span class="label">{{loadedEvent.CalendarName}}</span></p>
<span class="date">{{loadedEvent.Location}}</span>
<div *ngIf="loadedEvent.Organizer">
<div *ngIf="loadedEvent.Organizer.Name == 'Agenda do Presidente da República' ">
<span class="label" *ngIf="loadedEvent.CalendarName == 'Oficial' " style="background-color: #99e47b;">{{loadedEvent.CalendarName}}</span>
<span class="label" *ngIf="loadedEvent.CalendarName == 'Pessoal' " style="background-color: #958bfc;">{{loadedEvent.CalendarName}}</span>
</div>
<div *ngIf="loadedEvent.Organizer.Name == 'Agenda do Ministro e Director do Gabinete do PR' ">
<span class="label" *ngIf="loadedEvent.CalendarName == 'Oficial' " style="background-color: #ffb703;">{{loadedEvent.CalendarName}}</span>
<span class="label" *ngIf="loadedEvent.CalendarName == 'Pessoal' " style="background-color: #f05d5e;">{{loadedEvent.CalendarName}}</span>
</div>
</div>
</div>
<div class="content-details">
<ion-label>
<p>{{customDate}}</p>
@@ -4,17 +4,84 @@
<ion-content>
<div class="main-content d-flex height-100">
<div class="content d-flex flex-column" *ngIf="task">
<div class="main-header">
<div class="title-content width-100 d-flex justify-space-between align-center">
<div class=" btn-dismiss font-30 cursor-pointer" (click)="goBack()" defaultHref="#">
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
</div>
<div class="middle d-flex align-center flex-grow-1">
<ion-label class="title">{{ task.Folio}}</ion-label>
</div>
<div class="div-icon" (click)="openOptions()">
<ion-icon src="assets/images/icons-menu.svg"></ion-icon>
</div>
</div>
</div>
<div class="upper-content">
<div class="content-details">
<ion-label>
<p><span class="date">{{customDate}}</span><span class="label">{{ task.activityInstanceName }}</span></p>
<p><span class="color-red">{{ task.DeadlineType }}</span></p>
</ion-label>
</div>
</div>
<div class="line"></div>
<div class="overflow-y-auto" style="margin-right: -20px; margin-right: -20px;">
<div class="middle-content">
<h5 *ngIf="intervenientes">Intervenientes</h5>
<ion-item class="ion-no-margin ion-no-padding">
<ion-label>
<div *ngFor="let interveniente of intervenientes">
<p>{{interveniente.Name}}</p>
</div>
</ion-label>
</ion-item>
<div *ngIf="cc.length > 0">
<h5>Com conhecimento</h5>
<ion-item class="ion-no-margin ion-no-padding">
<ion-label>
<div *ngFor="let c of cc">
<p>{{c.Name}}</p>
</div>
</ion-label>
</ion-item>
</div>
<div *ngIf="fulltask.workflowInstanceDataFields.TaskMessage">
<h5>Detalhes</h5>
<ion-item class="ion-no-margin ion-no-padding">
<p [innerHTML]="fulltask.workflowInstanceDataFields.TaskMessage"></p>
</ion-item>
</div>
</div>
<div class="bottom-content width-100">
<ion-list>
<h5>Documentos Anexados</h5>
<ion-item class="ion-no-margin ion-no-padding cursor-pointer" *ngFor="let Document of fulltask.Documents">
<ion-label class="d-block" (click)="viewDocument(Document.DocId)">
<p class="attach-title-item">{{ Document.Assunto }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p><span class="span-left">{{ Document.Sender}}</span><span class="span-right">{{ Document.DocDate | date: 'dd/MM/yyyy HH:mm' }}</span></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
</div>
<app-task-details class="content d-flex flex-column"
[task]="task"
[intervenientes]="intervenientes"
[cc]="cc"
[customDate]="customDate"
[fulltask]="fulltask"
(openOptions)="openOptions($event)"
(goBack)="goBack()"
(viewDocument)="viewDocument($event)"
></app-task-details>
[task]="task"
[intervenientes]="intervenientes"
[cc]="cc"
[customDate]="customDate"
[fulltask]="fulltask"
(openOptions)="openOptions($event)"
(goBack)="goBack()"
(viewDocument)="viewDocument($event)"
>
<div *ngIf="task" class="aside-right flex-column height-100">
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
@@ -48,7 +115,6 @@
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
</div>
</div>
</div>
</ion-content>
@@ -1,15 +1,10 @@
import { Component, OnInit } from '@angular/core';
import { ProcessesService } from 'src/app/services/processes.service';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { EventsService } from 'src/app/services/events.service';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { formatDate } from '@angular/common';
import { Event } from '../../../../models/event.model';
import { AnimationController, MenuController, ModalController, PopoverController } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service';
import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
import { momentG } from 'src/plugin/momentG'
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
@@ -23,6 +18,7 @@ import { ToastService } from 'src/app/services/toast.service';
import { ForwardPage } from 'src/app/modals/forward/forward.page';
import { PermissionService } from 'src/app/OtherService/permission.service';
import { Location } from '@angular/common';
import { PedidoService } from 'src/app/Rules/pedido.service';
@Component({
@@ -45,13 +41,10 @@ export class PedidoPage implements OnInit {
intervenientes: any;
cc: any = [];
loggeduser: User;
fromPeddingList = false
constructor(private activatedRoute: ActivatedRoute,
private processes: ProcessesService,
private iab: InAppBrowser,
private attachmentsService: AttachmentsService,
private events: EventsService,
private menu: MenuController,
private router: Router,
private modalController: ModalController,
@@ -61,7 +54,8 @@ export class PedidoPage implements OnInit {
private animationController: AnimationController,
private toastService: ToastService,
public p: PermissionService,
private location: Location
private location: Location,
private pedidoService: PedidoService
) {
this.loggeduser = authService.ValidatedUser;
@@ -218,6 +212,8 @@ export class PedidoPage implements OnInit {
this.goBack()
}
alert(JSON.stringify(res)+' nada')
}))
}
@@ -247,25 +243,20 @@ export class PedidoPage implements OnInit {
}
async arquivar(note:string, documents:any) {
let body = {
"serialNumber": this.serialnumber,
"action": "Arquivo",
"ActionTypeId": 95,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
const loader = this.toastService.loading()
try {
await this.processes.CompleteTask(body).toPromise()
await this.pedidoService.arquivar({serialNumber: this.serialnumber,
documents,
note
}).toPromise()
this.toastService.successMessage('Processo arquivado')
this.close();
} catch (error) {
this.toastService.badRequest()
} finally {
} finally {
loader.remove()
}
@@ -348,22 +339,22 @@ export class PedidoPage implements OnInit {
modal.onDidDismiss();
}
async viewEventDetail(eventId: any) {
// async viewEventDetail(eventId: any) {
const modal = await this.modalController.create({
component: ViewEventPage,
componentProps: {
eventId: eventId,
},
cssClass: 'modal modal-desktop',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then((res) => {
if (res) {
}
});
}
// const modal = await this.modalController.create({
// component: ViewEventPage,
// componentProps: {
// eventId: eventId,
// },
// cssClass: 'modal modal-desktop',
// backdropDismiss: false
// });
// await modal.present();
// modal.onDidDismiss().then((res) => {
// if (res) {
// }
// });
// }
async distartExpedientModal(){
console.log(this.fulltask);
@@ -491,11 +482,11 @@ export class PedidoPage implements OnInit {
await this.repreciar(res.data.note, docs);
this.goBack();
}
else if(actionName == 'Arquivar'){
else if(actionName == 'Arquivar') {
await this.arquivar(res.data.note, docs);
this.goBack();
}
else if(actionName == 'Assignar'){
else if(actionName == 'Assignar') {
await this.assignar(res.data.note, docs);
}
}
+14 -5
View File
@@ -12,19 +12,28 @@ export class ModalService {
private modalController: ModalController,
) { }
BookMeetingModalPage(task, { classs, backdropDismiss = false }) {
BookMeetingModalPage(e:BookMeetingModalPagecomponentProps, { cssClass='', backdropDismiss = false }) {
return this.modalController.create({
component: BookMeetingModalPage,
componentProps: {
task: task,
task: e.task,
},
cssClass: classs,
cssClass,
backdropDismiss
});
}
ExpedientTaskModalPage(task, { classs, backdropDismiss = false }) {
ExpedientTaskModalPage(e:ExpedientTaskModalPageComponentProps, { cssClass ="", backdropDismiss = false }) {
return this.modalController.create({
component: ExpedientTaskModalPage,
componentProps: {
taskAction: e.taskAction,
task: e.task,
profile: e.profile,
},
cssClass,
});
}
+6 -2
View File
@@ -175,6 +175,10 @@ export class NotificationsService {
}
}
tempClearArray(){
this.DataArray = [];
}
async onReceviNotification() {
if(window['WLAuthorizationManager']) {
@@ -231,8 +235,8 @@ export class NotificationsService {
else if (data.Service === "gabinete-digital" && data.Object === "expediente") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente',data.IdObject,'gabinete-digital']));
}
else if (data.Service === "gabinete-digital" && data.Object === "event-list") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',data.IdObject, 'gabinete-digital']));
else if (data.Service === "agenda" && data.Object === "event-list") {
this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event',data.IdObject, 'agenda']));
}else if (data.Service === "gabinete-digital" && data.Object === "despachos") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos',data.IdObject,'gabinete-digital'],{replaceUrl: true}));
@@ -6,11 +6,11 @@ import { CreateProcessPage } from 'src/app/modals/create-process/create-process.
import { DarParecerPage } from 'src/app/modals/dar-parecer/dar-parecer.page';
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
import { PermissionService } from 'src/app/OtherService/permission.service';
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
import { ProcessesService } from 'src/app/services/processes.service';
import { ToastService } from 'src/app/services/toast.service';
import { Location } from '@angular/common';
import { PedidoService } from 'src/app/Rules/pedido.service';
@Component({
selector: 'app-request-options',
@@ -35,7 +35,7 @@ export class RequestOptionsPage implements OnInit {
private toastService: ToastService,
private router: Router,
public p: PermissionService,
private location: Location
private pedidoService: PedidoService
) {
this.task = this.navParams.get('task');
this.fulltask = this.navParams.get('fulltask');
@@ -137,7 +137,6 @@ export class RequestOptionsPage implements OnInit {
if(res['data']=='openDiscart') {
console.log('open discart');
this.distartExpedientModal();
} else {
this.popoverController.dismiss('close')
}
@@ -145,29 +144,6 @@ export class RequestOptionsPage implements OnInit {
});
}
async distartExpedientModal() {
this.popoverController.dismiss();
console.log(this.fulltask);
const modal = await this.modalController.create({
component: DiscartExpedientModalPage,
componentProps: {
serialNumber: this.fulltask.serialNumber,
folderId: this.fulltask.workflowInstanceDataFields.FolderID,
action: 'complete',
},
cssClass: 'discart-expedient-modal',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then(res=>{
if(res['data']=='close') {
this.close();
} else {}
});
}
async repreciar(note:string, documents:any) {
let body = {
"serialNumber": this.serialNumber,
@@ -195,7 +171,7 @@ export class RequestOptionsPage implements OnInit {
}
async openAddNoteModal(actionName:string) {
this.popoverController.dismiss();
let classs;
if( window.innerWidth <= 800){
classs = 'modal modal-desktop'
@@ -229,7 +205,7 @@ export class RequestOptionsPage implements OnInit {
}
if(res.data){
if(res.data) {
if(actionName == 'Solicitar Reapreciação') {
await this.repreciar(res.data.note, docs);
@@ -237,29 +213,27 @@ export class RequestOptionsPage implements OnInit {
else if(actionName == 'Arquivar') {
await this.arquivar(res.data.note, docs);
this.popoverController.dismiss('close')
this.modalController.dismiss('close');
alert('close')
}
}
});
}
async arquivar(note:string, documents:any) {
let body = {
"serialNumber": this.serialNumber,
"action": "Arquivo",
"ActionTypeId": 95,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
const loader = this.toastService.loading()
try {
await this.processes.CompleteTask(body).toPromise()
await this.pedidoService.arquivar({serialNumber: this.serialNumber,
documents,
note
}).toPromise()
this.toastService.successMessage('Processo arquivado')
} catch (error) {
this.toastService.badRequest('Processo não arquivado')
} finally {
loader.remove()
}
}
@@ -290,7 +264,6 @@ export class RequestOptionsPage implements OnInit {
async openDelegarModal(task: any) {
this.popoverController.dismiss();
let classs;
if( window.innerWidth <= 800){
@@ -307,7 +280,13 @@ export class RequestOptionsPage implements OnInit {
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
modal.onDidDismiss().then( async (res)=> {
if(res['data']=='close') {
this.popoverController.dismiss('close');
}
})
}