This commit is contained in:
Peter Maquiran
2022-06-24 15:26:15 +01:00
parent 4fd5685899
commit d0a45fa490
9 changed files with 579 additions and 269 deletions
+6 -9
View File
@@ -1,7 +1,5 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
import { ChatPage } from './pages/chat/chat.page';
import { MessagesPage } from './pages/chat/messages/messages.page';
const routes = [ const routes = [
{ {
@@ -235,21 +233,20 @@ const routes = [
{ {
path: 'previewer', path: 'previewer',
loadChildren: () => import('./modals/previewer/previewer.module').then( m => m.PreviewerPageModule) loadChildren: () => import('./modals/previewer/previewer.module').then( m => m.PreviewerPageModule)
}, },
{
path: 'set-room-owner', path: 'set-room-owner',
loadChildren: () => import('./modals/set-room-owner/set-room-owner.module').then( m => m.SetRoomOwnerPageModule) loadChildren: () => import('./modals/set-room-owner/set-room-owner.module').then( m => m.SetRoomOwnerPageModule)
}, },
{ {
path: 'diplomas-gerar', path: 'diplomas-gerar',
loadChildren: () => import('./shared/gabinete-digital/diplomas-gerar/diplomas-gerar.module').then( m => m.DiplomasGerarPageModule) loadChildren: () => import('./shared/gabinete-digital/diplomas-gerar/diplomas-gerar.module').then( m => m.DiplomasGerarPageModule)
},
{
path: 'diplomas-gerar-options',
loadChildren: () => import('./shared/popover/diplomas-gerar-options/diplomas-gerar-options.module').then( m => m.DiplomasGerarOptionsPageModule)
} }
/* /*
path: 'chat', path: 'chat',
component: ChatPage component: ChatPage
@@ -335,11 +335,9 @@ export class NewEventPage implements OnInit {
}); });
this.toastService._successMessage() this.toastService._successMessage()
this.modalController.dismiss(this.postEvent); this.modalController.dismiss(this.postEvent);
} catch (error) { } catch (error) {
this.toastService._badRequest() this.toastService._badRequest()
} finally { } finally {
@@ -437,13 +435,13 @@ export class NewEventPage implements OnInit {
this.openAttendees(); this.openAttendees();
} }
addParticipantsCC(){ addParticipantsCC() {
this.adding = 'CC' this.adding = 'CC'
this.openAttendees(); this.openAttendees();
} }
async getDoc(){ async getDoc() {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: SearchPage, component: SearchPage,
cssClass: 'modal-width-100-width-background modal', cssClass: 'modal-width-100-width-background modal',
@@ -13,6 +13,7 @@ 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';
@Component({ @Component({
selector: 'app-diplomas-gerar', selector: 'app-diplomas-gerar',
@@ -66,7 +67,7 @@ export class DiplomasGerarPage implements OnInit {
async openOptions(taskAction?: any) { async openOptions(taskAction?: any) {
const popover = await this.popoverController.create({ const popover = await this.popoverController.create({
component: DeplomaOptionsPage, component: DiplomasGerarOptionsPage,
cssClass: 'exp-options', cssClass: 'exp-options',
componentProps: { componentProps: {
serialNumber: this.task.SerialNumber, serialNumber: this.task.SerialNumber,
@@ -179,7 +180,7 @@ export class DiplomasGerarPage implements OnInit {
backdropDismiss: false backdropDismiss: false
}); });
await modal.present(); await modal.present();
modal.onDidDismiss(); modal.onDidDismiss()
} }
async sendExpedienteToPending() { async sendExpedienteToPending() {
@@ -323,6 +324,7 @@ export class DiplomasGerarPage implements OnInit {
toDateString(e) { toDateString(e) {
return new Date(e).toDateString() return new Date(e).toDateString()
} }
close() { close() {
this.modalController.dismiss(); this.modalController.dismiss();
} }
@@ -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 {}
@@ -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 {}
@@ -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>
@@ -0,0 +1,65 @@
.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: 35px;
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;
} */
}
@@ -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,175 @@
import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { ProcessesService } from 'src/app/services/processes.service';
import { ActivatedRoute, Router } from '@angular/router';
import { ToastService } from 'src/app/services/toast.service';
import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.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';
@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 activatedRoute: ActivatedRoute,
private toastService: ToastService,
private RouteService: RouteService,
public ThemeService: ThemeService,
private despachoService: DespachoService,
private navParams: NavParams,
private router: Router,
) { }
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'
}
const modal = await this.modalController.create({
component: AddNotePage,
componentProps: {
showAttachmentBtn: true,
},
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,
}
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) {
this.toastService._badRequest();
} finally {
loader.remove()
}
}
});
}
async sendExpedienteToPending() {
this.despachoService.sendExpedienteToPending(this.serialNumber).subscribe(res => {
this.goBack();
this.toastService.successMessage()
},
error => {
this.toastService.badRequest("Processo não enviado para despacho")
});
}
async openBookMeetingModal() {
let classs;
if (window.innerWidth <= 800) {
classs = 'book-meeting-modal modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: BookMeetingModalPage,
componentProps: {
task: this.task,
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
}
async openDelegarModal() {
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
});
await modal.present();
modal.onDidDismiss().then(res => {
if(res) {
const data = res.data;
if(data == 'close') {
this.goBack();
}
}
});
}
goBack() {
this.popoverController.dismiss();
this.router.navigate(['/home/gabinete-digital/diplomas-gerar']);
}
}