mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
+154
-153
@@ -1,141 +1,142 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
||||
import { ChatPage } from './pages/chat/chat.page';
|
||||
import { MessagesPage } from './pages/chat/messages/messages.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
loadChildren: () => import('./index/index.module').then(m => m.IndexPageModule)
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)
|
||||
},
|
||||
{
|
||||
path: 'empty-chat',
|
||||
loadChildren: () => import('./shared/chat/empty-chat/empty-chat.module').then( m => m.EmptyChatPageModule)
|
||||
},
|
||||
{
|
||||
path: 'empty-container',
|
||||
loadChildren: () => import('./shared/empty-container/empty-container.module').then( m => m.EmptyContainerPageModule)
|
||||
},
|
||||
{
|
||||
path: 'events-to-approve',
|
||||
loadChildren: () => import('./shared/gabinete-digital/events-to-approve/events-to-approve.module').then( m => m.EventsToApprovePageModule)
|
||||
},
|
||||
{
|
||||
path: 'expedients',
|
||||
loadChildren: () => import('./shared/gabinete-digital/expedients/expedients.module').then( m => m.ExpedientsPageModule)
|
||||
},
|
||||
{
|
||||
path: 'document-detail',
|
||||
loadChildren: () => import('./modals/document-detail/document-detail.module').then( m => m.DocumentDetailPageModule)
|
||||
},
|
||||
{
|
||||
path: 'edit-group',
|
||||
loadChildren: () => import('./shared/chat/edit-group/edit-group.module').then( m => m.EditGroupPageModule)
|
||||
},
|
||||
{
|
||||
path: 'pedidos',
|
||||
loadChildren: () => import('./shared/gabinete-digital/pedidos/pedidos.module').then( m => m.PedidosPageModule)
|
||||
},
|
||||
{
|
||||
path: 'event-list',
|
||||
loadChildren: () => import('./pages/gabinete-digital/event-list/event-list.module').then(m =>m.EventListPageModule)
|
||||
},
|
||||
{
|
||||
path: 'despachos',
|
||||
loadChildren: () => import('./shared/gabinete-digital/despachos/despachos.module').then( m => m.DespachosPageModule)
|
||||
},
|
||||
{
|
||||
path: 'create-process',
|
||||
loadChildren: () => import('./modals/create-process/create-process.module').then( m => m.CreateProcessPageModule)
|
||||
},
|
||||
{
|
||||
path: 'pendentes',
|
||||
loadChildren: () => import('./shared/gabinete-digital/pendentes/pendentes.module').then( m => m.PendentesPageModule)
|
||||
},
|
||||
{
|
||||
path: 'delegar',
|
||||
loadChildren: () => import('./modals/delegar/delegar.module').then( m => m.DelegarPageModule)
|
||||
},
|
||||
{
|
||||
path: 'add-note',
|
||||
loadChildren: () => import('./modals/add-note/add-note.module').then( m => m.AddNotePageModule)
|
||||
},
|
||||
{
|
||||
path: 'dar-parecer',
|
||||
loadChildren: () => import('./modals/dar-parecer/dar-parecer.module').then( m => m.DarParecerPageModule)
|
||||
},
|
||||
{
|
||||
path: 'opts-expediente',
|
||||
loadChildren: () => import('./shared/popover/opts-expediente/opts-expediente.module').then( m => m.OptsExpedientePageModule)
|
||||
},
|
||||
{
|
||||
path: 'despachos-pr',
|
||||
loadChildren: () => import('./shared/gabinete-digital/despachos-pr/despachos-pr.module').then( m => m.DespachosPrPageModule)
|
||||
},
|
||||
{
|
||||
path: 'diplomas',
|
||||
loadChildren: () => import('./shared/gabinete-digital/diplomas/diplomas.module').then( m => m.DiplomasPageModule)
|
||||
},
|
||||
{
|
||||
path: 'expedientes-pr',
|
||||
loadChildren: () => import('./shared/gabinete-digital/expedientes-pr/expedientes-pr.module').then( m => m.ExpedientesPrPageModule)
|
||||
},
|
||||
{
|
||||
path: 'diplomas-assinar',
|
||||
loadChildren: () => import('./shared/gabinete-digital/diplomas-assinar/diplomas-assinar.module').then( m => m.DiplomasAssinarPageModule)
|
||||
},
|
||||
{
|
||||
path: 'opts-expediente-pr',
|
||||
loadChildren: () => import('./shared/popover/opts-expediente-pr/opts-expediente-pr.module').then( m => m.OptsExpedientePrPageModule)
|
||||
},
|
||||
{
|
||||
path: 'despachos-options',
|
||||
loadChildren: () => import('./shared/popover/despachos-options/despachos-options.module').then( m => m.DespachosOptionsPageModule)
|
||||
},
|
||||
{
|
||||
path: 'despachos-pr-options',
|
||||
loadChildren: () => import('./shared/popover/despachos-pr-options/despachos-pr-options.module').then( m => m.DespachosPrOptionsPageModule)
|
||||
},
|
||||
{
|
||||
path: 'deploma-options',
|
||||
loadChildren: () => import('./shared/popover/deploma-options/deploma-options.module').then( m => m.DeplomaOptionsPageModule)
|
||||
},
|
||||
{
|
||||
path: 'pin',
|
||||
loadChildren: () => import('./shared/pin/pin.module').then( m => m.PinPageModule)
|
||||
},
|
||||
{
|
||||
path: 'fingerprint',
|
||||
loadChildren: () => import('./shared/fingerprint/fingerprint.module').then( m => m.FingerprintPageModule)
|
||||
},
|
||||
{
|
||||
path: 'new-event',
|
||||
loadChildren: () => import('./shared/agenda/new-event/new-event.module').then( m => m.NewEventPageModule)
|
||||
},
|
||||
{
|
||||
path: 'event-list',
|
||||
loadChildren: () => import('./shared/agenda/event-list/event-list.module').then( m => m.EventListPageModule)
|
||||
},
|
||||
{
|
||||
path: 'approve-event',
|
||||
loadChildren: () => import('./shared/agenda/approve-event/approve-event.module').then( m => m.ApproveEventPageModule)
|
||||
},
|
||||
{
|
||||
path: 'bad-request',
|
||||
loadChildren: () => import('./shared/popover/bad-request/bad-request.module').then( m => m.BadRequestPageModule)
|
||||
},
|
||||
{
|
||||
path: 'success-message',
|
||||
loadChildren: () => import('./shared/popover/success-message/success-message.module').then( m => m.SuccessMessagePageModule)
|
||||
},
|
||||
{
|
||||
path: 'forward',
|
||||
loadChildren: () => import('./modals/forward/forward.module').then( m => m.ForwardPageModule)
|
||||
},
|
||||
import { NgModule } from '@angular/core';
|
||||
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
||||
import { ChatPage } from './pages/chat/chat.page';
|
||||
import { MessagesPage } from './pages/chat/messages/messages.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
loadChildren: () => import('./index/index.module').then(m => m.IndexPageModule)
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)
|
||||
},
|
||||
{
|
||||
path: 'empty-chat',
|
||||
loadChildren: () => import('./shared/chat/empty-chat/empty-chat.module').then( m => m.EmptyChatPageModule)
|
||||
},
|
||||
{
|
||||
path: 'empty-container',
|
||||
loadChildren: () => import('./shared/empty-container/empty-container.module').then( m => m.EmptyContainerPageModule)
|
||||
},
|
||||
{
|
||||
path: 'events-to-approve',
|
||||
loadChildren: () => import('./shared/gabinete-digital/events-to-approve/events-to-approve.module').then( m => m.EventsToApprovePageModule)
|
||||
},
|
||||
{
|
||||
path: 'expedients',
|
||||
loadChildren: () => import('./shared/gabinete-digital/expedients/expedients.module').then( m => m.ExpedientsPageModule)
|
||||
},
|
||||
{
|
||||
path: 'document-detail',
|
||||
loadChildren: () => import('./modals/document-detail/document-detail.module').then( m => m.DocumentDetailPageModule)
|
||||
},
|
||||
{
|
||||
path: 'edit-group',
|
||||
loadChildren: () => import('./shared/chat/edit-group/edit-group.module').then( m => m.EditGroupPageModule)
|
||||
},
|
||||
{
|
||||
path: 'pedidos',
|
||||
loadChildren: () => import('./shared/gabinete-digital/pedidos/pedidos.module').then( m => m.PedidosPageModule)
|
||||
},
|
||||
{
|
||||
path: 'event-list',
|
||||
loadChildren: () => import('./pages/gabinete-digital/event-list/event-list.module').then(m =>m.EventListPageModule)
|
||||
},
|
||||
{
|
||||
path: 'despachos',
|
||||
loadChildren: () => import('./shared/gabinete-digital/despachos/despachos.module').then( m => m.DespachosPageModule)
|
||||
},
|
||||
{
|
||||
path: 'create-process',
|
||||
loadChildren: () => import('./modals/create-process/create-process.module').then( m => m.CreateProcessPageModule)
|
||||
},
|
||||
{
|
||||
path: 'pendentes',
|
||||
loadChildren: () => import('./shared/gabinete-digital/pendentes/pendentes.module').then( m => m.PendentesPageModule)
|
||||
},
|
||||
{
|
||||
path: 'delegar',
|
||||
loadChildren: () => import('./modals/delegar/delegar.module').then( m => m.DelegarPageModule)
|
||||
},
|
||||
{
|
||||
path: 'add-note',
|
||||
loadChildren: () => import('./modals/add-note/add-note.module').then( m => m.AddNotePageModule)
|
||||
},
|
||||
{
|
||||
path: 'dar-parecer',
|
||||
loadChildren: () => import('./modals/dar-parecer/dar-parecer.module').then( m => m.DarParecerPageModule)
|
||||
},
|
||||
{
|
||||
path: 'opts-expediente',
|
||||
loadChildren: () => import('./shared/popover/opts-expediente/opts-expediente.module').then( m => m.OptsExpedientePageModule)
|
||||
},
|
||||
{
|
||||
path: 'despachos-pr',
|
||||
loadChildren: () => import('./shared/gabinete-digital/despachos-pr/despachos-pr.module').then( m => m.DespachosPrPageModule)
|
||||
},
|
||||
{
|
||||
path: 'diplomas',
|
||||
loadChildren: () => import('./shared/gabinete-digital/diplomas/diplomas.module').then( m => m.DiplomasPageModule)
|
||||
},
|
||||
{
|
||||
path: 'expedientes-pr',
|
||||
loadChildren: () => import('./shared/gabinete-digital/expedientes-pr/expedientes-pr.module').then( m => m.ExpedientesPrPageModule)
|
||||
},
|
||||
{
|
||||
path: 'diplomas-assinar',
|
||||
loadChildren: () => import('./shared/gabinete-digital/diplomas-assinar/diplomas-assinar.module').then( m => m.DiplomasAssinarPageModule)
|
||||
},
|
||||
{
|
||||
path: 'opts-expediente-pr',
|
||||
loadChildren: () => import('./shared/popover/opts-expediente-pr/opts-expediente-pr.module').then( m => m.OptsExpedientePrPageModule)
|
||||
},
|
||||
{
|
||||
path: 'despachos-options',
|
||||
loadChildren: () => import('./shared/popover/despachos-options/despachos-options.module').then( m => m.DespachosOptionsPageModule)
|
||||
},
|
||||
{
|
||||
path: 'despachos-pr-options',
|
||||
loadChildren: () => import('./shared/popover/despachos-pr-options/despachos-pr-options.module').then( m => m.DespachosPrOptionsPageModule)
|
||||
},
|
||||
{
|
||||
path: 'deploma-options',
|
||||
loadChildren: () => import('./shared/popover/deploma-options/deploma-options.module').then( m => m.DeplomaOptionsPageModule)
|
||||
},
|
||||
{
|
||||
path: 'pin',
|
||||
loadChildren: () => import('./shared/pin/pin.module').then( m => m.PinPageModule)
|
||||
},
|
||||
{
|
||||
path: 'fingerprint',
|
||||
loadChildren: () => import('./shared/fingerprint/fingerprint.module').then( m => m.FingerprintPageModule)
|
||||
},
|
||||
{
|
||||
path: 'new-event',
|
||||
loadChildren: () => import('./shared/agenda/new-event/new-event.module').then( m => m.NewEventPageModule)
|
||||
},
|
||||
{
|
||||
path: 'event-list',
|
||||
loadChildren: () => import('./shared/agenda/event-list/event-list.module').then( m => m.EventListPageModule)
|
||||
},
|
||||
{
|
||||
path: 'approve-event',
|
||||
loadChildren: () => import('./shared/agenda/approve-event/approve-event.module').then( m => m.ApproveEventPageModule)
|
||||
},
|
||||
{
|
||||
path: 'bad-request',
|
||||
loadChildren: () => import('./shared/popover/bad-request/bad-request.module').then( m => m.BadRequestPageModule)
|
||||
},
|
||||
{
|
||||
path: 'success-message',
|
||||
loadChildren: () => import('./shared/popover/success-message/success-message.module').then( m => m.SuccessMessagePageModule)
|
||||
},
|
||||
{
|
||||
path: 'forward',
|
||||
loadChildren: () => import('./modals/forward/forward.module').then( m => m.ForwardPageModule)
|
||||
},
|
||||
{
|
||||
path: 'edit-event-to-approve',
|
||||
loadChildren: () => import('./shared/agenda/edit-event-to-approve/edit-event-to-approve.module').then( m => m.EditEventToApprovePageModule)
|
||||
},
|
||||
@@ -148,18 +149,18 @@ const routes: Routes = [
|
||||
loadChildren: () => import('./shared/publication/edit-action/edit-action.module').then( m => m.EditActionPageModule)
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/* {
|
||||
path: 'chat',
|
||||
component: ChatPage
|
||||
} */
|
||||
|
||||
];
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
|
||||
],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
|
||||
|
||||
/* {
|
||||
path: 'chat',
|
||||
component: ChatPage
|
||||
} */
|
||||
|
||||
];
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
|
||||
],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class AppRoutingModule {}
|
||||
|
||||
@@ -58,7 +58,7 @@ import { ProcessesResolverService } from './resolvers/processes-resolver.service
|
||||
provide: DateAdapter,
|
||||
useFactory: adapterFactory
|
||||
}),
|
||||
IonicModule.forRoot(),
|
||||
IonicModule.forRoot({animated: false}),
|
||||
IonicStorageModule.forRoot(),
|
||||
AppRoutingModule,
|
||||
HttpClientModule,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<ion-item lines="none">
|
||||
<ion-label class="title">{{modalTitle[taskType]}}</ion-label>
|
||||
</ion-item>
|
||||
<div class="ion-item-container width-100">
|
||||
<div class="ion-item-container width-100" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
|
||||
<ion-input placeholder="Assunto*" [(ngModel)]="postData.DispatchFolder.Subject"></ion-input>
|
||||
</div>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('Message')?.invalid && validateFrom ">
|
||||
<ion-textarea class="add-border" placeholder="Descrição" [(ngModel)]="postData.DispatchFolder.Message"></ion-textarea>
|
||||
</div>
|
||||
</div>
|
||||
@@ -27,26 +27,17 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon class="icon-time" slot="start" name="time-outline"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('Priority')?.invalid && validateFrom">
|
||||
|
||||
<ion-select class="d-block" [(ngModel)]="postData.Priority" interface="action-sheet" Cancel-text="Cancelar" required>
|
||||
<ion-select class="d-block d-md-none" [(ngModel)]="postData.Priority" interface="action-sheet" Cancel-text="Cancelar" required>
|
||||
<ion-select-option value="99999861"><b>Normal</b> (4 dias para a execução da tarefa)</ion-select-option>
|
||||
<ion-select-option value="99999862"><b>Urgente</b> (2 dias para a execução da tarefa)</ion-select-option>
|
||||
<ion-select-option value="99999863"><b>Muito Urgente</b> (1 dia para a execução da tarefa)</ion-select-option>
|
||||
<ion-select-option value="99999864"><b>Urgentíssimo</b> (8 horas para a execução da tarefa)</ion-select-option>
|
||||
</ion-select>
|
||||
</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-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
|
||||
<mat-form-field appearance="fill" class="width-100" floatLabel="never">
|
||||
<mat-select placeholder="Prazo*" [formControl]="toppings">
|
||||
<mat-form-field appearance="fill" class="width-100 d-none d-md-block" floatLabel="never">
|
||||
<mat-select placeholder="Prazo*" [(value)]="postData.Priority">
|
||||
<mat-option [value]="99999861">Normal</mat-option>
|
||||
<mat-option [value]="99999862">Urgente</mat-option>
|
||||
<mat-option [value]="99999863">Muito Urgente</mat-option>
|
||||
@@ -58,6 +49,36 @@
|
||||
</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-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('selectedTypes')?.invalid && validateFrom ">
|
||||
<!-- <ion-item
|
||||
class="ion-no-border ion-no-padding ion-no-margin d-block d-md-none">
|
||||
<ion-select
|
||||
[(ngModel)]="selectedTypes"
|
||||
(ngModelChange)="onSelectedTypesChanged($event)"
|
||||
multiple="true" interface="alert" Cancel-text="Cancelar" required>
|
||||
<ion-select-option *ngFor="let type of subjectTypes" value="{{type.Code}}">{{type.Description}}</ion-select-option>
|
||||
</ion-select>
|
||||
</ion-item> -->
|
||||
|
||||
<mat-form-field
|
||||
floatLabel="never"
|
||||
appearance="fill"
|
||||
class="width-100 d-block"
|
||||
appearance="none">
|
||||
<mat-select [(ngModel)]="selectedTypes" multiple placeholder="Selecione o tipo de evento*">
|
||||
<mat-option *ngFor="let type of subjectTypes" [value]="type.Code">{{type.Description}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
|
||||
@@ -14,7 +14,7 @@ import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||
|
||||
@@ -69,6 +69,9 @@ export class CreateProcessPage implements OnInit {
|
||||
adding: "intervenient" | "CC" = "intervenient";
|
||||
profile: string;
|
||||
|
||||
Form: FormGroup;
|
||||
validateFrom = false
|
||||
|
||||
emptyTextDescription = "Sem intervenientes selecionados";
|
||||
showEmptyContainer = true;
|
||||
|
||||
@@ -162,8 +165,43 @@ export class CreateProcessPage implements OnInit {
|
||||
this.modalController.dismiss(null);
|
||||
|
||||
}
|
||||
async saveTask(){
|
||||
|
||||
|
||||
runValidation() {
|
||||
this.validateFrom = true
|
||||
}
|
||||
|
||||
injectValidation() {
|
||||
|
||||
this.Form = new FormGroup({
|
||||
Subject: new FormControl(this.postData.DispatchFolder.Subject, [
|
||||
Validators.required,
|
||||
// Validators.minLength(4)
|
||||
]),
|
||||
Message: new FormControl(this.postData.DispatchFolder.Message, [
|
||||
Validators.required,
|
||||
]),
|
||||
Priority: new FormControl(this.postData.Priority, [
|
||||
Validators.required,
|
||||
]),
|
||||
participantes: new FormControl(this.taskParticipantsCc.concat(this.taskParticipants), [
|
||||
// Validators.required
|
||||
]),
|
||||
selectedTypes: new FormControl(this.selectedTypes, [
|
||||
Validators.required,
|
||||
]),
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
async saveTask() {
|
||||
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
|
||||
if(this.Form.invalid) return false
|
||||
|
||||
|
||||
if(this.postData.Priority=='99999861') {
|
||||
this.dispatchFolder.DeadlineType = 'Normal';
|
||||
}
|
||||
@@ -199,73 +237,69 @@ export class CreateProcessPage implements OnInit {
|
||||
this.dispatchFolder.SubjectTypes = this.selectedTypes;
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
if(this.taskParticipants.length > 0) {
|
||||
switch (this.taskType) {
|
||||
case '0':
|
||||
this.postData = {
|
||||
DistributionType: "Paralelo",
|
||||
CountryCode: 'AO',
|
||||
Priority: this.postData.Priority,
|
||||
UserEmail: this.loggeduser.Email,
|
||||
UsersSelected: attendees,
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
}
|
||||
console.log('this.postData', this.postData, this.taskType);
|
||||
|
||||
try {
|
||||
await this.processes.postDespatcho(this.postData).toPromise();
|
||||
this.FinalizarDespacho('Despacho criado');
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
}
|
||||
|
||||
break;
|
||||
case '1':
|
||||
this.postData = {
|
||||
DistributionType: "Paralelo",
|
||||
CountryCode: 'AO',
|
||||
Priority: this.postData.Priority,
|
||||
UserEmail: this.loggeduser.Email,
|
||||
UsersSelected: attendees,
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
}
|
||||
console.log(this.postData);
|
||||
|
||||
try {
|
||||
await this.processes.postParecer(this.postData).toPromise();
|
||||
this.FinalizarParecer('Pedido de Parecer enviado');
|
||||
}
|
||||
catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
}
|
||||
|
||||
break;
|
||||
case '2':
|
||||
this.postData = {
|
||||
DistributionType: "Paralelo",
|
||||
CountryCode: 'AO',
|
||||
Priority: this.postData.Priority,
|
||||
UserEmail: this.loggeduser.Email,
|
||||
UsersSelected: attendees,
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
}
|
||||
console.log(this.postData);
|
||||
|
||||
try {
|
||||
await this.processes.postDeferimento(this.postData).toPromise();
|
||||
this.FinalizarDeferimento('Pedido de deferimento enviado');
|
||||
}
|
||||
catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
}
|
||||
break;
|
||||
switch (this.taskType) {
|
||||
case '0':
|
||||
this.postData = {
|
||||
DistributionType: "Paralelo",
|
||||
CountryCode: 'AO',
|
||||
Priority: this.postData.Priority,
|
||||
UserEmail: this.loggeduser.Email,
|
||||
UsersSelected: attendees,
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
}
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
else {
|
||||
this.toastService.badRequest('Lista de intervenientes vazia. Por favor, adicione 1 ou mais intervenientes.');
|
||||
}
|
||||
|
||||
console.log('this.postData', this.postData, this.taskType);
|
||||
|
||||
try {
|
||||
await this.processes.postDespatcho(this.postData).toPromise();
|
||||
this.FinalizarDespacho('Despacho criado');
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
}
|
||||
|
||||
break;
|
||||
case '1':
|
||||
this.postData = {
|
||||
DistributionType: "Paralelo",
|
||||
CountryCode: 'AO',
|
||||
Priority: this.postData.Priority,
|
||||
UserEmail: this.loggeduser.Email,
|
||||
UsersSelected: attendees,
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
}
|
||||
console.log(this.postData);
|
||||
|
||||
try {
|
||||
await this.processes.postParecer(this.postData).toPromise();
|
||||
this.FinalizarParecer('Pedido de Parecer enviado');
|
||||
}
|
||||
catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
}
|
||||
|
||||
break;
|
||||
case '2':
|
||||
this.postData = {
|
||||
DistributionType: "Paralelo",
|
||||
CountryCode: 'AO',
|
||||
Priority: this.postData.Priority,
|
||||
UserEmail: this.loggeduser.Email,
|
||||
UsersSelected: attendees,
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
}
|
||||
console.log(this.postData);
|
||||
|
||||
try {
|
||||
await this.processes.postDeferimento(this.postData).toPromise();
|
||||
this.FinalizarDeferimento('Pedido de deferimento enviado');
|
||||
}
|
||||
catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
}
|
||||
break;
|
||||
}
|
||||
this.modalController.dismiss();
|
||||
|
||||
break;
|
||||
|
||||
case 'PR':
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2021"
|
||||
max="2022"
|
||||
max="2025"
|
||||
>
|
||||
</ion-datetime>
|
||||
<!-- <ion-input placeholder="Data início" [(ngModel)]="postData.StartDate"></ion-input> -->
|
||||
@@ -144,7 +144,7 @@
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2021"
|
||||
max="2022"
|
||||
max="2025"
|
||||
>
|
||||
</ion-datetime>
|
||||
<!-- <ion-input placeholder="Data fim" [(ngModel)]="postData.EndDate"></ion-input> -->
|
||||
|
||||
@@ -77,7 +77,6 @@
|
||||
|
||||
<div *ngIf="Form && validateFrom" >
|
||||
<div *ngIf="Form.get('CalendarName').invalid " class="input-errror-message">
|
||||
{{ postEvent.Categories[0] }}
|
||||
<div *ngIf="Form.get('CalendarName').errors?.required">
|
||||
Campo obrigatório.
|
||||
</div>
|
||||
@@ -117,15 +116,15 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||
<ion-datetime
|
||||
placeholder="Início*"
|
||||
[(ngModel)]="postEvent.StartDate"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022"
|
||||
min="{{minDate}}"
|
||||
max="2025"
|
||||
>
|
||||
</ion-datetime>
|
||||
<!-- <ion-input placeholder="Data início" [(ngModel)]="postData.StartDate"></ion-input> -->
|
||||
@@ -138,15 +137,16 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||
<ion-datetime
|
||||
placeholder="Fim*"
|
||||
[(ngModel)]="postEvent.EndDate"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022"
|
||||
min="{{minDate}}"
|
||||
max="2025"
|
||||
|
||||
>
|
||||
</ion-datetime>
|
||||
<!-- <ion-input placeholder="Data fim" [(ngModel)]="postData.EndDate"></ion-input> -->
|
||||
|
||||
@@ -14,7 +14,6 @@ import { AttendeesPageModal } from '../../events/attendees/attendees.page';
|
||||
import { SearchPage } from '../../search/search.page';
|
||||
import { ThemePalette } from '@angular/material/core';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import * as moment from 'moment';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -31,7 +30,7 @@ export class NewEventPage implements OnInit {
|
||||
public showSeconds = false;
|
||||
public touchUi = false;
|
||||
public enableMeridian = false;
|
||||
public minDate = new Date();
|
||||
public minDate = new Date().toISOString().slice(0,10)
|
||||
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
|
||||
public stepHour = 1;
|
||||
public stepMinute = 5;
|
||||
@@ -146,6 +145,15 @@ export class NewEventPage implements OnInit {
|
||||
this.validateFrom = true
|
||||
}
|
||||
|
||||
|
||||
get dateValid() {
|
||||
if (window.innerWidth <= 800) {
|
||||
return this.postEvent.StartDate < this.postEvent.EndDate? ['ok']: []
|
||||
} else {
|
||||
return ['ok']
|
||||
}
|
||||
}
|
||||
|
||||
injectValidation() {
|
||||
|
||||
this.Form = new FormGroup({
|
||||
@@ -159,6 +167,9 @@ export class NewEventPage implements OnInit {
|
||||
CalendarName: new FormControl(this.postEvent.CalendarName, [
|
||||
Validators.required
|
||||
]),
|
||||
Date: new FormControl(this.dateValid, [
|
||||
Validators.required
|
||||
]),
|
||||
Categories: new FormControl(this.postEvent.Categories[0], [
|
||||
Validators.required
|
||||
]),
|
||||
|
||||
+6
-6
@@ -83,7 +83,7 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||
<ion-datetime
|
||||
class="d-block d-md-none"
|
||||
placeholder="Início*"
|
||||
@@ -91,8 +91,8 @@
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022"
|
||||
min="{{ionicMinDate}}"
|
||||
max="2025"
|
||||
value="2020-11-19T11:06Z">
|
||||
</ion-datetime>
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||
<ion-datetime
|
||||
class="d-block d-md-none"
|
||||
placeholder="Fim*"
|
||||
@@ -130,8 +130,8 @@
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022"
|
||||
min="{{ionicMinDate}}"
|
||||
max="2025"
|
||||
value="2020-11-19T11:06Z">
|
||||
</ion-datetime>
|
||||
|
||||
|
||||
+18
-3
@@ -55,6 +55,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
public touchUi = false;
|
||||
public enableMeridian = false;
|
||||
public minDate = new Date();
|
||||
public ionicMinDate = new Date().toISOString().slice(0,10)
|
||||
|
||||
// curent timestamp + 15 minutes
|
||||
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
|
||||
@@ -172,6 +173,14 @@ export class BookMeetingModalPage implements OnInit {
|
||||
this.validateFrom = true
|
||||
}
|
||||
|
||||
get dateValid() {
|
||||
if (window.innerWidth <= 800) {
|
||||
return this.postData.StartDate < this.postData.EndDate? ['ok']: []
|
||||
} else {
|
||||
return ['ok']
|
||||
}
|
||||
}
|
||||
|
||||
injectValidation() {
|
||||
|
||||
this.Form = new FormGroup({
|
||||
@@ -184,7 +193,10 @@ export class BookMeetingModalPage implements OnInit {
|
||||
]),
|
||||
CalendarName: new FormControl(this.postData.CalendarName, [
|
||||
Validators.required
|
||||
])
|
||||
]),
|
||||
Date: new FormControl(this.dateValid, [
|
||||
Validators.required
|
||||
]),
|
||||
// participantes: new FormControl(this.taskParticipantsCc.concat(this.taskParticipants), [
|
||||
// Validators.required
|
||||
// ]),
|
||||
@@ -195,8 +207,11 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
async saveTask(){
|
||||
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
if(this.loggeduser.Profile == 'MDGPR') {
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
}
|
||||
|
||||
|
||||
if(this.Form.invalid) return false
|
||||
|
||||
|
||||
+6
-7
@@ -57,7 +57,7 @@
|
||||
interface="action-sheet"
|
||||
Cancel-text="Cancelar"
|
||||
required
|
||||
class="d-md-none"
|
||||
class="d-block d-md-none"
|
||||
>
|
||||
<ion-select-option value="99999861"><b>Normal</b> (4 dias para a execução da tarefa)</ion-select-option>
|
||||
<ion-select-option value="99999862"><b>Urgente</b> (2 dias para a execução da tarefa)</ion-select-option>
|
||||
@@ -95,22 +95,21 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('selectedTypes')?.invalid && validateFrom ">
|
||||
<ion-item
|
||||
class="ion-no-border ion-no-padding ion-no-margin d-md-none">
|
||||
<!-- <ion-item
|
||||
class="ion-no-border ion-no-padding ion-no-margin d-block d-md-none">
|
||||
<ion-select
|
||||
[(ngModel)]="selectedTypes"
|
||||
(ngModelChange)="onSelectedTypesChanged($event)"
|
||||
multiple="true" interface="alert" Cancel-text="Cancelar" required>
|
||||
<ion-select-option *ngFor="let type of subjectTypes" value="{{type.Code}}">{{type.Description}}</ion-select-option>
|
||||
</ion-select>
|
||||
</ion-item>
|
||||
|
||||
</ion-item> -->
|
||||
<mat-form-field
|
||||
floatLabel="never"
|
||||
appearance="fill"
|
||||
class="width-100 d-none d-md-block"
|
||||
class="width-100 d-block"
|
||||
appearance="none">
|
||||
<mat-select [formControl]="toppings" multiple placeholder="Selecione o tipo de evento*">
|
||||
<mat-select [(ngModel)]="selectedTypes" multiple placeholder="Selecione o tipo de evento*">
|
||||
<mat-option *ngFor="let type of subjectTypes" [value]="type.Code">{{type.Description}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
+10
-6
@@ -166,7 +166,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
|
||||
getSubjectType(){
|
||||
getSubjectType() {
|
||||
this.processes.GetSubjectType().subscribe(res=>{
|
||||
console.log(res);
|
||||
this.subjectTypes = res;
|
||||
@@ -191,12 +191,12 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
Location: new FormControl(this.postData.DispatchFolder.Message, [
|
||||
Validators.required,
|
||||
]),
|
||||
selectedTypes: new FormControl(this.toppingsValues, [
|
||||
selectedTypes: new FormControl(this.selectedTypes, [
|
||||
Validators.required,
|
||||
]),
|
||||
Priority: new FormControl(this.postData.Priority, [
|
||||
Validators.required,
|
||||
])
|
||||
]),
|
||||
// CalendarName: new FormControl(this.postEvent.CalendarName, [
|
||||
// Validators.required
|
||||
// ]),
|
||||
@@ -215,10 +215,14 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
|
||||
async saveTask(){
|
||||
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
if(this.loggeduser.Profile == 'MDGPR') {
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
|
||||
if(this.Form.invalid) return false
|
||||
}
|
||||
|
||||
|
||||
if(this.Form.invalid) return false
|
||||
|
||||
if(this.postData.Priority=='99999861'){
|
||||
this.dispatchFolder.DeadlineType = 'Normal';
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022">
|
||||
max="2025">
|
||||
</ion-datetime>
|
||||
</div>
|
||||
</div>
|
||||
@@ -54,7 +54,7 @@
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022">
|
||||
max="2025">
|
||||
</ion-datetime>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022"
|
||||
max="2025"
|
||||
>
|
||||
</ion-datetime>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022"
|
||||
max="2025"
|
||||
>
|
||||
</ion-datetime>
|
||||
|
||||
|
||||
@@ -62,14 +62,14 @@ export class DespachosPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
//Inicializar segment
|
||||
this.segment = "despachos";
|
||||
this.LoadList();
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
||||
this.doRefresh();
|
||||
}
|
||||
});
|
||||
//Inicializar segment
|
||||
this.segment = "despachos";
|
||||
this.LoadList();
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
||||
this.doRefresh();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022"
|
||||
max="2025"
|
||||
>
|
||||
</ion-datetime>
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022">
|
||||
max="2025">
|
||||
</ion-datetime>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,12 +8,40 @@ import { NewActionPageRoutingModule } from './new-action-routing.module';
|
||||
|
||||
import { NewActionPage } from './new-action.page';
|
||||
|
||||
|
||||
import { MatNativeDateModule } from '@angular/material/core';
|
||||
import {
|
||||
NgxMatDatetimePickerModule,
|
||||
NgxMatNativeDateModule,
|
||||
NgxMatTimepickerModule
|
||||
} from '@angular-material-components/datetime-picker';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { NgxMatMomentModule } from '@angular-material-components/moment-adapter';
|
||||
import { MAT_DATE_LOCALE } from '@angular/material/core';
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
NewActionPageRoutingModule
|
||||
NewActionPageRoutingModule,
|
||||
// Angular material
|
||||
MatDatepickerModule,
|
||||
MatInputModule,
|
||||
MatNativeDateModule,
|
||||
NgxMatDatetimePickerModule,
|
||||
NgxMatTimepickerModule,
|
||||
NgxMatNativeDateModule,
|
||||
NgxMatMomentModule,
|
||||
MatSelectModule,
|
||||
MatButtonModule,
|
||||
ReactiveFormsModule,
|
||||
MatDialogModule,
|
||||
],
|
||||
exports: [NewActionPage],
|
||||
declarations: [NewActionPage]
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<ion-content>
|
||||
<div class="content-container">
|
||||
|
||||
<div class="ion-item-container">
|
||||
<div class="ion-item-container" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
|
||||
<ion-input [(ngModel)]="folder.Description" placeholder="Assunto" ></ion-input>
|
||||
</div>
|
||||
|
||||
@@ -31,14 +31,34 @@
|
||||
</div>
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
<ion-datetime
|
||||
class="d-block d-md-none"
|
||||
[(ngModel)]="folder.DateBegin"
|
||||
placeholder="Início"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022">
|
||||
max="2025">
|
||||
</ion-datetime>
|
||||
|
||||
|
||||
<mat-form-field class="width-100 date-hour-picker d-md-block">
|
||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||
placeholder="Choose a date*"
|
||||
[formControl]="dateControlStart"
|
||||
[min]="minDate"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #picker1
|
||||
[showSpinners]="showSpinners"
|
||||
[showSeconds]="showSeconds"
|
||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||
[stepSecond]="stepSecond"
|
||||
[touchUi]="touchUi">
|
||||
</ngx-mat-datetime-picker>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -50,15 +70,33 @@
|
||||
</div>
|
||||
<div class="ion-input-class d-flex flex-grow-1">
|
||||
<ion-datetime
|
||||
class="flex-grow-1"
|
||||
class="flex-grow-1 d-md-none"
|
||||
[(ngModel)]="folder.DateEnd"
|
||||
placeholder="Fim"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022">
|
||||
max="2025">
|
||||
</ion-datetime>
|
||||
|
||||
|
||||
<mat-form-field class="width-100 date-hour-picker d-md-block">
|
||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||
placeholder="Choose a date*"
|
||||
[formControl]="dateControlEnd"
|
||||
[min]="minDate"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #picker1
|
||||
[showSpinners]="showSpinners"
|
||||
[showSeconds]="showSeconds"
|
||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||
[stepSecond]="stepSecond"
|
||||
[touchUi]="touchUi">
|
||||
</ngx-mat-datetime-picker>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { AnimationController, ModalController } from '@ionic/angular';
|
||||
import * as moment from 'moment';
|
||||
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
@@ -15,16 +17,35 @@ export class NewActionPage implements OnInit {
|
||||
|
||||
folder: PublicationFolder;
|
||||
segment:string;
|
||||
public minDate = new Date();
|
||||
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
|
||||
|
||||
Form: FormGroup;
|
||||
validateFrom = false
|
||||
|
||||
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
|
||||
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
|
||||
|
||||
|
||||
@Output() closeDesktopComponent= new EventEmitter<any>();
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private publication: PublicationsService,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService
|
||||
) {
|
||||
this.folder = new PublicationFolder();
|
||||
|
||||
this.dateControlStart = new FormControl(moment(new Date()));
|
||||
this.dateControlEnd = new FormControl(moment(new Date(new Date().getTime() + 15 * 60000)));
|
||||
|
||||
}
|
||||
|
||||
get dateStart () {
|
||||
return this.dateControlStart.value
|
||||
}
|
||||
|
||||
get dateEnd () {
|
||||
return this.dateControlEnd.value
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -35,7 +56,30 @@ export class NewActionPage implements OnInit {
|
||||
console.log(ev.detail.value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
runValidation() {
|
||||
this.validateFrom = true
|
||||
}
|
||||
|
||||
injectValidation() {
|
||||
|
||||
this.Form = new FormGroup({
|
||||
Subject: new FormControl(this.folder.Description, [
|
||||
Validators.required,
|
||||
// Validators.minLength(4)
|
||||
])
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
async save() {
|
||||
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
|
||||
if(this.Form.invalid) return false
|
||||
|
||||
this.folder = {
|
||||
ProcessId: null,
|
||||
Description: this.folder.Description,
|
||||
|
||||
@@ -12,15 +12,13 @@
|
||||
<ion-content>
|
||||
<div class="content-container">
|
||||
|
||||
<div *ngIf="publicationType!='1'" class="ion-item-container">
|
||||
<div *ngIf="publicationType!='1'" class="ion-item-container" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
|
||||
<ion-input [(ngModel)]="pub.Title" name="title" placeholder="Título" ></ion-input>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div *ngIf="publicationType!='1'" class="container-div pb-20">
|
||||
<div class="ion-item-class-2 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<div class="ion-icon-class" >
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-textarea-class flex-grow-1">
|
||||
|
||||
@@ -13,12 +13,8 @@ import { PhotoService } from 'src/app/services/photo.service';
|
||||
|
||||
//Cordova
|
||||
import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
|
||||
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||
import { ViewPublicationsPage } from '../view-publications/view-publications.page';
|
||||
import { LoadingService } from 'src/app/services/loading.service';
|
||||
import { BadRequestPage } from '../../popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage} from '../../popover/success-message/success-message.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-publication',
|
||||
@@ -35,6 +31,8 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
Defaultimage:any = '';
|
||||
|
||||
Form: FormGroup;
|
||||
validateFrom = false
|
||||
|
||||
photo: SafeResourceUrl;
|
||||
|
||||
@@ -139,7 +137,30 @@ export class NewPublicationPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
runValidation() {
|
||||
this.validateFrom = true
|
||||
}
|
||||
|
||||
injectValidation() {
|
||||
|
||||
this.Form = new FormGroup({
|
||||
Subject: new FormControl(this.pub.Title, [
|
||||
Validators.required,
|
||||
// Validators.minLength(4)
|
||||
])
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
async save(){
|
||||
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
|
||||
if(this.Form.invalid) return false
|
||||
|
||||
if(this.publicationType == '3'){
|
||||
|
||||
if(this.capturedImage != '') {
|
||||
|
||||
Reference in New Issue
Block a user