mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
fix despacho from a task
This commit is contained in:
@@ -14,6 +14,7 @@ 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';
|
||||
|
||||
@Component({
|
||||
selector: 'app-despacho',
|
||||
@@ -81,12 +82,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 +142,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();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -178,7 +180,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,
|
||||
@@ -232,7 +234,7 @@ export class DespachoPage implements OnInit {
|
||||
const modal = await this.modalController.create({
|
||||
component: BookMeetingModalPage,
|
||||
componentProps: {
|
||||
task: task,
|
||||
task: this.task,
|
||||
},
|
||||
cssClass: classs,
|
||||
backdropDismiss: false
|
||||
|
||||
+10
-12
@@ -63,6 +63,8 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.adding = "intervenient";
|
||||
console.log(this.task);
|
||||
|
||||
|
||||
this.getAttachments();
|
||||
}
|
||||
@@ -110,12 +112,12 @@ 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();
|
||||
this.calendarService.postExpedientEvent(this.task.DocId, this.postData, "md",this.task.SerialNumber, this.task.FsId);
|
||||
|
||||
if(this.task.FsId == '8'){
|
||||
this.distartExpedientModal();
|
||||
}
|
||||
|
||||
this.close();
|
||||
}
|
||||
|
||||
@@ -138,16 +140,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);
|
||||
@@ -156,10 +156,8 @@ export class BookMeetingModalPage implements OnInit {
|
||||
this.postData.Attendees = this.eventAttendees;
|
||||
});
|
||||
} else {
|
||||
|
||||
this.showAttendees = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async addParticipantsCc() {
|
||||
|
||||
+3
-3
@@ -74,9 +74,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: '',
|
||||
|
||||
};
|
||||
|
||||
+1
-1
@@ -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>
|
||||
|
||||
+2
-2
@@ -92,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);
|
||||
@@ -210,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
|
||||
|
||||
@@ -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)
|
||||
},
|
||||
|
||||
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user