mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
dix bugs
This commit is contained in:
@@ -301,7 +301,32 @@ const routes = [
|
|||||||
{
|
{
|
||||||
path: 'not-found',
|
path: 'not-found',
|
||||||
loadChildren: () => import('./pages/not-found/not-found.module').then( m => m.NotFoundPageModule)
|
loadChildren: () => import('./pages/not-found/not-found.module').then( m => m.NotFoundPageModule)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'dk-deplomas-options',
|
||||||
|
loadChildren: () => import('./shared/popover/desktop/dk-deplomas-options/dk-deplomas-options.module').then( m => m.DkDeplomasOptionsPageModule)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'dk-despachos-options',
|
||||||
|
loadChildren: () => import('./shared/popover/desktop/dk-despachos-options/dk-despachos-options.module').then( m => m.DkDespachosOptionsPageModule)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'dk-despachos-pr-options',
|
||||||
|
loadChildren: () => import('./shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options.module').then( m => m.DkDespachosPrOptionsPageModule)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'dk-diplomas-gerar-options',
|
||||||
|
loadChildren: () => import('./shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options.module').then( m => m.DkDiplomasGerarOptionsPageModule)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'dk-opts-expediente',
|
||||||
|
loadChildren: () => import('./shared/popover/desktop/dk-opts-expediente/dk-opts-expediente.module').then( m => m.DKOptsExpedientePageModule)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'dk-request-options',
|
||||||
|
loadChildren: () => import('./shared/popover/desktop/dk-request-options/dk-request-options.module').then( m => m.DKRequestOptionsPageModule)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
path: 'chat',
|
path: 'chat',
|
||||||
component: ChatPage
|
component: ChatPage
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ import { AngularFireModule } from '@angular/fire';
|
|||||||
import { AngularFireMessagingModule } from '@angular/fire/messaging';
|
import { AngularFireMessagingModule } from '@angular/fire/messaging';
|
||||||
import { firebaseConfig } from '../firebase-config';
|
import { firebaseConfig } from '../firebase-config';
|
||||||
import { EditorModule } from '@tinymce/tinymce-angular';
|
import { EditorModule } from '@tinymce/tinymce-angular';
|
||||||
import { DeplomaOptionsPageModule } from './shared/popover/deploma-options/deploma-options.module';
|
import { DeplomaOptionsPageModule } from './shared/popover/desktop/deploma-options/deploma-options.module';
|
||||||
import { DiplomaOptionsPage } from './shared/popover/deploma-options/deploma-options.page';
|
import { DiplomaOptionsPage } from './shared/popover/desktop/deploma-options/deploma-options.page';
|
||||||
import { CreateProcessPageModule } from './modals/create-process/create-process.module';
|
import { CreateProcessPageModule } from './modals/create-process/create-process.module';
|
||||||
import { CreateProcessPage } from './modals/create-process/create-process.page';
|
import { CreateProcessPage } from './modals/create-process/create-process.page';
|
||||||
import { LoggingInterceptorService } from './services/logging-interceptor.service';
|
import { LoggingInterceptorService } from './services/logging-interceptor.service';
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'request-options',
|
path: 'request-options',
|
||||||
loadChildren: () => import('../shared/popover/request-options/request-options.module').then( m => m.RequestOptionsPageModule)
|
loadChildren: () => import('../shared/popover/desktop/request-options/request-options.module').then( m => m.RequestOptionsPageModule)
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
@@ -326,7 +326,6 @@ export class CreateProcessPage implements OnInit {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (this.loggeduser.Profile != 'PR') {
|
if (this.loggeduser.Profile != 'PR') {
|
||||||
// console.log('Despacho MD');
|
|
||||||
switch (this.taskType) {
|
switch (this.taskType) {
|
||||||
case '0': // Despacho
|
case '0': // Despacho
|
||||||
this.postData = {
|
this.postData = {
|
||||||
|
|||||||
@@ -16,22 +16,21 @@
|
|||||||
[fulltask]="fulltask"
|
[fulltask]="fulltask"
|
||||||
></app-task-details>
|
></app-task-details>
|
||||||
|
|
||||||
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
<!-- <div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
||||||
|
|
||||||
|
|
||||||
<div class="buttons px-20" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
|
<div class="buttons px-20" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
|
||||||
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc"> <div>Responder ao PR</div> </div>
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc"> <div>Responder ao PR</div> </div>
|
||||||
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Executado')" class="btn-cancel mb-0" style="margin-bottom: 0px !important;" shape="round" >Executado</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Executado')" class="btn-cancel mb-0" style="margin-bottom: 0px !important;" shape="round" >Executado</button>
|
||||||
<!-- <div class="solid"></div> -->
|
|
||||||
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc">Reencaminhar para Área Jurídica</div>
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc">Reencaminhar para Área Jurídica</div>
|
||||||
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Gerar Diploma')" class="btn-cancel" style="margin-bottom: 0px !important;" shape="round" >Gerar Diploma </button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Gerar Diploma')" class="btn-cancel" style="margin-bottom: 0px !important;" shape="round" >Gerar Diploma </button>
|
||||||
<!-- <div class="solid"></div> -->
|
|
||||||
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc">Outras opções</div>
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc">Outras opções</div>
|
||||||
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
|
||||||
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<!-- <div class="solid"></div> -->
|
|
||||||
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks]) && task.Status != 'Pending'" (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks]) && task.Status != 'Pending'" (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons px-20" *ngIf="task.activityInstanceName == 'Concluir Despacho'">
|
<div class="buttons px-20" *ngIf="task.activityInstanceName == 'Concluir Despacho'">
|
||||||
@@ -42,7 +41,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div *ngIf="!task">
|
<div *ngIf="!task">
|
||||||
<ion-list>
|
<ion-list>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
.content{
|
.content{
|
||||||
margin: 0;
|
margin: 0;
|
||||||
float: left;
|
float: left;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
ion-button{
|
ion-button{
|
||||||
@@ -52,42 +53,42 @@ ion-button{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 800px) {
|
// @media only screen and (max-width: 800px) {
|
||||||
.content{
|
// .content{
|
||||||
width: 100% !important;
|
// width: 100% !important;
|
||||||
}
|
// }
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
display: none;
|
// display: none;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
@media only screen and (min-width: 801px) {
|
// @media only screen and (min-width: 801px) {
|
||||||
.div-icon{
|
// .div-icon{
|
||||||
display: none !important;
|
// display: none !important;
|
||||||
}
|
// }
|
||||||
.content{
|
// .content{
|
||||||
width: 65%;
|
// width: 65%;
|
||||||
border-right: 1px solid #d8d8d8;
|
// border-right: 1px solid #d8d8d8;
|
||||||
}
|
// }
|
||||||
|
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
width: 35%;
|
// width: 35%;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
@media only screen and (min-width: 1024px){
|
// @media only screen and (min-width: 1024px){
|
||||||
.content{
|
// .content{
|
||||||
width: 70%;
|
// width: 70%;
|
||||||
}
|
// }
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
width: 30%;
|
// width: 30%;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
@media only screen and (min-width: 1140px){
|
// @media only screen and (min-width: 1140px){
|
||||||
.content{
|
// .content{
|
||||||
width: 75%;
|
// width: 75%;
|
||||||
}
|
// }
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
width: 25%;
|
// width: 25%;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-m
|
|||||||
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||||
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||||
import { DespachosPrOptionsPage } from 'src/app/shared/popover/despachos-pr-options/despachos-pr-options.page';
|
import { DkDespachosPrOptionsPage } from 'src/app/shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options.page';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { DespachoService } from 'src/app/Rules/despacho.service';
|
import { DespachoService } from 'src/app/Rules/despacho.service';
|
||||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||||
@@ -24,6 +24,7 @@ import { TaskService } from 'src/app/services/task.service'
|
|||||||
import { TinyMCEPage } from 'src/app/tiny-mce/tiny-mce.page';
|
import { TinyMCEPage } from 'src/app/tiny-mce/tiny-mce.page';
|
||||||
import { DocumentViewerOptionService } from "src/app/services/document-viewer-option.service";
|
import { DocumentViewerOptionService } from "src/app/services/document-viewer-option.service";
|
||||||
import { DeviceService } from "src/app/services/device.service"
|
import { DeviceService } from "src/app/services/device.service"
|
||||||
|
import { DespachosPrOptionsPage } from 'src/app/shared/popover/despachos-pr-options/despachos-pr-options.page';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-despacho-pr',
|
selector: 'app-despacho-pr',
|
||||||
@@ -594,32 +595,63 @@ export class DespachoPrPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async openOptions(taskAction?: any) {
|
async openOptions(taskAction?: any) {
|
||||||
const popover = await this.popoverController.create({
|
|
||||||
component: DespachosPrOptionsPage,
|
|
||||||
cssClass: 'exp-options',
|
|
||||||
componentProps: {
|
|
||||||
task: this.task,
|
|
||||||
fulltask: this.fulltask,
|
|
||||||
taskAction: taskAction,
|
|
||||||
showEnviarPendentes: false
|
|
||||||
},
|
|
||||||
translucent: true
|
|
||||||
});
|
|
||||||
|
|
||||||
await popover.present();
|
if (window.innerWidth > 500) {
|
||||||
|
const popover = await this.popoverController.create({
|
||||||
|
component: DkDespachosPrOptionsPage,
|
||||||
|
cssClass: 'exp-options-desktop',
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
fulltask: this.fulltask,
|
||||||
|
taskAction: taskAction,
|
||||||
|
showEnviarPendentes: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await popover.present();
|
||||||
|
|
||||||
|
popover.onDidDismiss().then((res => {
|
||||||
|
|
||||||
|
if (res['data'] == 'close') {
|
||||||
|
this.goBack()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
this.TaskService.loadDiplomas()
|
||||||
|
|
||||||
|
}), (error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
const popover = await this.popoverController.create({
|
||||||
|
component: DespachosPrOptionsPage,
|
||||||
|
cssClass: 'exp-options',
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
fulltask: this.fulltask,
|
||||||
|
taskAction: taskAction,
|
||||||
|
showEnviarPendentes: false
|
||||||
|
},
|
||||||
|
translucent: true
|
||||||
|
});
|
||||||
|
|
||||||
|
await popover.present();
|
||||||
|
|
||||||
|
popover.onDidDismiss().then((res => {
|
||||||
|
|
||||||
|
if (res['data'] == 'close') {
|
||||||
|
this.goBack()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
this.TaskService.loadDiplomas()
|
||||||
|
|
||||||
|
}), (error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
popover.onDidDismiss().then((res => {
|
|
||||||
|
|
||||||
if (res['data'] == 'close') {
|
|
||||||
this.goBack()
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
this.TaskService.loadDiplomas()
|
|
||||||
|
|
||||||
}), (error) => {
|
|
||||||
console.log(error)
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
[fulltask]="fulltask"
|
[fulltask]="fulltask"
|
||||||
></app-task-details>
|
></app-task-details>
|
||||||
|
|
||||||
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
<!-- <div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
||||||
|
|
||||||
|
|
||||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div *ngIf="!task">
|
<div *ngIf="!task">
|
||||||
<ion-list>
|
<ion-list>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
.content{
|
.content{
|
||||||
margin: 0;
|
margin: 0;
|
||||||
float: left;
|
float: left;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
ion-button{
|
ion-button{
|
||||||
@@ -52,42 +53,43 @@ ion-button{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@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 !important;
|
|
||||||
}
|
|
||||||
.content{
|
|
||||||
width: 65%;
|
|
||||||
border-right: 1px solid #d8d8d8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.aside-right{
|
// @media only screen and (max-width: 800px) {
|
||||||
width: 35%;
|
// .content{
|
||||||
}
|
// width: 100% !important;
|
||||||
}
|
// }
|
||||||
|
// .aside-right{
|
||||||
|
// display: none;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// @media only screen and (min-width: 801px) {
|
||||||
|
// .div-icon{
|
||||||
|
// display: none !important;
|
||||||
|
// }
|
||||||
|
// .content{
|
||||||
|
// width: 65%;
|
||||||
|
// border-right: 1px solid #d8d8d8;
|
||||||
|
// }
|
||||||
|
|
||||||
@media only screen and (min-width: 1024px){
|
// .aside-right{
|
||||||
.content{
|
// width: 35%;
|
||||||
width: 70%;
|
// }
|
||||||
}
|
// }
|
||||||
.aside-right{
|
|
||||||
width: 30%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (min-width: 1140px){
|
// @media only screen and (min-width: 1024px){
|
||||||
.content{
|
// .content{
|
||||||
width: 75%;
|
// width: 70%;
|
||||||
}
|
// }
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
width: 25%;
|
// width: 30%;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
// @media only screen and (min-width: 1140px){
|
||||||
|
// .content{
|
||||||
|
// width: 75%;
|
||||||
|
// }
|
||||||
|
// .aside-right{
|
||||||
|
// width: 25%;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-m
|
|||||||
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||||
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||||
import { DespachosOptionsPage } from 'src/app/shared/popover/despachos-options/despachos-options.page';
|
import { DkDespachosOptionsPage } from 'src/app/shared/popover/desktop/dk-despachos-options/dk-despachos-options.page';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { DespachoService } from 'src/app/Rules/despacho.service'
|
import { DespachoService } from 'src/app/Rules/despacho.service'
|
||||||
import { fullTask } from 'src/app/models/dailyworktask.model';
|
import { fullTask } from 'src/app/models/dailyworktask.model';
|
||||||
@@ -27,6 +27,7 @@ import { DocumentViewerOptionService } from "src/app/services/document-viewer-op
|
|||||||
|
|
||||||
import { fromEvent, merge, interval, Subscription } from 'rxjs';
|
import { fromEvent, merge, interval, Subscription } from 'rxjs';
|
||||||
import { takeUntil, filter, switchMap, take } from 'rxjs/operators';
|
import { takeUntil, filter, switchMap, take } from 'rxjs/operators';
|
||||||
|
import { DespachosOptionsPage } from 'src/app/shared/popover/despachos-options/despachos-options.page';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-despacho',
|
selector: 'app-despacho',
|
||||||
@@ -606,31 +607,57 @@ export class DespachoPage implements OnInit {
|
|||||||
|
|
||||||
async openOptions(taskAction?: any) {
|
async openOptions(taskAction?: any) {
|
||||||
|
|
||||||
const popover = await this.popoverController.create({
|
if (window.innerWidth > 500) {
|
||||||
component: DespachosOptionsPage,
|
const model = await this.popoverController.create({
|
||||||
cssClass: 'exp-options',
|
component: DkDespachosOptionsPage,
|
||||||
componentProps: {
|
cssClass: 'exp-options-desktop',
|
||||||
task: this.task,
|
componentProps: {
|
||||||
fulltask: this.fulltask,
|
task: this.task,
|
||||||
taskAction: taskAction,
|
fulltask: this.fulltask,
|
||||||
showEnviarPendentes: false
|
taskAction: taskAction,
|
||||||
},
|
showEnviarPendentes: false
|
||||||
translucent: true
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await model.present();
|
||||||
|
|
||||||
|
model.onDidDismiss().then((res) => {
|
||||||
|
// console.log('res', res.data)
|
||||||
|
if (res.data == 'back') {
|
||||||
|
this.goBack();
|
||||||
|
}
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
const popover = await this.popoverController.create({
|
||||||
|
component: DespachosOptionsPage,
|
||||||
|
cssClass: 'exp-options',
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
fulltask: this.fulltask,
|
||||||
|
taskAction: taskAction,
|
||||||
|
showEnviarPendentes: false
|
||||||
|
},
|
||||||
|
translucent: true
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
popover.onDidDismiss().then((res) => {
|
||||||
|
// console.log('res', res.data)
|
||||||
|
if (res.data == 'back') {
|
||||||
|
this.goBack();
|
||||||
|
}
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
|
||||||
|
await popover.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
popover.onDidDismiss().then((res) => {
|
|
||||||
// console.log('res', res.data)
|
|
||||||
if (res.data == 'back') {
|
|
||||||
this.goBack();
|
|
||||||
}
|
|
||||||
|
|
||||||
}, (error) => {
|
|
||||||
console.log(error)
|
|
||||||
})
|
|
||||||
|
|
||||||
await popover.present();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-5
@@ -15,20 +15,17 @@
|
|||||||
|
|
||||||
></app-task-details>
|
></app-task-details>
|
||||||
|
|
||||||
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
<!-- <div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<button *ngIf="p.userRole('PR')" (click)="AssinarDraft()" class="btn-cancel" shape="round" >Assinar</button>
|
<button *ngIf="p.userRole('PR')" (click)="AssinarDraft()" class="btn-cancel" shape="round" >Assinar</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<button class="btn-cancel" shape="round" (click)="openAddNoteModal('Arquivo')">Arquivar</button>
|
<button class="btn-cancel" shape="round" (click)="openAddNoteModal('Arquivo')">Arquivar</button>
|
||||||
<!-- <div class="solid"></div> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<!-- <button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> -->
|
|
||||||
<!-- <div class="solid"></div> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div *ngIf="!task">
|
<div *ngIf="!task">
|
||||||
<ion-list>
|
<ion-list>
|
||||||
|
|||||||
+37
-36
@@ -39,6 +39,7 @@ ion-content, .header-2{
|
|||||||
.content{
|
.content{
|
||||||
margin: 0;
|
margin: 0;
|
||||||
float: left;
|
float: left;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
.color-red{
|
.color-red{
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@@ -230,42 +231,42 @@ ion-button{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 800px) {
|
// @media only screen and (max-width: 800px) {
|
||||||
.content{
|
// .content{
|
||||||
width: 100% !important;
|
// width: 100% !important;
|
||||||
}
|
// }
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
display: none;
|
// display: none;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
@media only screen and (min-width: 801px) {
|
// @media only screen and (min-width: 801px) {
|
||||||
.div-icon{
|
// .div-icon{
|
||||||
display: none !important;
|
// display: none !important;
|
||||||
}
|
// }
|
||||||
.content{
|
// .content{
|
||||||
width: 65%;
|
// width: 65%;
|
||||||
border-right: 1px solid #d8d8d8;
|
// border-right: 1px solid #d8d8d8;
|
||||||
}
|
// }
|
||||||
|
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
width: 35%;
|
// width: 35%;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
@media only screen and (min-width: 1024px){
|
// @media only screen and (min-width: 1024px){
|
||||||
.content{
|
// .content{
|
||||||
width: 70%;
|
// width: 70%;
|
||||||
}
|
// }
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
width: 30%;
|
// width: 30%;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
@media only screen and (min-width: 1140px){
|
// @media only screen and (min-width: 1140px){
|
||||||
.content{
|
// .content{
|
||||||
width: 75%;
|
// width: 75%;
|
||||||
}
|
// }
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
width: 25%;
|
// width: 25%;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|||||||
+45
-20
@@ -4,7 +4,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
|||||||
import { momentG } from 'src/plugin/momentG';
|
import { momentG } from 'src/plugin/momentG';
|
||||||
|
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { DiplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deploma-options.page';
|
import { DkDiplomasGerarOptionsPage } from 'src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options.page';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
@@ -19,6 +19,7 @@ import { TaskService } from 'src/app/services/task.service'
|
|||||||
import { TinyMCEPage } from 'src/app/tiny-mce/tiny-mce.page';
|
import { TinyMCEPage } from 'src/app/tiny-mce/tiny-mce.page';
|
||||||
import { PopupQuestionPage } from 'src/app/modals/popup-question/popup-question.page';
|
import { PopupQuestionPage } from 'src/app/modals/popup-question/popup-question.page';
|
||||||
import { PermissionService } from 'src/app/services/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
import { DiplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deploma-options.page';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-diploma-assinar',
|
selector: 'app-diploma-assinar',
|
||||||
@@ -84,26 +85,50 @@ export class DiplomaAssinarPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async openOptions(taskAction?: any) {
|
async openOptions(taskAction?: any) {
|
||||||
const popover = await this.popoverController.create({
|
|
||||||
component: DiplomaOptionsPage,
|
if (window.innerWidth > 500) {
|
||||||
cssClass: 'exp-options',
|
const modalController = await this.popoverController.create({
|
||||||
componentProps: {
|
component: DkDiplomasGerarOptionsPage,
|
||||||
serialNumber: this.task.SerialNumber,
|
cssClass: 'exp-options-desktop',
|
||||||
task: this.task,
|
componentProps: {
|
||||||
showEnviarPendentes: false,
|
serialNumber: this.task.SerialNumber,
|
||||||
fulltask: this.fulltask,
|
task: this.task,
|
||||||
DraftNames: this.DraftNames,
|
showEnviarPendentes: false,
|
||||||
DraftIds: this.DraftIds,
|
fulltask: this.fulltask,
|
||||||
asDraft: this.asDraft
|
DraftNames: this.DraftNames,
|
||||||
|
DraftIds: this.DraftIds,
|
||||||
|
asDraft: this.asDraft
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return await modalController.present().then(() => {
|
||||||
|
this.TaskService.loadDiplomas()
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
const popover = await this.popoverController.create({
|
||||||
|
component: DiplomaOptionsPage,
|
||||||
|
cssClass: 'exp-options',
|
||||||
|
componentProps: {
|
||||||
|
serialNumber: this.task.SerialNumber,
|
||||||
|
task: this.task,
|
||||||
|
showEnviarPendentes: false,
|
||||||
|
fulltask: this.fulltask,
|
||||||
|
DraftNames: this.DraftNames,
|
||||||
|
DraftIds: this.DraftIds,
|
||||||
|
asDraft: this.asDraft
|
||||||
|
|
||||||
|
},
|
||||||
|
translucent: true
|
||||||
|
});
|
||||||
|
return await popover.present().then(() => {
|
||||||
|
this.TaskService.loadDiplomas()
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
},
|
|
||||||
translucent: true
|
|
||||||
});
|
|
||||||
return await popover.present().then(() => {
|
|
||||||
this.TaskService.loadDiplomas()
|
|
||||||
}, (error) => {
|
|
||||||
console.log(error)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async LoadTaskDetail(serial: string) {
|
async LoadTaskDetail(serial: string) {
|
||||||
|
|||||||
+48
-25
@@ -12,9 +12,10 @@ import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-m
|
|||||||
import { DespachoService } from 'src/app/Rules/despacho.service'
|
import { DespachoService } from 'src/app/Rules/despacho.service'
|
||||||
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||||
import { DiplomasGerarOptionsPage } from 'src/app/shared/popover/diplomas-gerar-options/diplomas-gerar-options.page';
|
import { DkDiplomasGerarOptionsPage } from 'src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options.page';
|
||||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'
|
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'
|
||||||
import { TaskService } from 'src/app/services/task.service'
|
import { TaskService } from 'src/app/services/task.service'
|
||||||
|
import { DiplomasGerarOptionsPage } from 'src/app/shared/popover/diplomas-gerar-options/diplomas-gerar-options.page';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -70,21 +71,43 @@ export class DiplomasGerarPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async openOptions(taskAction?: any) {
|
async openOptions(taskAction?: any) {
|
||||||
const popover = await this.popoverController.create({
|
|
||||||
component: DiplomasGerarOptionsPage,
|
|
||||||
cssClass: 'exp-options',
|
if (window.innerWidth > 500) {
|
||||||
componentProps: {
|
const modal = await this.popoverController.create({
|
||||||
serialNumber: this.task.SerialNumber,
|
component: DkDiplomasGerarOptionsPage,
|
||||||
task: this.task,
|
cssClass: 'exp-options-desktop',
|
||||||
showEnviarPendentes: false
|
componentProps: {
|
||||||
},
|
serialNumber: this.task.SerialNumber,
|
||||||
translucent: true
|
task: this.task,
|
||||||
});
|
showEnviarPendentes: false
|
||||||
return await popover.present().then(() => {
|
}
|
||||||
this.TaskService.loadDiplomas()
|
});
|
||||||
}, (error) => {
|
return await modal.present().then(() => {
|
||||||
console.log(error)
|
this.TaskService.loadDiplomas()
|
||||||
})
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
const popover = await this.popoverController.create({
|
||||||
|
component: DiplomasGerarOptionsPage,
|
||||||
|
cssClass: 'exp-options',
|
||||||
|
componentProps: {
|
||||||
|
serialNumber: this.task.SerialNumber,
|
||||||
|
task: this.task,
|
||||||
|
showEnviarPendentes: false
|
||||||
|
},
|
||||||
|
translucent: true
|
||||||
|
});
|
||||||
|
return await popover.present().then(() => {
|
||||||
|
this.TaskService.loadDiplomas()
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async LoadTaskDetail(serial: string) {
|
async LoadTaskDetail(serial: string) {
|
||||||
@@ -122,7 +145,7 @@ export class DiplomasGerarPage implements OnInit {
|
|||||||
this.cc = users.filter(user=>{
|
this.cc = users.filter(user=>{
|
||||||
return user.Type == 'CC';
|
return user.Type == 'CC';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
this.getDocumentDetails(this.task.FolderId, '361');
|
this.getDocumentDetails(this.task.FolderId, '361');
|
||||||
@@ -143,7 +166,7 @@ export class DiplomasGerarPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async openDelegarModal() {
|
async openDelegarModal() {
|
||||||
let classs;
|
let classs;
|
||||||
if (window.innerWidth <= 800) {
|
if (window.innerWidth <= 800) {
|
||||||
@@ -222,7 +245,7 @@ export class DiplomasGerarPage implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
async enviarDiploma({note = '', documents = [], serialnumber}) {
|
async enviarDiploma({note = '', documents = [], serialnumber}) {
|
||||||
|
|
||||||
let classs;
|
let classs;
|
||||||
if (window.innerWidth <= 800) {
|
if (window.innerWidth <= 800) {
|
||||||
classs = 'modal modal-desktop'
|
classs = 'modal modal-desktop'
|
||||||
@@ -267,9 +290,9 @@ export class DiplomasGerarPage implements OnInit {
|
|||||||
},
|
},
|
||||||
"AttachmentList" : docs,
|
"AttachmentList" : docs,
|
||||||
}
|
}
|
||||||
|
|
||||||
const loader = this.toastService.loading()
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.processes.CompleteTask(body).toPromise();
|
await this.processes.CompleteTask(body).toPromise();
|
||||||
this.modalController.dismiss('sucess');
|
this.modalController.dismiss('sucess');
|
||||||
@@ -290,7 +313,7 @@ export class DiplomasGerarPage implements OnInit {
|
|||||||
await modal.present();
|
await modal.present();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async viewDocument(DocId:string, Document) {
|
async viewDocument(DocId:string, Document) {
|
||||||
|
|
||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
@@ -317,8 +340,8 @@ export class DiplomasGerarPage implements OnInit {
|
|||||||
getDocumentDetails(forlderId:string, applicationId:string) {
|
getDocumentDetails(forlderId:string, applicationId:string) {
|
||||||
this.processes.GetDocumentDetails(forlderId,applicationId).subscribe(res=>{
|
this.processes.GetDocumentDetails(forlderId,applicationId).subscribe(res=>{
|
||||||
this.attachments = res.Documents;
|
this.attachments = res.Documents;
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -349,7 +372,7 @@ export class DiplomasGerarPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
toDateString(e) {
|
toDateString(e) {
|
||||||
return new Date(e).toDateString()
|
return new Date(e).toDateString()
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { DiplomaPageRoutingModule } from './diploma-routing.module';
|
|||||||
|
|
||||||
import { DiplomaPage } from './diploma.page';
|
import { DiplomaPage } from './diploma.page';
|
||||||
import { BtnModalDismissPageModule } from 'src/app/shared/btn-modal-dismiss/btn-modal-dismiss.module';
|
import { BtnModalDismissPageModule } from 'src/app/shared/btn-modal-dismiss/btn-modal-dismiss.module';
|
||||||
import { DiplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deploma-options.page';
|
import { DiplomaOptionsPage } from 'src/app/shared/popover/desktop/deploma-options/deploma-options.page';
|
||||||
import { TaskDetailsPageModule } from 'src/app/shared/gabinete-digital/generic/task-details/task-details.module';
|
import { TaskDetailsPageModule } from 'src/app/shared/gabinete-digital/generic/task-details/task-details.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
[fulltask]="fulltask"
|
[fulltask]="fulltask"
|
||||||
></app-task-details>
|
></app-task-details>
|
||||||
|
|
||||||
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
<!-- <div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
||||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Revisar Diploma'">
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Revisar Diploma'">
|
||||||
<button (click)="openAddNoteModal('Solicitar assinatura')" class="btn-cancel" shape="round" >Solicitar assinatura do Presidente</button>
|
<button (click)="openAddNoteModal('Solicitar assinatura')" class="btn-cancel" shape="round" >Solicitar assinatura do Presidente</button>
|
||||||
<button (click)="openAddNoteModal('Solicitar alteração')" class="btn-cancel" shape="round" >Solicitar alteração</button>
|
<button (click)="openAddNoteModal('Solicitar alteração')" class="btn-cancel" shape="round" >Solicitar alteração</button>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efectuar Despacho</button>
|
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efectuar Despacho</button>
|
||||||
<button (click)="openAddNoteModal('Arquivo')" class="btn-cancel" shape="round" >Arquivar</button>
|
<button (click)="openAddNoteModal('Arquivo')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div *ngIf="!task">
|
<div *ngIf="!task">
|
||||||
<ion-list>
|
<ion-list>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
.content{
|
.content{
|
||||||
margin: 0;
|
margin: 0;
|
||||||
float: left;
|
float: left;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -53,42 +54,42 @@ ion-button{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 800px) {
|
// @media only screen and (max-width: 800px) {
|
||||||
.content{
|
// .content{
|
||||||
width: 100% !important;
|
// width: 100% !important;
|
||||||
}
|
// }
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
display: none;
|
// display: none;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
@media only screen and (min-width: 801px) {
|
// @media only screen and (min-width: 801px) {
|
||||||
.div-icon{
|
// .div-icon{
|
||||||
display: none !important;
|
// display: none !important;
|
||||||
}
|
// }
|
||||||
.content{
|
// .content{
|
||||||
width: 65%;
|
// width: 65%;
|
||||||
border-right: 1px solid #d8d8d8;
|
// border-right: 1px solid #d8d8d8;
|
||||||
}
|
// }
|
||||||
|
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
width: 35%;
|
// width: 35%;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
@media only screen and (min-width: 1024px){
|
// @media only screen and (min-width: 1024px){
|
||||||
.content{
|
// .content{
|
||||||
width: 70%;
|
// width: 70%;
|
||||||
}
|
// }
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
width: 30%;
|
// width: 30%;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
@media only screen and (min-width: 1140px){
|
// @media only screen and (min-width: 1140px){
|
||||||
.content{
|
// .content{
|
||||||
width: 75%;
|
// width: 75%;
|
||||||
}
|
// }
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
width: 25%;
|
// width: 25%;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { momentG } from 'src/plugin/momentG';
|
|||||||
|
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
|
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
|
||||||
import { DiplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deploma-options.page';
|
import { DkDeplomasOptionsPage } from 'src/app/shared/popover/desktop/dk-deplomas-options/dk-deplomas-options.page';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||||
|
|
||||||
@@ -21,6 +21,8 @@ import { CreateProcessPage } from 'src/app/modals/create-process/create-process.
|
|||||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||||
import { TaskService } from 'src/app/services/task.service'
|
import { TaskService } from 'src/app/services/task.service'
|
||||||
import { TinyMCEPage } from 'src/app/tiny-mce/tiny-mce.page';
|
import { TinyMCEPage } from 'src/app/tiny-mce/tiny-mce.page';
|
||||||
|
import { DespachosPrOptionsPage } from 'src/app/shared/popover/despachos-pr-options/despachos-pr-options.page';
|
||||||
|
import { DiplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deploma-options.page';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -95,28 +97,56 @@ export class DiplomaPage implements OnInit {
|
|||||||
|
|
||||||
async openOptions() {
|
async openOptions() {
|
||||||
|
|
||||||
const popover = await this.popoverController.create({
|
|
||||||
component: DiplomaOptionsPage,
|
if (window.innerWidth > 500) {
|
||||||
cssClass: 'exp-options',
|
|
||||||
componentProps: {
|
const model = await this.popoverController.create({
|
||||||
serialNumber: this.serialNumber,
|
component: DkDeplomasOptionsPage,
|
||||||
task: this.task,
|
cssClass: 'exp-options-desktop',
|
||||||
fulltask: this.fulltask,
|
componentProps: {
|
||||||
showEnviarPendentes: false
|
serialNumber: this.serialNumber,
|
||||||
},
|
task: this.task,
|
||||||
translucent: true
|
fulltask: this.fulltask,
|
||||||
});
|
showEnviarPendentes: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
model.onDidDismiss().then(() => {
|
||||||
|
this.TaskService.loadDiplomas()
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
}).catch((e) => {
|
||||||
|
console.log(e)
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
await model.present();
|
||||||
|
} else {
|
||||||
|
const popover = await this.popoverController.create({
|
||||||
|
component: DiplomaOptionsPage,
|
||||||
|
cssClass: 'exp-options',
|
||||||
|
componentProps: {
|
||||||
|
serialNumber: this.serialNumber,
|
||||||
|
task: this.task,
|
||||||
|
fulltask: this.fulltask,
|
||||||
|
showEnviarPendentes: false
|
||||||
|
},
|
||||||
|
translucent: true
|
||||||
|
});
|
||||||
|
|
||||||
|
popover.onDidDismiss().then(() => {
|
||||||
|
this.TaskService.loadDiplomas()
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
}).catch((e) => {
|
||||||
|
console.log(e)
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
let a = await popover.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
popover.onDidDismiss().then(() => {
|
|
||||||
this.TaskService.loadDiplomas()
|
|
||||||
}, (error) => {
|
|
||||||
console.log(error)
|
|
||||||
}).catch((e) => {
|
|
||||||
console.log(e)
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
let a = await popover.present();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async LoadTaskDetail(serial: string) {
|
async LoadTaskDetail(serial: string) {
|
||||||
|
|||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
<ion-content class="container-wrapper" >
|
<ion-content class="container-wrapper" >
|
||||||
<div *ngIf="task" class="main-content d-flex height-100 overflow-hidden">
|
<div *ngIf="task" class="main-content d-flex height-100 overflow-hidden">
|
||||||
<div class="width-100 d-flex flex-column content" *ngIf="task">
|
<div class="width-100 d-flex flex-column content" *ngIf="task">
|
||||||
<app-task-details
|
<app-task-details
|
||||||
*ngIf="task"
|
*ngIf="task"
|
||||||
[task]=task
|
[task]=task
|
||||||
[intervenientes]=intervenientes
|
[intervenientes]=intervenientes
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
></app-task-details>
|
></app-task-details>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="aside-right flex-column height-100 overflow-y-auto">
|
<!-- <div class="aside-right flex-column height-100 overflow-y-auto">
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc"> <div>Enviar para o PR</div> </div>
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc"> <div>Enviar para o PR</div> </div>
|
||||||
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Solicitar consideração superior</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Solicitar consideração superior</button>
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<button *ngIf="p.userPermission([p.permissionList.Chat.access])" (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
|
<button *ngIf="p.userPermission([p.permissionList.Chat.access])" (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
+37
-36
@@ -8,6 +8,7 @@
|
|||||||
padding: 0px 0px 0 0px !important;
|
padding: 0px 0px 0 0px !important;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
float: left;
|
float: left;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
.color-red{
|
.color-red{
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@@ -277,45 +278,45 @@ ion-button{
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@media only screen and (max-width: 800px) {
|
// @media only screen and (max-width: 800px) {
|
||||||
.content{
|
// .content{
|
||||||
width: 100% !important;
|
// width: 100% !important;
|
||||||
}
|
// }
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
display: none;
|
// display: none;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
@media only screen and (min-width: 801px) {
|
// @media only screen and (min-width: 801px) {
|
||||||
.menu-ptions{
|
// .menu-ptions{
|
||||||
display: none !important;
|
// display: none !important;
|
||||||
}
|
// }
|
||||||
.content{
|
// .content{
|
||||||
width: 65%;
|
// width: 65%;
|
||||||
border-right: 1px solid #d8d8d8;
|
// border-right: 1px solid #d8d8d8;
|
||||||
}
|
// }
|
||||||
|
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
width: 35%;
|
// width: 35%;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
@media only screen and (min-width: 1024px){
|
// @media only screen and (min-width: 1024px){
|
||||||
.content{
|
// .content{
|
||||||
width: 70%;
|
// width: 70%;
|
||||||
}
|
// }
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
width: 30%;
|
// width: 30%;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
@media only screen and (min-width: 1140px){
|
// @media only screen and (min-width: 1140px){
|
||||||
.content{
|
// .content{
|
||||||
width: 75%;
|
// width: 75%;
|
||||||
}
|
// }
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
width: 25%;
|
// width: 25%;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
.option-desc {
|
.option-desc {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
+38
-16
@@ -9,7 +9,7 @@ import { BookMeetingModalPage } from '../book-meeting-modal/book-meeting-modal.p
|
|||||||
import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
|
import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
|
||||||
import { momentG } from 'src/plugin/momentG'
|
import { momentG } from 'src/plugin/momentG'
|
||||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||||
import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page';
|
import { DKOptsExpedientePage } from 'src/app/shared/popover/desktop/dk-opts-expediente/dk-opts-expediente.page';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||||
import { SearchList } from 'src/app/models/search-document';
|
import { SearchList } from 'src/app/models/search-document';
|
||||||
@@ -31,6 +31,7 @@ import { LoginUserRespose } from 'src/app/models/user.model';
|
|||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||||
import { TaskService } from 'src/app/services/task.service';
|
import { TaskService } from 'src/app/services/task.service';
|
||||||
|
import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -591,21 +592,42 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
|
|
||||||
async openOptions(taskAction?: any) {
|
async openOptions(taskAction?: any) {
|
||||||
|
|
||||||
const popover = await this.popoverController.create({
|
|
||||||
component: OptsExpedientePage,
|
if (window.innerWidth > 500) {
|
||||||
cssClass: 'exp-options',
|
|
||||||
componentProps: {
|
const model = await this.popoverController.create({
|
||||||
task: this.task,
|
component: DKOptsExpedientePage,
|
||||||
fulltask: this.fulltask,
|
cssClass: 'exp-options-desktop',
|
||||||
taskAction: taskAction,
|
componentProps: {
|
||||||
},
|
task: this.task,
|
||||||
translucent: true
|
fulltask: this.fulltask,
|
||||||
});
|
taskAction: taskAction,
|
||||||
return await popover.present().then(() => {
|
}
|
||||||
this.TaskService.loadExpedientes()
|
});
|
||||||
}, (error) => {
|
return await model.present().then(() => {
|
||||||
console.log(error)
|
this.TaskService.loadExpedientes()
|
||||||
})
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
const popover = await this.popoverController.create({
|
||||||
|
component: OptsExpedientePage,
|
||||||
|
cssClass: 'exp-options',
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
fulltask: this.fulltask,
|
||||||
|
taskAction: taskAction,
|
||||||
|
},
|
||||||
|
translucent: true
|
||||||
|
});
|
||||||
|
return await popover.present().then(() => {
|
||||||
|
this.TaskService.loadExpedientes()
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
openNewGroupPage() {
|
openNewGroupPage() {
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
</ion-item>
|
</ion-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
<!-- <div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
||||||
<div *ngIf="task.WorkflowName == 'Pedido de Deferimento'">
|
<div *ngIf="task.WorkflowName == 'Pedido de Deferimento'">
|
||||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Deferimento'">
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Deferimento'">
|
||||||
<button (click)="openAddNoteModal('Arquivar')" class="btn-cancel" shape="round" >Arquivar</button>
|
<button (click)="openAddNoteModal('Arquivar')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||||
@@ -105,6 +105,6 @@
|
|||||||
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
|
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
padding: 0px 0px 0 0px !important;
|
padding: 0px 0px 0 0px !important;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
float: left;
|
float: left;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
.color-red{
|
.color-red{
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@@ -162,21 +163,21 @@ ion-button{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 800px) {
|
@media only screen and (max-width: 800px) {
|
||||||
.content{
|
// .content{
|
||||||
width: 100% !important;
|
// width: 100% !important;
|
||||||
}
|
// }
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
display: none;
|
// display: none;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
@media only screen and (min-width: 801px) {
|
@media only screen and (min-width: 801px) {
|
||||||
.div-icon{
|
.div-icon{
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
.content{
|
// .content{
|
||||||
width: 65%;
|
// width: 65%;
|
||||||
border-right: 1px solid #d8d8d8;
|
// border-right: 1px solid #d8d8d8;
|
||||||
}
|
// }
|
||||||
|
|
||||||
.aside-right{
|
.aside-right{
|
||||||
width: 35%;
|
width: 35%;
|
||||||
@@ -184,19 +185,19 @@ ion-button{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (min-width: 1024px){
|
@media only screen and (min-width: 1024px){
|
||||||
.content{
|
// .content{
|
||||||
width: 70%;
|
// width: 70%;
|
||||||
}
|
// }
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
width: 30%;
|
// width: 30%;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (min-width: 1140px){
|
@media only screen and (min-width: 1140px){
|
||||||
.content{
|
// .content{
|
||||||
width: 75%;
|
// width: 75%;
|
||||||
}
|
// }
|
||||||
.aside-right{
|
// .aside-right{
|
||||||
width: 25%;
|
// width: 25%;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { CreateProcessPage } from 'src/app/modals/create-process/create-process.
|
|||||||
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||||
import { DarParecerPage } from 'src/app/modals/dar-parecer/dar-parecer.page';
|
import { DarParecerPage } from 'src/app/modals/dar-parecer/dar-parecer.page';
|
||||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||||
import { RequestOptionsPage } from 'src/app/shared/popover/request-options/request-options.page';
|
import { DKRequestOptionsPage } from 'src/app/shared/popover/desktop/dk-request-options/dk-request-options.page';
|
||||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { ForwardPage } from 'src/app/modals/forward/forward.page';
|
import { ForwardPage } from 'src/app/modals/forward/forward.page';
|
||||||
@@ -27,6 +27,7 @@ import { RouteService } from 'src/app/services/route.service';
|
|||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||||
import { TaskService } from 'src/app/services/task.service'
|
import { TaskService } from 'src/app/services/task.service'
|
||||||
|
import { RequestOptionsPage } from 'src/app/shared/popover/request-options/request-options.page';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-pedido',
|
selector: 'app-pedido',
|
||||||
@@ -248,32 +249,64 @@ export class PedidoPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async openOptions(taskAction?: any) {
|
async openOptions(taskAction?: any) {
|
||||||
const popover = await this.popoverController.create({
|
|
||||||
component: RequestOptionsPage,
|
|
||||||
cssClass: 'exp-options',
|
|
||||||
componentProps: {
|
|
||||||
task: this.task,
|
|
||||||
serialNumber: this.task.SerialNumber,
|
|
||||||
fulltask: this.fulltask,
|
|
||||||
taskAction: taskAction,
|
|
||||||
showEnviarPendentes: false,
|
|
||||||
actions: this.taskArrayActions
|
|
||||||
},
|
|
||||||
translucent: true
|
|
||||||
});
|
|
||||||
await popover.present();
|
|
||||||
|
|
||||||
popover.onDidDismiss().then((res => {
|
|
||||||
this.TaskService.loadPedidos();
|
if (window.innerWidth > 500) {
|
||||||
if (res['data'] == 'close') {
|
const model = await this.popoverController.create({
|
||||||
this.goBack()
|
component: DKRequestOptionsPage,
|
||||||
}
|
cssClass: 'exp-options-desktop',
|
||||||
this.TaskService.loadPedidos();
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
serialNumber: this.task.SerialNumber,
|
||||||
|
fulltask: this.fulltask,
|
||||||
|
taskAction: taskAction,
|
||||||
|
showEnviarPendentes: false,
|
||||||
|
actions: this.taskArrayActions
|
||||||
|
}
|
||||||
|
});
|
||||||
|
await model.present();
|
||||||
|
|
||||||
|
model.onDidDismiss().then((res => {
|
||||||
|
this.TaskService.loadPedidos();
|
||||||
|
if (res['data'] == 'close') {
|
||||||
|
this.goBack()
|
||||||
|
}
|
||||||
|
this.TaskService.loadPedidos();
|
||||||
|
|
||||||
|
|
||||||
|
}), (error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
const popover = await this.popoverController.create({
|
||||||
|
component: RequestOptionsPage,
|
||||||
|
cssClass: 'exp-options',
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
serialNumber: this.task.SerialNumber,
|
||||||
|
fulltask: this.fulltask,
|
||||||
|
taskAction: taskAction,
|
||||||
|
showEnviarPendentes: false,
|
||||||
|
actions: this.taskArrayActions
|
||||||
|
},
|
||||||
|
translucent: true
|
||||||
|
});
|
||||||
|
await popover.present();
|
||||||
|
|
||||||
|
popover.onDidDismiss().then((res => {
|
||||||
|
this.TaskService.loadPedidos();
|
||||||
|
if (res['data'] == 'close') {
|
||||||
|
this.goBack()
|
||||||
|
}
|
||||||
|
this.TaskService.loadPedidos();
|
||||||
|
|
||||||
|
|
||||||
|
}), (error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}), (error) => {
|
|
||||||
console.log(error)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async repreciar(note: string, documents: any) {
|
async repreciar(note: string, documents: any) {
|
||||||
|
|||||||
@@ -1,52 +1,55 @@
|
|||||||
<div class="height-100 d-flex flex-column overflow-hidden width-100">
|
<div class="height-100 d-flex flex-column overflow-hidden width-100">
|
||||||
|
|
||||||
<div class="overflow-x-auto d-flex pa-10 attachment-list" style="background-color: #d9d9d9;" *ngIf="showAttachmentList">
|
<div class="d-flex overflow-x-auto pa-10 width-100">
|
||||||
|
<div style="background-color: #d9d9d9;" *ngIf="showAttachmentList">
|
||||||
|
|
||||||
<div *ngFor="let attachment of taskViewerAttachment; let i = index"
|
<div *ngFor="let attachment of taskViewerAttachment; let i = index"
|
||||||
class="ion-no-margin ion-no-padding cursor-pointer attachment-list" class="pa-10 mx-10 card-text"
|
class="ion-no-margin ion-no-padding cursor-pointer attachment-list" class="pa-10 mx-10 card-text"
|
||||||
>
|
>
|
||||||
<div class="attachment" (touchstart)="startHold($event, attachment, i)" (touchend)="endHold()" (click)="clickDocument(attachment, i )">
|
<div class="attachment" (touchstart)="startHold($event, attachment, i)" (touchend)="endHold()" (click)="clickDocument(attachment, i )">
|
||||||
|
|
||||||
|
<div class="attach-title-item tex-left">
|
||||||
|
{{ attachment.Assunto || "Sem assunto" }}
|
||||||
|
<br>
|
||||||
|
{{ attachment.Sender }}
|
||||||
|
<br>
|
||||||
|
<span class="document-type" *ngIf="isSelectedAttachmentIsDraft(attachment)">Rascunho</span>
|
||||||
|
<br *ngIf="isSelectedAttachmentIsDraft(attachment)">
|
||||||
|
{{ attachment.DocDate | date: 'dd/MM/yy' }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<button mat-icon-button [matMenuTriggerFor]="menu" aria-label="Example icon-button with a menu" style="
|
||||||
|
width: 0px;
|
||||||
|
height: 0px;
|
||||||
|
/* top: -40px; */
|
||||||
|
position: absolute;
|
||||||
|
"></button>
|
||||||
|
<mat-menu #menu="matMenu">
|
||||||
|
<button (click)="openExpedientActionsModal('0', attachment)" mat-menu-item>
|
||||||
|
<span>Efetuar Despacho</span>
|
||||||
|
</button>
|
||||||
|
<button (click)="openExpedientActionsModal('1', attachment)" mat-menu-item >
|
||||||
|
<span>Solicitar Parecer</span>
|
||||||
|
</button>
|
||||||
|
<button *ngIf="!p.userRole(['PR']) && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openExpedientActionsModal('1', attachment)" mat-menu-item >
|
||||||
|
<span>Pedido de Deferimento</span>
|
||||||
|
</button>
|
||||||
|
<button (click)="openBookMeetingModal(attachment)" mat-menu-item>
|
||||||
|
<span>Marcar Reunião</span>
|
||||||
|
</button>
|
||||||
|
<button *ngIf="p.userRole('PR')" mat-menu-item>
|
||||||
|
<span>Assinar</span>
|
||||||
|
</button>
|
||||||
|
</mat-menu>
|
||||||
|
|
||||||
<div class="attach-title-item tex-left">
|
|
||||||
{{ attachment.Assunto || "Sem assunto" }}
|
|
||||||
<br>
|
|
||||||
{{ attachment.Sender }}
|
|
||||||
<br>
|
|
||||||
<span class="document-type" *ngIf="isSelectedAttachmentIsDraft(attachment)">Rascunho</span>
|
|
||||||
<br *ngIf="isSelectedAttachmentIsDraft(attachment)">
|
|
||||||
{{ attachment.DocDate | date: 'dd/MM/yy' }}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<button mat-icon-button [matMenuTriggerFor]="menu" aria-label="Example icon-button with a menu" style="
|
|
||||||
width: 0px;
|
|
||||||
height: 0px;
|
|
||||||
/* top: -40px; */
|
|
||||||
position: absolute;
|
|
||||||
"></button>
|
|
||||||
<mat-menu #menu="matMenu">
|
|
||||||
<button (click)="openExpedientActionsModal('0', attachment)" mat-menu-item>
|
|
||||||
<span>Efetuar Despacho</span>
|
|
||||||
</button>
|
|
||||||
<button (click)="openExpedientActionsModal('1', attachment)" mat-menu-item >
|
|
||||||
<span>Solicitar Parecer</span>
|
|
||||||
</button>
|
|
||||||
<button *ngIf="!p.userRole(['PR']) && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openExpedientActionsModal('1', attachment)" mat-menu-item >
|
|
||||||
<span>Pedido de Deferimento</span>
|
|
||||||
</button>
|
|
||||||
<button (click)="openBookMeetingModal(attachment)" mat-menu-item>
|
|
||||||
<span>Marcar Reunião</span>
|
|
||||||
</button>
|
|
||||||
<button *ngIf="p.userRole('PR')" mat-menu-item>
|
|
||||||
<span>Assinar</span>
|
|
||||||
</button>
|
|
||||||
</mat-menu>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div [ngClass]="{'d-none': draft}" #iframeContainer class="height-100 flex-1" ></div>
|
<div [ngClass]="{'d-none': draft}" #iframeContainer class="height-100 flex-1" ></div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,10 +24,7 @@ import { RouteService } from 'src/app/services/route.service';
|
|||||||
import { FileService } from 'src/app/services/functions/file.service';
|
import { FileService } from 'src/app/services/functions/file.service';
|
||||||
import { FilePicker } from '@capawesome/capacitor-file-picker';
|
import { FilePicker } from '@capawesome/capacitor-file-picker';
|
||||||
import { CapacitorVideoPlayer } from 'capacitor-video-player';
|
import { CapacitorVideoPlayer } from 'capacitor-video-player';
|
||||||
import { CaptureError, CaptureImageOptions, MediaCapture, MediaFile } from '@awesome-cordova-plugins/media-capture/ngx';
|
import { CaptureImageOptions, MediaCapture } from '@awesome-cordova-plugins/media-capture/ngx';
|
||||||
import { Capacitor } from '@capacitor/core';
|
|
||||||
import { File } from '@ionic-native/file/ngx';
|
|
||||||
import { Media } from '@ionic-native/media/ngx';
|
|
||||||
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
||||||
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||||
import { PublicationAttachmentEntity } from 'src/app/shared/publication/upload/upload-streaming.service';
|
import { PublicationAttachmentEntity } from 'src/app/shared/publication/upload/upload-streaming.service';
|
||||||
|
|||||||
@@ -202,6 +202,7 @@
|
|||||||
[publicationType]="publicationType"
|
[publicationType]="publicationType"
|
||||||
[folderId]="folderId"
|
[folderId]="folderId"
|
||||||
[documentId]="documentId"
|
[documentId]="documentId"
|
||||||
|
[publication]="publication"
|
||||||
|
|
||||||
(closeDesktopComponent)="closeDesktopComponent($event)"
|
(closeDesktopComponent)="closeDesktopComponent($event)"
|
||||||
(goBacktoPublicationDetails)="goBacktoPublicationDetails()"
|
(goBacktoPublicationDetails)="goBacktoPublicationDetails()"
|
||||||
|
|||||||
@@ -470,6 +470,7 @@ export class PublicationsPage implements OnInit {
|
|||||||
this.idSelected = this.folderId;
|
this.idSelected = this.folderId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log({publication})
|
||||||
this.publication = publication;
|
this.publication = publication;
|
||||||
this.documentId = publication?.DocumentId
|
this.documentId = publication?.DocumentId
|
||||||
this.desktopComponent.showAddNewPublication = true;
|
this.desktopComponent.showAddNewPublication = true;
|
||||||
|
|||||||
@@ -229,16 +229,6 @@ GetIdsPublicationNext(id:any){
|
|||||||
/* params: params */
|
/* params: params */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* this.http.post<any>(`${geturl}`, body, options).subscribe(
|
|
||||||
(resposta) => {
|
|
||||||
console.log('Resposta da solicitação POST:', resposta);
|
|
||||||
},
|
|
||||||
(erro) => {
|
|
||||||
console.error('Erro na solicitação POST:', erro);
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
return this.http.post<any>(`${geturl}`, body, options)
|
return this.http.post<any>(`${geturl}`, body, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,45 +81,66 @@ class ReconnectingWebSocketSignalR {
|
|||||||
|
|
||||||
connect() {
|
connect() {
|
||||||
console.log("try to connect=================================")
|
console.log("try to connect=================================")
|
||||||
this.stop = false
|
this.stop = false;
|
||||||
|
|
||||||
|
// Limpar a conexão anterior, se existir
|
||||||
|
|
||||||
|
if (this.connection && this.connection.state !== signalR.HubConnectionState.Disconnected) {
|
||||||
|
this.connection.stop();
|
||||||
|
}
|
||||||
|
|
||||||
this.connection = new signalR.HubConnectionBuilder()
|
this.connection = new signalR.HubConnectionBuilder()
|
||||||
.withUrl("https://gdcmapi-dev.dyndns.info/FileHub", {
|
.withUrl('https://gdcmapi-dev.dyndns.info/FileHub', {
|
||||||
transport: signalR.HttpTransportType.LongPolling,
|
transport: signalR.HttpTransportType.LongPolling,
|
||||||
accessTokenFactory: () => SessionStore.user.Authorization
|
accessTokenFactory: () => SessionStore.user.Authorization
|
||||||
}).configureLogging(signalR.LogLevel.Information)
|
})
|
||||||
.build();
|
.configureLogging(signalR.LogLevel.Information)
|
||||||
|
.build();
|
||||||
|
|
||||||
this.connection.start()
|
this.connection.start()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.isOpen = true;
|
this.isOpen = true;
|
||||||
console.log('WebSocket connection established');
|
console.log('WebSocket connection established');
|
||||||
|
this.onConnect.forEach(callback => callback());
|
||||||
|
this.whenConnected.forEach(callback => callback());
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
|
||||||
this.onConnect.forEach(callback => callback());
|
console.error("Error starting SignalR connection:", error);
|
||||||
this.whenConnected.forEach(callback => callback())
|
// Adicione tratamento de erros detalhado conforme necessário
|
||||||
})
|
// Exemplo: Verificar se o erro é devido à perda de conexão com a internet
|
||||||
.catch((error) => {
|
|
||||||
console.error("Error starting SignalR connection:", error);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
if (error.message.includes("Failed to fetch")) {
|
||||||
|
console.error("Erro de conexão com a internet");
|
||||||
|
}
|
||||||
|
// Tentar reconectar após um atraso
|
||||||
|
if (!this.stop) {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.connect();
|
||||||
|
}, 1000); // Ajuste o atraso conforme necessário
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.connection.on("ReceiveMessage", (message) => {
|
this.connection.on("ReceiveMessage", (message) => {
|
||||||
const data: any = JSON.parse(message)
|
|
||||||
console.log("ReceiveMessage", data)
|
const data = JSON.parse(message);
|
||||||
|
|
||||||
|
console.log("ReceiveMessage", data);
|
||||||
|
|
||||||
this.callbacks.forEach(callback => callback(data));
|
this.callbacks.forEach(callback => callback(data));
|
||||||
})
|
|
||||||
|
});
|
||||||
|
|
||||||
this.connection.onclose((error) => {
|
this.connection.onclose((error) => {
|
||||||
console.log('WebSocket connection closed..');
|
console.log('WebSocket connection closed..');
|
||||||
this.isOpen = false;
|
this.isOpen = false;
|
||||||
this.onDisconnect.forEach(callback => callback());
|
this.onDisconnect.forEach(callback => callback());
|
||||||
// Attempt to reconnect after a delay
|
// Tentar reconectar após um atraso
|
||||||
if(this.stop == false) {
|
if (!this.stop && (!error || error.message !== "Connection stopped by client.")) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.connect();
|
this.connect();
|
||||||
}, 1000); // Adjust the delay as needed
|
}, 1000); // Ajuste o atraso conforme necessário
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -179,7 +200,6 @@ class ReconnectingWebSocketSignalR {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface socketResponse {
|
interface socketResponse {
|
||||||
|
|
||||||
index: string
|
index: string
|
||||||
Guid: string
|
Guid: string
|
||||||
IsCompleted: Boolean
|
IsCompleted: Boolean
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
<div class="overflow-y-auto height-100 width-60 visionDesktop-block" style="overflow: hidden; margin-right:20px;">
|
<div class="overflow-y-auto height-100 width-60 visionDesktop-block" style="overflow: hidden; margin-right:20px;">
|
||||||
<app-viewer-attachment *ngIf="mergedArray.length >= 1" [showAttachmentList]=false [selectedIndex]="selectedIndex" [taskViewerAttachment]="mergedArray" class="height-100" ></app-viewer-attachment>
|
<app-viewer-attachment *ngIf="mergedArray.length >= 1" [showAttachmentList]=false [selectedIndex]="selectedIndex" [taskViewerAttachment]="mergedArray" class="height-100" ></app-viewer-attachment>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class=" flex-1 d-flex flex-column height-100 d-flex overflow-y-auto-desktop" >
|
<div class=" flex-1 d-flex flex-column height-100 d-flex overflow-y-auto-desktop" >
|
||||||
<div class="upper-content" >
|
<div class="upper-content" >
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
">
|
" class="overflow-y-auto-desktop">
|
||||||
<div class="middle-content" *ngIf="dropButton">
|
<div class="middle-content" *ngIf="dropButton">
|
||||||
<h5 class="font-17-rem" *ngIf="intervenientes">Intervenientes</h5>
|
<h5 class="font-17-rem" *ngIf="intervenientes">Intervenientes</h5>
|
||||||
<ion-item class="ion-no-margin ion-no-padding">
|
<ion-item class="ion-no-margin ion-no-padding">
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
<ion-label class="d-block" >
|
<ion-label class="d-block" >
|
||||||
<div class="d-flex" >
|
<div class="d-flex" >
|
||||||
|
|
||||||
<div class="flex-1">
|
<div class="flex-1 overflow-hidden">
|
||||||
<p class="attach-title-item overflow-hidden">{{ Document.Assunto || "Sem assunto" }} <span class="document-type" *ngIf="Document.content">Rascunho</span></p>
|
<p class="attach-title-item overflow-hidden">{{ Document.Assunto || "Sem assunto" }} <span class="document-type" *ngIf="Document.content">Rascunho</span></p>
|
||||||
<p class="overflow-hidden"><span class="span-left">{{ Document.Sender}}</span><span class="span-right">{{ Document.DocDate | date: 'dd-MM-yyyy HH:mm' }}</span></p>
|
<p class="overflow-hidden"><span class="span-left">{{ Document.Sender}}</span><span class="span-right">{{ Document.DocDate | date: 'dd-MM-yyyy HH:mm' }}</span></p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -183,9 +183,6 @@ ion-button{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
@media only screen and (min-width: 801px) {
|
@media only screen and (min-width: 801px) {
|
||||||
.div-icon{
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.content{
|
.content{
|
||||||
width: 65%;
|
width: 65%;
|
||||||
border-right: 1px solid #d8d8d8;
|
border-right: 1px solid #d8d8d8;
|
||||||
@@ -261,7 +258,8 @@ ion-button{
|
|||||||
}
|
}
|
||||||
|
|
||||||
.mobile-header {
|
.mobile-header {
|
||||||
flex-grow: 1;
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content-details {
|
.content-details {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export class PendentesPage implements OnInit {
|
|||||||
private router: Router,
|
private router: Router,
|
||||||
private sortService: SortService,
|
private sortService: SortService,
|
||||||
private storage: Storage,
|
private storage: Storage,
|
||||||
public TaskService: TaskService,
|
public TaskService: TaskService,
|
||||||
public ThemeService: ThemeService) {
|
public ThemeService: ThemeService) {
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ export class PendentesPage implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
this.listSubscription.delete()
|
this.listSubscription.delete()
|
||||||
this.routerSubscription?.unsubscribe();
|
this.routerSubscription?.unsubscribe();
|
||||||
@@ -99,7 +99,7 @@ export class PendentesPage implements OnInit {
|
|||||||
async dynamicSearch() {
|
async dynamicSearch() {
|
||||||
|
|
||||||
if(this.showSearch && this.searchSubject) {
|
if(this.showSearch && this.searchSubject) {
|
||||||
|
|
||||||
const list = this.pendentesstore.list.filter((task) => {
|
const list = this.pendentesstore.list.filter((task) => {
|
||||||
let subject = task.Folio || task.Subject || task.workflowInstanceDataFields.Subject
|
let subject = task.Folio || task.Subject || task.workflowInstanceDataFields.Subject
|
||||||
subject = subject.toLowerCase();
|
subject = subject.toLowerCase();
|
||||||
@@ -146,11 +146,11 @@ export class PendentesPage implements OnInit {
|
|||||||
this.listToPresent = pendentesList
|
this.listToPresent = pendentesList
|
||||||
this.pendentesstore.reset(pendentesList);
|
this.pendentesstore.reset(pendentesList);
|
||||||
this.storage.set('pendente-list',pendentesList).then(() => {
|
this.storage.set('pendente-list',pendentesList).then(() => {
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
this.dynamicSearch()
|
this.dynamicSearch()
|
||||||
|
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
this.skeletonLoader = false;
|
this.skeletonLoader = false;
|
||||||
if(error.status == 0){
|
if(error.status == 0){
|
||||||
@@ -165,7 +165,7 @@ export class PendentesPage implements OnInit {
|
|||||||
this.listToPresent =pendentes
|
this.listToPresent =pendentes
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
doRefresh(event) {
|
doRefresh(event) {
|
||||||
if (event) {
|
if (event) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -183,13 +183,13 @@ export class PendentesPage implements OnInit {
|
|||||||
|
|
||||||
async viewTaskDetails({ SerialNumber, WorkflowName, activityInstanceName }:customTask) {
|
async viewTaskDetails({ SerialNumber, WorkflowName, activityInstanceName }:customTask) {
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
if(WorkflowName == 'Despacho') {
|
if(WorkflowName == 'Despacho') {
|
||||||
this.router.navigate(['/home/gabinete-digital/despachos',SerialNumber,'gabinete-digital']);
|
this.router.navigate(['/home/gabinete-digital/despachos',SerialNumber,'gabinete-digital']);
|
||||||
}
|
}
|
||||||
else if (WorkflowName == 'Despacho do Presidente da República') {
|
else if (WorkflowName == 'Despacho do Presidente da República') {
|
||||||
this.router.navigate(['/home/gabinete-digital/despachos', SerialNumber, 'gabinete-digital']);
|
this.router.navigate(['/home/gabinete-digital/despachos-pr', SerialNumber, 'gabinete-digital']);
|
||||||
}
|
}
|
||||||
else if(WorkflowName == 'Pedido de Parecer' || WorkflowName == 'Pedido de Deferimento' || WorkflowName == 'Pedido de Parecer do Presidente') {
|
else if(WorkflowName == 'Pedido de Parecer' || WorkflowName == 'Pedido de Deferimento' || WorkflowName == 'Pedido de Parecer do Presidente') {
|
||||||
this.router.navigate(['/home/gabinete-digital/pedidos',SerialNumber,'gabinete-digital']);
|
this.router.navigate(['/home/gabinete-digital/pedidos',SerialNumber,'gabinete-digital']);
|
||||||
@@ -207,7 +207,7 @@ export class PendentesPage implements OnInit {
|
|||||||
this.router.navigate(['/home/gabinete-digital/despachos',SerialNumber,'gabinete-digital']);
|
this.router.navigate(['/home/gabinete-digital/despachos',SerialNumber,'gabinete-digital']);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { DiplomaOptionsPage } from './deploma-options.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: DiplomaOptionsPage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class DeplomaOptionsPageRoutingModule {}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { DeplomaOptionsPageRoutingModule } from './deploma-options-routing.module';
|
||||||
|
|
||||||
|
import { DiplomaOptionsPage } from './deploma-options.page';
|
||||||
|
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||||
|
import { CreateProcessPageModule } from 'src/app/modals/create-process/create-process.module';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
DeplomaOptionsPageRoutingModule,
|
||||||
|
CreateProcessPageModule
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
DiplomaOptionsPage,
|
||||||
|
],
|
||||||
|
exports: [DiplomaOptionsPage],
|
||||||
|
entryComponents: [
|
||||||
|
DiplomaOptionsPage,
|
||||||
|
CreateProcessPage
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class DeplomaOptionsPageModule {}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<ion-content class="options-container">
|
||||||
|
|
||||||
|
<!-- <div class="buttons">
|
||||||
|
<button (click)="openAddNoteModal('Solicitar assinatura')" class="btn-cancel" shape="round" >Solicitar assinatura</button>
|
||||||
|
<button (click)="openAddNoteModal('Solicitar alteração')" class="btn-cancel" shape="round" >Solicitar alteração</button>
|
||||||
|
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<div class="buttons">
|
||||||
|
<div *ngIf="task" class="aside-right flex-column height-100 width-100">
|
||||||
|
<div class="buttons width-100" *ngIf="task.activityInstanceName == 'Revisar Diploma'">
|
||||||
|
<button (click)="openAddNoteModal('Solicitar assinatura')" class="btn-cancel" shape="round" >Solicitar assinatura do Presidente</button>
|
||||||
|
<button (click)="openAddNoteModal('Solicitar alteração')" class="btn-cancel" shape="round" >Solicitar alteração</button>
|
||||||
|
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar despacho</button>
|
||||||
|
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="solid"></div>
|
||||||
|
</div>
|
||||||
|
<div class="buttons width-100" *ngIf="task.activityInstanceName == 'Diploma Assinado'">
|
||||||
|
<button (click)="openAddNoteModal('Concluir diploma')" class="btn-cancel" shape="round" >Concluir</button>
|
||||||
|
</div>
|
||||||
|
<div class="buttons width-100" *ngIf="task.activityInstanceName == 'Assinar Diploma'">
|
||||||
|
<button *ngIf="p.userRole('PR')" (click)="AssinarNew()" class="btn-cancel" shape="round" >Assinar</button>
|
||||||
|
</div>
|
||||||
|
<div class="buttons width-100">
|
||||||
|
<button (click)="openAddNoteModal('Arquivo')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||||
|
</div>
|
||||||
|
<div class="buttons width-100" *ngIf="task.activityInstanceName != 'Assinar Diploma'">
|
||||||
|
<button (click)="openExpedientActionsModal('0',task)" class="btn-cancel" shape="round" >Efetuar despacho</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ion-content>
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
@import '~src/function.scss';
|
||||||
|
|
||||||
|
.options-container{
|
||||||
|
--padding-top:20px !important;
|
||||||
|
--padding-bottom:20px !important;
|
||||||
|
--padding-start:20px !important;
|
||||||
|
--padding-end:20px !important;
|
||||||
|
}
|
||||||
|
.arrow-right {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
.arrow-right-icon {
|
||||||
|
width: 37px;
|
||||||
|
float: right;
|
||||||
|
font-size: rem(35);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.buttons {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
.solid {
|
||||||
|
width: 90%;
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
margin: 0 auto !important;
|
||||||
|
}
|
||||||
|
.btn-ok, .btn-cancel, .btn-delete{
|
||||||
|
width: 100% !important;
|
||||||
|
margin: 5px 5px 5px 5px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 800px) {
|
||||||
|
.btn-ok, .btn-cancel, .btn-delete{
|
||||||
|
width: 100% !important;
|
||||||
|
min-width: 300px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media only screen and (min-width: 1024px) {
|
||||||
|
.arrow-right{
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
.btn-cancel{
|
||||||
|
width: 100% !important;
|
||||||
|
margin-bottom: 10px !important;
|
||||||
|
}
|
||||||
|
.btn-delete, .btn-ok{
|
||||||
|
width: 100% !important;
|
||||||
|
margin-bottom: 10px !important;
|
||||||
|
margin-top: 10px !important;
|
||||||
|
}
|
||||||
|
/* .solid{
|
||||||
|
display: block;
|
||||||
|
} */
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { DeplomaOptionsPage } from './deploma-options.page';
|
||||||
|
|
||||||
|
describe('DeplomaOptionsPage', () => {
|
||||||
|
let component: DeplomaOptionsPage;
|
||||||
|
let fixture: ComponentFixture<DeplomaOptionsPage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ DeplomaOptionsPage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(DeplomaOptionsPage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,428 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||||
|
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||||
|
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||||
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
||||||
|
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||||
|
import { AttachmentList } from 'src/app/models/Excludetask';
|
||||||
|
import { DespachoService } from 'src/app/Rules/despacho.service';
|
||||||
|
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||||
|
import { TaskService } from 'src/app/services/task.service'
|
||||||
|
import { PopupQuestionPage } from 'src/app/modals/popup-question/popup-question.page';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-deploma-options',
|
||||||
|
templateUrl: './deploma-options.page.html',
|
||||||
|
styleUrls: ['./deploma-options.page.scss'],
|
||||||
|
})
|
||||||
|
export class DiplomaOptionsPage implements OnInit {
|
||||||
|
|
||||||
|
|
||||||
|
serialNumber: string;
|
||||||
|
profile: string;
|
||||||
|
task: any
|
||||||
|
fulltask: any
|
||||||
|
DraftIds = ""
|
||||||
|
DraftNames = ""
|
||||||
|
asDraft: boolean;
|
||||||
|
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
public popoverController: PopoverController,
|
||||||
|
private modalController: ModalController,
|
||||||
|
private processes: ProcessesService,
|
||||||
|
private navParams: NavParams,
|
||||||
|
private toastService: ToastService,
|
||||||
|
private RouteService: RouteService,
|
||||||
|
public p: PermissionService,
|
||||||
|
private despachoService: DespachoService,
|
||||||
|
private httpErroHandle: HttpErrorHandle,
|
||||||
|
public TaskService: TaskService) {
|
||||||
|
this.serialNumber = this.navParams.get('serialNumber');
|
||||||
|
this.task = this.navParams.get('task');
|
||||||
|
this.fulltask = this.navParams.get('fulltask');
|
||||||
|
|
||||||
|
this.DraftIds = this.navParams.get("DraftIds");
|
||||||
|
this.DraftNames = this.navParams.get("DraftNames");
|
||||||
|
this.asDraft = this.navParams.get('asDraft');
|
||||||
|
|
||||||
|
|
||||||
|
console.log('this.task', this.task)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
console.log(this.task.activityInstanceName)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openAddNoteModal(actionName: string) {
|
||||||
|
// this.popoverController.dismiss();
|
||||||
|
let classs;
|
||||||
|
if (window.innerWidth <= 800) {
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: AddNotePage,
|
||||||
|
componentProps: {
|
||||||
|
actionName: actionName
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: true
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(async (res) => {
|
||||||
|
if (res.data) {
|
||||||
|
|
||||||
|
|
||||||
|
const DocumentToSave = res.data.documents.map((e) => {
|
||||||
|
return {
|
||||||
|
ApplicationId: e.ApplicationType,
|
||||||
|
SourceId: e.Id,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let docs = {
|
||||||
|
ProcessInstanceID: "",
|
||||||
|
Attachments: DocumentToSave,
|
||||||
|
}
|
||||||
|
|
||||||
|
if (actionName == 'Solicitar assinatura') {
|
||||||
|
await this.askSignature(res.data.note, docs);
|
||||||
|
this.goBack();
|
||||||
|
} else if (actionName == 'Solicitar alteração') {
|
||||||
|
await this.askToChange(res.data.note, docs);
|
||||||
|
this.goBack();
|
||||||
|
} else if (actionName == 'Assinar Diploma') {
|
||||||
|
await this.sign(res.data.note, docs);
|
||||||
|
this.goBack();
|
||||||
|
} else if (actionName == 'Concluir diploma') {
|
||||||
|
await this.finish(res.data.note, docs);
|
||||||
|
this.goBack();
|
||||||
|
} else if (actionName == 'Arquivo') {
|
||||||
|
await this.arquivar(res.data.note, docs);
|
||||||
|
this.goBack();
|
||||||
|
} else if (actionName == 'AssinarNew') {
|
||||||
|
await this.AssinarNew(res.data.note, docs)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async askToChange(note: string, documents: any) {
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Retificar",
|
||||||
|
"ActionTypeId": 99999841,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList": documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.close();
|
||||||
|
this.toastService._successMessage()
|
||||||
|
} catch (error) {
|
||||||
|
if (error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async openBookMeetingModal(task: any) {
|
||||||
|
this.popoverController.dismiss();
|
||||||
|
let classs;
|
||||||
|
if (window.innerWidth <= 800) {
|
||||||
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: BookMeetingModalPage,
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
fulltask: this.fulltask
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
await modal.present();
|
||||||
|
modal.onDidDismiss().then(
|
||||||
|
() => { },
|
||||||
|
(error) => {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async askSignature(note: string, documents: any) {
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Aprovar",
|
||||||
|
"ActionTypeId": 99999840,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList": documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.close();
|
||||||
|
this.toastService._successMessage()
|
||||||
|
} catch (error) {
|
||||||
|
if (error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async sign(note?: string, documents?: any) {
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Assinado",
|
||||||
|
"ActionTypeId": 99999842,
|
||||||
|
"FolderId": this.task.FolderID,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
"InstanceIDNew": this.task.InstanceID,
|
||||||
|
"DraftIds": "",
|
||||||
|
},
|
||||||
|
"AttachmentList": {
|
||||||
|
"ProcessInstanceID": this.task.InstanceID,
|
||||||
|
/* "DraftIds": null, */
|
||||||
|
"Attachments": []
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.httpErroHandle.httpsSucessMessagge('Assinado')
|
||||||
|
} catch (error) {
|
||||||
|
if (error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
} finally { }
|
||||||
|
}
|
||||||
|
|
||||||
|
async AssinarNew(note?, doc?) {
|
||||||
|
|
||||||
|
if (this.asDraft) {
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: PopupQuestionPage,
|
||||||
|
componentProps: {
|
||||||
|
title: 'Deseja assinar este Diploma?',
|
||||||
|
/* message: 'Nota: Ao Efetuar esta operação, o tratamento deste diploma não poderá ser realizado a partir da caixa de correspondência' */
|
||||||
|
|
||||||
|
},
|
||||||
|
cssClass: "popup-question discart-expedient-modal",
|
||||||
|
backdropDismiss: true
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(async (res) => {
|
||||||
|
const data = res.data
|
||||||
|
if (data == "Yes") {
|
||||||
|
|
||||||
|
console.log(' diploma options Draft draft',this.DraftIds)
|
||||||
|
let body = {
|
||||||
|
"InstanceId": this.task.InstanceID,
|
||||||
|
"FolderId": this.task.FolderID,
|
||||||
|
"DraftIds": this.task.DraftIds,
|
||||||
|
"OriginalFileName": this.DraftNames
|
||||||
|
}
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.presidentialActionsSignature(body).toPromise()
|
||||||
|
await this.sign()
|
||||||
|
this.TaskService.loadDiplomas()
|
||||||
|
this.goBack();
|
||||||
|
} catch (error) {
|
||||||
|
this.httpErroHandle.httpStatusHandle(error)
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
} else {
|
||||||
|
this.httpErroHandle.validationMessagge("diplomaAsDraft");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async finish(note: string, documents: any) {
|
||||||
|
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Concluir",
|
||||||
|
"ActionTypeId": 95,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList": documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise();
|
||||||
|
this.toastService._successMessage('Processo concluído')
|
||||||
|
} catch (error) {
|
||||||
|
if (error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async arquivar(note: string, documents: AttachmentList) {
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.despachoService.arquivar(note, documents, this.serialNumber).toPromise()
|
||||||
|
this.httpErroHandle.httpsSucessMessagge('Arquivar')
|
||||||
|
this.close();
|
||||||
|
} catch (error) {
|
||||||
|
this.httpErroHandle.httpStatusHandle(error)
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openExpedientActionsModal(taskAction: any, task: any) {
|
||||||
|
|
||||||
|
let classs;
|
||||||
|
if (window.innerWidth <= 800) {
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: CreateProcessPage,
|
||||||
|
componentProps: {
|
||||||
|
taskAction: taskAction,
|
||||||
|
task: task,
|
||||||
|
profile: this.profile,
|
||||||
|
fulltask: this.fulltask
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
});
|
||||||
|
modal.onDidDismiss().then(async (res) => {
|
||||||
|
|
||||||
|
|
||||||
|
if (res['data'] == 'openDiscart') {
|
||||||
|
await this.distartExpedientModal();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.goBack();
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
}).catch(e => {
|
||||||
|
console.log(e)
|
||||||
|
})
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async distartExpedientModal() {
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
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
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(res => {
|
||||||
|
if (res['data'] == 'close') {
|
||||||
|
this.close();
|
||||||
|
/*
|
||||||
|
this.close();
|
||||||
|
this.openMenu(); */
|
||||||
|
}
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
}).catch(e => {
|
||||||
|
console.log(e)
|
||||||
|
})
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
goBack() {
|
||||||
|
this.RouteService.goBack()
|
||||||
|
this.TaskService.loadDiplomas()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
close() {
|
||||||
|
this.popoverController.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { DespachosOptionsPage } from './despachos-options.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: DespachosOptionsPage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class DespachosOptionsPageRoutingModule {}
|
||||||
@@ -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 { DespachosOptionsPageRoutingModule } from './despachos-options-routing.module';
|
||||||
|
|
||||||
|
import { DespachosOptionsPage } from './despachos-options.page';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
DespachosOptionsPageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [DespachosOptionsPage]
|
||||||
|
})
|
||||||
|
export class DespachosOptionsPageModule {}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
<ion-content class="options-container">
|
||||||
|
<div class="arrow-right" (click)="goBack('no')">
|
||||||
|
<button class="btn-no-color">
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' "slot="end" class="arrow-right-icon" src='assets/images/icons-arrow-arrow-right.svg'></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" class="arrow-right-icon" src='assets/images/theme/gov/icons-calendar-arrow-right.svg'></ion-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="width-100 pr-options" *ngIf="task.activityInstanceName == 'Tarefa de Despacho' && task.WorkflowName == 'Despacho do Presidente da República' ">
|
||||||
|
<div *ngIf="task && !p.userRole(['PR'])" class="d-flex width-100">
|
||||||
|
<div class="flex-grow-1 width-50 pr-10">
|
||||||
|
<button class="btn-cancel desk" shape="round" > Responder ao {{ environment.PR}} </button>
|
||||||
|
<button (click)="openAddNoteModal('Executado')" class="btn-cancel width-100" shape="round" >Executado</button>
|
||||||
|
<button class="btn-cancel desk" shape="round"> Reencaminhar para Área Jurídica </button>
|
||||||
|
<button (click)="openAddNoteModal('Gerar Diploma')" class="btn-cancel width-100" shape="round" >Gerar Diploma</button>
|
||||||
|
<button class="btn-cancel desk" shape="round"> Outras opções </button>
|
||||||
|
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel width-100" shape="round" >Efetuar Despacho</button>
|
||||||
|
</div>
|
||||||
|
<div class="flex-grow-1 width-50 pl-10">
|
||||||
|
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel width-100" shape="round" >Solicitar Parecer</button>
|
||||||
|
<button *ngIf="!p.userRole(['PR']) && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openTaskProcessModal('2',fulltask)" class="btn-cancel width-100" shape="round" >Pedido de Deferimento</button>
|
||||||
|
<button (click)="openDelegarModal(task)" class="btn-cancel width-100" shape="round" >Delegar</button>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel width-100" shape="round" >Enviar para Pendentes</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="task && p.userRole(['PR'])" class="d-flex width-100">
|
||||||
|
<div class="flex-grow-1">
|
||||||
|
<button (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
|
||||||
|
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Despacho' && task.WorkflowName != 'Despacho do Presidente da República' ">
|
||||||
|
<button (click)="openAddNoteModal('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)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
|
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Reexecutar Despacho'">
|
||||||
|
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
||||||
|
<button (click)="openDelegarModal(task)" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Delegar</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
|
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
</div>
|
||||||
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Concluir Despacho'">
|
||||||
|
<button (click)="openAddNoteModal('Arquivar')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
|
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ion-content>
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
@import '~src/function.scss';
|
||||||
|
|
||||||
|
.options-container {
|
||||||
|
--padding-top:20px !important;
|
||||||
|
--padding-bottom:20px !important;
|
||||||
|
--padding-start:20px !important;
|
||||||
|
--padding-end:20px !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
.arrow-right {
|
||||||
|
display: none;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
.arrow-right-icon {
|
||||||
|
width: 37px;
|
||||||
|
float: right;
|
||||||
|
font-size: rem(35);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.buttons {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
.solid {
|
||||||
|
display: none;
|
||||||
|
width: 90%;
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
margin: 0 auto !important;
|
||||||
|
}
|
||||||
|
.btn-ok, .btn-cancel, .btn-delete{
|
||||||
|
width: 100% !important;
|
||||||
|
margin: 5px 5px 5px 5px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pr-options {
|
||||||
|
.btn-ok, .btn-cancel{
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { DespachosOptionsPage } from './despachos-options.page';
|
||||||
|
|
||||||
|
describe('DespachosOptionsPage', () => {
|
||||||
|
let component: DespachosOptionsPage;
|
||||||
|
let fixture: ComponentFixture<DespachosOptionsPage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ DespachosOptionsPage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(DespachosOptionsPage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,402 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
|
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||||
|
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||||
|
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||||
|
import { AddNotePage } from 'src/app/modals/add-note/add-note.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';
|
||||||
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { customTask, fullTask } from 'src/app/models/dailyworktask.model';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
import { TaskService } from 'src/app/services/task.service'
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-despachos-options',
|
||||||
|
templateUrl: './despachos-options.page.html',
|
||||||
|
styleUrls: ['./despachos-options.page.scss'],
|
||||||
|
})
|
||||||
|
export class DespachosOptionsPage implements OnInit {
|
||||||
|
|
||||||
|
task: customTask
|
||||||
|
fulltask: fullTask;
|
||||||
|
serialNumber: string;
|
||||||
|
environment = environment
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private processes: ProcessesService,
|
||||||
|
private modalController: ModalController,
|
||||||
|
public popoverController: PopoverController,
|
||||||
|
private navParams: NavParams,
|
||||||
|
private toastService: ToastService,
|
||||||
|
public p: PermissionService,
|
||||||
|
public ThemeService: ThemeService,
|
||||||
|
private RouteService: RouteService,
|
||||||
|
private httpErrorHandle: HttpErrorHandle,
|
||||||
|
public TaskService: TaskService
|
||||||
|
) {
|
||||||
|
|
||||||
|
this.task = this.navParams.get('task')
|
||||||
|
this.fulltask = this.navParams.get('fulltask')
|
||||||
|
|
||||||
|
|
||||||
|
this.serialNumber = this.task.SerialNumber
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async openTaskProcessModal(taskAction: any, task: any) {
|
||||||
|
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: CreateProcessPage,
|
||||||
|
componentProps: {
|
||||||
|
taskAction: taskAction,
|
||||||
|
task: task,
|
||||||
|
fulltask: this.fulltask
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then( res => {
|
||||||
|
// this.goBack();
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
sendExpedienteToPending() {
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
|
||||||
|
this.httpErrorHandle.httpsSucessMessagge('Enviar para Pendentes')
|
||||||
|
loader.remove()
|
||||||
|
|
||||||
|
this.goBack('back');
|
||||||
|
},(error)=>{
|
||||||
|
loader.remove()
|
||||||
|
this.httpErrorHandle.httpStatusHandle(error)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async distartExpedientModal() {
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
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
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(res=>{
|
||||||
|
if(res['data']=='close'){
|
||||||
|
this.goBack('back');
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async openBookMeetingModal(task: any) {
|
||||||
|
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: BookMeetingModalPage,
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
fulltask:this.fulltask
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(() => {
|
||||||
|
this.goBack('no');
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async openDelegarModal(task: any) {
|
||||||
|
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: DelegarPage,
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
modal.onDidDismiss().then(res => {
|
||||||
|
if(res){
|
||||||
|
const data = res.data;
|
||||||
|
if(data == 'close') {
|
||||||
|
this.goBack('back');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async generateDiploma(note:string, documents:any){
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Reencaminhar",
|
||||||
|
"ActionTypeId": 99999839,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.toastService._successMessage()
|
||||||
|
this.goBack('back');
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openAddNoteModal(actionName:string) {
|
||||||
|
|
||||||
|
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: AddNotePage,
|
||||||
|
componentProps: {
|
||||||
|
showAttachmentBtn: true,
|
||||||
|
actionName:actionName
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: true
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(async (res) => {
|
||||||
|
|
||||||
|
if(res.data) {
|
||||||
|
|
||||||
|
const DocumentToSave = res.data.documents.map((e) => {
|
||||||
|
return {
|
||||||
|
ApplicationId: e.ApplicationType,
|
||||||
|
SourceId: e.Id,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let docs = {
|
||||||
|
ProcessInstanceID: "",
|
||||||
|
Attachments: DocumentToSave,
|
||||||
|
}
|
||||||
|
|
||||||
|
if(actionName == 'Executado') {
|
||||||
|
await this.executado(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Arquivar') {
|
||||||
|
await this.arquivar(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Gerar Diploma') {
|
||||||
|
await this.generateDiploma(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Concluido') {
|
||||||
|
this.concluir(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Reexecução') {
|
||||||
|
await this.reexecutar(res.data.note, docs);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
async concluir(note: string, documents: any) {
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Arquivo",
|
||||||
|
"ActionTypeId": 95,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList": documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.httpErrorHandle.httpsSucessMessagge('Concluir Despacho')
|
||||||
|
this.TaskService.loadDiplomas()
|
||||||
|
} catch (error) {
|
||||||
|
this.httpErrorHandle.httpStatusHandle(error)
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async arquivar(note:string, documents:any) {
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Arquivo",
|
||||||
|
"ActionTypeId": 95,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.toastService._successMessage('Processo arquivado')
|
||||||
|
this.goBack('back');
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest('Processo não arquivado')
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async executado(note:string, documents:any) {
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Conhecimento",
|
||||||
|
"ActionTypeId": 104,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.goBack('back');
|
||||||
|
this.toastService._successMessage()
|
||||||
|
} catch(error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
async reexecutar(note:string, documents:any){
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Reexecução",
|
||||||
|
"ActionTypeId": 100000010,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.toastService._successMessage()
|
||||||
|
this.goBack('back');
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
goBack(params) {
|
||||||
|
this.popoverController.dismiss(params)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { DespachosPrOptionsPage } from './despachos-pr-options.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: DespachosPrOptionsPage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class DespachosPrOptionsPageRoutingModule {}
|
||||||
@@ -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 { DespachosPrOptionsPageRoutingModule } from './despachos-pr-options-routing.module';
|
||||||
|
|
||||||
|
import { DespachosPrOptionsPage } from './despachos-pr-options.page';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
DespachosPrOptionsPageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [DespachosPrOptionsPage]
|
||||||
|
})
|
||||||
|
export class DespachosPrOptionsPageModule {}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<ion-content class="options-container">
|
||||||
|
<div class="arrow-right" (click)="close()">
|
||||||
|
<button class="btn-no-color">
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' "slot="end" class="arrow-right-icon" src='assets/images/icons-arrow-arrow-right.svg'></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" class="arrow-right-icon" src='assets/images/theme/gov/icons-calendar-arrow-right.svg'></ion-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="width-100">
|
||||||
|
<div *ngIf="task && !p.userRole(['PR'])" class="d-flex width-100">
|
||||||
|
<div class="flex-grow-1 width-50 pr-10">
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Responder ao {{ environment.PR}} </button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Reencaminhar para Área Jurídica </button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Gerar Diploma')" class="btn-cancel" shape="round" >Gerar Diploma</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Outras opções </button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
|
</div>
|
||||||
|
<div class="flex-grow-1 width-50 pl-10">
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
|
<!-- <button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button> -->
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks]) && task.Status != 'Pending'" (click)="sendExpedienteToPending()" full class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
<button (click)="cancle()" full class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="task && p.userRole(['PR'])" class="d-flex width-100">
|
||||||
|
<div class="flex-grow-1">
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks]) && task.Status != 'Pending'" (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
<button (click)="cancle()" full class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <div class="solid"></div>
|
||||||
|
<button (click)="cancle()" full class="btn-cancel" shape="round" >Cancelar</button> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ion-content>
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
@import '~src/function.scss';
|
||||||
|
|
||||||
|
:host {
|
||||||
|
height: 100% !important;
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.options-container{
|
||||||
|
--padding-top:20px !important;
|
||||||
|
--padding-bottom:20px !important;
|
||||||
|
--padding-start:20px !important;
|
||||||
|
--padding-end:20px !important;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.arrow-right{
|
||||||
|
display: none;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
.arrow-right-icon{
|
||||||
|
width: 37px;
|
||||||
|
float: right;
|
||||||
|
font-size: rem(35);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.buttons{
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
.solid {
|
||||||
|
display: none;
|
||||||
|
width: 90%;
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
margin: 0 auto !important;
|
||||||
|
}
|
||||||
|
.btn-ok, .btn-cancel{
|
||||||
|
//width: 50% !important;
|
||||||
|
margin-bottom: 5px !important;
|
||||||
|
margin-top: 5px !important;
|
||||||
|
}
|
||||||
|
.btn-ok, .btn-cancel, .btn-delete{
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.desk{
|
||||||
|
text-align: left;
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { DespachosPrOptionsPage } from './despachos-pr-options.page';
|
||||||
|
|
||||||
|
describe('DespachosPrOptionsPage', () => {
|
||||||
|
let component: DespachosPrOptionsPage;
|
||||||
|
let fixture: ComponentFixture<DespachosPrOptionsPage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ DespachosPrOptionsPage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(DespachosPrOptionsPage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,430 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
import { ModalController } from '@ionic/angular';
|
||||||
|
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||||
|
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||||
|
import { AddNotePage } from 'src/app/modals/add-note/add-note.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';
|
||||||
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||||
|
import { TaskService } from 'src/app/services/task.service'
|
||||||
|
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-despachos-pr-options',
|
||||||
|
templateUrl: './despachos-pr-options.page.html',
|
||||||
|
styleUrls: ['./despachos-pr-options.page.scss'],
|
||||||
|
})
|
||||||
|
export class DespachosPrOptionsPage implements OnInit {
|
||||||
|
|
||||||
|
|
||||||
|
task: any;
|
||||||
|
fulltask: any;
|
||||||
|
serialNumber: string;
|
||||||
|
profile: string
|
||||||
|
environment = environment
|
||||||
|
|
||||||
|
constructor(private activateRoute: ActivatedRoute,
|
||||||
|
private processes: ProcessesService,
|
||||||
|
private router: Router,
|
||||||
|
private modalController: ModalController,
|
||||||
|
private activatedRoute: ActivatedRoute,
|
||||||
|
private toastService: ToastService,
|
||||||
|
private RouteService: RouteService,
|
||||||
|
public p: PermissionService,
|
||||||
|
public ThemeService: ThemeService,
|
||||||
|
public TaskService: TaskService,
|
||||||
|
private httpErroHandle: HttpErrorHandle,
|
||||||
|
) { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
|
||||||
|
this.profile = "mdgpr";
|
||||||
|
|
||||||
|
this.activatedRoute.queryParams.subscribe(params => {
|
||||||
|
if(params["serialNumber"]) {
|
||||||
|
this.serialNumber = params["serialNumber"];
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if(this.task.serialNumber) {
|
||||||
|
this.serialNumber = this.task.serialNumber
|
||||||
|
} else if(this.task.SerialNumber) {
|
||||||
|
this.serialNumber = this.task.SerialNumber
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
close () {
|
||||||
|
this.goBack()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async openExpedientActionsModal(taskAction: any, task: any) {
|
||||||
|
// this.modalController.dismiss();
|
||||||
|
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: CreateProcessPage,
|
||||||
|
componentProps: {
|
||||||
|
taskAction: taskAction,
|
||||||
|
task: task,
|
||||||
|
profile: this.profile,
|
||||||
|
fulltask: this.fulltask
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then( (res)=> {
|
||||||
|
|
||||||
|
if(res['data']=='openDiscart') {
|
||||||
|
|
||||||
|
|
||||||
|
this.distartExpedientModal();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.goBack()
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss('close')
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
sendExpedienteToPending() {
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
this.processes.SetTaskToPending(this.serialNumber).subscribe(res=>{
|
||||||
|
|
||||||
|
this.httpErroHandle.httpsSucessMessagge('Enviar para Pendentes')
|
||||||
|
this.modalController.dismiss('close')
|
||||||
|
loader.remove()
|
||||||
|
},(error)=>{
|
||||||
|
loader.remove()
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest('Processo não encontrado')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async distartExpedientModal() {
|
||||||
|
this.modalController.dismiss();
|
||||||
|
|
||||||
|
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
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(res=>{
|
||||||
|
if(res['data']=='close'){
|
||||||
|
this.close();
|
||||||
|
/*
|
||||||
|
this.close();
|
||||||
|
this.openMenu(); */
|
||||||
|
}
|
||||||
|
this.modalController.dismiss('close')
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async openBookMeetingModal(task: any) {
|
||||||
|
this.modalController.dismiss();
|
||||||
|
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,
|
||||||
|
fulltask:this.fulltask
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(
|
||||||
|
()=> {},
|
||||||
|
(error) => {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openDelegarModal(task: any) {
|
||||||
|
this.modalController.dismiss();
|
||||||
|
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
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(res => {
|
||||||
|
if(res) {
|
||||||
|
const data = res.data;
|
||||||
|
if(data == 'close') {
|
||||||
|
this.goBack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async generateDiploma(note:string, documents:any) {
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Reencaminhar",
|
||||||
|
"ActionTypeId": 99999839,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.toastService._successMessage()
|
||||||
|
this.close();
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openAddNoteModal(actionName:string) {
|
||||||
|
this.modalController.dismiss();
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
}
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: AddNotePage,
|
||||||
|
componentProps: {
|
||||||
|
showAttachmentBtn: true,
|
||||||
|
actionName:actionName
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: true
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(async (res) => {
|
||||||
|
|
||||||
|
if(res.data){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const DocumentToSave = res.data.documents.map((e) => {
|
||||||
|
return {
|
||||||
|
ApplicationId: e.ApplicationType,
|
||||||
|
SourceId: e.Id,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let docs = {
|
||||||
|
ProcessInstanceID: "",
|
||||||
|
Attachments: DocumentToSave,
|
||||||
|
}
|
||||||
|
|
||||||
|
if(actionName == 'Executado') {
|
||||||
|
await this.executado(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Arquivar') {
|
||||||
|
await this.arquivar(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Gerar Diploma') {
|
||||||
|
await this.generateDiploma(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Reexecução') {
|
||||||
|
await this.reexecutar(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Concluido') {
|
||||||
|
await this.concluir(res.data.note, docs);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.goBack();
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async concluir(note:string, documents:any){
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Arquivo",
|
||||||
|
"ActionTypeId": 95,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.httpErroHandle.httpsSucessMessagge('Concluir Despacho')
|
||||||
|
this.close();
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async arquivar(note:string, documents:any){
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Arquivo",
|
||||||
|
"ActionTypeId": 95,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.toastService.successMessage('Processo arquivado')
|
||||||
|
this.close();
|
||||||
|
} catch (error) {
|
||||||
|
this.toastService.badRequest('Processo não arquivado')
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async executado(note:string, documents:any){
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Conhecimento",
|
||||||
|
"ActionTypeId": 104,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.httpErroHandle.httpsSucessMessagge('Executado')
|
||||||
|
this.close();
|
||||||
|
this.toastService.successMessage()
|
||||||
|
} catch(error) {
|
||||||
|
this.toastService.badRequest()
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async reexecutar(note:string, documents:any){
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Reexecução",
|
||||||
|
"ActionTypeId": 100000010,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.httpErroHandle.httpsSucessMessagge('Reexecução')
|
||||||
|
this.toastService.successMessage()
|
||||||
|
this.close();
|
||||||
|
} catch (error) {
|
||||||
|
this.toastService.badRequest()
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
goBack() {
|
||||||
|
this.RouteService.goBack();
|
||||||
|
this.TaskService.loadDiplomas()
|
||||||
|
}
|
||||||
|
|
||||||
|
cancle() {
|
||||||
|
this.modalController.dismiss()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { DiplomasGerarOptionsPage } from './diplomas-gerar-options.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: DiplomasGerarOptionsPage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class DiplomasGerarOptionsPageRoutingModule {}
|
||||||
+20
@@ -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 { DiplomasGerarOptionsPageRoutingModule } from './diplomas-gerar-options-routing.module';
|
||||||
|
|
||||||
|
import { DiplomasGerarOptionsPage } from './diplomas-gerar-options.page';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
DiplomasGerarOptionsPageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [DiplomasGerarOptionsPage]
|
||||||
|
})
|
||||||
|
export class DiplomasGerarOptionsPageModule {}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
<div class="wrapper">
|
||||||
|
<div>
|
||||||
|
<div class="buttons">
|
||||||
|
<button (click)="enviarDiploma({note: '', documents: [], serialnumber: task.SerialNumber})" class="btn-cancel" shape="round" >Enviar Diploma</button>
|
||||||
|
<button (click)="openDelegarModal()" class="btn-cancel" shape="round" >Delegar</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
+67
@@ -0,0 +1,67 @@
|
|||||||
|
@import '~src/function.scss';
|
||||||
|
|
||||||
|
.wrapper{
|
||||||
|
width: 100% !important;
|
||||||
|
padding-top:20px !important;
|
||||||
|
padding-bottom:20px !important;
|
||||||
|
}
|
||||||
|
.arrow-right{
|
||||||
|
display: none;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
.arrow-right-icon{
|
||||||
|
width: 37px;
|
||||||
|
float: right;
|
||||||
|
font-size: rem(35);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.buttons{
|
||||||
|
width: 100% !important;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-around;
|
||||||
|
margin: 0 auto !important;
|
||||||
|
}
|
||||||
|
.solid {
|
||||||
|
display: none;
|
||||||
|
width: 90%;
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
margin: 0 auto !important;
|
||||||
|
}
|
||||||
|
.btn-ok, .btn-cancel{
|
||||||
|
//width: 50% !important;
|
||||||
|
margin-bottom: 5px !important;
|
||||||
|
margin-top: 5px !important;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 800px) {
|
||||||
|
.container{
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
.btn-ok, .btn-cancel, .btn-delete{
|
||||||
|
width: 47% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media only screen and (min-width: 1024px) {
|
||||||
|
.container{
|
||||||
|
width: 100% !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
.arrow-right{
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
.btn-cancel{
|
||||||
|
display: none;
|
||||||
|
width: 100% !important;
|
||||||
|
margin-bottom: 10px !important;
|
||||||
|
}
|
||||||
|
.btn-delete, .btn-ok{
|
||||||
|
width: 100% !important;
|
||||||
|
margin-bottom: 10px !important;
|
||||||
|
margin-top: 10px !important;
|
||||||
|
}
|
||||||
|
/* .solid{
|
||||||
|
display: block;
|
||||||
|
} */
|
||||||
|
}
|
||||||
|
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { DiplomasGerarOptionsPage } from './diplomas-gerar-options.page';
|
||||||
|
|
||||||
|
describe('DiplomasGerarOptionsPage', () => {
|
||||||
|
let component: DiplomasGerarOptionsPage;
|
||||||
|
let fixture: ComponentFixture<DiplomasGerarOptionsPage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ DiplomasGerarOptionsPage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(DiplomasGerarOptionsPage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,208 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||||
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
|
import { DespachoService } from 'src/app/Rules/despacho.service'
|
||||||
|
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||||
|
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||||
|
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||||
|
import { customTask, fullTask } from 'src/app/models/dailyworktask.model';
|
||||||
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { TaskService } from 'src/app/services/task.service'
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-diplomas-gerar-options',
|
||||||
|
templateUrl: './diplomas-gerar-options.page.html',
|
||||||
|
styleUrls: ['./diplomas-gerar-options.page.scss'],
|
||||||
|
})
|
||||||
|
export class DiplomasGerarOptionsPage implements OnInit {
|
||||||
|
|
||||||
|
task: customTask
|
||||||
|
fulltask: fullTask;
|
||||||
|
serialNumber: string;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private processes: ProcessesService,
|
||||||
|
public popoverController: PopoverController,
|
||||||
|
private modalController: ModalController,
|
||||||
|
private toastService: ToastService,
|
||||||
|
public ThemeService: ThemeService,
|
||||||
|
private despachoService: DespachoService,
|
||||||
|
private navParams: NavParams,
|
||||||
|
private router: Router,
|
||||||
|
private RouteService: RouteService,
|
||||||
|
public TaskService: TaskService
|
||||||
|
) { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.task = this.navParams.get('task')
|
||||||
|
this.fulltask = this.navParams.get('fulltask')
|
||||||
|
this.serialNumber = this.navParams.get('serialNumber')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async enviarDiploma({note = '', documents = [], serialnumber}) {
|
||||||
|
|
||||||
|
let classs;
|
||||||
|
if (window.innerWidth <= 800) {
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'add-note-modal-no-height'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: AddNotePage,
|
||||||
|
componentProps: {
|
||||||
|
showAttachmentBtn: true,
|
||||||
|
actionName:false
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: true
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(async (res) => {
|
||||||
|
if (res.data) {
|
||||||
|
|
||||||
|
const DocumentToSave = res.data.documents.map((e) => {
|
||||||
|
return {
|
||||||
|
ApplicationId: e.ApplicationType,
|
||||||
|
SourceId: e.Id,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let docs = {
|
||||||
|
ProcessInstanceID: "",
|
||||||
|
Attachments: DocumentToSave,
|
||||||
|
}
|
||||||
|
|
||||||
|
let body = {
|
||||||
|
"serialNumber": serialnumber,
|
||||||
|
"action": "Enviar diploma",
|
||||||
|
"ActionTypeId": 104,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": res.data.note,
|
||||||
|
},
|
||||||
|
"AttachmentList" : docs,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise();
|
||||||
|
this.modalController.dismiss('sucess');
|
||||||
|
this.toastService._successMessage();
|
||||||
|
this.goBack()
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest();
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async sendExpedienteToPending() {
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
this.despachoService.sendExpedienteToPending(this.serialNumber).subscribe(res => {
|
||||||
|
this.goBack();
|
||||||
|
this.toastService._badRequest("Processo enviado para Pendentes")
|
||||||
|
loader.remove()
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
loader.remove()
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest("Processo não enviado para Pendentes")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async openBookMeetingModal() {
|
||||||
|
let classs;
|
||||||
|
if (window.innerWidth <= 800) {
|
||||||
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: BookMeetingModalPage,
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
fulltask:this.fulltask
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(
|
||||||
|
()=>{},
|
||||||
|
(error) => {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async openDelegarModal() {
|
||||||
|
let classs;
|
||||||
|
if (window.innerWidth <= 800) {
|
||||||
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: DelegarPage,
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(res => {
|
||||||
|
if(res) {
|
||||||
|
const data = res.data;
|
||||||
|
if(data == 'close') {
|
||||||
|
this.goBack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
goBack() {
|
||||||
|
|
||||||
|
this.popoverController.dismiss();
|
||||||
|
this.RouteService.goBack();
|
||||||
|
this.TaskService.loadDespachos();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { DkDeplomasOptionsPage } from './dk-deplomas-options.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: DkDeplomasOptionsPage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class DkDeplomasOptionsPageRoutingModule {}
|
||||||
@@ -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 { DkDeplomasOptionsPageRoutingModule } from './dk-deplomas-options-routing.module';
|
||||||
|
|
||||||
|
import { DkDeplomasOptionsPage } from './dk-deplomas-options.page';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
DkDeplomasOptionsPageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [DkDeplomasOptionsPage]
|
||||||
|
})
|
||||||
|
export class DkDeplomasOptionsPageModule {}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
<ion-content class="options-container">
|
||||||
|
<div class="arrow-right" (click)="goBack('no')">
|
||||||
|
<button class="btn-no-color">
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' "slot="end" class="arrow-right-icon" src='assets/images/icons-arrow-arrow-right.svg'></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" class="arrow-right-icon" src='assets/images/theme/gov/icons-calendar-arrow-right.svg'></ion-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="width-100 pr-options" *ngIf="task.activityInstanceName == 'Tarefa de Despacho' && task.WorkflowName == 'Despacho do Presidente da República' ">
|
||||||
|
<div *ngIf="task && !p.userRole(['PR'])" class="d-flex width-100">
|
||||||
|
<div class="flex-grow-1 width-50 pr-10">
|
||||||
|
<button class="btn-cancel desk" shape="round" > Responder ao {{ environment.PR}} </button>
|
||||||
|
<button (click)="openAddNoteModal('Executado')" class="btn-cancel width-100" shape="round" >Executado</button>
|
||||||
|
<button class="btn-cancel desk" shape="round"> Reencaminhar para Área Jurídica </button>
|
||||||
|
<button (click)="openAddNoteModal('Gerar Diploma')" class="btn-cancel width-100" shape="round" >Gerar Diploma</button>
|
||||||
|
<button class="btn-cancel desk" shape="round"> Outras opções </button>
|
||||||
|
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel width-100" shape="round" >Efetuar Despacho</button>
|
||||||
|
</div>
|
||||||
|
<div class="flex-grow-1 width-50 pl-10">
|
||||||
|
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel width-100" shape="round" >Solicitar Parecer</button>
|
||||||
|
<button *ngIf="!p.userRole(['PR']) && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openTaskProcessModal('2',fulltask)" class="btn-cancel width-100" shape="round" >Pedido de Deferimento</button>
|
||||||
|
<button (click)="openDelegarModal(task)" class="btn-cancel width-100" shape="round" >Delegar</button>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel width-100" shape="round" >Enviar para Pendentes</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="task && p.userRole(['PR'])" class="d-flex width-100">
|
||||||
|
<div class="flex-grow-1">
|
||||||
|
<button (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
|
||||||
|
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Despacho' && task.WorkflowName != 'Despacho do Presidente da República' ">
|
||||||
|
<button (click)="openAddNoteModal('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)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
|
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Reexecutar Despacho'">
|
||||||
|
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
||||||
|
<button (click)="openDelegarModal(task)" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Delegar</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
|
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
</div>
|
||||||
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Concluir Despacho'">
|
||||||
|
<button (click)="openAddNoteModal('Arquivar')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
|
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ion-content>
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
@import '~src/function.scss';
|
||||||
|
|
||||||
|
.options-container {
|
||||||
|
--padding-top:20px !important;
|
||||||
|
--padding-bottom:20px !important;
|
||||||
|
--padding-start:20px !important;
|
||||||
|
--padding-end:20px !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
.arrow-right {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
.arrow-right-icon {
|
||||||
|
width: 37px;
|
||||||
|
float: right;
|
||||||
|
font-size: rem(35);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.buttons {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
.solid {
|
||||||
|
width: 90%;
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
margin: 0 auto !important;
|
||||||
|
}
|
||||||
|
.btn-ok, .btn-cancel, .btn-delete{
|
||||||
|
width: 100% !important;
|
||||||
|
margin: 5px 5px 5px 5px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pr-options {
|
||||||
|
.btn-ok, .btn-cancel{
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { DkDeplomasOptionsPage } from './dk-deplomas-options.page';
|
||||||
|
|
||||||
|
describe('DkDeplomasOptionsPage', () => {
|
||||||
|
let component: DkDeplomasOptionsPage;
|
||||||
|
let fixture: ComponentFixture<DkDeplomasOptionsPage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ DkDeplomasOptionsPage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(DkDeplomasOptionsPage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,402 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
|
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||||
|
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||||
|
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||||
|
import { AddNotePage } from 'src/app/modals/add-note/add-note.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';
|
||||||
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { customTask, fullTask } from 'src/app/models/dailyworktask.model';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
import { TaskService } from 'src/app/services/task.service'
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-dk-deplomas-options',
|
||||||
|
templateUrl: './dk-deplomas-options.page.html',
|
||||||
|
styleUrls: ['./dk-deplomas-options.page.scss'],
|
||||||
|
})
|
||||||
|
export class DkDeplomasOptionsPage implements OnInit {
|
||||||
|
|
||||||
|
|
||||||
|
task: customTask
|
||||||
|
fulltask: fullTask;
|
||||||
|
serialNumber: string;
|
||||||
|
environment = environment
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private processes: ProcessesService,
|
||||||
|
private modalController: ModalController,
|
||||||
|
public popoverController: PopoverController,
|
||||||
|
private navParams: NavParams,
|
||||||
|
private toastService: ToastService,
|
||||||
|
public p: PermissionService,
|
||||||
|
public ThemeService: ThemeService,
|
||||||
|
private RouteService: RouteService,
|
||||||
|
private httpErrorHandle: HttpErrorHandle,
|
||||||
|
public TaskService: TaskService
|
||||||
|
) {
|
||||||
|
|
||||||
|
this.task = this.navParams.get('task')
|
||||||
|
this.fulltask = this.navParams.get('fulltask')
|
||||||
|
|
||||||
|
|
||||||
|
this.serialNumber = this.task.SerialNumber
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async openTaskProcessModal(taskAction: any, task: any) {
|
||||||
|
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: CreateProcessPage,
|
||||||
|
componentProps: {
|
||||||
|
taskAction: taskAction,
|
||||||
|
task: task,
|
||||||
|
fulltask: this.fulltask
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then( res => {
|
||||||
|
// this.goBack();
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
sendExpedienteToPending() {
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
|
||||||
|
this.httpErrorHandle.httpsSucessMessagge('Enviar para Pendentes')
|
||||||
|
loader.remove()
|
||||||
|
|
||||||
|
this.goBack('back');
|
||||||
|
},(error)=>{
|
||||||
|
loader.remove()
|
||||||
|
this.httpErrorHandle.httpStatusHandle(error)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async distartExpedientModal() {
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
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
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(res=>{
|
||||||
|
if(res['data']=='close'){
|
||||||
|
this.goBack('back');
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async openBookMeetingModal(task: any) {
|
||||||
|
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: BookMeetingModalPage,
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
fulltask:this.fulltask
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(() => {
|
||||||
|
this.goBack('no');
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async openDelegarModal(task: any) {
|
||||||
|
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: DelegarPage,
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
modal.onDidDismiss().then(res => {
|
||||||
|
if(res){
|
||||||
|
const data = res.data;
|
||||||
|
if(data == 'close') {
|
||||||
|
this.goBack('back');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async generateDiploma(note:string, documents:any){
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Reencaminhar",
|
||||||
|
"ActionTypeId": 99999839,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.toastService._successMessage()
|
||||||
|
this.goBack('back');
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openAddNoteModal(actionName:string) {
|
||||||
|
|
||||||
|
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: AddNotePage,
|
||||||
|
componentProps: {
|
||||||
|
showAttachmentBtn: true,
|
||||||
|
actionName:actionName
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: true
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(async (res) => {
|
||||||
|
|
||||||
|
if(res.data) {
|
||||||
|
|
||||||
|
const DocumentToSave = res.data.documents.map((e) => {
|
||||||
|
return {
|
||||||
|
ApplicationId: e.ApplicationType,
|
||||||
|
SourceId: e.Id,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let docs = {
|
||||||
|
ProcessInstanceID: "",
|
||||||
|
Attachments: DocumentToSave,
|
||||||
|
}
|
||||||
|
|
||||||
|
if(actionName == 'Executado') {
|
||||||
|
await this.executado(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Arquivar') {
|
||||||
|
await this.arquivar(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Gerar Diploma') {
|
||||||
|
await this.generateDiploma(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Concluido') {
|
||||||
|
this.concluir(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Reexecução') {
|
||||||
|
await this.reexecutar(res.data.note, docs);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
async concluir(note: string, documents: any) {
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Arquivo",
|
||||||
|
"ActionTypeId": 95,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList": documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.httpErrorHandle.httpsSucessMessagge('Concluir Despacho')
|
||||||
|
this.TaskService.loadDiplomas()
|
||||||
|
} catch (error) {
|
||||||
|
this.httpErrorHandle.httpStatusHandle(error)
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async arquivar(note:string, documents:any) {
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Arquivo",
|
||||||
|
"ActionTypeId": 95,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.toastService._successMessage('Processo arquivado')
|
||||||
|
this.goBack('back');
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest('Processo não arquivado')
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async executado(note:string, documents:any) {
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Conhecimento",
|
||||||
|
"ActionTypeId": 104,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.goBack('back');
|
||||||
|
this.toastService._successMessage()
|
||||||
|
} catch(error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
async reexecutar(note:string, documents:any){
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Reexecução",
|
||||||
|
"ActionTypeId": 100000010,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.toastService._successMessage()
|
||||||
|
this.goBack('back');
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
goBack(params) {
|
||||||
|
this.popoverController.dismiss(params)
|
||||||
|
}
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { DkDespachosOptionsPage } from './dk-despachos-options.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: DkDespachosOptionsPage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class DkDespachosOptionsPageRoutingModule {}
|
||||||
@@ -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 { DkDespachosOptionsPageRoutingModule } from './dk-despachos-options-routing.module';
|
||||||
|
|
||||||
|
import { DkDespachosOptionsPage } from './dk-despachos-options.page';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
DkDespachosOptionsPageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [DkDespachosOptionsPage]
|
||||||
|
})
|
||||||
|
export class DkDespachosOptionsPageModule {}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
<ion-content class="options-container">
|
||||||
|
<div class="arrow-right" (click)="goBack('no')">
|
||||||
|
<button class="btn-no-color">
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' "slot="end" class="arrow-right-icon" src='assets/images/icons-arrow-arrow-right.svg'></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" class="arrow-right-icon" src='assets/images/theme/gov/icons-calendar-arrow-right.svg'></ion-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="width-100 pr-options" *ngIf="task.activityInstanceName == 'Tarefa de Despacho' && task.WorkflowName == 'Despacho do Presidente da República' ">
|
||||||
|
<div *ngIf="task && !p.userRole(['PR'])" class="d-flex width-100">
|
||||||
|
<div class="flex-grow-1 width-50 pr-10">
|
||||||
|
<button class="btn-cancel desk" shape="round" > Responder ao {{ environment.PR}} </button>
|
||||||
|
<button (click)="openAddNoteModal('Executado')" class="btn-cancel width-100" shape="round" >Executado</button>
|
||||||
|
<button class="btn-cancel desk" shape="round"> Reencaminhar para Área Jurídica </button>
|
||||||
|
<button (click)="openAddNoteModal('Gerar Diploma')" class="btn-cancel width-100" shape="round" >Gerar Diploma</button>
|
||||||
|
<button class="btn-cancel desk" shape="round"> Outras opções </button>
|
||||||
|
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel width-100" shape="round" >Efetuar Despacho</button>
|
||||||
|
</div>
|
||||||
|
<div class="flex-grow-1 width-50 pl-10">
|
||||||
|
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel width-100" shape="round" >Solicitar Parecer</button>
|
||||||
|
<button *ngIf="!p.userRole(['PR']) && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openTaskProcessModal('2',fulltask)" class="btn-cancel width-100" shape="round" >Pedido de Deferimento</button>
|
||||||
|
<button (click)="openDelegarModal(task)" class="btn-cancel width-100" shape="round" >Delegar</button>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel width-100" shape="round" >Enviar para Pendentes</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="task && p.userRole(['PR'])" class="d-flex width-100">
|
||||||
|
<div class="flex-grow-1">
|
||||||
|
<button (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
|
||||||
|
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Despacho' && task.WorkflowName != 'Despacho do Presidente da República' ">
|
||||||
|
<button (click)="openAddNoteModal('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)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
|
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Reexecutar Despacho'">
|
||||||
|
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
||||||
|
<button (click)="openDelegarModal(task)" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Delegar</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
|
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
</div>
|
||||||
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Concluir Despacho'">
|
||||||
|
<button (click)="openAddNoteModal('Arquivar')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
|
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ion-content>
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
@import '~src/function.scss';
|
||||||
|
|
||||||
|
.options-container {
|
||||||
|
--padding-top:20px !important;
|
||||||
|
--padding-bottom:20px !important;
|
||||||
|
--padding-start:20px !important;
|
||||||
|
--padding-end:20px !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
.arrow-right {
|
||||||
|
display: none;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
.arrow-right-icon {
|
||||||
|
width: 37px;
|
||||||
|
float: right;
|
||||||
|
font-size: rem(35);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.buttons {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
.solid {
|
||||||
|
display: none;
|
||||||
|
width: 90%;
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
margin: 0 auto !important;
|
||||||
|
}
|
||||||
|
.btn-ok, .btn-cancel, .btn-delete{
|
||||||
|
width: 100% !important;
|
||||||
|
margin: 5px 5px 5px 5px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pr-options {
|
||||||
|
.btn-ok, .btn-cancel{
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { DkDespachosOptionsPage } from './dk-despachos-options.page';
|
||||||
|
|
||||||
|
describe('DkDespachosOptionsPage', () => {
|
||||||
|
let component: DkDespachosOptionsPage;
|
||||||
|
let fixture: ComponentFixture<DkDespachosOptionsPage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ DkDespachosOptionsPage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(DkDespachosOptionsPage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,403 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
|
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||||
|
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||||
|
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||||
|
import { AddNotePage } from 'src/app/modals/add-note/add-note.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';
|
||||||
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { customTask, fullTask } from 'src/app/models/dailyworktask.model';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
import { TaskService } from 'src/app/services/task.service'
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-dk-despachos-options',
|
||||||
|
templateUrl: './dk-despachos-options.page.html',
|
||||||
|
styleUrls: ['./dk-despachos-options.page.scss'],
|
||||||
|
})
|
||||||
|
export class DkDespachosOptionsPage implements OnInit {
|
||||||
|
|
||||||
|
task: customTask
|
||||||
|
fulltask: fullTask;
|
||||||
|
serialNumber: string;
|
||||||
|
environment = environment
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private processes: ProcessesService,
|
||||||
|
private modalController: ModalController,
|
||||||
|
public popoverController: PopoverController,
|
||||||
|
private navParams: NavParams,
|
||||||
|
private toastService: ToastService,
|
||||||
|
public p: PermissionService,
|
||||||
|
public ThemeService: ThemeService,
|
||||||
|
private RouteService: RouteService,
|
||||||
|
private httpErrorHandle: HttpErrorHandle,
|
||||||
|
public TaskService: TaskService
|
||||||
|
) {
|
||||||
|
|
||||||
|
this.task = this.navParams.get('task')
|
||||||
|
this.fulltask = this.navParams.get('fulltask')
|
||||||
|
|
||||||
|
|
||||||
|
this.serialNumber = this.task.SerialNumber
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async openTaskProcessModal(taskAction: any, task: any) {
|
||||||
|
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: CreateProcessPage,
|
||||||
|
componentProps: {
|
||||||
|
taskAction: taskAction,
|
||||||
|
task: task,
|
||||||
|
fulltask: this.fulltask
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then( res => {
|
||||||
|
// this.goBack();
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
sendExpedienteToPending() {
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
|
||||||
|
this.httpErrorHandle.httpsSucessMessagge('Enviar para Pendentes')
|
||||||
|
loader.remove()
|
||||||
|
|
||||||
|
this.goBack('back');
|
||||||
|
},(error)=>{
|
||||||
|
loader.remove()
|
||||||
|
this.httpErrorHandle.httpStatusHandle(error)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async distartExpedientModal() {
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
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
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(res=>{
|
||||||
|
if(res['data']=='close'){
|
||||||
|
this.goBack('back');
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async openBookMeetingModal(task: any) {
|
||||||
|
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: BookMeetingModalPage,
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
fulltask:this.fulltask
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(() => {
|
||||||
|
this.goBack('no');
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async openDelegarModal(task: any) {
|
||||||
|
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: DelegarPage,
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
modal.onDidDismiss().then(res => {
|
||||||
|
if(res){
|
||||||
|
const data = res.data;
|
||||||
|
if(data == 'close') {
|
||||||
|
this.goBack('back');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async generateDiploma(note:string, documents:any){
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Reencaminhar",
|
||||||
|
"ActionTypeId": 99999839,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.toastService._successMessage()
|
||||||
|
this.goBack('back');
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openAddNoteModal(actionName:string) {
|
||||||
|
|
||||||
|
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: AddNotePage,
|
||||||
|
componentProps: {
|
||||||
|
showAttachmentBtn: true,
|
||||||
|
actionName:actionName
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: true
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(async (res) => {
|
||||||
|
|
||||||
|
if(res.data) {
|
||||||
|
|
||||||
|
const DocumentToSave = res.data.documents.map((e) => {
|
||||||
|
return {
|
||||||
|
ApplicationId: e.ApplicationType,
|
||||||
|
SourceId: e.Id,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let docs = {
|
||||||
|
ProcessInstanceID: "",
|
||||||
|
Attachments: DocumentToSave,
|
||||||
|
}
|
||||||
|
|
||||||
|
if(actionName == 'Executado') {
|
||||||
|
await this.executado(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Arquivar') {
|
||||||
|
await this.arquivar(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Gerar Diploma') {
|
||||||
|
await this.generateDiploma(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Concluido') {
|
||||||
|
this.concluir(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Reexecução') {
|
||||||
|
await this.reexecutar(res.data.note, docs);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
async concluir(note: string, documents: any) {
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Arquivo",
|
||||||
|
"ActionTypeId": 95,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList": documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.httpErrorHandle.httpsSucessMessagge('Concluir Despacho')
|
||||||
|
this.TaskService.loadDiplomas()
|
||||||
|
} catch (error) {
|
||||||
|
this.httpErrorHandle.httpStatusHandle(error)
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async arquivar(note:string, documents:any) {
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Arquivo",
|
||||||
|
"ActionTypeId": 95,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.toastService._successMessage('Processo arquivado')
|
||||||
|
this.goBack('back');
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest('Processo não arquivado')
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async executado(note:string, documents:any) {
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Conhecimento",
|
||||||
|
"ActionTypeId": 104,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.goBack('back');
|
||||||
|
this.toastService._successMessage()
|
||||||
|
} catch(error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
async reexecutar(note:string, documents:any){
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Reexecução",
|
||||||
|
"ActionTypeId": 100000010,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.toastService._successMessage()
|
||||||
|
this.goBack('back');
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
goBack(params) {
|
||||||
|
this.popoverController.dismiss(params)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { DkDespachosPrOptionsPage } from './dk-despachos-pr-options.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: DkDespachosPrOptionsPage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class DkDespachosPrOptionsPageRoutingModule {}
|
||||||
+20
@@ -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 { DkDespachosPrOptionsPageRoutingModule } from './dk-despachos-pr-options-routing.module';
|
||||||
|
|
||||||
|
import { DkDespachosPrOptionsPage } from './dk-despachos-pr-options.page';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
DkDespachosPrOptionsPageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [DkDespachosPrOptionsPage]
|
||||||
|
})
|
||||||
|
export class DkDespachosPrOptionsPageModule {}
|
||||||
+41
@@ -0,0 +1,41 @@
|
|||||||
|
<ion-content class="options-container">
|
||||||
|
<div class="arrow-right" (click)="close()">
|
||||||
|
<button class="btn-no-color">
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' "slot="end" class="arrow-right-icon" src='assets/images/icons-arrow-arrow-right.svg'></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" class="arrow-right-icon" src='assets/images/theme/gov/icons-calendar-arrow-right.svg'></ion-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="width-100">
|
||||||
|
<div *ngIf="task && !p.userRole(['PR'])" class="d-flex width-100">
|
||||||
|
<div class="flex-grow-1 width-50 pr-10">
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Responder ao {{ environment.PR}} </button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Reencaminhar para Área Jurídica </button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Gerar Diploma')" class="btn-cancel" shape="round" >Gerar Diploma</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Outras opções </button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
|
</div>
|
||||||
|
<div class="flex-grow-1 width-50 pl-10">
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
|
<!-- <button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button> -->
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks]) && task.Status != 'Pending'" (click)="sendExpedienteToPending()" full class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
<button (click)="cancle()" full class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="task && p.userRole(['PR'])" class="d-flex width-100">
|
||||||
|
<div class="flex-grow-1">
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks]) && task.Status != 'Pending'" (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
<button (click)="cancle()" full class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <div class="solid"></div>
|
||||||
|
<button (click)="cancle()" full class="btn-cancel" shape="round" >Cancelar</button> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ion-content>
|
||||||
+49
@@ -0,0 +1,49 @@
|
|||||||
|
@import '~src/function.scss';
|
||||||
|
|
||||||
|
:host {
|
||||||
|
height: 100% !important;
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.options-container{
|
||||||
|
--padding-top:20px !important;
|
||||||
|
--padding-bottom:20px !important;
|
||||||
|
--padding-start:20px !important;
|
||||||
|
--padding-end:20px !important;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.arrow-right{
|
||||||
|
display: none;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
.arrow-right-icon{
|
||||||
|
width: 37px;
|
||||||
|
float: right;
|
||||||
|
font-size: rem(35);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.buttons{
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
.solid {
|
||||||
|
display: none;
|
||||||
|
width: 90%;
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
margin: 0 auto !important;
|
||||||
|
}
|
||||||
|
.btn-ok, .btn-cancel{
|
||||||
|
//width: 50% !important;
|
||||||
|
margin-bottom: 5px !important;
|
||||||
|
margin-top: 5px !important;
|
||||||
|
}
|
||||||
|
.btn-ok, .btn-cancel, .btn-delete{
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.desk{
|
||||||
|
text-align: left;
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { DkDespachosPrOptionsPage } from './dk-despachos-pr-options.page';
|
||||||
|
|
||||||
|
describe('DkDespachosPrOptionsPage', () => {
|
||||||
|
let component: DkDespachosPrOptionsPage;
|
||||||
|
let fixture: ComponentFixture<DkDespachosPrOptionsPage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ DkDespachosPrOptionsPage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(DkDespachosPrOptionsPage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
+430
@@ -0,0 +1,430 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
import { ModalController } from '@ionic/angular';
|
||||||
|
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||||
|
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||||
|
import { AddNotePage } from 'src/app/modals/add-note/add-note.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';
|
||||||
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||||
|
import { TaskService } from 'src/app/services/task.service'
|
||||||
|
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-dk-despachos-pr-options',
|
||||||
|
templateUrl: './dk-despachos-pr-options.page.html',
|
||||||
|
styleUrls: ['./dk-despachos-pr-options.page.scss'],
|
||||||
|
})
|
||||||
|
export class DkDespachosPrOptionsPage implements OnInit {
|
||||||
|
|
||||||
|
|
||||||
|
task: any;
|
||||||
|
fulltask: any;
|
||||||
|
serialNumber: string;
|
||||||
|
profile: string
|
||||||
|
environment = environment
|
||||||
|
|
||||||
|
constructor(private activateRoute: ActivatedRoute,
|
||||||
|
private processes: ProcessesService,
|
||||||
|
private router: Router,
|
||||||
|
private modalController: ModalController,
|
||||||
|
private activatedRoute: ActivatedRoute,
|
||||||
|
private toastService: ToastService,
|
||||||
|
private RouteService: RouteService,
|
||||||
|
public p: PermissionService,
|
||||||
|
public ThemeService: ThemeService,
|
||||||
|
public TaskService: TaskService,
|
||||||
|
private httpErroHandle: HttpErrorHandle,
|
||||||
|
) { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
|
||||||
|
this.profile = "mdgpr";
|
||||||
|
|
||||||
|
this.activatedRoute.queryParams.subscribe(params => {
|
||||||
|
if(params["serialNumber"]) {
|
||||||
|
this.serialNumber = params["serialNumber"];
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if(this.task.serialNumber) {
|
||||||
|
this.serialNumber = this.task.serialNumber
|
||||||
|
} else if(this.task.SerialNumber) {
|
||||||
|
this.serialNumber = this.task.SerialNumber
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
close () {
|
||||||
|
this.goBack()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async openExpedientActionsModal(taskAction: any, task: any) {
|
||||||
|
// this.modalController.dismiss();
|
||||||
|
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: CreateProcessPage,
|
||||||
|
componentProps: {
|
||||||
|
taskAction: taskAction,
|
||||||
|
task: task,
|
||||||
|
profile: this.profile,
|
||||||
|
fulltask: this.fulltask
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then( (res)=> {
|
||||||
|
|
||||||
|
if(res['data']=='openDiscart') {
|
||||||
|
|
||||||
|
|
||||||
|
this.distartExpedientModal();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.goBack()
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss('close')
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
sendExpedienteToPending() {
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
this.processes.SetTaskToPending(this.serialNumber).subscribe(res=>{
|
||||||
|
|
||||||
|
this.httpErroHandle.httpsSucessMessagge('Enviar para Pendentes')
|
||||||
|
this.modalController.dismiss('close')
|
||||||
|
loader.remove()
|
||||||
|
},(error)=>{
|
||||||
|
loader.remove()
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest('Processo não encontrado')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async distartExpedientModal() {
|
||||||
|
this.modalController.dismiss();
|
||||||
|
|
||||||
|
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
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(res=>{
|
||||||
|
if(res['data']=='close'){
|
||||||
|
this.close();
|
||||||
|
/*
|
||||||
|
this.close();
|
||||||
|
this.openMenu(); */
|
||||||
|
}
|
||||||
|
this.modalController.dismiss('close')
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async openBookMeetingModal(task: any) {
|
||||||
|
this.modalController.dismiss();
|
||||||
|
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,
|
||||||
|
fulltask:this.fulltask
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(
|
||||||
|
()=> {},
|
||||||
|
(error) => {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openDelegarModal(task: any) {
|
||||||
|
this.modalController.dismiss();
|
||||||
|
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
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(res => {
|
||||||
|
if(res) {
|
||||||
|
const data = res.data;
|
||||||
|
if(data == 'close') {
|
||||||
|
this.goBack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async generateDiploma(note:string, documents:any) {
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Reencaminhar",
|
||||||
|
"ActionTypeId": 99999839,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.toastService._successMessage()
|
||||||
|
this.close();
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openAddNoteModal(actionName:string) {
|
||||||
|
this.modalController.dismiss();
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
}
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: AddNotePage,
|
||||||
|
componentProps: {
|
||||||
|
showAttachmentBtn: true,
|
||||||
|
actionName:actionName
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: true
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(async (res) => {
|
||||||
|
|
||||||
|
if(res.data){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const DocumentToSave = res.data.documents.map((e) => {
|
||||||
|
return {
|
||||||
|
ApplicationId: e.ApplicationType,
|
||||||
|
SourceId: e.Id,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let docs = {
|
||||||
|
ProcessInstanceID: "",
|
||||||
|
Attachments: DocumentToSave,
|
||||||
|
}
|
||||||
|
|
||||||
|
if(actionName == 'Executado') {
|
||||||
|
await this.executado(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Arquivar') {
|
||||||
|
await this.arquivar(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Gerar Diploma') {
|
||||||
|
await this.generateDiploma(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Reexecução') {
|
||||||
|
await this.reexecutar(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Concluido') {
|
||||||
|
await this.concluir(res.data.note, docs);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.goBack();
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async concluir(note:string, documents:any){
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Arquivo",
|
||||||
|
"ActionTypeId": 95,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.httpErroHandle.httpsSucessMessagge('Concluir Despacho')
|
||||||
|
this.close();
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async arquivar(note:string, documents:any){
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Arquivo",
|
||||||
|
"ActionTypeId": 95,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.toastService.successMessage('Processo arquivado')
|
||||||
|
this.close();
|
||||||
|
} catch (error) {
|
||||||
|
this.toastService.badRequest('Processo não arquivado')
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async executado(note:string, documents:any){
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Conhecimento",
|
||||||
|
"ActionTypeId": 104,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.httpErroHandle.httpsSucessMessagge('Executado')
|
||||||
|
this.close();
|
||||||
|
this.toastService.successMessage()
|
||||||
|
} catch(error) {
|
||||||
|
this.toastService.badRequest()
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async reexecutar(note:string, documents:any){
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Reexecução",
|
||||||
|
"ActionTypeId": 100000010,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.httpErroHandle.httpsSucessMessagge('Reexecução')
|
||||||
|
this.toastService.successMessage()
|
||||||
|
this.close();
|
||||||
|
} catch (error) {
|
||||||
|
this.toastService.badRequest()
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
goBack() {
|
||||||
|
this.RouteService.goBack();
|
||||||
|
this.TaskService.loadDiplomas()
|
||||||
|
}
|
||||||
|
|
||||||
|
cancle() {
|
||||||
|
this.modalController.dismiss()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { DkDiplomasGerarOptionsPage } from './dk-diplomas-gerar-options.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: DkDiplomasGerarOptionsPage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class DkDiplomasGerarOptionsPageRoutingModule {}
|
||||||
+20
@@ -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 { DkDiplomasGerarOptionsPageRoutingModule } from './dk-diplomas-gerar-options-routing.module';
|
||||||
|
|
||||||
|
import { DkDiplomasGerarOptionsPage } from './dk-diplomas-gerar-options.page';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
DkDiplomasGerarOptionsPageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [DkDiplomasGerarOptionsPage]
|
||||||
|
})
|
||||||
|
export class DkDiplomasGerarOptionsPageModule {}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
<div class="wrapper">
|
||||||
|
<div>
|
||||||
|
<div class="buttons">
|
||||||
|
<button (click)="enviarDiploma({note: '', documents: [], serialnumber: task.SerialNumber})" class="btn-cancel" shape="round" >Enviar Diploma</button>
|
||||||
|
<button (click)="openDelegarModal()" class="btn-cancel" shape="round" >Delegar</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
+67
@@ -0,0 +1,67 @@
|
|||||||
|
@import '~src/function.scss';
|
||||||
|
|
||||||
|
.wrapper{
|
||||||
|
width: 100% !important;
|
||||||
|
padding-top:20px !important;
|
||||||
|
padding-bottom:20px !important;
|
||||||
|
}
|
||||||
|
.arrow-right{
|
||||||
|
display: none;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
.arrow-right-icon{
|
||||||
|
width: 37px;
|
||||||
|
float: right;
|
||||||
|
font-size: rem(35);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.buttons{
|
||||||
|
width: 100% !important;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-around;
|
||||||
|
margin: 0 auto !important;
|
||||||
|
}
|
||||||
|
.solid {
|
||||||
|
display: none;
|
||||||
|
width: 90%;
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
margin: 0 auto !important;
|
||||||
|
}
|
||||||
|
.btn-ok, .btn-cancel{
|
||||||
|
//width: 50% !important;
|
||||||
|
margin-bottom: 5px !important;
|
||||||
|
margin-top: 5px !important;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 800px) {
|
||||||
|
.container{
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
.btn-ok, .btn-cancel, .btn-delete{
|
||||||
|
width: 47% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media only screen and (min-width: 1024px) {
|
||||||
|
.container{
|
||||||
|
width: 100% !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
.arrow-right{
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
.btn-cancel{
|
||||||
|
display: none;
|
||||||
|
width: 100% !important;
|
||||||
|
margin-bottom: 10px !important;
|
||||||
|
}
|
||||||
|
.btn-delete, .btn-ok{
|
||||||
|
width: 100% !important;
|
||||||
|
margin-bottom: 10px !important;
|
||||||
|
margin-top: 10px !important;
|
||||||
|
}
|
||||||
|
/* .solid{
|
||||||
|
display: block;
|
||||||
|
} */
|
||||||
|
}
|
||||||
|
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { DkDiplomasGerarOptionsPage } from './dk-diplomas-gerar-options.page';
|
||||||
|
|
||||||
|
describe('DkDiplomasGerarOptionsPage', () => {
|
||||||
|
let component: DkDiplomasGerarOptionsPage;
|
||||||
|
let fixture: ComponentFixture<DkDiplomasGerarOptionsPage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ DkDiplomasGerarOptionsPage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(DkDiplomasGerarOptionsPage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
+209
@@ -0,0 +1,209 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||||
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
|
import { DespachoService } from 'src/app/Rules/despacho.service'
|
||||||
|
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||||
|
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||||
|
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||||
|
import { customTask, fullTask } from 'src/app/models/dailyworktask.model';
|
||||||
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { TaskService } from 'src/app/services/task.service'
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-dk-diplomas-gerar-options',
|
||||||
|
templateUrl: './dk-diplomas-gerar-options.page.html',
|
||||||
|
styleUrls: ['./dk-diplomas-gerar-options.page.scss'],
|
||||||
|
})
|
||||||
|
export class DkDiplomasGerarOptionsPage implements OnInit {
|
||||||
|
|
||||||
|
|
||||||
|
task: customTask
|
||||||
|
fulltask: fullTask;
|
||||||
|
serialNumber: string;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private processes: ProcessesService,
|
||||||
|
public popoverController: PopoverController,
|
||||||
|
private modalController: ModalController,
|
||||||
|
private toastService: ToastService,
|
||||||
|
public ThemeService: ThemeService,
|
||||||
|
private despachoService: DespachoService,
|
||||||
|
private navParams: NavParams,
|
||||||
|
private router: Router,
|
||||||
|
private RouteService: RouteService,
|
||||||
|
public TaskService: TaskService
|
||||||
|
) { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.task = this.navParams.get('task')
|
||||||
|
this.fulltask = this.navParams.get('fulltask')
|
||||||
|
this.serialNumber = this.navParams.get('serialNumber')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async enviarDiploma({note = '', documents = [], serialnumber}) {
|
||||||
|
|
||||||
|
let classs;
|
||||||
|
if (window.innerWidth <= 800) {
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'add-note-modal-no-height'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: AddNotePage,
|
||||||
|
componentProps: {
|
||||||
|
showAttachmentBtn: true,
|
||||||
|
actionName:false
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: true
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(async (res) => {
|
||||||
|
if (res.data) {
|
||||||
|
|
||||||
|
const DocumentToSave = res.data.documents.map((e) => {
|
||||||
|
return {
|
||||||
|
ApplicationId: e.ApplicationType,
|
||||||
|
SourceId: e.Id,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let docs = {
|
||||||
|
ProcessInstanceID: "",
|
||||||
|
Attachments: DocumentToSave,
|
||||||
|
}
|
||||||
|
|
||||||
|
let body = {
|
||||||
|
"serialNumber": serialnumber,
|
||||||
|
"action": "Enviar diploma",
|
||||||
|
"ActionTypeId": 104,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": res.data.note,
|
||||||
|
},
|
||||||
|
"AttachmentList" : docs,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise();
|
||||||
|
this.modalController.dismiss('sucess');
|
||||||
|
this.toastService._successMessage();
|
||||||
|
this.goBack()
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest();
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async sendExpedienteToPending() {
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
this.despachoService.sendExpedienteToPending(this.serialNumber).subscribe(res => {
|
||||||
|
this.goBack();
|
||||||
|
this.toastService._badRequest("Processo enviado para Pendentes")
|
||||||
|
loader.remove()
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
loader.remove()
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest("Processo não enviado para Pendentes")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async openBookMeetingModal() {
|
||||||
|
let classs;
|
||||||
|
if (window.innerWidth <= 800) {
|
||||||
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: BookMeetingModalPage,
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
fulltask:this.fulltask
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(
|
||||||
|
()=>{},
|
||||||
|
(error) => {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async openDelegarModal() {
|
||||||
|
let classs;
|
||||||
|
if (window.innerWidth <= 800) {
|
||||||
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: DelegarPage,
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(res => {
|
||||||
|
if(res) {
|
||||||
|
const data = res.data;
|
||||||
|
if(data == 'close') {
|
||||||
|
this.goBack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
goBack() {
|
||||||
|
|
||||||
|
this.popoverController.dismiss();
|
||||||
|
this.RouteService.goBack();
|
||||||
|
this.TaskService.loadDespachos();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { DKOptsExpedientePage } from './dk-opts-expediente.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: DKOptsExpedientePage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class DKOptsExpedientePageRoutingModule {}
|
||||||
@@ -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 { DKOptsExpedientePageRoutingModule } from './dk-opts-expediente-routing.module';
|
||||||
|
|
||||||
|
import { DKOptsExpedientePage } from './dk-opts-expediente.page';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
DKOptsExpedientePageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [DKOptsExpedientePage]
|
||||||
|
})
|
||||||
|
export class DKOptsExpedientePageModule {}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<ion-content class="options-container width-100 ">
|
||||||
|
<div class="width-100">
|
||||||
|
<div class="d-flex width-100">
|
||||||
|
<div class="flex-grow-1 flex-wrap d-flex">
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Enviar para o {{ environment.PR}} </button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Solicitar consideração superior</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Solicitar revisão </button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Submeter para revisão</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round">Outras opções </button>
|
||||||
|
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
|
<!-- <button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button> -->
|
||||||
|
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
|
<button *ngIf="!p.userRole(['PR']) && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button>
|
||||||
|
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="(task.Status || '') != 'Pending'" full class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Chat.access])" (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
|
||||||
|
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</ion-content>
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
@import '~src/function.scss';
|
||||||
|
|
||||||
|
.options-container{
|
||||||
|
--padding-top:20px !important;
|
||||||
|
--padding-bottom:20px !important;
|
||||||
|
--padding-start:20px !important;
|
||||||
|
--padding-end:20px !important;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.arrow-right{
|
||||||
|
display: none;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
.arrow-right-icon{
|
||||||
|
width: 37px;
|
||||||
|
float: right;
|
||||||
|
font-size: rem(35);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.buttons{
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
.solid {
|
||||||
|
display: none;
|
||||||
|
width: 90%;
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
margin: 0 auto !important;
|
||||||
|
}
|
||||||
|
.btn-ok, .btn-cancel{
|
||||||
|
//width: 50% !important;
|
||||||
|
margin-bottom: 5px !important;
|
||||||
|
margin-top: 5px !important;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 800px) {
|
||||||
|
.btn-ok, .btn-cancel, .btn-delete{
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media only screen and (min-width: 1024px) {
|
||||||
|
.arrow-right{
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
.btn-cancel{
|
||||||
|
// display: none;
|
||||||
|
width: 100% !important;
|
||||||
|
margin-bottom: 10px !important;
|
||||||
|
}
|
||||||
|
.btn-delete, .btn-ok{
|
||||||
|
width: 100% !important;
|
||||||
|
margin-bottom: 10px !important;
|
||||||
|
margin-top: 10px !important;
|
||||||
|
}
|
||||||
|
/* .solid{
|
||||||
|
display: block;
|
||||||
|
} */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.desk{
|
||||||
|
text-align: left;
|
||||||
|
background-color: white;
|
||||||
|
color: var(--profile-text-color);
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { DKOptsExpedientePage } from './dk-opts-expediente.page';
|
||||||
|
|
||||||
|
describe('DKOptsExpedientePage', () => {
|
||||||
|
let component: DKOptsExpedientePage;
|
||||||
|
let fixture: ComponentFixture<DKOptsExpedientePage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ DKOptsExpedientePage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(DKOptsExpedientePage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,464 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { NavigationExtras, Router } from '@angular/router';
|
||||||
|
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||||
|
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||||
|
import { expedienteTask } from 'src/app/models/dailyworktask.model';
|
||||||
|
import { SearchList } from 'src/app/models/search-document';
|
||||||
|
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
||||||
|
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||||
|
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||||
|
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||||
|
import { SearchDocumentPipe } from 'src/app/pipes/search-document.pipe';
|
||||||
|
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||||
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { ExpedienteService } from 'src/app/Rules/expediente.service';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
|
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
|
||||||
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
|
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
import { TaskService } from 'src/app/services/task.service';
|
||||||
|
import { DataService } from 'src/app/services/data.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-dk-opts-expediente',
|
||||||
|
templateUrl: './dk-opts-expediente.page.html',
|
||||||
|
styleUrls: ['./dk-opts-expediente.page.scss'],
|
||||||
|
})
|
||||||
|
export class DKOptsExpedientePage implements OnInit {
|
||||||
|
|
||||||
|
|
||||||
|
task: expedienteTask
|
||||||
|
fulltask: any;
|
||||||
|
profile:string;
|
||||||
|
caller:string;
|
||||||
|
|
||||||
|
showEnviarPendentes = false
|
||||||
|
searchDocumentPipe = new SearchDocumentPipe()
|
||||||
|
documents:SearchList[] = [];
|
||||||
|
|
||||||
|
SessionStore = SessionStore;
|
||||||
|
environment = environment
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private popoverController: PopoverController,
|
||||||
|
private modalController: ModalController,
|
||||||
|
private navParams: NavParams,
|
||||||
|
private processes: ProcessesService,
|
||||||
|
private toastService: ToastService,
|
||||||
|
private router: Router,
|
||||||
|
public p: PermissionService,
|
||||||
|
private attachmentsService: AttachmentsService,
|
||||||
|
private RouteService: RouteService,
|
||||||
|
private expedienteService: ExpedienteService,
|
||||||
|
public ThemeService: ThemeService,
|
||||||
|
private httpErrorHanlde: HttpErrorHandle,
|
||||||
|
public TaskService: TaskService,
|
||||||
|
private dataService: DataService,
|
||||||
|
) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openNewGroupPage() {
|
||||||
|
|
||||||
|
// this.dataService.set("newGroup", true);
|
||||||
|
// this.dataService.set("task", this.task);
|
||||||
|
// this.dataService.set("newGroupName", this.task.Folio);
|
||||||
|
// this.dataService.set("documents", this.fulltask.Documents);
|
||||||
|
// this.dataService.set("link", window.location.pathname);
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: NewGroupPage,
|
||||||
|
cssClass: 'modal modal-desktop',
|
||||||
|
componentProps: {
|
||||||
|
name: this.task.Folio,
|
||||||
|
task: this.task,
|
||||||
|
documents: this.fulltask.Documents,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(
|
||||||
|
()=>{},
|
||||||
|
(error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
close() {
|
||||||
|
if( window.innerWidth < 801) {
|
||||||
|
this.popoverController.dismiss();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.popoverController.dismiss();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
goBack() {
|
||||||
|
this.TaskService.loadExpedientes()
|
||||||
|
this.RouteService.goBack()
|
||||||
|
}
|
||||||
|
|
||||||
|
attachDocument(){
|
||||||
|
this.getDoc();
|
||||||
|
}
|
||||||
|
|
||||||
|
async getDoc() {
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: SearchPage,
|
||||||
|
cssClass: 'modal-width-100-width-background modal',
|
||||||
|
componentProps: {
|
||||||
|
type: 'AccoesPresidenciais & ArquivoDespachoElect',
|
||||||
|
showSearchInput: true,
|
||||||
|
select: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then( async (res)=>{
|
||||||
|
if(res){
|
||||||
|
const data = res.data;
|
||||||
|
this.documents.push(data.selected);
|
||||||
|
this.documents.forEach((element: any) =>{
|
||||||
|
|
||||||
|
let body = {
|
||||||
|
"InstanceID": this.task.InstanceID,
|
||||||
|
"WorkflowDisplayName": this.task.WorkflowName,
|
||||||
|
"FolderID": this.task.FolderId,
|
||||||
|
"DispatchNumber": this.task.DispatchNumber,
|
||||||
|
"AttachmentsProcessLastInstanceID": this.task.AttachmentsProcessLastInstanceID,
|
||||||
|
"Attachments": []
|
||||||
|
}
|
||||||
|
|
||||||
|
const Attachments = this.searchDocumentPipe.transformToAttachment(element)
|
||||||
|
body.Attachments = Attachments;
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
this.attachmentsService.AddAttachment(body).subscribe((res)=> {
|
||||||
|
this.toastService._successMessage()
|
||||||
|
}, (error) => {
|
||||||
|
this.httpErrorHanlde.httpStatusHandle(error)
|
||||||
|
},()=> {
|
||||||
|
loader.remove()
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
this.popoverController.dismiss()
|
||||||
|
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openAddNoteModal(actionName:string) {
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth < 801) {
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'add-note-modal'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: AddNotePage,
|
||||||
|
componentProps:{
|
||||||
|
showAttachmentBtn: false,
|
||||||
|
actionName:actionName
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
//backdropDismiss: true
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then( async (res) => {
|
||||||
|
|
||||||
|
if(res.data){
|
||||||
|
const DocumentToSave = res.data.documents.map((e) => {
|
||||||
|
return {
|
||||||
|
ApplicationId: e.ApplicationType,
|
||||||
|
SourceId: e.Id,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let docs = {
|
||||||
|
ProcessInstanceID: "",
|
||||||
|
Attachments: DocumentToSave,
|
||||||
|
}
|
||||||
|
|
||||||
|
if(actionName == 'Aprovar') {
|
||||||
|
await this.approve(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Revisão') {
|
||||||
|
await this.sendToReview(res.data.note, docs);
|
||||||
|
}
|
||||||
|
this.popoverController.dismiss();
|
||||||
|
this.goBack();
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async sendToReview(note:string, documents:any) {
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.task.SerialNumber,
|
||||||
|
"action": "Retificar",
|
||||||
|
"ActionTypeId": 99999877,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.TaskService.loadExpedientes()
|
||||||
|
this.close();
|
||||||
|
this.toastService._successMessage()
|
||||||
|
} catch(error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sendExpedienteToPending() {
|
||||||
|
this.close();
|
||||||
|
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
|
||||||
|
this.TaskService.loadExpedientes()
|
||||||
|
this.goBack();
|
||||||
|
},(error) => {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest('Processo não encontrado')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async approve(note:string, documents:any){
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.task.SerialNumber,
|
||||||
|
"action": "Aprovar",
|
||||||
|
"ActionTypeId": 100000004 ,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise();
|
||||||
|
this.TaskService.loadExpedientes()
|
||||||
|
this.close();
|
||||||
|
this.httpErrorHanlde.httpsSucessMessagge('Avaliação Superiror')
|
||||||
|
} catch(error) {
|
||||||
|
this.httpErrorHanlde.httpStatusHandle(error)
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openBookMeetingModal() {
|
||||||
|
this.close();
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: BookMeetingModalPage,
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
fulltask: this.fulltask
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(
|
||||||
|
()=>{},
|
||||||
|
(error) => {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async openExpedientActionsModal(taskAction: any, task: any) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
this.close();
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: ExpedientTaskModalPage,
|
||||||
|
componentProps: {
|
||||||
|
taskAction: taskAction,
|
||||||
|
task: task,
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(async res=>{
|
||||||
|
|
||||||
|
let body = res['data'];
|
||||||
|
if(res['data']){
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise();
|
||||||
|
this.TaskService.loadExpedientes()
|
||||||
|
this.goBack();
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest('Processo não descartado')
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async distartExpedientModal(body:any){
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: DiscartExpedientModalPage,
|
||||||
|
componentProps: {
|
||||||
|
},
|
||||||
|
cssClass: 'discart-expedient-modal',
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
modal.onDidDismiss().then( async (res) => {
|
||||||
|
|
||||||
|
|
||||||
|
if(body == 'descartar') {
|
||||||
|
if(res['data']== 'Yes') {
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.expedienteService.discard({SerialNumber: this.task.SerialNumber}).toPromise()
|
||||||
|
this.TaskService.loadExpedientes()
|
||||||
|
this.toastService._successMessage('Processo descartado');
|
||||||
|
this.goBack();
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest('Processo não descartado')
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(res['data'] == 'No'){
|
||||||
|
//Do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(res['data']== 'Yes') {
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise();
|
||||||
|
this.toastService._successMessage('Processo descartado');
|
||||||
|
this.TaskService.loadExpedientes()
|
||||||
|
this.goBack();
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest('Processo não descartado')
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
this.goBack();
|
||||||
|
}
|
||||||
|
else if(res['data'] == 'No'){
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
|
||||||
|
this.TaskService.loadExpedientes()
|
||||||
|
this.toastService._successMessage();
|
||||||
|
this.goBack();
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { DKRequestOptionsPage } from './dk-request-options.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: DKRequestOptionsPage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class DKRequestOptionsPageRoutingModule {}
|
||||||
@@ -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 { DKRequestOptionsPageRoutingModule } from './dk-request-options-routing.module';
|
||||||
|
|
||||||
|
import { DKRequestOptionsPage } from './dk-request-options.page';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
DKRequestOptionsPageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [DKRequestOptionsPage]
|
||||||
|
})
|
||||||
|
export class DKRequestOptionsPageModule {}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
<div class="wrapper">
|
||||||
|
<div *ngIf="task.WorkflowName == 'Pedido de Deferimento'">
|
||||||
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Deferimento'">
|
||||||
|
<button (click)="openAddNoteModal('Arquivar')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||||
|
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
|
<button *ngIf="!p.userRole(['PR']) && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
|
</div>
|
||||||
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Reapreciar Deferimento'">
|
||||||
|
<button (click)="openAddNoteModal('Arquivar')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||||
|
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
|
<button *ngIf="!p.userRole(['PR']) && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
|
</div>
|
||||||
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Concluir Deferimento'">
|
||||||
|
<button (click)="openAddNoteModal('Arquivar')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||||
|
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
|
||||||
|
<div class="solid"></div>
|
||||||
|
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
|
<!-- <button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> -->
|
||||||
|
<button (click)="openAddNoteModal('Solicitar Reapreciação')" class="btn-cancel" shape="round" >Solicitar Reapreciação</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="task.WorkflowName == 'Pedido de Parecer' || task.WorkflowName == 'Pedido de Parecer do Presidente' ">
|
||||||
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Parecer'">
|
||||||
|
<button *ngIf="checkStringInArray('Registar')" (click)="openDarParecer(task)" class="btn-cancel" shape="round" >Dar o meu Parecer</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<button *ngIf="task.WorkflowName == 'Pedido de Parecer do Presidente' && checkStringInArray('Reencaminhar')" (click)="openForwardModal(task)" class="btn-cancel" shape="round" >Reencaminhar</button>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" *ngIf="task.WorkflowName == 'Pedido de Parecer do Presidente'">Iniciar Conversa</button>
|
||||||
|
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
|
</div>
|
||||||
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Concluir Parecer'">
|
||||||
|
<button (click)="openAddNoteModal('Arquivar')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||||
|
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
|
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
|
<button *ngIf="!p.userRole(['PR']) && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
@import '~src/function.scss';
|
||||||
|
|
||||||
|
.wrapper{
|
||||||
|
width: 100% !important;
|
||||||
|
padding-top:20px !important;
|
||||||
|
padding-bottom:20px !important;
|
||||||
|
}
|
||||||
|
.arrow-right{
|
||||||
|
display: none;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
.arrow-right-icon{
|
||||||
|
width: 37px;
|
||||||
|
float: right;
|
||||||
|
font-size: rem(35);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.buttons{
|
||||||
|
width: 100% !important;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-around;
|
||||||
|
margin: 0 auto !important;
|
||||||
|
}
|
||||||
|
.solid {
|
||||||
|
display: none;
|
||||||
|
width: 90%;
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
margin: 0 auto !important;
|
||||||
|
}
|
||||||
|
.btn-ok, .btn-cancel{
|
||||||
|
//width: 50% !important;
|
||||||
|
margin-bottom: 5px !important;
|
||||||
|
margin-top: 5px !important;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 800px) {
|
||||||
|
.container{
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
.btn-ok, .btn-cancel, .btn-delete{
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media only screen and (min-width: 1024px) {
|
||||||
|
.container{
|
||||||
|
width: 100% !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
.arrow-right{
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
.btn-cancel{
|
||||||
|
width: 100% !important;
|
||||||
|
margin-bottom: 10px !important;
|
||||||
|
}
|
||||||
|
.btn-delete, .btn-ok{
|
||||||
|
width: 100% !important;
|
||||||
|
margin-bottom: 10px !important;
|
||||||
|
margin-top: 10px !important;
|
||||||
|
}
|
||||||
|
/* .solid{
|
||||||
|
display: block;
|
||||||
|
} */
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { DKRequestOptionsPage } from './dk-request-options.page';
|
||||||
|
|
||||||
|
describe('DKRequestOptionsPage', () => {
|
||||||
|
let component: DKRequestOptionsPage;
|
||||||
|
let fixture: ComponentFixture<DKRequestOptionsPage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ DKRequestOptionsPage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(DKRequestOptionsPage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,400 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||||
|
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||||
|
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||||
|
import { DarParecerPage } from 'src/app/modals/dar-parecer/dar-parecer.page';
|
||||||
|
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||||
|
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||||
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { PedidoService } from 'src/app/Rules/pedido.service';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
|
||||||
|
import { ForwardPage } from 'src/app/modals/forward/forward.page';
|
||||||
|
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||||
|
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-dk-request-options',
|
||||||
|
templateUrl: './dk-request-options.page.html',
|
||||||
|
styleUrls: ['./dk-request-options.page.scss'],
|
||||||
|
})
|
||||||
|
export class DKRequestOptionsPage implements OnInit {
|
||||||
|
|
||||||
|
|
||||||
|
task:any;
|
||||||
|
fulltask: any;
|
||||||
|
profile:string;
|
||||||
|
serialNumber : string;
|
||||||
|
showEnviarPendentes = false;
|
||||||
|
taskActions = [];
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private popoverController: PopoverController,
|
||||||
|
private modalController: ModalController,
|
||||||
|
private navParams: NavParams,
|
||||||
|
private processes: ProcessesService,
|
||||||
|
private activatedRoute: ActivatedRoute,
|
||||||
|
private toastService: ToastService,
|
||||||
|
public p: PermissionService,
|
||||||
|
private pedidoService: PedidoService,
|
||||||
|
private httpErrorHandle: HttpErrorHandle
|
||||||
|
) {
|
||||||
|
this.task = this.navParams.get('task');
|
||||||
|
this.fulltask = this.navParams.get('fulltask');
|
||||||
|
this.serialNumber = this.navParams.get('serialNumber');
|
||||||
|
this.taskActions = this.navParams.get('actions');
|
||||||
|
|
||||||
|
this.activatedRoute.queryParams.subscribe(params => {
|
||||||
|
if(params["serialNumber"]) {
|
||||||
|
this.serialNumber = params["serialNumber"];
|
||||||
|
//
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if(this.task.serialNumber) {
|
||||||
|
this.serialNumber = this.task.serialNumber
|
||||||
|
} else if (this.task.SerialNumber) {
|
||||||
|
this.serialNumber = this.task.SerialNumber
|
||||||
|
}
|
||||||
|
|
||||||
|
this.showEnviarPendentes = this.navParams.get('showEnviarPendentes');
|
||||||
|
|
||||||
|
if(!this.showEnviarPendentes) this.showEnviarPendentes = false
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
|
||||||
|
this.profile = "mdgpr";
|
||||||
|
|
||||||
|
window.onresize = (event) => {
|
||||||
|
if( window.innerWidth >= 800){
|
||||||
|
this.popoverController.dismiss();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
checkStringInArray(str) {
|
||||||
|
return this.taskActions.includes(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
close() {
|
||||||
|
this.popoverController.dismiss('close')
|
||||||
|
}
|
||||||
|
cancel(){
|
||||||
|
this.popoverController.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
sendExpedienteToPending() {
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
|
||||||
|
|
||||||
|
this.httpErrorHandle.httpsSucessMessagge('Enviar para Pendentes')
|
||||||
|
this.close();
|
||||||
|
loader.remove()
|
||||||
|
}, (error)=> {
|
||||||
|
loader.remove()
|
||||||
|
|
||||||
|
this.httpErrorHandle.httpStatusHandle(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openBookMeetingModal(task: any) {
|
||||||
|
this.popoverController.dismiss();
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800) {
|
||||||
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: BookMeetingModalPage,
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
fulltask: this.fulltask
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(
|
||||||
|
()=>{}
|
||||||
|
, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async openNewGroupPage(){
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: NewGroupPage,
|
||||||
|
cssClass: 'modal modal-desktop',
|
||||||
|
componentProps: {
|
||||||
|
name: this.task.Folio,
|
||||||
|
task: this.task,
|
||||||
|
documents: this.fulltask.Documents,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then( () => {
|
||||||
|
this.popoverController.dismiss('close');
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async newGroup(){
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: NewGroupPage,
|
||||||
|
cssClass: 'modal modal-desktop',
|
||||||
|
componentProps: {
|
||||||
|
name: this.task.Folio,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
await modal.present();
|
||||||
|
modal.onDidDismiss().then(
|
||||||
|
()=>{},
|
||||||
|
(error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
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'
|
||||||
|
}
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: CreateProcessPage,
|
||||||
|
componentProps: {
|
||||||
|
taskAction: taskAction,
|
||||||
|
task: task,
|
||||||
|
profile: this.profile,
|
||||||
|
fulltask: this.fulltask
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(res=> {
|
||||||
|
|
||||||
|
if(res['data']=='openDiscart') {
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.popoverController.dismiss('close')
|
||||||
|
}
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async repreciar(note:string, documents:any) {
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.serialNumber,
|
||||||
|
"action": "Reapreciação",
|
||||||
|
"ActionTypeId": 100000009,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.close();
|
||||||
|
this.httpErrorHandle.httpsSucessMessagge('Solicitar Reapreciação')
|
||||||
|
} catch (error) {
|
||||||
|
this.httpErrorHandle.httpStatusHandle(error);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openAddNoteModal(actionName:string) {
|
||||||
|
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: AddNotePage,
|
||||||
|
componentProps:{
|
||||||
|
showAttachmentBtn: true,
|
||||||
|
actionName:actionName
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: true
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(async (res) => {
|
||||||
|
|
||||||
|
|
||||||
|
const DocumentToSave = res.data.documents.map((e) => {
|
||||||
|
return {
|
||||||
|
ApplicationId: e.ApplicationType,
|
||||||
|
SourceId: e.Id,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let docs = {
|
||||||
|
ProcessInstanceID: "",
|
||||||
|
Attachments: DocumentToSave,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(res.data) {
|
||||||
|
if(actionName == 'Solicitar Reapreciação') {
|
||||||
|
|
||||||
|
await this.repreciar(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Arquivar') {
|
||||||
|
await this.arquivar(res.data.note, docs);
|
||||||
|
this.popoverController.dismiss('close')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async arquivar(note:string, documents:any) {
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.pedidoService.arquivar({serialNumber: this.serialNumber,
|
||||||
|
documents,
|
||||||
|
note
|
||||||
|
}).toPromise()
|
||||||
|
|
||||||
|
this.httpErrorHandle.httpsSucessMessagge('Arquivar')
|
||||||
|
} catch (error) {
|
||||||
|
this.httpErrorHandle.httpStatusHandle(error)
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openDarParecer(task: any) {
|
||||||
|
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: DarParecerPage,
|
||||||
|
componentProps: {
|
||||||
|
serialNumber: this.task.SerialNumber,
|
||||||
|
ProcessInstanceID: this.task.ProcessInstanceID,
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then( () => {
|
||||||
|
this.popoverController.dismiss('close');
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openForwardModal(tasK: any) {
|
||||||
|
let classs;
|
||||||
|
if (window.innerWidth <= 800) {
|
||||||
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: ForwardPage,
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(() => {
|
||||||
|
this.popoverController.dismiss('close');
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async openDelegarModal(task: any) {
|
||||||
|
|
||||||
|
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: DelegarPage,
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then( async (res)=> {
|
||||||
|
|
||||||
|
if(res['data']=='close') {
|
||||||
|
this.popoverController.dismiss('close');
|
||||||
|
}
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { OptsExpedientePage } from './opts-expediente.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: OptsExpedientePage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class OptsExpedientePageRoutingModule {}
|
||||||
@@ -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 { OptsExpedientePageRoutingModule } from './opts-expediente-routing.module';
|
||||||
|
|
||||||
|
import { OptsExpedientePage } from './opts-expediente.page';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
OptsExpedientePageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [OptsExpedientePage]
|
||||||
|
})
|
||||||
|
export class OptsExpedientePageModule {}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<ion-content class="options-container width-100 ">
|
||||||
|
<div class="width-100">
|
||||||
|
<div class="d-flex width-100">
|
||||||
|
<div class="flex-grow-1 flex-wrap d-flex">
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Enviar para o {{ environment.PR}} </button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Solicitar consideração superior</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Solicitar revisão </button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Submeter para revisão</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round">Outras opções </button>
|
||||||
|
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
|
<!-- <button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button> -->
|
||||||
|
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
|
<button *ngIf="!p.userRole(['PR']) && !p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button>
|
||||||
|
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||||
|
<button (click)="sendExpedienteToPending()" *ngIf="(task.Status || '') != 'Pending'" full class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
<button *ngIf="p.userPermission([p.permissionList.Chat.access])" (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
|
||||||
|
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</ion-content>
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
@import '~src/function.scss';
|
||||||
|
|
||||||
|
.options-container{
|
||||||
|
--padding-top:20px !important;
|
||||||
|
--padding-bottom:20px !important;
|
||||||
|
--padding-start:20px !important;
|
||||||
|
--padding-end:20px !important;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.arrow-right{
|
||||||
|
display: none;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
.arrow-right-icon{
|
||||||
|
width: 37px;
|
||||||
|
float: right;
|
||||||
|
font-size: rem(35);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.buttons{
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
.solid {
|
||||||
|
display: none;
|
||||||
|
width: 90%;
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
margin: 0 auto !important;
|
||||||
|
}
|
||||||
|
.btn-ok, .btn-cancel{
|
||||||
|
//width: 50% !important;
|
||||||
|
margin-bottom: 5px !important;
|
||||||
|
margin-top: 5px !important;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 800px) {
|
||||||
|
.btn-ok, .btn-cancel, .btn-delete{
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media only screen and (min-width: 1024px) {
|
||||||
|
.arrow-right{
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
.btn-cancel{
|
||||||
|
// display: none;
|
||||||
|
width: 100% !important;
|
||||||
|
margin-bottom: 10px !important;
|
||||||
|
}
|
||||||
|
.btn-delete, .btn-ok{
|
||||||
|
width: 100% !important;
|
||||||
|
margin-bottom: 10px !important;
|
||||||
|
margin-top: 10px !important;
|
||||||
|
}
|
||||||
|
/* .solid{
|
||||||
|
display: block;
|
||||||
|
} */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.desk{
|
||||||
|
text-align: left;
|
||||||
|
background-color: white;
|
||||||
|
color: var(--profile-text-color);
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { OptsExpedientePage } from './opts-expediente.page';
|
||||||
|
|
||||||
|
describe('OptsExpedientePage', () => {
|
||||||
|
let component: OptsExpedientePage;
|
||||||
|
let fixture: ComponentFixture<OptsExpedientePage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ OptsExpedientePage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(OptsExpedientePage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,462 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { NavigationExtras, Router } from '@angular/router';
|
||||||
|
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||||
|
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||||
|
import { expedienteTask } from 'src/app/models/dailyworktask.model';
|
||||||
|
import { SearchList } from 'src/app/models/search-document';
|
||||||
|
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
||||||
|
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||||
|
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||||
|
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||||
|
import { SearchDocumentPipe } from 'src/app/pipes/search-document.pipe';
|
||||||
|
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||||
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { ExpedienteService } from 'src/app/Rules/expediente.service';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
|
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
|
||||||
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
|
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
import { TaskService } from 'src/app/services/task.service';
|
||||||
|
import { DataService } from 'src/app/services/data.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-opts-expediente',
|
||||||
|
templateUrl: './opts-expediente.page.html',
|
||||||
|
styleUrls: ['./opts-expediente.page.scss'],
|
||||||
|
})
|
||||||
|
export class OptsExpedientePage implements OnInit {
|
||||||
|
|
||||||
|
task: expedienteTask
|
||||||
|
fulltask: any;
|
||||||
|
profile:string;
|
||||||
|
caller:string;
|
||||||
|
|
||||||
|
showEnviarPendentes = false
|
||||||
|
searchDocumentPipe = new SearchDocumentPipe()
|
||||||
|
documents:SearchList[] = [];
|
||||||
|
|
||||||
|
SessionStore = SessionStore;
|
||||||
|
environment = environment
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private popoverController: PopoverController,
|
||||||
|
private modalController: ModalController,
|
||||||
|
private navParams: NavParams,
|
||||||
|
private processes: ProcessesService,
|
||||||
|
private toastService: ToastService,
|
||||||
|
private router: Router,
|
||||||
|
public p: PermissionService,
|
||||||
|
private attachmentsService: AttachmentsService,
|
||||||
|
private RouteService: RouteService,
|
||||||
|
private expedienteService: ExpedienteService,
|
||||||
|
public ThemeService: ThemeService,
|
||||||
|
private httpErrorHanlde: HttpErrorHandle,
|
||||||
|
public TaskService: TaskService,
|
||||||
|
private dataService: DataService,
|
||||||
|
) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openNewGroupPage() {
|
||||||
|
|
||||||
|
// this.dataService.set("newGroup", true);
|
||||||
|
// this.dataService.set("task", this.task);
|
||||||
|
// this.dataService.set("newGroupName", this.task.Folio);
|
||||||
|
// this.dataService.set("documents", this.fulltask.Documents);
|
||||||
|
// this.dataService.set("link", window.location.pathname);
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: NewGroupPage,
|
||||||
|
cssClass: 'modal modal-desktop',
|
||||||
|
componentProps: {
|
||||||
|
name: this.task.Folio,
|
||||||
|
task: this.task,
|
||||||
|
documents: this.fulltask.Documents,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(
|
||||||
|
()=>{},
|
||||||
|
(error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
close() {
|
||||||
|
if( window.innerWidth < 801) {
|
||||||
|
this.popoverController.dismiss();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.popoverController.dismiss();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
goBack() {
|
||||||
|
this.TaskService.loadExpedientes()
|
||||||
|
this.RouteService.goBack()
|
||||||
|
}
|
||||||
|
|
||||||
|
attachDocument(){
|
||||||
|
this.getDoc();
|
||||||
|
}
|
||||||
|
|
||||||
|
async getDoc() {
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: SearchPage,
|
||||||
|
cssClass: 'modal-width-100-width-background modal',
|
||||||
|
componentProps: {
|
||||||
|
type: 'AccoesPresidenciais & ArquivoDespachoElect',
|
||||||
|
showSearchInput: true,
|
||||||
|
select: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then( async (res)=>{
|
||||||
|
if(res){
|
||||||
|
const data = res.data;
|
||||||
|
this.documents.push(data.selected);
|
||||||
|
this.documents.forEach((element: any) =>{
|
||||||
|
|
||||||
|
let body = {
|
||||||
|
"InstanceID": this.task.InstanceID,
|
||||||
|
"WorkflowDisplayName": this.task.WorkflowName,
|
||||||
|
"FolderID": this.task.FolderId,
|
||||||
|
"DispatchNumber": this.task.DispatchNumber,
|
||||||
|
"AttachmentsProcessLastInstanceID": this.task.AttachmentsProcessLastInstanceID,
|
||||||
|
"Attachments": []
|
||||||
|
}
|
||||||
|
|
||||||
|
const Attachments = this.searchDocumentPipe.transformToAttachment(element)
|
||||||
|
body.Attachments = Attachments;
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
this.attachmentsService.AddAttachment(body).subscribe((res)=> {
|
||||||
|
this.toastService._successMessage()
|
||||||
|
}, (error) => {
|
||||||
|
this.httpErrorHanlde.httpStatusHandle(error)
|
||||||
|
},()=> {
|
||||||
|
loader.remove()
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
this.popoverController.dismiss()
|
||||||
|
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openAddNoteModal(actionName:string) {
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth < 801) {
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'add-note-modal'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: AddNotePage,
|
||||||
|
componentProps:{
|
||||||
|
showAttachmentBtn: false,
|
||||||
|
actionName:actionName
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
//backdropDismiss: true
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then( async (res) => {
|
||||||
|
|
||||||
|
if(res.data){
|
||||||
|
const DocumentToSave = res.data.documents.map((e) => {
|
||||||
|
return {
|
||||||
|
ApplicationId: e.ApplicationType,
|
||||||
|
SourceId: e.Id,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let docs = {
|
||||||
|
ProcessInstanceID: "",
|
||||||
|
Attachments: DocumentToSave,
|
||||||
|
}
|
||||||
|
|
||||||
|
if(actionName == 'Aprovar') {
|
||||||
|
await this.approve(res.data.note, docs);
|
||||||
|
}
|
||||||
|
else if(actionName == 'Revisão') {
|
||||||
|
await this.sendToReview(res.data.note, docs);
|
||||||
|
}
|
||||||
|
this.popoverController.dismiss();
|
||||||
|
this.goBack();
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async sendToReview(note:string, documents:any) {
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.task.SerialNumber,
|
||||||
|
"action": "Retificar",
|
||||||
|
"ActionTypeId": 99999877,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise()
|
||||||
|
this.TaskService.loadExpedientes()
|
||||||
|
this.close();
|
||||||
|
this.toastService._successMessage()
|
||||||
|
} catch(error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sendExpedienteToPending() {
|
||||||
|
this.close();
|
||||||
|
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
|
||||||
|
this.TaskService.loadExpedientes()
|
||||||
|
this.goBack();
|
||||||
|
},(error) => {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest('Processo não encontrado')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async approve(note:string, documents:any){
|
||||||
|
let body = {
|
||||||
|
"serialNumber": this.task.SerialNumber,
|
||||||
|
"action": "Aprovar",
|
||||||
|
"ActionTypeId": 100000004 ,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise();
|
||||||
|
this.TaskService.loadExpedientes()
|
||||||
|
this.close();
|
||||||
|
this.httpErrorHanlde.httpsSucessMessagge('Avaliação Superiror')
|
||||||
|
} catch(error) {
|
||||||
|
this.httpErrorHanlde.httpStatusHandle(error)
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openBookMeetingModal() {
|
||||||
|
this.close();
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: BookMeetingModalPage,
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
fulltask: this.fulltask
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(
|
||||||
|
()=>{},
|
||||||
|
(error) => {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async openExpedientActionsModal(taskAction: any, task: any) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
this.close();
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth <= 800){
|
||||||
|
classs = 'modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: ExpedientTaskModalPage,
|
||||||
|
componentProps: {
|
||||||
|
taskAction: taskAction,
|
||||||
|
task: task,
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss().then(async res=>{
|
||||||
|
|
||||||
|
let body = res['data'];
|
||||||
|
if(res['data']){
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise();
|
||||||
|
this.TaskService.loadExpedientes()
|
||||||
|
this.goBack();
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest('Processo não descartado')
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
async distartExpedientModal(body:any){
|
||||||
|
|
||||||
|
this.modalController.dismiss()
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: DiscartExpedientModalPage,
|
||||||
|
componentProps: {
|
||||||
|
},
|
||||||
|
cssClass: 'discart-expedient-modal',
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
modal.onDidDismiss().then( async (res) => {
|
||||||
|
|
||||||
|
|
||||||
|
if(body == 'descartar') {
|
||||||
|
if(res['data']== 'Yes') {
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.expedienteService.discard({SerialNumber: this.task.SerialNumber}).toPromise()
|
||||||
|
this.TaskService.loadExpedientes()
|
||||||
|
this.toastService._successMessage('Processo descartado');
|
||||||
|
this.goBack();
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest('Processo não descartado')
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(res['data'] == 'No'){
|
||||||
|
//Do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(res['data']== 'Yes') {
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise();
|
||||||
|
this.toastService._successMessage('Processo descartado');
|
||||||
|
this.TaskService.loadExpedientes()
|
||||||
|
this.goBack();
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest('Processo não descartado')
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
this.goBack();
|
||||||
|
}
|
||||||
|
else if(res['data'] == 'No'){
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
|
||||||
|
this.TaskService.loadExpedientes()
|
||||||
|
this.toastService._successMessage();
|
||||||
|
this.goBack();
|
||||||
|
} catch (error) {
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user