mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
working on delegar
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { DelegarPage } from './delegar.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: DelegarPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class DelegarPageRoutingModule {}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { DelegarPageRoutingModule } from './delegar-routing.module';
|
||||
|
||||
import { DelegarPage } from './delegar.page';
|
||||
import { AttendeeModalPage } from 'src/app/shared/event/attendee-modal/attendee-modal.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
DelegarPageRoutingModule
|
||||
],
|
||||
declarations: [
|
||||
DelegarPage,
|
||||
AttendeeModalPage,
|
||||
]
|
||||
})
|
||||
export class DelegarPageModule {}
|
||||
@@ -0,0 +1,111 @@
|
||||
<ion-content>
|
||||
<div class="main-content d-flex height-100">
|
||||
|
||||
<div class="content d-flex flex-column width-100 height-100 ">
|
||||
<div class="header-content">
|
||||
<div class="header-title">
|
||||
<label>Delegar</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overflow-y-auto">
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height">
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
<ion-label *ngIf="taskParticipants.length == 0" class="list-people-title">Adicionar intervenientes</ion-label>
|
||||
<ion-label *ngFor="let participant of taskParticipants">{{participant.Name}}</ion-label>
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="add-people" (click)="addParticipants()">
|
||||
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height">
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
<ion-label *ngIf="taskParticipantsCc.length == 0" class="list-people-title">Com conhecimento</ion-label>
|
||||
<ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label>
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="add-people" (click)="addParticipantsCc()">
|
||||
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height width-100">
|
||||
<ion-textarea [(ngModel)]="postData.Body.Text" placeholder="Detalhes" rows="6" cols="20"></ion-textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div hidden class="ion-item-container-no-border">
|
||||
<ion-label>
|
||||
<div class="attach-icon">
|
||||
<ion-icon src="assets/images/icons-attach-doc.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="attach-document">
|
||||
<ion-label>Anexar Documentos</ion-label>
|
||||
</div>
|
||||
</ion-label>
|
||||
</div>
|
||||
|
||||
<div *ngIf="loadedAttachments">
|
||||
<ion-item>
|
||||
<ion-label>Documentos Anexados</ion-label>
|
||||
</ion-item>
|
||||
<ion-list>
|
||||
<ion-item *ngFor="let attachment of loadedAttachments">
|
||||
<ion-label>
|
||||
<h4 class="attach-title-item">{{attachment.Description}}</h4>
|
||||
<p><span class="span-left">{{attachment.Stakeholders}}</span><span class="span-right"> {{ attachment.CreateDate | date: 'dd/MM/yyyy' }}</span></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="aside-righ flex-grow-1">
|
||||
<app-attendee-modal class=" d-flex flex-column height-100"
|
||||
*ngIf="showAttendees"
|
||||
[taskParticipants]="taskParticipants"
|
||||
[taskParticipantsCc]="taskParticipantsCc"
|
||||
[adding]="adding"
|
||||
(dynamicSetIntervenient)="dynamicSetIntervenient($event)"
|
||||
>
|
||||
</app-attendee-modal>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
<ion-footer>
|
||||
<div class="buttons">
|
||||
<button class="btn-cancel" shape="round" (click)="cancelTask()">Cancelar</button>
|
||||
<button class="btn-ok" shape="round" (click)="saveTask()">Gravar</button>
|
||||
</div>
|
||||
</ion-footer>
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
.content{
|
||||
padding: 30px 20px 0 20px !important;
|
||||
margin: 0;
|
||||
float: left;
|
||||
|
||||
.header-content{
|
||||
}
|
||||
.header-title{
|
||||
font-family: Roboto;
|
||||
font-size: 25px;
|
||||
padding: 0;
|
||||
color:#000;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.ion-item-container{
|
||||
margin: 15px auto;
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
padding-left: 10px;
|
||||
|
||||
}
|
||||
.ion-item-container-no-border{
|
||||
margin: 0px auto;
|
||||
padding: 0 !important;
|
||||
overflow: auto;
|
||||
}
|
||||
.container-div{
|
||||
margin-bottom: 15px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.ion-item-class-2{
|
||||
margin: 0px auto;
|
||||
}
|
||||
.ion-icon-class{
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
float: left;
|
||||
padding: 10px;
|
||||
font-size: 25px;
|
||||
}
|
||||
ion-select{
|
||||
padding-left: 5px;
|
||||
margin-left: 0;
|
||||
}
|
||||
.ion-input-class{
|
||||
width: calc(100% - 45px);
|
||||
height: 45px;
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
padding-left: 5px;
|
||||
padding-right: 10px;
|
||||
float: left;
|
||||
}
|
||||
.ion-input-class-no-height{
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
overflow: auto;
|
||||
}
|
||||
.list-people{
|
||||
width: 256px;
|
||||
float: left;
|
||||
|
||||
}
|
||||
.add-people{
|
||||
width: 45px;
|
||||
float: right;
|
||||
overflow: auto;
|
||||
font-size: 25px;
|
||||
padding: 10px;
|
||||
}
|
||||
.list-people-title{
|
||||
/* font-size: 13px; */
|
||||
color: #797979;
|
||||
}
|
||||
.attach-document{
|
||||
font-size: 15px;
|
||||
color: #0d89d1;
|
||||
margin: 5px 5px 5px 10px;
|
||||
padding: 5px;
|
||||
float: left;
|
||||
}
|
||||
.attach-icon{
|
||||
width: 37px;
|
||||
font-size: 35px;
|
||||
float: left;
|
||||
}
|
||||
.attach-title-item{
|
||||
width: 100%;
|
||||
font-size: 15px;
|
||||
color:#0d89d1;
|
||||
}
|
||||
/* SPAN */
|
||||
.span-left{
|
||||
float: left;
|
||||
font-size: 15x;
|
||||
}
|
||||
.span-right{
|
||||
text-align: right;
|
||||
float: right;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
.container-footer{
|
||||
margin:0 auto;
|
||||
overflow: auto;
|
||||
}
|
||||
.button-cancel {
|
||||
width: 170px;
|
||||
height: 44px;
|
||||
border-radius: 22.5px;
|
||||
--background: #e0e9ee;
|
||||
--color: #061b52;
|
||||
margin:10px;
|
||||
}
|
||||
.button-save {
|
||||
width: 170px;
|
||||
height: 44px;
|
||||
border-radius: 22.5px;
|
||||
--background: #42b9fe;
|
||||
--color:#ffffff;
|
||||
margin:10px;
|
||||
}
|
||||
|
||||
.text-input{
|
||||
width: 100%;
|
||||
border: 1px solid #ebebeb;
|
||||
margin: 0px 15px 15px 0px;
|
||||
padding: 0 !important;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
/* Error Messages */
|
||||
.error{
|
||||
color:red;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
.span-color{
|
||||
color:red;
|
||||
}
|
||||
.buttons{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20px;
|
||||
overflow: auto;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { DelegarPage } from './delegar.page';
|
||||
|
||||
describe('DelegarPage', () => {
|
||||
let component: DelegarPage;
|
||||
let fixture: ComponentFixture<DelegarPage>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ DelegarPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(DelegarPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,237 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { Event } from 'src/app/models/event.model'
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { AddParticipantsModalPage } from 'src/app/pages/gabinete-digital/expediente/add-participants-modal/add-participants-modal.page';
|
||||
import { AddParticipantsCcModalPage } from 'src/app/pages/gabinete-digital/expediente/add-participants-cc-modal/add-participants-cc-modal.page';
|
||||
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-delegar',
|
||||
templateUrl: './delegar.page.html',
|
||||
styleUrls: ['./delegar.page.scss'],
|
||||
})
|
||||
export class DelegarPage implements OnInit {
|
||||
task: any;
|
||||
|
||||
taskParticipants: EventPerson[] = [];
|
||||
taskParticipantsCc: EventPerson[] = [];
|
||||
|
||||
taskDocId:string;
|
||||
loadedAttachments:any;
|
||||
|
||||
adding: "intervenient" | "CC" = "intervenient";
|
||||
|
||||
postData: Event;
|
||||
eventBody: EventBody;
|
||||
eventAttendees: EventPerson[];
|
||||
|
||||
formLocationSatus: boolean = false;
|
||||
showAttendees= false;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private router:Router,
|
||||
private navParams: NavParams,
|
||||
private processes:ProcessesService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private calendarService: EventsService,
|
||||
) {
|
||||
this.task = this.navParams.get('task');
|
||||
this.postData = new Event();
|
||||
this.eventBody = { BodyType : "1", Text : ""};
|
||||
this.postData.Body = this.eventBody;
|
||||
|
||||
/* Initialize 'Subject' with the title of the expedient */
|
||||
this.postData.Subject = this.task.Folio;
|
||||
this.postData.CalendarName = "Oficial";
|
||||
/* this.postData.StartDate = new Date(); */
|
||||
/* Set + 30minutes to seleted datetime */
|
||||
let selectedEndDate = new Date();
|
||||
/* this.postData.EndDate = new Date(selectedEndDate.setMinutes(new Date().getMinutes() + 30)); */
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.adding = "intervenient";
|
||||
console.log(this.task);
|
||||
|
||||
|
||||
this.getAttachments();
|
||||
}
|
||||
|
||||
getAttachments(){
|
||||
this.attachmentsService.getAttachmentsBySerial(this.task.SerialNumber).subscribe(res=>{
|
||||
this.loadedAttachments = res;
|
||||
});
|
||||
}
|
||||
|
||||
close(){
|
||||
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
cancelTask(){
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
saveTask(){
|
||||
|
||||
// issue12323423
|
||||
let Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
|
||||
this.eventBody={
|
||||
BodyType: '1',
|
||||
Text: this.postData.Body.Text,
|
||||
}
|
||||
this.postData = {
|
||||
EventId: '',
|
||||
Subject: this.postData.Subject,
|
||||
Body: this.eventBody,
|
||||
Location: this.postData.Location,
|
||||
CalendarId: '',
|
||||
CalendarName: this.postData.CalendarName,
|
||||
StartDate: this.postData.StartDate,
|
||||
EndDate: this.postData.EndDate,
|
||||
EventType: 'Reunião',
|
||||
Attendees: Attendees,
|
||||
IsMeeting: false,
|
||||
IsRecurring: false,
|
||||
AppointmentState: 0,
|
||||
TimeZone: 'UTC',
|
||||
Organizer: null,
|
||||
Categories: null,
|
||||
HasAttachments: true,
|
||||
}
|
||||
console.log(this.postData);
|
||||
|
||||
|
||||
|
||||
if(this.task.FsId == '8'){
|
||||
this.calendarService.postExpedientEvent(this.task.DocId, this.postData, "md",this.task.SerialNumber, this.task.FsId);
|
||||
this.distartExpedientModal();
|
||||
}
|
||||
else if(this.task.FsId == '361'){
|
||||
this.calendarService.createTaskEvent(this.task.FolderId, this.postData, "md",this.task.SerialNumber, this.task.FsId);
|
||||
}
|
||||
|
||||
this.close();
|
||||
}
|
||||
|
||||
async addParticipants(){
|
||||
|
||||
this.adding = "intervenient";
|
||||
|
||||
if(window.innerWidth <= 800){
|
||||
const modal = await this.modalController.create({
|
||||
component: AddParticipantsModalPage,
|
||||
componentProps: {
|
||||
eventPersons: this.eventAttendees
|
||||
},
|
||||
cssClass: 'book-meeting-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((res) => {
|
||||
this.taskParticipants = res.data;
|
||||
let newattendees: EventPerson[] = res['data'];
|
||||
if(newattendees != null){
|
||||
newattendees.forEach(newattendee => {
|
||||
let att = {
|
||||
"EmailAddress": newattendee.EmailAddress,
|
||||
"Name": newattendee.Name,
|
||||
"IsRequired": true
|
||||
};
|
||||
if(this.eventAttendees == null){
|
||||
this.eventAttendees = new Array();
|
||||
}
|
||||
this.eventAttendees.push(att);
|
||||
});
|
||||
}
|
||||
this.postData.Attendees = this.eventAttendees;
|
||||
});
|
||||
} else {
|
||||
this.showAttendees = true;
|
||||
}
|
||||
}
|
||||
|
||||
async addParticipantsCc() {
|
||||
|
||||
this.adding = "CC";
|
||||
|
||||
if(window.innerWidth <= 800) {
|
||||
const modal = await this.modalController.create({
|
||||
component: AddParticipantsCcModalPage,
|
||||
componentProps: {
|
||||
eventPersons: this.eventAttendees
|
||||
},
|
||||
cssClass: 'add-participants-cc-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((res) => {
|
||||
this.taskParticipantsCc = res.data;
|
||||
let newattendees: EventPerson[] = res['data'];
|
||||
|
||||
|
||||
if (newattendees != null)
|
||||
{
|
||||
newattendees.forEach(newattendee => {
|
||||
let att = {
|
||||
"EmailAddress": newattendee.EmailAddress,
|
||||
"Name": newattendee.Name,
|
||||
"IsRequired": false
|
||||
};
|
||||
if (this.eventAttendees == null)
|
||||
{
|
||||
this.eventAttendees = new Array();
|
||||
}
|
||||
this.eventAttendees.push(att);
|
||||
|
||||
});
|
||||
}
|
||||
this.postData.Attendees = this.eventAttendees;
|
||||
});
|
||||
} else {
|
||||
this.showAttendees = true;
|
||||
}
|
||||
}
|
||||
|
||||
async distartExpedientModal(){
|
||||
const modal = await this.modalController.create({
|
||||
component: DiscartExpedientModalPage,
|
||||
componentProps: {
|
||||
serialNumber: this.task.SerialNumber,
|
||||
},
|
||||
cssClass: 'discart-expedient-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
validateFormInputs(){
|
||||
let formLocation = this.postData.Location.trim();
|
||||
if(!this.postData.Location && formLocation.length <= 0){
|
||||
this.formLocationSatus=true;
|
||||
}
|
||||
}
|
||||
|
||||
dynamicSetIntervenient({taskParticipants, taskParticipantsCc}){
|
||||
|
||||
this.taskParticipants = taskParticipants;
|
||||
this.taskParticipantsCc = taskParticipantsCc;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user