This commit is contained in:
Peter Maquiran
2021-08-10 13:22:33 +01:00
parent a6218e39c7
commit 05e3e1a95c
16 changed files with 376 additions and 106 deletions
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { SearchedDocumentOptionsPage } from './searched-document-options.page';
const routes: Routes = [
{
path: '',
component: SearchedDocumentOptionsPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class SearchedDocumentOptionsPageRoutingModule {}
@@ -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 { SearchedDocumentOptionsPageRoutingModule } from './searched-document-options-routing.module';
import { SearchedDocumentOptionsPage } from './searched-document-options.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
SearchedDocumentOptionsPageRoutingModule
],
declarations: [SearchedDocumentOptionsPage]
})
export class SearchedDocumentOptionsPageModule {}
@@ -0,0 +1,10 @@
<ion-content class="container width-100 ">
<div class="buttons">
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0')" class="btn-ok" shape="round" >Marcar para Despacho</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('0')" class="btn-ok" shape="round" >Efetuar Despacho</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2')" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
</div>
</ion-content>
@@ -0,0 +1,63 @@
.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: 35px;
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;
}
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { SearchedDocumentOptionsPage } from './searched-document-options.page';
describe('SearchedDocumentOptionsPage', () => {
let component: SearchedDocumentOptionsPage;
let fixture: ComponentFixture<SearchedDocumentOptionsPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ SearchedDocumentOptionsPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(SearchedDocumentOptionsPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,137 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting/document-set-up-meeting.page';
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
import { FromSearchDocument, SearchFolder } from 'src/app/models/search-document';
import { PermissionService } from 'src/app/OtherService/permission.service';
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
import { ProcessesService } from 'src/app/services/processes.service';
import { ToastService } from 'src/app/services/toast.service';
@Component({
selector: 'app-searched-document-options',
templateUrl: './searched-document-options.page.html',
styleUrls: ['./searched-document-options.page.scss'],
})
export class SearchedDocumentOptionsPage implements OnInit {
task: any
LoadedDocument: any
constructor(
private popoverController: PopoverController,
private modalController: ModalController,
private navParams: NavParams,
private processes: ProcessesService,
private toastService: ToastService,
private router: Router,
private activatedRoute: ActivatedRoute,
public p: PermissionService
) { }
ngOnInit() {
this.task = this.navParams.get('task');
this.LoadedDocument = this.navParams.get('LoadedDocument')
}
close() {
this.modalController.dismiss();
let document: FromSearchDocument = this.LoadedDocument
let folder: SearchFolder = this.LoadedDocument
let task;
if(folder.ApplicationID == 361) {
task = {
serialNumber: folder.DispatchNumber,
taskStartDate: folder.DateDispatch,
isEvent: true,
Folio: folder.Assunto,
FsId: folder.ApplicationID,
workflowInstanceDataFields: {
FsId: folder.ApplicationID,
FolderID: null,
DocId: folder.DispatchNumber,
Subject: folder.Assunto
},
}
} else if (document.ApplicationID == 8 || document.ApplicationId == 8) {
task = {
taskStartDate: document.DocDate,
isEvent: true,
Folio: document.Assunto,
FsId: document.ApplicationID,
workflowInstanceDataFields: {
FsId: document.ApplicationID || document.ApplicationId,
FolderID: null,
DocId: document.DocID || document.DocId,
Subject: document.Assunto
}
}
}
}
goBack() {
this.modalController.dismiss();
}
async openBookMeetingModal() {
const task: ExpedientTaskModalPageNavParamsTask = this.task
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: DocumentSetUpMeetingPage,
componentProps: {
task: task,
document: this.LoadedDocument
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then( async(res)=>{
this.modalController.dismiss();
});
}
async openExpedientActionsModal( taskAction: any) {
const task: ExpedientTaskModalPageNavParamsTask = this.task
let classs;
if( window.innerWidth <= 800) {
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: ExpedientTaskModalPage,
componentProps: {
taskAction: taskAction,
task: task,
},
cssClass: classs,
});
await modal.present();
modal.onDidDismiss().then( async(res)=>{
this.modalController.dismiss();
});
}
async distartExpedientModal(body:any){}
}