Merge branch 'feature/gabinete' into developer

This commit is contained in:
tiago.kayaya
2021-04-30 14:26:57 +01:00
49 changed files with 2727 additions and 61 deletions
+12
View File
@@ -51,6 +51,18 @@ const routes: Routes = [
{
path: 'despachos',
loadChildren: () => import('./shared/gabinete-digital/despachos/despachos.module').then( m => m.DespachosPageModule)
},
{
path: 'create-process',
loadChildren: () => import('./modals/create-process/create-process.module').then( m => m.CreateProcessPageModule)
},
{
path: 'pendentes',
loadChildren: () => import('./shared/gabinete-digital/pendentes/pendentes.module').then( m => m.PendentesPageModule)
},
{
path: 'delegar',
loadChildren: () => import('./modals/delegar/delegar.module').then( m => m.DelegarPageModule)
},
/* {
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { CreateProcessPage } from './create-process.page';
const routes: Routes = [
{
path: '',
component: CreateProcessPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class CreateProcessPageRoutingModule {}
@@ -0,0 +1,26 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { CreateProcessPageRoutingModule } from './create-process-routing.module';
import { CreateProcessPage } from './create-process.page';
import { AttendeeModalPage } from 'src/app/shared/event/attendee-modal/attendee-modal.page';
import { EmptyContainerPage } from 'src/app/shared/empty-container/empty-container.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
CreateProcessPageRoutingModule
],
declarations: [
CreateProcessPage,
AttendeeModalPage,
EmptyContainerPage,
]
})
export class CreateProcessPageModule {}
@@ -0,0 +1,145 @@
<ion-content class="height-100">
<div class="main-content d-flex height-100">
<div class="content d-flex flex-column width-100">
<ion-item lines="none">
<ion-label class="title">{{modalTitle[taskType]}}</ion-label>
</ion-item>
<div class="ion-item-container width-100">
<ion-input placeholder="Assunto" [(ngModel)]="postData.DispatchFolder.Subject"></ion-input>
</div>
<div class="container-div width-100">
<div class="ion-item-class-2">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div>
<div class="ion-input-class">
<ion-input class="add-border" placeholder="Descrição" [(ngModel)]="postData.DispatchFolder.Message"></ion-input>
</div>
</div>
</div>
<div class="container-div width-100">
<div class="ion-item-class-2 width-100">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
</div>
<div class="ion-input-class">
<ion-select placeholder="Prazo" [(ngModel)]="postData.Priority" interface="action-sheet" Cancel-text="Cancelar" required>
<ion-select-option value="99999861"><b>Normal</b> (4 dias para a execução da tarefa)</ion-select-option>
<ion-select-option value="99999862"><b>Urgente</b> (2 dias para a execução da tarefa)</ion-select-option>
<ion-select-option value="99999863"><b>Muito Urgente</b> (1 dia para a execução da tarefa)</ion-select-option>
<ion-select-option value="99999864"><b>Urgentíssimo</b> (8 horas para a execução da tarefa)</ion-select-option>
</ion-select>
</div>
</div>
</div>
<div class="container-div">
<div class="ion-item-class-2">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
</div>
<div class="ion-input-class">
<ion-select placeholder="Tipo" [(ngModel)]="postData.SubjectTypeId" interface="action-sheet" Cancel-text="Cancelar" required>
<ion-select-option *ngFor="let type of subjectTypes" value="{{type.Code}}">{{type.Description}}</ion-select-option>
</ion-select>
</div>
</div>
</div>
<div class="container-div">
<div class="ion-item-class-2">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
</div>
<div class="ion-input-class-no-height">
<div class="list-people">
<ion-item lines="none">
<ion-list>
<ion-label *ngIf="taskParticipants.length == 0" class="list-people-title">Adicionar intervenientes</ion-label>
<ion-label *ngFor="let participant of taskParticipants">{{participant.Name}}</ion-label>
</ion-list>
</ion-item>
</div>
<div class="add-people" (click)="addParticipants();">
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
</div>
</div>
</div>
</div>
<div class="container-div">
<div class="ion-item-class-2">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
</div>
<div class="ion-input-class-no-height">
<div class="list-people">
<ion-item lines="none">
<ion-list>
<ion-label *ngIf="taskParticipantsCc.length == 0" class="list-people-title">Com conhecimento</ion-label>
<ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label>
</ion-list>
</ion-item>
</div>
<div class="add-people" (click)="addParticipantsCc();">
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
</div>
</div>
</div>
</div>
<div hidden class="ion-item-container-no-border">
<ion-label>
<div class="attach-icon">
<ion-icon src="assets/images/icons-attach-doc.svg"></ion-icon>
</div>
<div class="attach-document">
<ion-label>Anexar Documentos</ion-label>
</div>
</ion-label>
</div>
<div *ngIf="loadedAttachments">
<ion-item>
<ion-label>Documentos Anexados</ion-label>
</ion-item>
<ion-list>
<ion-item *ngFor="let attachment of loadedAttachments">
<ion-label>
<h4 class="attach-title-item">{{attachment.Description}}</h4>
<p><span class="span-left">{{attachment.Stakeholders}}</span><span class="span-right"> {{ attachment.CreateDate | date: 'dd/MM/yyyy' }}</span></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
<div *ngIf="postData" class="aside-right flex-column height-100">
<app-empty-container
[texto]="emptyTextDescription"
*ngIf="!showAttendees"
class="d-flex height-100 flex-column">
</app-empty-container>
<app-attendee-modal
*ngIf="showAttendees"
class="d-flex flex-column height-100"
[adding]="adding"
[taskParticipants]="taskParticipants"
[taskParticipantsCc]="taskParticipantsCc"
(closeComponent)="closeComponent()"
(setIntervenient)="setIntervenient($event)"
(setIntervenientCC)="setIntervenientCC($event)"
(setContact)="setContact($event)"
></app-attendee-modal>
</div>
</div>
</ion-content>
<ion-footer>
<div class="buttons">
<button class="btn-cancel" shape="round" (click)="cancelTask()">Cancelar</button>
<button class="btn-ok" shape="round" (click)="saveTask()">Gravar</button>
</div>
</ion-footer>
@@ -0,0 +1,128 @@
.content{
padding: 30px 20px 0 20px !important;
margin: 0;
float: left;
.title{
font-family: Roboto;
font-size: 25px;
font-weight: normal;
font-stretch: normal;
font-style: normal;
line-height: normal;
letter-spacing: normal;
color: #000000;
//margin: 8px 0 8px 0px;
}
.container-div{
margin-bottom: 15px;
}
.ion-item-container{
//width: 360px;
margin: 15px auto;
border: 1px solid #ebebeb;
border-radius: 5px;
padding-left: 5px;
}
.ion-item-container-no-border{
//width: 360px;
//margin: 15px auto;
}
.ion-item-class-2{
//width: 360px;
margin: 0px auto;
overflow: auto;
}
.ion-icon-class{
width: 45px;
height: 45px;
float: left;
padding: 10px;
font-size: 25px;
}
ion-select{
padding-left: 5px;
margin-left: 0;
}
.ion-input-class{
width: calc(100% - 45px);
height: 45px;
border: 1px solid #ebebeb;
border-radius: 5px;
padding-left: 5px;
padding-right: 10px;
float: left;
}
.ion-input-class-no-height{
border: 1px solid #ebebeb;
border-radius: 5px;
overflow: auto;
}
.list-people{
width: 256px;
float: left;
}
.add-people{
width: 45px;
float: right;
overflow: auto;
font-size: 25px;
padding: 10px;
}
.list-people-title{
/* font-size: 13px; */
color: #797979;
}
.attach-document{
font-size: 15px;
color: #0d89d1;
}
.attach-title-item{
width: 100%;
font-size: 15px;
color:#0d89d1;
}
/* SPAN */
.span-left{
float: left;
font-size: 15x;
}
.span-right{
text-align: right;
float: right;
font-size: 13px;
}
}
.container-footer{
margin:0 auto;
overflow: auto;
.button-cancel {
width: 170px;
height: 44px;
border-radius: 22.5px;
--background: #e0e9ee;
--color: #061b52;
margin:10px;
}
.button-save {
width: 170px;
height: 44px;
border-radius: 22.5px;
--background: #42b9fe;
--color:#ffffff;
margin:10px;
}
}
.buttons{
display: flex;
justify-content: space-between;
padding: 20px;
overflow: auto;
}
@media only screen and (min-width: 1024px){
.aside-content{
display: block;
}
}
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { CreateProcessPage } from './create-process.page';
describe('CreateProcessPage', () => {
let component: CreateProcessPage;
let fixture: ComponentFixture<CreateProcessPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ CreateProcessPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(CreateProcessPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,370 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { ModalController, NavParams } from '@ionic/angular';
import { Despacho } from 'src/app/models/despacho.model';
import { EventPerson } from 'src/app/models/eventperson.model';
import { Participant } from 'src/app/models/participant.model';
import { Folder } from 'src/app/models/folder.model';
import { AuthService } from 'src/app/services/auth.service';
import { ProcessesService } from 'src/app/services/processes.service';
import { environment } from 'src/environments/environment';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { AlertService } from 'src/app/services/alert.service';
import { AddParticipantsModalPage } from 'src/app/pages/gabinete-digital/expediente/add-participants-modal/add-participants-modal.page';
import { AddParticipantsCcModalPage } from 'src/app/pages/gabinete-digital/expediente/add-participants-cc-modal/add-participants-cc-modal.page';
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
import { ExpedienteDetailPage } from 'src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page';
@Component({
selector: 'app-create-process',
templateUrl: './create-process.page.html',
styleUrls: ['./create-process.page.scss'],
})
export class CreateProcessPage implements OnInit {
modalTitle: string[] = [
'Efectuar Despacho',
'Solicitar Parecer',
'Solicitar Deferimento'
];
taskType:string;
task: any;
taskParticipants: any = [];
taskParticipantsCc: any = [];
taskDate: Date;
taskDescription: string;
user: string;
loadedAttachments:any;
subjectTypes:any;
postData: Despacho;
dispatchFolder: Folder;
participants: Participant[];
contacts= [];
// trigger hide and show for attendee component
showAttendees= false;
adding: "intervenient" | "CC" = "intervenient";
profile: string;
emptyTextDescription = "Sem intervenientes selecionados";
showEmptyContainer = true;
constructor(
private modalController: ModalController,
private router:Router,
private processes:ProcessesService,
private attachmentsService: AttachmentsService,
private navParams: NavParams,
private alertController: AlertService,
private authService: AuthService) {
this.user = environment.defaultuser +'@'+ environment.domain;
this.task = this.navParams.get('task');
console.log('task', this.task)
this.taskType = this.navParams.get('taskAction');
this.postData = new Despacho();
this.participants = this.participants = new Array();
this.dispatchFolder = {
Nad: 30,
Subject: '',
Message: '',
SourceSecFsId: '361',
SouceType: 'FOLDER',
SourceId: this.task.workflowInstanceDataFields.FolderID,
DeadlineType: '',
};
this.postData.DispatchFolder = this.dispatchFolder;
this.postData.UsersSelected = this.participants;
/* By Default TypeDeadline should be 'Normal' */
this.postData.Priority = '99999861';
/* By Default TypeDeadline should be 'Economia' */
this.postData.SubjectTypeId = '99999844';
/* Initialize 'Subject' with the title of the expedient */
this.postData.DispatchFolder.Subject = this.task.workflowInstanceDataFields.Subject;
this.profile = this.navParams.get('profile');
}
async setAdding(type: "intervenient" | "CC"){
this.adding = type;
}
ngOnInit() {
this.taskDate = new Date(this.task.taskStartDate);
if(!this.task.hasOwnProperty('isEvent')) {
// if not
this.getAttachments();
}
this.getSubjectType();
console.log('CHEGOU');
}
close(){
this.router.navigate(['/home/gabinete-digital/expediente']);
this.modalController.dismiss(null);
}
getSubjectType() {
this.processes.GetSubjectType().subscribe(res=>{
console.log(res);
this.subjectTypes = res;
});
}
cancelTask() {
this.modalController.dismiss(null);
}
saveTask(){
if(this.postData.Priority=='99999861'){
this.dispatchFolder.DeadlineType = 'Normal';
}
else if(this.postData.Priority=='99999862'){
this.dispatchFolder.DeadlineType = 'Urgente';
}
else if(this.postData.Priority=='99999863'){
this.dispatchFolder.DeadlineType = 'Muito Urgente';
}
else if(this.postData.Priority=='99999864'){
this.dispatchFolder.DeadlineType = 'Urgentíssimo';
}
let attendees = this.taskParticipants.concat(this.taskParticipantsCc);
attendees = attendees.map(function(val) {
return {
UserEmail: val.EmailAddress,
UserType: val.IsRequired?"I": "CC"
};
})
if(this.taskParticipants.length > 0) {
switch (this.taskType) {
case '0':
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.user,
SubjectTypeId: this.postData.SubjectTypeId,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
}
console.log('this.postData', this.postData, this.taskType);
this.processes.postDespatcho(this.postData);
break;
case '1':
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.user,
SubjectTypeId: this.postData.SubjectTypeId,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
}
console.log(this.postData);
this.processes.postParecer(this.postData);
break;
case '2':
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.user,
SubjectTypeId: this.postData.SubjectTypeId,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
}
console.log(this.postData);
this.processes.postDeferimento(this.postData);
break;
}
this.modalController.dismiss();
/* this.distartExpedientModal();
this.close(); */
}
else {
this.alertController.presentAlert("Lista de intervenientes vazia. Por favor, adicione 1 ou mais intervenientes.");
}
}
getAttachments() {
this.attachmentsService.getAttachmentsBySerial(this.task.serialNumber).subscribe(res=>{
this.loadedAttachments = res;
console.log(res);
});
}
async addParticipants() {
/* console.log('HERES'); */
this.adding = "intervenient";
this.contacts = this.taskParticipants;
if(window.innerWidth <=800){
this.showAttendees=false;
const modal = await this.modalController.create({
component: AddParticipantsModalPage,
componentProps: {
eventPersons: this.participants
},
cssClass: 'add-participants-modal',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then((res) => {
this.taskParticipants = res.data;
let newattendees: EventPerson[] = res['data'];
if(newattendees!= null){
newattendees.forEach(newattendee => {
let att = {
'UserEmail': newattendee.EmailAddress,
'UserType': 'I',
};
if(this.participants == null){
this.participants = new Array();
}
this.participants.push(att);
});
}
this.postData.UsersSelected = this.participants;
console.log(this.postData);
});
} else {
this.showAttendees=true
}
}
async addParticipantsCc() {
this.adding = "CC";
this.contacts = this.taskParticipantsCc;
if(window.innerWidth <=800){
this.showAttendees=false;
const modal = await this.modalController.create({
component: AddParticipantsCcModalPage,
componentProps: {
eventPersons: this.participants
},
cssClass: 'add-participants-cc-modal',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then((res) => {
this.taskParticipantsCc = res.data;
let newattendees: EventPerson[] = res['data'];
if(newattendees!= null){
newattendees.forEach(newattendee => {
let att = {
'UserEmail': newattendee.EmailAddress,
'UserType': 'CC',
};
if(this.participants == null){
this.participants = new Array();
}
this.participants.push(att);
});
}
this.postData.UsersSelected = this.participants;
console.log(this.postData);
});
} else {
this.showAttendees=true
}
}
async distartExpedientModal() {
const modal = await this.modalController.create({
component: DiscartExpedientModalPage,
componentProps: {
serialNumber: this.task.serialNumber,
folderId: this.task.workflowInstanceDataFields.FolderID,
action: 'complete',
},
cssClass: 'discart-expedient-modal',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then(res=>{
if(res['data']=='close'){
console.log('Expedient Discard closed');
this.modalController.dismiss(res['data'])
}
});
}
async setContact(data:EventPerson[]) {
if(this.adding == "intervenient"){
this.taskParticipants = data;
} else if (this.adding == "CC") {
this.taskParticipantsCc = data;
}
}
async setIntervenient(data) {
this.taskParticipants = data;
}
async setIntervenientCC(data) {
this.taskParticipantsCc = data;
}
async closeComponent() {
this.showAttendees = false;
}
async viewExpedientDetail() {
console.log(this.profile);
let classs;
if( window.innerWidth <= 800){
classs = 'modal'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: ExpedienteDetailPage,
componentProps:{
serialNumber: this.task.serialNumber,
profile: this.profile,
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then((res)=>{
/* console.log('!refresh list'); */
});
}
}
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { DelegarPage } from './delegar.page';
const routes: Routes = [
{
path: '',
component: DelegarPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class DelegarPageRoutingModule {}
+24
View File
@@ -0,0 +1,24 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { DelegarPageRoutingModule } from './delegar-routing.module';
import { DelegarPage } from './delegar.page';
import { AttendeeModalPage } from 'src/app/shared/event/attendee-modal/attendee-modal.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
DelegarPageRoutingModule
],
declarations: [
DelegarPage,
AttendeeModalPage,
]
})
export class DelegarPageModule {}
+90
View File
@@ -0,0 +1,90 @@
<ion-content>
<div class="main-content d-flex height-100">
<div class="content d-flex flex-column width-100">
<div class="header-content pb-20">
<div class="header-title">
<label>Delegar</label>
</div>
</div>
<div class="overflow-y-auto">
<div class="container-div">
<div class="ion-item-class-2">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
</div>
<div class="ion-input-class-no-height">
<div class="list-people">
<ion-item lines="none">
<ion-list>
<ion-label *ngIf="taskParticipants.length == 0" class="list-people-title">Adicionar intervenientes</ion-label>
<ion-label *ngFor="let participant of taskParticipants">{{participant.Name}}</ion-label>
</ion-list>
</ion-item>
</div>
<div class="add-people" (click)="addParticipants()">
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
</div>
</div>
</div>
</div>
<div class="container-div">
<div class="ion-item-class-2 d-flex">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div>
<div class="ion-input-class-no-height width-100">
<ion-textarea [(ngModel)]="postData.Body.Text" placeholder="Detalhes" rows="6" cols="20"></ion-textarea>
</div>
</div>
</div>
<div hidden class="ion-item-container-no-border">
<ion-label>
<div class="attach-icon">
<ion-icon src="assets/images/icons-attach-doc.svg"></ion-icon>
</div>
<div class="attach-document">
<ion-label>Anexar Documentos</ion-label>
</div>
</ion-label>
</div>
<div *ngIf="loadedAttachments">
<ion-item>
<ion-label>Documentos Anexados</ion-label>
</ion-item>
<ion-list>
<ion-item *ngFor="let attachment of loadedAttachments">
<ion-label>
<h4 class="attach-title-item">{{attachment.Description}}</h4>
<p><span class="span-left">{{attachment.Stakeholders}}</span><span class="span-right"> {{ attachment.CreateDate | date: 'dd/MM/yyyy' }}</span></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
</div>
<div class="aside-righ flex-grow-1">
<app-attendee-modal class=" d-flex flex-column height-100"
*ngIf="showAttendees"
[taskParticipants]="taskParticipants"
[taskParticipantsCc]="taskParticipantsCc"
[adding]="adding"
(dynamicSetIntervenient)="dynamicSetIntervenient($event)"
>
</app-attendee-modal>
</div>
</div>
</ion-content>
<ion-footer>
<div class="buttons">
<button class="btn-cancel" shape="round" (click)="cancelTask()">Cancelar</button>
<button class="btn-ok" shape="round" (click)="saveTask()">Gravar</button>
</div>
</ion-footer>
+150
View File
@@ -0,0 +1,150 @@
.content{
padding: 30px 20px 0 20px !important;
margin: 0;
float: left;
.header-content{
margin-bottom: 20px !important;
}
.header-title{
font-family: Roboto;
font-size: 25px;
padding: 0;
color:#000;
float: left;
}
.ion-item-container{
margin: 15px auto;
border: 1px solid #ebebeb;
border-radius: 5px;
padding-left: 10px;
}
.ion-item-container-no-border{
margin: 0px auto;
padding: 0 !important;
overflow: auto;
}
.container-div{
margin-bottom: 15px;
overflow: hidden;
}
.ion-item-class-2{
margin: 0px auto;
}
.ion-icon-class{
width: 45px;
height: 45px;
float: left;
padding: 10px;
font-size: 25px;
}
ion-select{
padding-left: 5px;
margin-left: 0;
}
.ion-input-class{
width: calc(100% - 45px);
height: 45px;
border: 1px solid #ebebeb;
border-radius: 5px;
padding-left: 5px;
padding-right: 10px;
float: left;
}
.ion-input-class-no-height{
border: 1px solid #ebebeb;
border-radius: 5px;
overflow: auto;
}
.list-people{
width: 256px;
float: left;
}
.add-people{
width: 45px;
float: right;
overflow: auto;
font-size: 25px;
padding: 10px;
}
.list-people-title{
/* font-size: 13px; */
color: #797979;
}
.attach-document{
font-size: 15px;
color: #0d89d1;
margin: 5px 5px 5px 10px;
padding: 5px;
float: left;
}
.attach-icon{
width: 37px;
font-size: 35px;
float: left;
}
.attach-title-item{
width: 100%;
font-size: 15px;
color:#0d89d1;
}
/* SPAN */
.span-left{
float: left;
font-size: 15x;
}
.span-right{
text-align: right;
float: right;
font-size: 13px;
}
}
.container-footer{
margin:0 auto;
overflow: auto;
}
.button-cancel {
width: 170px;
height: 44px;
border-radius: 22.5px;
--background: #e0e9ee;
--color: #061b52;
margin:10px;
}
.button-save {
width: 170px;
height: 44px;
border-radius: 22.5px;
--background: #42b9fe;
--color:#ffffff;
margin:10px;
}
.text-input{
width: 100%;
border: 1px solid #ebebeb;
margin: 0px 15px 15px 0px;
padding: 0 !important;
border-radius: 5px;
}
/* Error Messages */
.error{
color:red;
font-size: 12px;
font-weight: bold;
padding-bottom: 20px;
}
.span-color{
color:red;
}
.buttons{
display: flex;
justify-content: space-between;
padding: 20px;
overflow: auto;
}
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { DelegarPage } from './delegar.page';
describe('DelegarPage', () => {
let component: DelegarPage;
let fixture: ComponentFixture<DelegarPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ DelegarPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(DelegarPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
+181
View File
@@ -0,0 +1,181 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { ModalController, NavParams } from '@ionic/angular';
import { Event } from 'src/app/models/event.model'
import { EventBody } from 'src/app/models/eventbody.model';
import { ProcessesService } from 'src/app/services/processes.service';
import { EventPerson } from 'src/app/models/eventperson.model';
import { EventsService } from 'src/app/services/events.service';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { AddParticipantsModalPage } from 'src/app/pages/gabinete-digital/expediente/add-participants-modal/add-participants-modal.page';
import { AddParticipantsCcModalPage } from 'src/app/pages/gabinete-digital/expediente/add-participants-cc-modal/add-participants-cc-modal.page';
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
@Component({
selector: 'app-delegar',
templateUrl: './delegar.page.html',
styleUrls: ['./delegar.page.scss'],
})
export class DelegarPage implements OnInit {
task: any;
taskParticipants: EventPerson[] = [];
taskParticipantsCc: EventPerson[] = [];
taskDocId:string;
loadedAttachments:any;
adding: "intervenient" | "CC" = "intervenient";
postData: Event;
eventBody: EventBody;
eventAttendees: EventPerson[];
formLocationSatus: boolean = false;
showAttendees= false;
constructor(
private modalController: ModalController,
private router:Router,
private navParams: NavParams,
private processes:ProcessesService,
private attachmentsService: AttachmentsService,
private calendarService: EventsService,
) {
this.task = this.navParams.get('task');
this.postData = new Event();
this.eventBody = { BodyType : "1", Text : ""};
this.postData.Body = this.eventBody;
/* Initialize 'Subject' with the title of the expedient */
this.postData.Subject = this.task.Folio;
this.postData.CalendarName = "Oficial";
/* this.postData.StartDate = new Date(); */
/* Set + 30minutes to seleted datetime */
let selectedEndDate = new Date();
/* this.postData.EndDate = new Date(selectedEndDate.setMinutes(new Date().getMinutes() + 30)); */
}
ngOnInit() {
this.adding = "intervenient";
console.log(this.task);
}
close(){
this.router.navigate(['/home/gabinete-digital/expediente']);
this.modalController.dismiss(null);
}
cancelTask(){
this.modalController.dismiss(null);
}
saveTask(){
// issue12323423
let Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
this.eventBody={
BodyType: '1',
Text: this.postData.Body.Text,
}
this.postData = {
EventId: '',
Subject: this.postData.Subject,
Body: this.eventBody,
Location: this.postData.Location,
CalendarId: '',
CalendarName: this.postData.CalendarName,
StartDate: this.postData.StartDate,
EndDate: this.postData.EndDate,
EventType: 'Reunião',
Attendees: Attendees,
IsMeeting: false,
IsRecurring: false,
AppointmentState: 0,
TimeZone: 'UTC',
Organizer: null,
Categories: null,
HasAttachments: true,
}
console.log(this.postData);
if(this.task.FsId == '8'){
this.calendarService.postExpedientEvent(this.task.DocId, this.postData, "md",this.task.SerialNumber, this.task.FsId);
this.distartExpedientModal();
}
else if(this.task.FsId == '361'){
this.calendarService.createTaskEvent(this.task.FolderId, this.postData, "md",this.task.SerialNumber, this.task.FsId);
}
this.close();
}
async addParticipants(){
this.adding = "intervenient";
if(window.innerWidth <= 800){
const modal = await this.modalController.create({
component: AddParticipantsModalPage,
componentProps: {
eventPersons: this.eventAttendees
},
cssClass: 'book-meeting-modal',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then((res) => {
this.taskParticipants = res.data;
let newattendees: EventPerson[] = res['data'];
if(newattendees != null){
newattendees.forEach(newattendee => {
let att = {
"EmailAddress": newattendee.EmailAddress,
"Name": newattendee.Name,
"IsRequired": true
};
if(this.eventAttendees == null){
this.eventAttendees = new Array();
}
this.eventAttendees.push(att);
});
}
this.postData.Attendees = this.eventAttendees;
});
} else {
this.showAttendees = true;
}
}
async distartExpedientModal(){
const modal = await this.modalController.create({
component: DiscartExpedientModalPage,
componentProps: {
serialNumber: this.task.SerialNumber,
},
cssClass: 'discart-expedient-modal',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
}
validateFormInputs(){
let formLocation = this.postData.Location.trim();
if(!this.postData.Location && formLocation.length <= 0){
this.formLocationSatus=true;
}
}
dynamicSetIntervenient({taskParticipants, taskParticipantsCc}){
this.taskParticipants = taskParticipants;
this.taskParticipantsCc = taskParticipantsCc;
}
}
+2
View File
@@ -6,6 +6,7 @@ export class DailyWorkTask{
DocumentURL: string;
Remetente:string;
DocumentsQty:any;
WorkflowName:string;
}
export class tasksList{
@@ -52,4 +53,5 @@ export class tasksList{
workflowInstanceFolio: string
workflowInstanceID: number
workflowName: string
}
@@ -105,11 +105,14 @@
<div *ngIf="task" class="aside-right flex-column height-100">
<div class="buttons">
<button (click)="executado()" class="btn-ok" shape="round" >Executado</button>
<button (click)="delegar()" class="btn-ok" shape="round" >Delegar</button>
<button (click)="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-ok" shape="round" >Efectuar Despacho</button>
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<div class="solid"></div>
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div>
</div>
@@ -14,6 +14,8 @@ import { momentG } from 'src/plugin/momentG'
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
import { ExpedientTaskModalPage } from '../../expediente/expedient-task-modal/expedient-task-modal.page';
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
@Component({
selector: 'app-despacho',
@@ -81,12 +83,14 @@ export class DespachoPage implements OnInit {
"Remetente": res.workflowInstanceDataFields.Sender,
"Note": res.workflowInstanceDataFields.Note,
"FolderId": res.workflowInstanceDataFields.FolderID,
"FsId": res.workflowInstanceDataFields.FsId,
"DocId": res.workflowInstanceDataFields.DocId,
"FsId": '361',
"DocId": res.workflowInstanceDataFields.DispatchDocId,
"WorkflowName": res.workflowDisplayName,
"DeadlineType": res.workflowInstanceDataFields.DeadlineType,
}
this.fulltask = res;
console.log(this.task);
console.log('GetTask', res);
let thedate = new Date(this.task.CreateDate);
@@ -139,7 +143,6 @@ export class DespachoPage implements OnInit {
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
browser.show();
});
}
@@ -162,6 +165,13 @@ export class DespachoPage implements OnInit {
}
sendExpedienteToPending(){
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
console.log(res);
this.close();
});
}
async openExpedientActionsModal(taskAction: any, task: any) {
//this.modalController.dismiss();
let classs;
@@ -171,7 +181,7 @@ export class DespachoPage implements OnInit {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: ExpedientTaskModalPage,
component: CreateProcessPage,
componentProps: {
taskAction: taskAction,
task: task,
@@ -225,7 +235,26 @@ export class DespachoPage implements OnInit {
const modal = await this.modalController.create({
component: BookMeetingModalPage,
componentProps: {
task: task,
task: this.task,
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
}
async openDelegarModal(task: any) {
let classs;
if( window.innerWidth <= 800){
classs = 'book-meeting-modal modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: DelegarPage,
componentProps: {
task: this.task,
},
cssClass: classs,
backdropDismiss: false
@@ -64,6 +64,8 @@ export class BookMeetingModalPage implements OnInit {
ngOnInit() {
this.adding = "intervenient";
console.log(this.task);
this.getAttachments();
}
@@ -111,12 +113,14 @@ export class BookMeetingModalPage implements OnInit {
}
console.log(this.postData);
this.processes.FindTaskDocId(this.task.SerialNumber).subscribe(res =>{
if(res){
this.calendarService.postExpedientEvent(res, this.postData, "md",this.task.SerialNumber, this.task.FsId);
}
});
this.distartExpedientModal();
if(this.task.FsId == '8'){
this.calendarService.postExpedientEvent(this.task.DocId, this.postData, "md",this.task.SerialNumber, this.task.FsId);
this.distartExpedientModal();
}
else if(this.task.FsId == '361'){
this.calendarService.createTaskEvent(this.task.FolderId, this.postData, "md",this.task.SerialNumber, this.task.FsId);
}
this.close();
}
@@ -139,16 +143,14 @@ export class BookMeetingModalPage implements OnInit {
modal.onDidDismiss().then((res) => {
this.taskParticipants = res.data;
let newattendees: EventPerson[] = res['data'];
if (newattendees != null)
{
if(newattendees != null){
newattendees.forEach(newattendee => {
let att = {
"EmailAddress": newattendee.EmailAddress,
"Name": newattendee.Name,
"IsRequired": true
};
if (this.eventAttendees == null)
{
if(this.eventAttendees == null){
this.eventAttendees = new Array();
}
this.eventAttendees.push(att);
@@ -157,10 +159,8 @@ export class BookMeetingModalPage implements OnInit {
this.postData.Attendees = this.eventAttendees;
});
} else {
this.showAttendees = true;
}
}
async addParticipantsCc() {
@@ -77,9 +77,9 @@ export class ExpedientTaskModalPage implements OnInit {
Nad: 30,
Subject: '',
Message: '',
SourceSecFsId: this.task.workflowInstanceDataFields.FsId,
SouceType: 'DOC',
SourceId: this.task.workflowInstanceDataFields.DocId,
SourceSecFsId: this.task.workflowInstanceDataFields.FsId, //361
SouceType: 'DOC', //FOLDER
SourceId: this.task.workflowInstanceDataFields.DocId, //FolderId
DeadlineType: '',
};
@@ -36,7 +36,7 @@
<ion-icon name="arrow-redo" slot="start"></ion-icon>
<ion-label>Pedido de Deferimento</ion-label>
</ion-item>
<ion-item (click)="openBookMeetingModal(task)">
<ion-item (click)="openBookMeetingModal(fulltask)">
<ion-icon name="calendar" slot="start"></ion-icon>
<ion-label>Marcar reunião</ion-label>
</ion-item>
@@ -14,7 +14,6 @@ import { BookMeetingModalPage } from '../book-meeting-modal/book-meeting-modal.p
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 { ProcessTask } from 'src/app/models/task';
@Component({
selector: 'app-expediente-detail',
@@ -93,7 +92,7 @@ export class ExpedienteDetailPage implements OnInit {
"DocId": res.workflowInstanceDataFields.DocId,
}
console.log('task', this.fulltask);
console.log('task', this.task);
this.fulltask = res;
console.log('GetTask', res);
@@ -211,7 +210,7 @@ export class ExpedienteDetailPage implements OnInit {
const modal = await this.modalController.create({
component: BookMeetingModalPage,
componentProps: {
task: task,
task: this.task,
},
cssClass: classs,
backdropDismiss: false
@@ -53,6 +53,7 @@ export class ExpedientePage implements OnInit {
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"WorkflowName": element.workflowDisplayName,
}
this.taskslist.push(task);
});
@@ -23,6 +23,10 @@ const routes: Routes = [
{
path: 'despachos',
loadChildren: () => import('./despachos/despachos.module').then( m => m.DespachosPageModule)
},
{
path: 'pedidos',
loadChildren: () => import('./pedidos/pedidos.module').then( m => m.PedidosPageModule)
},
@@ -14,6 +14,7 @@ import { EmptyContainerPage } from 'src/app/shared/empty-container/empty-contain
import { EventsToApprovePage } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page';
import { ExpedientePage } from 'src/app/shared/gabinete-digital/expediente/expediente.page';
import { ExpedientsPage } from 'src/app/shared/gabinete-digital/expedients/expedients.page';
import { PendentesPage } from 'src/app/shared/gabinete-digital/pendentes/pendentes.page';
import { PedidosPage } from 'src/app/shared/gabinete-digital/pedidos/pedidos.page';
import { DespachosPage } from 'src/app/shared/gabinete-digital/despachos/despachos.page';
@@ -36,6 +37,7 @@ import { DespachosPage } from 'src/app/shared/gabinete-digital/despachos/despach
ExpedientsPage,
PedidosPage,
DespachosPage,
PendentesPage,
],
entryComponents: [
EmptyContainerPage,
@@ -44,6 +46,7 @@ import { DespachosPage } from 'src/app/shared/gabinete-digital/despachos/despach
ExpedientsPage,
PedidosPage,
DespachosPage,
PendentesPage,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
@@ -36,13 +36,13 @@
<p class="text-center exp-card-content">{{count_exp_dailywork}} <span class="title1">Documentos</span></p>
</div>
<div [class.active]="selectedElementF('Pending')" (click)="notImplemented()" class="exp-card d-flex flex-column justify-center" >
<div [class.active]="selectedElement == 'Pending'" (click)="openPendentesPage(); selectedElement='Pending'" class="exp-card d-flex flex-column justify-center" >
<div class="d-flex justify-center">
<ion-icon src="assets/images/icons-expediente-pendente.svg"></ion-icon>
</div>
<p class="text-center exp-card-title ">Pendentes</p>
<p class="text-center exp-card-content"><span class="number">-</span> <span class="title1">Documentos</span></p>
<p class="text-center exp-card-content"><span class="number">{{this.count_desp_pending + count_def_pending + count_par_pending}}</span> <span class="title1">Documentos</span></p>
</div>
<div [class.active]="selectedElementF('Dispatches') " class="exp-card d-flex flex-column justify-center" (click)="openDespachosPage(); selectedElement='Dispatches'">
@@ -144,6 +144,7 @@
<app-expediente (openExpedientList)="openExpedientListPage()" [profile]="profile" [serialNumber]="serialNumber" class="d-flex height-100 flex-column" *ngIf="showExpedientDetail"></app-expediente>
<app-pedidos (openExpedientDetail)="openExpedientPage($event)" [profile]="profile" [segment]="segment" class="d-flex height-100 flex-column" *ngIf="showPedidos"></app-pedidos>
<app-despachos (openExpedientDetail)="openExpedientPage($event)" [profile]="profile" class="d-flex height-100 flex-column" *ngIf="showDespachos"></app-despachos>
<app-pendentes (openExpedientDetail)="openExpedientPage($event)" [profile]="profile" class="d-flex height-100 flex-column" *ngIf="showPendentes"></app-pendentes>
</div>
@@ -19,9 +19,12 @@ export class GabineteDigitalPage implements OnInit {
public profile:string;
count_exp_dailywork=0;
count_desp_dailywork=0;
count_par_dailywork=0;
count_def_dailywork=0;
count_desp_dailywork=0;
count_desp_pending=0;
count_par_dailywork=0;
count_par_pending=0;
count_def_dailywork=0;
count_def_pending=0;
count_exp_pp : string;
count_exp_pd : string;
count_dip_apr : string;
@@ -42,6 +45,7 @@ export class GabineteDigitalPage implements OnInit {
showExpedients = true;
showPedidos = false;
showDespachos = false;
showPendentes = false;
showExpedientDetail = false;
emptyTextDescription = 'Sem opção selecionada';
@@ -118,26 +122,35 @@ export class GabineteDigitalPage implements OnInit {
this.showExpedients = false;
this.showPedidos = false;
this.showDespachos = false;
this.showPendentes = false;
this.showExpedientDetail = false;
}
LoadCounts() {
this.showLoader = true;
this.processesbackend.GetTasksList("Expediente", true).subscribe(res =>{
this.processesbackend.GetTasksList("Expediente", false).subscribe(res =>{
this.showLoader = false;
this.count_exp_dailywork = res;
this.count_exp_dailywork = Object.keys(res).length;
console.log(res);
});
this.processesbackend.GetTasksList("Despacho", true).subscribe(res =>{
this.processesbackend.GetTasksList("Despacho", false).subscribe(res =>{
this.showLoader = false;
this.count_desp_dailywork = res;
this.count_desp_dailywork = Object.keys(res).length;
let pendingList = res.filter(data => data.workflowInstanceDataFields.Status == "Pending");
this.count_desp_pending = Object.keys(pendingList).length;
});
this.processesbackend.GetTasksList("Pedido de Parecer", true).subscribe(res =>{
this.processesbackend.GetTasksList("Pedido de Parecer", false).subscribe(res =>{
this.showLoader = false;
this.count_par_dailywork = res;
this.count_par_dailywork = Object.keys(res).length;
let pendingList = res.filter(data => data.workflowInstanceDataFields.Status == "Pending");
this.count_par_pending = Object.keys(pendingList).length;
});
this.processesbackend.GetTasksList("Pedido de Deferimento", true).subscribe(res =>{
this.processesbackend.GetTasksList("Pedido de Deferimento", false).subscribe(res =>{
this.showLoader = false;
this.count_def_dailywork = res;
this.count_def_dailywork = Object.keys(res).length;
let pendingList = res.filter(data => data.workflowInstanceDataFields.Status == "Pending");
this.count_def_pending = Object.keys(pendingList).length;
});
this.processesbackend.GetToApprovedEvents('PR','true').subscribe(res=>{
this.count_ev_pr = res;
@@ -244,6 +257,16 @@ export class GabineteDigitalPage implements OnInit {
}
}
openPendentesPage(segment:string){
this.closeAllDesktopComponents();
if( window.innerWidth <= 1024){
this.openExpedientList();
}
else{
this.showPendentes = true;
}
}
async openExpedientList(){
this.closeAllDesktopComponent();
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { PedidoPage } from './pedido.page';
const routes: Routes = [
{
path: '',
component: PedidoPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class PedidoPageRoutingModule {}
@@ -0,0 +1,22 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { PedidoPageRoutingModule } from './pedido-routing.module';
import { PedidoPage } from './pedido.page';
import { SharedModule } from 'src/app/shared/shared.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
SharedModule,
PedidoPageRoutingModule
],
declarations: [PedidoPage]
})
export class PedidoPageModule {}
@@ -0,0 +1,166 @@
<ion-menu autoHide="false" side="end" content-id="main-content">
<ion-header>
<ion-toolbar translucent>
<ion-title>Menu</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-list>
<ion-item (click)="openExpedientActionsModal('0',fulltask)">
<ion-icon name="documents" slot="start"></ion-icon>
<ion-label>Efectuar Despacho</ion-label>
</ion-item>
<ion-item (click)="openExpedientActionsModal('1',fulltask)">
<ion-icon name="arrow-undo" slot="start"></ion-icon>
<ion-label>Pedido de Parecer</ion-label>
</ion-item>
<ion-item (click)="openExpedientActionsModal('2',fulltask)">
<ion-icon name="arrow-redo" slot="start"></ion-icon>
<ion-label>Pedido de Deferimento</ion-label>
</ion-item>
<ion-item (click)="openBookMeetingModal(task)">
<ion-icon name="calendar" slot="start"></ion-icon>
<ion-label>Marcar reunião</ion-label>
</ion-item>
<ion-item (click)="discartExpedient()">
<ion-icon name="trash" slot="start"></ion-icon>
<ion-label>Descartar</ion-label>
</ion-item>
<ion-item hidden disabled>
<ion-icon name="paper-plane" slot="start"></ion-icon>
<ion-label>Enviar para pendentes</ion-label>
</ion-item>
</ion-list>
</ion-content>
</ion-menu>
<div class="ion-page d-none" id="main-content">
<ion-menu-button></ion-menu-button>
</div>
<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">
<app-btn-modal-dismiss></app-btn-modal-dismiss>
<div class="middle">
<ion-label class="title">{{ task.Folio}}</ion-label>
</div>
<div class="div-icon">
<ion-menu-button autoHide="false">
<ion-icon name="ellipsis-vertical-outline"></ion-icon>
</ion-menu-button>
</div>
</div>
</div>
<div class="upper-content">
<div class="content-details">
<ion-label>
<p><span class="date">{{customDate}}</span><span class="label">{{ task.WorkflowName }}</span></p>
<p><span class="color-red">{{ task.DeadlineType }}</span></p>
</ion-label>
</div>
</div>
<div class="line"></div>
<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="task.Note">
<h5>Detalhes</h5>
<ion-item class="ion-no-margin ion-no-padding">
<p [innerHTML]="task.Note"></p>
</ion-item>
</div>
</div>
<div class="bottom-content width-100">
<ion-list>
<h5>Documentos Anexados</h5>
<ion-item *ngFor="let attachment of attachments" class="ion-no-margin ion-no-padding">
<ion-label
(click)="viewDocument(attachment.DocId)">
<p *ngIf="attachment.Assunto" class="attach-title-item">{{ attachment.Assunto }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p *ngIf="!attachment.Assunto" class="attach-title-item">{{ attachment.DocNumber }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p><span class="span-left">{{attachment.Sender}}</span><span class="span-right">{{ attachment.DocDate | date: 'dd/MM/yy' }}</span></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
<div *ngIf="task" class="aside-right flex-column height-100">
<div class="buttons" *ngIf="task.WorkflowName == 'Pedido de Deferimento'">
<button (click)="arquivar()" class="btn-cancel" shape="round" >Arquivar</button>
<button (click)="delegar()" class="btn-cancel" shape="round" >Delegar</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
<button (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div>
<div class="buttons" *ngIf="task.WorkflowName == 'Pedido de Parecer'">
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div>
</div>
<div *ngIf="!task">
<ion-list>
<ion-list-header>
<ion-label>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</ion-label>
</ion-list-header>
<ion-item>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
</p>
</ion-label>
</ion-item>
<ion-item>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
<ion-item>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
</p>
</ion-label>
</ion-item>
<ion-button color="medium" shape="round" expand="block">
<!-- <ion-icon color="medium" name="attach" slot="start"></ion-icon> -->
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</ion-button>
</ion-list>
</div>
</div>
</ion-content>
@@ -0,0 +1,236 @@
@import '~src/function.scss';
.content{
padding: 30px 20px 0 20px !important;
margin: 0;
float: left;
}
.color-red{
font-weight: 500;
color:#d30a0a !important;
}
.btn-size{
font-size: 18px !important;
}
.main-header{
font-family: Roboto;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
background-color: #fff;
overflow:auto;
color:#000;
transform: translate3d(0, 1px, 0);
.header-top{
width: 360px;
margin: 0px auto;
overflow: auto;
padding: 0 !important;
background: #fff;
.middle{
padding: 0!important;
float: left;
width: 280px;
margin: 2.5px 0 0 5px;
display: flex;
align-items: center;
}
.right{
padding: 0!important;
float: right;
font-size: 25px;
color: #0782c9;
margin: 5px 0 0 0;
}
}
.header-bottom{
width: 310px;
overflow: auto;
margin: 0 auto;
.header-bottom-icon{
width: 30px;
font-size: 25px;
float: left;
padding: 2px;
}
.header-bottom-contacts{
width: 275px;
font-size: 15px;
color: #797979;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
float: left;
padding: 5px;
margin: 1px;
}
}
.title{
font-size: 25px;
overflow: auto;
float: left;
padding-top: 4px;
padding-left: 5px;
}
.div-icon{
width: 40px;
float: right;
font-size: 35px;
overflow: auto;
padding: 1px;
}
}
ion-item-group{
margin: 15px;
}
ion-button{
display: block;
width: 80%;
margin: 20px auto;
}
.upper-content{
font-family: Roboto;
margin-left: 41px;
overflow: auto;
font-size: 18px;
.label{
border-radius: 20px;
background: #ffb703;
float: right;
padding: 5px 13.5px 5px 13.5px;
color: #fff;
}
.button-calendar-type ion-button{
height: 25px;
}
.content-details{
font-size: 17px;
.date{
color: #797979;
}
}
}
.middle-conten{
.middle-content p{
font-size: 16px;
}
}
.bottom-content{
//width: 360px;
margin: 0 auto;
.bottom-content h3{
font-size: 16px;
margin: 0 0 0 10px;
}
.attach-document{
font-size: 15px;
color: #0d89d1;
margin: 5px 5px 5px 10px;
padding: 5px;
float: left;
}
.attach-icon{
width: 37px;
font-size: 35px;
float: left;
}
.attach-title-item{
font-size: 18px;
width: 100%;
color:#0d89d1;
padding-bottom: 5px;
}
/* SPAN */
.span-left{
float: left;
font-size: 15x;
}
.span-right{
text-align: right;
float: right;
font-size: 13px;
}
}
.aside-right{
padding: 30px 20px 0 20px !important;
.arrow-right{
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
.arrow-right-icon{
width: 37px;
float: right;
font-size: 35px;
overflow: hidden;
}
}
.buttons{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.btn-ok, .btn-cancel, .btn-delete{
height: auto !important;
font-size: 16px !important;
font-weight: 600 !important;
width: 100% !important;
margin-bottom: 10px !important;
padding: 15px !important;
}
}
.solid {
display: block;
width: 90%;
border-top: 1px solid #ebebeb;
margin: 0 auto !important;
margin-bottom: 10px !important;
}
}
@media only screen and (max-width: 800px) {
.content{
width: 100% !important;
}
.aside-right{
display: none;
}
}
@media only screen and (min-width: 801px) {
.div-icon{
display: none;
}
.content{
width: 65%;
border-right: 1px solid #d8d8d8;
}
.aside-right{
width: 35%;
}
}
@media only screen and (min-width: 1024px){
.content{
width: 70%;
}
.aside-right{
width: 30%;
}
}
@media only screen and (min-width: 1140px){
.content{
width: 75%;
}
.aside-right{
width: 25%;
}
}
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { PedidoPage } from './pedido.page';
describe('PedidoPage', () => {
let component: PedidoPage;
let fixture: ComponentFixture<PedidoPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ PedidoPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(PedidoPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,307 @@
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 { DailyWorkTask } from '../../../../models/dailyworktask.model';
import { ActivatedRoute, Router } from '@angular/router';
import { formatDate } from '@angular/common';
import { Event } from '../../../../models/event.model';
import { MenuController, ModalController, NavParams } 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 { ExpedientTaskModalPage } from '../../expediente/expedient-task-modal/expedient-task-modal.page';
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
@Component({
selector: 'app-pedido',
templateUrl: './pedido.page.html',
styleUrls: ['./pedido.page.scss'],
})
export class PedidoPage implements OnInit {
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
customDate:any;
task: any;
attachments:any;
fulltask: any;
eventsList: Event[];
serialnumber: string;
profile: string;
intervenientes: any;
cc: any;
constructor(private activateRoute: ActivatedRoute,
private processes: ProcessesService,
private iab: InAppBrowser,
private attachmentsService: AttachmentsService,
private events: EventsService,
private menu: MenuController,
private router: Router,
private modalController: ModalController,
private navParams: NavParams,
private alertService: AlertService) {
this.serialnumber = this.navParams.get('serialNumber');
this.profile = this.navParams.get('profile');
}
ngOnInit() {
this.profile = "mdgpr";
console.log(this.serialnumber);
this.activateRoute.paramMap.subscribe(paramMap => {
if (!paramMap.has('SerialNumber')) {
return;
}
/* this.serialnumber = paramMap.get('SerialNumber'); */
this.LoadTaskDetail(this.serialnumber);
this.LoadRelatedEvents(this.serialnumber);
});
this.LoadTaskDetail(this.serialnumber);
this.LoadRelatedEvents(this.serialnumber);
}
close(){
this.modalController.dismiss();
}
async LoadTaskDetail(serial: string) {
this.processes.GetTask(serial).subscribe(res => {
if(res.workflowDisplayName == 'Pedido de Parecer'){
this.task = {
"SerialNumber": res.serialNumber,
"Folio": res.workflowInstanceDataFields.Subject,
"Senders": res.originator.email,
"CreateDate": momentG(new Date(res.taskStartDate),'yyyy-MM-dd HH:mm:ss'),
"DocumentURL": res.workflowInstanceDataFields.ViewerRequest,
"Remetente": res.workflowInstanceDataFields.Sender,
"Note": res.workflowInstanceDataFields.Note,
"FolderId": res.workflowInstanceDataFields.FolderID,
"FsId": '361',
"DocId": res.workflowInstanceDataFields.ParecerDocId,
"WorkflowName": res.workflowDisplayName,
"DeadlineType": res.workflowInstanceDataFields.DeadlineType,
}
}
else if(res.workflowDisplayName == 'Pedido de Deferimento'){
this.task = {
"SerialNumber": res.serialNumber,
"Folio": res.workflowInstanceDataFields.Subject,
"Senders": res.originator.email,
"CreateDate": momentG(new Date(res.taskStartDate),'yyyy-MM-dd HH:mm:ss'),
"DocumentURL": res.workflowInstanceDataFields.ViewerRequest,
"Remetente": res.workflowInstanceDataFields.Sender,
"Note": res.workflowInstanceDataFields.Note,
"FolderId": res.workflowInstanceDataFields.FolderID,
"FsId": '361',
"DocId": res.workflowInstanceDataFields.DocIdDiferimento,
"WorkflowName": res.workflowDisplayName,
"DeadlineType": res.workflowInstanceDataFields.DeadlineType,
}
}
this.fulltask = res;
console.log(this.task);
console.log('GetTask', res);
let thedate = new Date(this.task.CreateDate);
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
this.processes.GetTaskParticipants(this.task.FolderId).subscribe(users=>{
this.intervenientes = users.filter(user=>{
return user.Type == 'I';
});
this.cc = users.filter(user=>{
return user.Type == 'CC';
});
console.log(users);
});
this.getDocumentDetails(this.task.FolderId, '361');
});
}
getDocumentDetails(forlderId:string, applicationId:string){
this.processes.GetDocumentDetails(forlderId,applicationId).subscribe(res=>{
this.attachments = res.Documents;
console.log(res['Documents']);
console.log(this.attachments);
})
}
async LoadRelatedEvents(serial: string) {
if (this.eventsList == null) {
this.attachmentsService.getAttachmentsBySerial(serial).subscribe(res => {
console.log(res);
res.forEach(att => {
if (this.eventsList == null) {
this.eventsList = new Array();
}
this.events.getEvent(att.ParentId).subscribe(event => {
this.eventsList.push(event);
console.log(this.eventsList);
});
});
});
}
}
viewDocument(docId:string){
this.processes.GetDocumentUrl(docId, '361').subscribe(res=>{
console.log(res);
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
browser.show();
});
}
openMenu() {
this.menu.open();
this.modalController.dismiss();
}
arquivar(){
let body = {
"serialNumber": this.serialnumber,
"action": "Arquivo",
"dataFields": {
"ReviewerComments": '',
}
}
this.processes.PostTaskAction(body);
}
delegar(){
}
sendExpedienteToPending(){
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
console.log(res);
this.close();
});
}
async openExpedientActionsModal(taskAction: any, task: any) {
//this.modalController.dismiss();
let classs;
if( window.innerWidth <= 800){
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: ExpedientTaskModalPage,
componentProps: {
taskAction: taskAction,
task: task,
profile: this.profile,
},
cssClass: classs,
});
await modal.present();
modal.onDidDismiss().then(res=>{
console.log(res['data']);
if(res['data']=='openDiscart'){
console.log('open discart');
this.distartExpedientModal();
}
});
}
discartExpedient() {
/* let body = { "serialNumber": this.serialnumber, "action": "Passivo" }
console.log(body);
this.processes.PostTaskAction(body);
this.router.navigate(['/home/gabinete-digital/expediente']); */
}
async distartExpedientModal2(task: any){
const modal = await this.modalController.create({
component: DiscartExpedientModalPage,
componentProps: {
serialNumber: task.serialNumber,
folderId: task.workflowInstanceDataFields.FolderID,
action: 'discart',
},
cssClass: 'discart-expedient-modal',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
}
async openBookMeetingModal(task: any) {
let classs;
if( window.innerWidth <= 800){
classs = 'book-meeting-modal modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: BookMeetingModalPage,
componentProps: {
task: this.task,
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
}
async viewEventDetail(eventId: any) {
console.log(this.profile);
const modal = await this.modalController.create({
component: ViewEventPage,
componentProps: {
eventId: eventId,
profile: this.profile,
},
cssClass: 'modal modal-desktop',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then((res) => {
if (res) {
}
});
}
async distartExpedientModal(){
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();
/* console.log('2Expedient Discard closed2');
this.close();
this.openMenu(); */
}
});
}
}
@@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { PedidosPage } from './pedidos.page';
const routes: Routes = [
{
path: '',
component: PedidosPage
},
{
path: 'pedido',
loadChildren: () => import('./pedido/pedido.module').then( m => m.PedidoPageModule)
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class PedidosPageRoutingModule {}
@@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { PedidosPageRoutingModule } from './pedidos-routing.module';
import { PedidosPage } from './pedidos.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
PedidosPageRoutingModule
],
declarations: [PedidosPage]
})
export class PedidosPageModule {}
@@ -0,0 +1,9 @@
<ion-header>
<ion-toolbar>
<ion-title>pedidos</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
</ion-content>
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { PedidosPage } from './pedidos.page';
describe('PedidosPage', () => {
let component: PedidosPage;
let fixture: ComponentFixture<PedidosPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ PedidosPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(PedidosPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-pedidos',
templateUrl: './pedidos.page.html',
styleUrls: ['./pedidos.page.scss'],
})
export class PedidosPage implements OnInit {
constructor() { }
ngOnInit() {
}
}
+16
View File
@@ -199,6 +199,22 @@ export class EventsService {
params = params.set("SerialNumber", serialNumber);
params = params.set("applicationID", applicationID);
let options = {
headers: this.headers,
params: params
};
return this.http.post<any>(`${geturl}`, body, options).toPromise().then(res =>{
console.log(res);
});
}
createTaskEvent(folderId:any, body:any, sharedagenda:string, serialNumber:any, applicationID:any){
const geturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'CreateEventExpediente')+'/dispatch';
let params = new HttpParams();
params = params.set("FolderId", folderId);
params = params.set("SerialNumber", serialNumber);
params = params.set("applicationID", applicationID);
let options = {
headers: this.headers,
params: params
@@ -35,20 +35,13 @@
<ion-header class="ion-no-border">
<div class="title">
<div class="thetitle"><ion-label >Despacho</ion-label></div>
<div class="thetitle"><ion-label >Despachos</ion-label></div>
<div class="theicon">
<button class="btn-no-color" (click)="doRefresh($event)">
<ion-icon slot="end" class="title-icon" name="reload-circle"></ion-icon>
</button>
</div>
</div>
<ion-toolbar>
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
<ion-segment-button value="despachos">
Lista de despachos
</ion-segment-button>
</ion-segment>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
@@ -60,9 +53,9 @@
</ion-refresher-content>
</ion-refresher>
<div class="width-100" [ngSwitch]="segment">
<div class="width-100">
<div *ngIf="despachoList">
<ion-list *ngSwitchCase="'despachos'">
<ion-list>
<ion-item
class="expediente ion-no-padding"
*ngFor = "let task of despachoList; let i = index"
@@ -88,7 +88,7 @@ export class DespachosPage implements OnInit {
console.log(element);
let task: DailyWorkTask = {
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.workflowInstanceDataFields.Sender,
@@ -96,11 +96,13 @@ export class DespachosPage implements OnInit {
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": this.totalDocs,
"DocId": element.workflowInstanceDataFields.DocId,
"WorkflowName": element.workflowDisplayName,
}
this.despachoList.push(task);
},
(error)=>{
let task: DailyWorkTask = {
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.workflowInstanceDataFields.Sender,
@@ -108,6 +110,8 @@ export class DespachosPage implements OnInit {
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocId": element.workflowInstanceDataFields.DocId,
"WorkflowName": element.workflowDisplayName,
}
this.despachoList.push(task);
@@ -72,6 +72,7 @@ export class ExpedientsPage implements OnInit {
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"WorkflowName": element.workflowDisplayName,
}
this.taskslist.push(task);
});
@@ -92,6 +93,7 @@ export class ExpedientsPage implements OnInit {
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"WorkflowName": element.workflowDisplayName,
}
this.taskslist.push(task);
});
@@ -6,11 +6,11 @@
</ion-header>
<ion-content>
<ion-list>
<ion-item (click)="openExpedientActionsModal('0',fulltask)">
<ion-item (click)="openExpedientActionsModal('0','')">
<ion-icon name="documents" slot="start"></ion-icon>
<ion-label>Efectuar Despacho</ion-label>
</ion-item>
<ion-item (click)="openExpedientActionsModal('1',fulltask)">
<ion-item (click)="openExpedientActionsModal('1','')">
<ion-icon name="arrow-undo" slot="start"></ion-icon>
<ion-label>Pedido de Parecer</ion-label>
</ion-item>
@@ -68,8 +68,8 @@
<ion-list *ngSwitchCase="'parecer'">
<ion-item
class="expediente ion-no-padding"
*ngFor = "let task of parecerList; let i = index"
(click)="viewExpedientDetail(task.SerialNumber)"
*ngFor = "let task of parecerList"
(click)="viewPedidoDetail(task.SerialNumber)"
>
<!-- (click)="viewExpedientDetail(task.SerialNumber)" -->
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
@@ -100,6 +100,7 @@
<ion-item
class="expediente ion-no-padding"
*ngFor = "let task of deferimentoList"
(click)="viewPedidoDetail(task.SerialNumber)"
>
<!-- (click)="viewExpedientDetail(task.SerialNumber)" -->
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
@@ -112,7 +113,7 @@
<ion-label>{{task.Remetente}}</ion-label>
</div>
<div class="exp-icon">
<ion-menu-button (click)="docIndex(i)" style="width: 35px; height: 41px;" autoHide="false">
<ion-menu-button style="width: 35px; height: 41px;" autoHide="false">
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
</ion-menu-button>
</div>
@@ -9,8 +9,9 @@ import { LoadingService } from 'src/app/services/loading.service';
import { ModalController, NavParams } from '@ionic/angular';
import { ExpedienteDetailPage } from 'src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page';
import { AlertService } from 'src/app/services/alert.service';
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
import { PedidoPage } from 'src/app/pages/gabinete-digital/pedidos/pedido/pedido.page';
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
@Component({
@@ -70,6 +71,7 @@ export class PedidosPage implements OnInit {
if(this.segment == 'parecer'){
this.taskType = "Pedido de Parecer";
this.processes.GetTasksList("Pedido de Parecer", false).subscribe(result => {
this.taskslist = result;
console.log(result);
this.parecerListResult =result;
@@ -77,7 +79,7 @@ export class PedidosPage implements OnInit {
this.parecerList = new Array();
let res = result.reverse();
res.forEach(element => {
let task: DailyWorkTask = {
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.originator.email,
@@ -85,6 +87,8 @@ export class PedidosPage implements OnInit {
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
"WorkflowName": element.workflowDisplayName,
}
this.parecerList.push(task);
});
@@ -102,7 +106,7 @@ export class PedidosPage implements OnInit {
this.deferimentoList = new Array();
let res = result.reverse();
res.forEach(element => {
let task: DailyWorkTask = {
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.originator.email,
@@ -110,6 +114,8 @@ export class PedidosPage implements OnInit {
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
"WorkflowName": element.workflowDisplayName,
}
this.deferimentoList.push(task);
});
@@ -127,7 +133,7 @@ export class PedidosPage implements OnInit {
}, 2000);
}
async viewExpedientDetail(serialNumber:any) {
async viewPedidoDetail(serialNumber:any) {
console.log(this.profile);
let classs;
@@ -138,7 +144,7 @@ export class PedidosPage implements OnInit {
}
const modal = await this.modalController.create({
component: ExpedienteDetailPage,
component: PedidoPage,
componentProps:{
enterAnimation: "",
serialNumber: serialNumber,
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { PendentesPage } from './pendentes.page';
const routes: Routes = [
{
path: '',
component: PendentesPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class PendentesPageRoutingModule {}
@@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { PendentesPageRoutingModule } from './pendentes-routing.module';
import { PendentesPage } from './pendentes.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
PendentesPageRoutingModule
],
declarations: [PendentesPage]
})
export class PendentesPageModule {}
@@ -0,0 +1,81 @@
<ion-header class="ion-no-border">
<div class="title">
<div class="thetitle"><ion-label >Pendentes</ion-label></div>
<div class="theicon">
<button class="btn-no-color" (click)="doRefresh($event)">
<ion-icon slot="end" class="title-icon" name="reload-circle"></ion-icon>
</button>
</div>
</div>
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
refreshingSpinner="circles"
refreshingText="A actualizar...">
</ion-refresher-content>
</ion-refresher>
<div class="width-100">
<div *ngIf="pendentesList">
<ion-list>
<ion-item
class="expediente ion-no-padding"
*ngFor = "let task of pendentesList"
(click)="viewTaskDetails(task.SerialNumber, task.WorkflowName)"
>
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
<div class="item width-100">
<div class="exp-top-detail">
<div class="exp-date">
<ion-label>{{ task.CreateDate | date: 'dd-MM-yy' }}</ion-label>
</div>
<div class="exp-remetente">
<ion-label>{{task.Senders}}</ion-label>
</div>
<div class="exp-workflow">
<span class="label">{{task.WorkflowName}}</span>
</div>
<div class="exp-icon">
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
<label>{{task.DocumentsQty}}</label>
</div>
</div>
<div class="exp-bottom-detail">
<ion-label>{{ task.Folio }}</ion-label>
</div>
</div>
</ion-item>
</ion-list>
</div>
</div>
<div *ngIf="!pendentesList">
<ion-list>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</ion-content>
@@ -0,0 +1,191 @@
@import '~src/function.scss';
/* CONTENT */
:host{
padding: 30px 20px 0 20px !important;
margin: 0;
}
.title{
font-family: Roboto;
font-size: 25px;
color:#000;
overflow: auto;
.thetitle{
width: fit-content;
float: left;
}
.theicon{
width: fit-content;
float: right;
}
}
.item-list-small{
font-size: 11px;
overflow: hidden;
}
.ion-item-class{
padding: 0;
}
.label-text{
width: 100%;
padding: 0;
margin: 0;
}
//DIV
ion-item{
--background: none;
}
.item {
//border-radius: 15px;
//box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07);
//Sborder: solid 1px #e9e9e9;
background-color: var(--white);
margin: 0 auto;
//padding: 10px;
margin-bottom: 10px;
overflow: hidden;
}
.div-content-expediente{
width: 100%;
float: left;
border-left: 3px solid #dae3f3;
padding:5px 5px 15px 5px;
margin: 10px 0 10px 0;
background: #dae3f3;
border-radius: 20px;
}
.div-content-pendentes{
width: 100%;
float: left;
border-left: 3px solid #d9d9d9;
padding: 5px;
}
.div-content-expediente h3, .div-content-pendentes h3{
margin: 0;
padding: 0;
font-size: 14pt;
width: 100%;
}
.div-icon{
width: 10%;
font-size: 20px;
float: left;
color: #808080;
}
.div-icon ion-icon{
display: block;
margin: 0 auto;
}
.div-content-expediente p, .div-content-pendentes p{
font-size: 14pt;
color: rgb(94, 92, 92);
padding: 0;
margin: 0;
}
.span-left{
/* border: 1px solid red; */
float: left;
font-size: 12px;
padding-left: 18px;
}
.span-right{
/* border: 1px solid blue; */
text-align: right;
float: right;
font-size: 12px;
padding-right: 18px;
}
/* New CSS */
.expediente{
padding-top: 10px;
}
.exp-list-item{
//width: 368px;
overflow: auto;
/* border-bottom: 1px solid gray; */
margin: 10px auto;
}
.exp-top-detail{
width: 100%;
overflow: auto;
}
.exp-date{
width: auto;
font-family: Roboto;
font-size: 13px;
font-weight: normal;
font-stretch: normal;
font-style: normal;
line-height: normal;
letter-spacing: normal;
color: #797979;
float: left;
}
.exp-workflow{
float: left;
margin-left: 15px;
.label{
border-radius: 20px;
background: #ffb703;
font-size: 12px;
float: right;
padding: 2.5px 13.5px 2.5px 13.5px;
color: #fff;
}
}
.exp-remetente{
//width: 200px;
font-family: Roboto;
font-size: 13px;
font-weight: normal;
color: #000000;
float: left;
margin-left: 16px;
}
.exp-icon{
width: 45px;
float: right;
font-size: 13px;
}
.exp-icon ion-icon{
font-size: 25px;
color: #42b9fe;
}
.exp-bottom-detail{
float: left;
font-family: Roboto;
font-size: 16px;
font-weight: 700;
color: #0d89d1;
}
.div-top-header{
width: 400px;
margin: 6px auto;
background-color: #0782c9;
overflow: auto;
}
.div-search{
font-size: 45px;
float: left;
margin: 0 0 0 10px
}
.div-logo{
background: transparent;
width: 150px;
margin: 2.5px 0 2.5px 71px;
float: left;
}
.div-logo img{
width: 100%;
}
.div-profile{
font-size: 45px;
float: right;
margin-right: 10px;
}
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { PendentesPage } from './pendentes.page';
describe('PendentesPage', () => {
let component: PendentesPage;
let fixture: ComponentFixture<PendentesPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ PendentesPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(PendentesPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,177 @@
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { CalendarComponent } from 'ionic2-calendar';
import { DailyWorkTask } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service';
import { formatDate } from '@angular/common';
import { ModalController, NavParams } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service';
import { DespachoPage } from 'src/app/pages/gabinete-digital/despachos/despacho/despacho.page';
import { AuthService } from 'src/app/services/auth.service';
import { PedidoPage } from 'src/app/pages/gabinete-digital/pedidos/pedido/pedido.page';
@Component({
selector: 'app-pendentes',
templateUrl: './pendentes.page.html',
styleUrls: ['./pendentes.page.scss'],
})
export class PendentesPage implements OnInit {
@ViewChild(CalendarComponent) myCal: CalendarComponent;
pendentesList:DailyWorkTask[];
taskType: string;
serialNumber:string;
totalDocs:any;
@Input() profile:string;
segment:string;
@Output() openExpedientDetail:EventEmitter<any> = new EventEmitter<any>();
constructor(
private processes:ProcessesService,
private modalController: ModalController,
private alertService: AlertService,
private authService: AuthService,
) {
this.profile = 'mdgpr';
}
ngOnInit() {
//Inicializar segment
this.segment = "despachos";
this.LoadList();
this.authService.userData$.subscribe((res:any)=>{
console.log(res);
});
}
segmentChanged(ev: any) {
this.LoadList();
}
notImplemented(){
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
}
openExpedientDetailPage(data){
console.log(data);
this.openExpedientDetail.emit(data);
}
LoadList(){
this.processes.GetTasksList("Despacho", false).subscribe(despachos => {
//ParecerList
this.processes.GetTasksList("Pedido de Parecer", false).subscribe(pareceres => {
//DeferimentoList
this.processes.GetTasksList("Pedido de Deferimento", false).subscribe(deferimentos => {
this.pendentesList = new Array();
//PendentesList
let pendentes = despachos.concat(pareceres, deferimentos).reverse().filter(data => data.workflowInstanceDataFields.Status == "Pending");
pendentes.forEach(element => {
let DocId = element.workflowInstanceDataFields.FolderID;
this.processes.GetDocumentDetails(DocId, '361').subscribe(res=>{
this.totalDocs = res.DocumentsTotal;
console.log(res.DocumentsTotal);
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.workflowInstanceDataFields.Sender,
"CreateDate": formatDate(new Date(element.taskStartDate), 'yyyy-MM-dd HH:mm', 'pt'),
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": this.totalDocs,
"DocId": element.workflowInstanceDataFields.DocId,
"WorkflowName": element.workflowDisplayName,
}
this.pendentesList.push(task);
},
(error)=>{
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.workflowInstanceDataFields.Sender,
"CreateDate": formatDate(new Date(element.taskStartDate), 'yyyy-MM-dd HH:mm', 'pt'),
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocId": element.workflowInstanceDataFields.DocId,
"WorkflowName": element.workflowDisplayName,
}
this.pendentesList.push(task);
});
});
console.log(pendentes);
console.log(this.pendentesList);
});//Fim deferimento
});//Fim parecer
});//Fim despacho
}
doRefresh(event) {
this.LoadList();
setTimeout(() => {
//event.target.complete();
}, 2000);
}
async viewTaskDetails(serialNumber:string, workflowName:string) {
console.log(this.profile);
if(workflowName == 'Despacho'){
this.openDespacho(serialNumber);
}
else if(workflowName == 'Pedido de Parecer' || workflowName == 'Pedido de Deferimento'){
this.openPedido(serialNumber);
}
}
async openDespacho(serialNumber:string){
let classs;
if( window.innerWidth <= 800){
classs = 'modal'
} else {
classs = 'modal modal-desktop'
}
const modal = await this.modalController.create({
component: DespachoPage,
componentProps:{
enterAnimation: "",
serialNumber: serialNumber,
profile: this.profile,
},
cssClass: classs,
});
await modal.present();
modal.onDidDismiss().then((res)=>{
console.log('refresh list');
this.LoadList();
});
}
async openPedido(serialNumber:string){
let classs;
if( window.innerWidth <= 800){
classs = 'modal'
} else {
classs = 'modal modal-desktop'
}
const modal = await this.modalController.create({
component: PedidoPage,
componentProps:{
enterAnimation: "",
serialNumber: serialNumber,
profile: this.profile,
},
cssClass: classs,
});
await modal.present();
modal.onDidDismiss().then((res)=>{
console.log('refresh list');
this.LoadList();
});
}
}