Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
Front-NG
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
José Alejandro Cáceres López
Front-NG
Commits
e0ac78c4
Commit
e0ac78c4
authored
Aug 23, 2023
by
José Alejandro Cáceres López
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
informe de avance
parent
e4ad8b2a
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
547 additions
and
54 deletions
+547
-54
config-panel-toggle.component.html
...el/config-panel-toggle/config-panel-toggle.component.html
+2
-2
layout.component.html
src/@vex/layout/layout.component.html
+4
-2
layout.component.ts
src/@vex/layout/layout.component.ts
+26
-7
toolbar-notifications.component.html
...oolbar-notifications/toolbar-notifications.component.html
+2
-1
toolbar-search.component.html
...yout/toolbar/toolbar-search/toolbar-search.component.html
+2
-2
toolbar.component.html
src/@vex/layout/toolbar/toolbar.component.html
+6
-6
auth.service.ts
src/app/core/auth/services/auth.service.ts
+12
-7
actproy.ts
src/app/modules/main/Models/actproy.ts
+7
-0
detactproy.ts
src/app/modules/main/Models/detactproy.ts
+8
-0
main.module.ts
src/app/modules/main/main.module.ts
+10
-2
add-informe.component.css
.../informes de avance/add-informe/add-informe.component.css
+68
-0
add-informe.component.html
...informes de avance/add-informe/add-informe.component.html
+16
-0
add-informe.component.spec.ts
...ormes de avance/add-informe/add-informe.component.spec.ts
+23
-0
add-informe.component.ts
...n/informes de avance/add-informe/add-informe.component.ts
+63
-0
edit-informe-body.component.css
... avance/edit-informe-body/edit-informe-body.component.css
+0
-0
edit-informe-body.component.html
...avance/edit-informe-body/edit-informe-body.component.html
+1
-0
edit-informe-body.component.spec.ts
...nce/edit-informe-body/edit-informe-body.component.spec.ts
+23
-0
edit-informe-body.component.ts
...e avance/edit-informe-body/edit-informe-body.component.ts
+15
-0
list-informe.component.html
...formes de avance/list-informe/list-informe.component.html
+30
-18
list-informe.component.ts
...informes de avance/list-informe/list-informe.component.ts
+86
-4
edit-proyecto.component.html
...ctos/Proyectos/edit-proyecto/edit-proyecto.component.html
+1
-1
compartir_id.service.ts
...odules/main/services/compartir_id/compartir_id.service.ts
+50
-1
informes_avance.service.spec.ts
.../services/informes_avance/informes_avance.service.spec.ts
+16
-0
informes_avance.service.ts
.../main/services/informes_avance/informes_avance.service.ts
+71
-0
mostrar-ocultar.service.ts
src/app/modules/main/services/mostrar-ocultar.service.ts
+5
-1
No files found.
src/@vex/components/config-panel/config-panel-toggle/config-panel-toggle.component.html
View file @
e0ac78c4
<button
<
!--<
button
(click)="openConfig.emit()"
(click)="openConfig.emit()"
class="config-panel-toggle"
class="config-panel-toggle"
color="primary"
color="primary"
mat-fab
mat-fab
type="button">
type="button">
<mat-icon svgIcon="mat:settings"></mat-icon>
<mat-icon svgIcon="mat:settings"></mat-icon>
</button>
</button>
-->
src/@vex/layout/layout.component.html
View file @
e0ac78c4
<div
<div
*
ngIf=
"authService.isUiEnabled"
>
<div
[
class
.
boxed
]="
isBoxed
$
|
async
"
[
class
.
boxed
]="
isBoxed
$
|
async
"
[
class
.
horizontal-layout
]="(
isLayoutVertical
$
|
async
)
===
false
"
[
class
.
horizontal-layout
]="(
isLayoutVertical
$
|
async
)
===
false
"
[
class
.
is-mobile
]="(
isDesktop
$
|
async
)
===
false
"
[
class
.
is-mobile
]="(
isDesktop
$
|
async
)
===
false
"
...
@@ -51,4 +52,5 @@
...
@@ -51,4 +52,5 @@
<ng-container
*
ngTemplateOutlet=
"footerRef"
></ng-container>
<ng-container
*
ngTemplateOutlet=
"footerRef"
></ng-container>
</mat-sidenav-content>
</mat-sidenav-content>
</mat-sidenav-container>
</mat-sidenav-container>
</div>
</div>
</div>
src/@vex/layout/layout.component.ts
View file @
e0ac78c4
...
@@ -17,6 +17,7 @@ import { filter, map, startWith, withLatestFrom } from 'rxjs/operators';
...
@@ -17,6 +17,7 @@ import { filter, map, startWith, withLatestFrom } from 'rxjs/operators';
import
{
checkRouterChildsData
}
from
'../utils/check-router-childs-data'
;
import
{
checkRouterChildsData
}
from
'../utils/check-router-childs-data'
;
import
{
DOCUMENT
}
from
'@angular/common'
;
import
{
DOCUMENT
}
from
'@angular/common'
;
import
{
ConfigService
}
from
'../config/config.service'
;
import
{
ConfigService
}
from
'../config/config.service'
;
import
{
AuthService
}
from
'src/app/core/auth/services/auth.service'
;
@
UntilDestroy
()
@
UntilDestroy
()
@
Component
({
@
Component
({
...
@@ -70,9 +71,9 @@ export class LayoutComponent implements OnInit, AfterViewInit {
...
@@ -70,9 +71,9 @@ export class LayoutComponent implements OnInit, AfterViewInit {
searchOpen$
=
this
.
layoutService
.
searchOpen$
;
searchOpen$
=
this
.
layoutService
.
searchOpen$
;
@
ViewChild
(
'quickpanel'
,
{
static
:
tru
e
})
quickpanel
:
MatSidenav
;
@
ViewChild
(
'quickpanel'
,
{
static
:
fals
e
})
quickpanel
:
MatSidenav
;
@
ViewChild
(
'sidenav'
,
{
static
:
tru
e
})
sidenav
:
MatSidenav
;
@
ViewChild
(
'sidenav'
,
{
static
:
fals
e
})
sidenav
:
MatSidenav
;
@
ViewChild
(
MatSidenavContainer
,
{
static
:
tru
e
})
@
ViewChild
(
MatSidenavContainer
,
{
static
:
fals
e
})
sidenavContainer
:
MatSidenavContainer
;
sidenavContainer
:
MatSidenavContainer
;
constructor
(
constructor
(
...
@@ -81,6 +82,7 @@ export class LayoutComponent implements OnInit, AfterViewInit {
...
@@ -81,6 +82,7 @@ export class LayoutComponent implements OnInit, AfterViewInit {
private
layoutService
:
LayoutService
,
private
layoutService
:
LayoutService
,
private
configService
:
ConfigService
,
private
configService
:
ConfigService
,
private
router
:
Router
,
private
router
:
Router
,
public
authService
:
AuthService
,
@
Inject
(
DOCUMENT
)
private
document
:
Document
@
Inject
(
DOCUMENT
)
private
document
:
Document
)
{}
)
{}
...
@@ -100,16 +102,33 @@ export class LayoutComponent implements OnInit, AfterViewInit {
...
@@ -100,16 +102,33 @@ export class LayoutComponent implements OnInit, AfterViewInit {
*/
*/
this
.
layoutService
.
quickpanelOpen$
this
.
layoutService
.
quickpanelOpen$
.
pipe
(
untilDestroyed
(
this
))
.
pipe
(
untilDestroyed
(
this
))
.
subscribe
(
open
=>
.
subscribe
(
open
=>
{
open
?
this
.
quickpanel
.
open
()
:
this
.
quickpanel
.
close
()
try
{
);
if
(
this
.
quickpanel
)
{
open
?
this
.
quickpanel
.
open
()
:
this
.
quickpanel
.
close
();
}
}
catch
(
error
)
{
console
.
log
(
error
)
}
});
/**
/**
* Open/Close Sidenav through LayoutService
* Open/Close Sidenav through LayoutService
*/
*/
this
.
layoutService
.
sidenavOpen$
this
.
layoutService
.
sidenavOpen$
.
pipe
(
untilDestroyed
(
this
))
.
pipe
(
untilDestroyed
(
this
))
.
subscribe
(
open
=>
(
open
?
this
.
sidenav
.
open
()
:
this
.
sidenav
.
close
()));
.
subscribe
(
open
=>
{
try
{
if
(
this
.
sidenav
)
{
open
?
this
.
sidenav
.
open
()
:
this
.
sidenav
.
close
();
}
}
catch
(
error
)
{
console
.
log
(
error
)
}
});
/**
/**
* Mobile only:
* Mobile only:
...
...
src/@vex/layout/toolbar/toolbar-notifications/toolbar-notifications.component.html
View file @
e0ac78c4
<button
<
!--<
button
#originRef
#originRef
(click)="showPopover()"
(click)="showPopover()"
[class.bg-hover]="dropdownOpen"
[class.bg-hover]="dropdownOpen"
...
@@ -7,3 +7,4 @@
...
@@ -7,3 +7,4 @@
type="button">
type="button">
<mat-icon color="primary" svgIcon="mat:notifications_active"></mat-icon>
<mat-icon color="primary" svgIcon="mat:notifications_active"></mat-icon>
</button>
</button>
-->
src/@vex/layout/toolbar/toolbar-search/toolbar-search.component.html
View file @
e0ac78c4
<div
class=
"flex items-center"
>
<
!--<
div class="flex items-center">
<button (click)="open()" mat-icon-button>
<button (click)="open()" mat-icon-button>
<mat-icon svgIcon="mat:search"></mat-icon>
<mat-icon svgIcon="mat:search"></mat-icon>
</button>
</button>
...
@@ -9,4 +9,4 @@
...
@@ -9,4 +9,4 @@
<mat-label>Search…</mat-label>
<mat-label>Search…</mat-label>
<input #input (blur)="close()" matInput />
<input #input (blur)="close()" matInput />
</mat-form-field>
</mat-form-field>
</div>
</div>
-->
src/@vex/layout/toolbar/toolbar.component.html
View file @
e0ac78c4
...
@@ -36,9 +36,9 @@
...
@@ -36,9 +36,9 @@
<div
class=
"-mx-1 flex items-center"
>
<div
class=
"-mx-1 flex items-center"
>
<div
class=
"px-1"
>
<div
class=
"px-1"
>
<button
(
click
)="
openSearch
()"
mat-icon-button
type=
"button"
>
<
!-- <
button (click)="openSearch()" mat-icon-button type="button">
<mat-icon color="primary" svgIcon="mat:search"></mat-icon>
<mat-icon color="primary" svgIcon="mat:search"></mat-icon>
</button>
</button>
-->
</div>
</div>
<div
class=
"px-1"
>
<div
class=
"px-1"
>
...
@@ -46,15 +46,15 @@
...
@@ -46,15 +46,15 @@
</div>
</div>
<div
class=
"px-1"
>
<div
class=
"px-1"
>
<button
(
click
)="
openQuickpanel
()"
mat-icon-button
type=
"button"
>
<
!-- <
button (click)="openQuickpanel()" mat-icon-button type="button">
<mat-icon color="primary" svgIcon="mat:bookmarks"></mat-icon>
<mat-icon color="primary" svgIcon="mat:bookmarks"></mat-icon>
</button>
</button>
-->
</div>
</div>
<div
class=
"px-1"
>
<div
class=
"px-1"
>
<button
[
matMenuTriggerFor
]="
languageMenu
"
mat-icon-button
type=
"button"
>
<
!-- <
button [matMenuTriggerFor]="languageMenu" mat-icon-button type="button">
<mat-icon svgIcon="flag:united-states"></mat-icon>
<mat-icon svgIcon="flag:united-states"></mat-icon>
</button>
</button>
-->
</div>
</div>
<div
*
ngIf=
"userVisible$ | async"
class=
"px-1"
>
<div
*
ngIf=
"userVisible$ | async"
class=
"px-1"
>
...
...
src/app/core/auth/services/auth.service.ts
View file @
e0ac78c4
...
@@ -12,6 +12,11 @@ import { Router } from '@angular/router';
...
@@ -12,6 +12,11 @@ import { Router } from '@angular/router';
providedIn
:
'root'
,
providedIn
:
'root'
,
})
})
export
class
AuthService
{
export
class
AuthService
{
public
isUiEnabled
:
boolean
=
false
;
private
isVerifying
:
boolean
=
false
;
private
globalUserSubject
:
BehaviorSubject
<
GlobalUser
>
=
private
globalUserSubject
:
BehaviorSubject
<
GlobalUser
>
=
new
BehaviorSubject
<
GlobalUser
>
(
null
);
new
BehaviorSubject
<
GlobalUser
>
(
null
);
globalUser$
:
Observable
<
GlobalUser
>
=
this
.
globalUserSubject
.
asObservable
();
globalUser$
:
Observable
<
GlobalUser
>
=
this
.
globalUserSubject
.
asObservable
();
...
@@ -72,25 +77,25 @@ export class AuthService {
...
@@ -72,25 +77,25 @@ export class AuthService {
private
getGlobalUser
()
{
private
getGlobalUser
()
{
const
email
=
this
.
oAuthService
.
getIdentityClaims
()[
'email'
];
const
email
=
this
.
oAuthService
.
getIdentityClaims
()[
'email'
];
// Realizar la solicitud HTTP al backend para verificar si el email del usuario existe en tu tabla de usuarios
this
.
httpClient
.
get
<
boolean
>
(
`http://localhost:8080/api/v1.0/users/by-email/
${
email
}
`
).
subscribe
(
this
.
httpClient
.
get
<
boolean
>
(
`http://localhost:8080/api/v1.0/users/by-email/
${
email
}
`
).
subscribe
(
(
exists
:
boolean
)
=>
{
(
exists
:
boolean
)
=>
{
this
.
isVerifying
=
false
;
// Restaurar la bandera de verificación
if
(
exists
)
{
if
(
exists
)
{
//existe el email en la bdd
// Existe el email en la bdd
this
.
globalUserService
this
.
globalUserService
.
getUserByUsername
(
this
.
tokenClaims
.
username
).
subscribe
(
user
=>
{
.
getUserByUsername
(
this
.
tokenClaims
.
username
)
.
subscribe
(
user
=>
{
this
.
setGlobalUser
(
user
);
this
.
setGlobalUser
(
user
);
this
.
isUiEnabled
=
true
;
// Habilitar la interfaz una vez que se completa la verificación
});
});
}
}
},
},
(
error
)
=>
{
(
error
)
=>
{
this
.
isUiEnabled
=
false
;
this
.
logout
();
this
.
logout
();
console
.
error
(
'Error al verificar el email del usuario'
,
error
);
}
}
);
);
}
}
private
setGlobalUser
(
user
:
GlobalUser
)
{
private
setGlobalUser
(
user
:
GlobalUser
)
{
this
.
globalUserSubject
.
next
(
user
);
this
.
globalUserSubject
.
next
(
user
);
...
...
src/app/modules/main/Models/actproy.ts
0 → 100644
View file @
e0ac78c4
export
class
actproy
{
uzytavactproy_id
?:
number
;
uzytavactproy_fech_regis
?:
Date
;
uzytavactproy_observa
?:
string
;
uzytavobjetivo_programa_id
?:
number
;
uzytavproyec_id
?:
number
;
}
src/app/modules/main/Models/detactproy.ts
0 → 100644
View file @
e0ac78c4
export
class
detactproy
{
uzytavdetactproy_id
?:
number
;
uzytavactproy_id
?:
number
;
uzytavobjetivo_programa_id
?:
number
;
uzytavdetactproyporcent
?:
number
;
uzytavdetactproyobserva
?:
string
;
uzytavdetactproyresultado
?:
string
;
}
src/app/modules/main/main.module.ts
View file @
e0ac78c4
...
@@ -220,6 +220,10 @@ import { AporteUniEjecComponent } from './pages/Proyectos/Cierre/presupuesto eje
...
@@ -220,6 +220,10 @@ import { AporteUniEjecComponent } from './pages/Proyectos/Cierre/presupuesto eje
import
{
ErrorTextoComponent
}
from
'./pages/Proyectos/errores/error-texto/error-texto.component'
;
import
{
ErrorTextoComponent
}
from
'./pages/Proyectos/errores/error-texto/error-texto.component'
;
import
{
seguim
}
from
'./Models/hito'
;
import
{
seguim
}
from
'./Models/hito'
;
import
{
ComisionAsigComponent
}
from
'./pages/asignar comision/comision-asig/comision-asig.component'
;
import
{
ComisionAsigComponent
}
from
'./pages/asignar comision/comision-asig/comision-asig.component'
;
import
{
actproy
}
from
'./Models/actproy'
;
import
{
detactproy
}
from
'./Models/detactproy'
;
import
{
EditInformeBodyComponent
}
from
'./pages/Proyectos/Ejecución/informes de avance/edit-informe-body/edit-informe-body.component'
;
import
{
AddInformeComponent
}
from
'./pages/Proyectos/Ejecución/informes de avance/add-informe/add-informe.component'
;
@
NgModule
({
@
NgModule
({
schemas
:
[
CUSTOM_ELEMENTS_SCHEMA
],
schemas
:
[
CUSTOM_ELEMENTS_SCHEMA
],
declarations
:
[
declarations
:
[
...
@@ -391,7 +395,9 @@ import { ComisionAsigComponent } from './pages/asignar comision/comision-asig/co
...
@@ -391,7 +395,9 @@ import { ComisionAsigComponent } from './pages/asignar comision/comision-asig/co
AporteEntEjecComponent
,
AporteEntEjecComponent
,
AporteUniEjecComponent
,
AporteUniEjecComponent
,
ErrorTextoComponent
,
ErrorTextoComponent
,
ComisionAsigComponent
ComisionAsigComponent
,
EditInformeBodyComponent
,
AddInformeComponent
],
],
imports
:
[
imports
:
[
MatTreeModule
,
MatTreeModule
,
...
@@ -446,7 +452,9 @@ import { ComisionAsigComponent } from './pages/asignar comision/comision-asig/co
...
@@ -446,7 +452,9 @@ import { ComisionAsigComponent } from './pages/asignar comision/comision-asig/co
prograObj
,
prograObj
,
FormBuilder
,
FormBuilder
,
planvprograma
,
planvprograma
,
programaeplanv
programaeplanv
,
actproy
,
detactproy
]
]
})
})
export
class
MainModule
{
export
class
MainModule
{
...
...
src/app/modules/main/pages/Proyectos/Ejecución/informes de avance/add-informe/add-informe.component.css
0 → 100644
View file @
e0ac78c4
.area-busqueda
{
padding
:
20px
;
margin-top
:
30px
;
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
}
.contenedorP
{
width
:
96%
;
margin-left
:
2%
;
margin-right
:
2%
;
margin
:
5px
auto
;
border-radius
:
10px
;
text-align
:
center
;
margin-top
:
2%
;
background-color
:
white
;
}
.mat-mdc-radio-button
~
.mat-mdc-radio-button
{
margin-left
:
16px
;
}
.mat-radio-button
{
margin-right
:
10px
;
}
.form-container
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
width
:
80%
;
}
.formulario
{
display
:
flex
;
flex-wrap
:
wrap
;
justify-content
:
space-between
;
max-width
:
96%
;
margin
:
0
auto
;
background-color
:
white
;
padding
:
10px
;
border-radius
:
10px
;
}
.contenedor-dos
{
margin-top
:
30px
;
padding
:
0.9375rem
20px
;
position
:
relative
;
}
.form-field
{
width
:
100%
;
margin-bottom
:
20px
;
}
.separator
{
margin
:
0
5px
;
opacity
:
0
;
pointer-events
:
none
;
}
.separator2
{
margin
:
5px
0
;
opacity
:
0
;
pointer-events
:
none
;
}
src/app/modules/main/pages/Proyectos/Ejecución/informes de avance/add-informe/add-informe.component.html
0 → 100644
View file @
e0ac78c4
<div
class=
"contenedorP"
>
<div>
<form
[
formGroup
]="
myForm
"
(
ngSubmit
)="
onUpdate
()"
>
<mat-label
*
ngIf=
"ocultar"
><strong>
Seleccione una Actividad
</strong></mat-label>
<mat-form-field
class=
"form-field"
*
ngIf=
"ocultar"
>
<mat-label>
Seleccione un Item
</mat-label>
<mat-select
formControlName=
"Actividades"
>
<mat-option
*
ngFor=
"let item of objetivosE"
[
value
]="
item
.
uzytavobjetivo_programa_id
"
>
{{ item.uzytavobjetivo_programaobjetivo_proy}}
</mat-option>
</mat-select>
</mat-form-field>
</form>
</div>
</div>
src/app/modules/main/pages/Proyectos/Ejecución/informes de avance/add-informe/add-informe.component.spec.ts
0 → 100644
View file @
e0ac78c4
import
{
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
AddInformeComponent
}
from
'./add-informe.component'
;
describe
(
'AddInformeComponent'
,
()
=>
{
let
component
:
AddInformeComponent
;
let
fixture
:
ComponentFixture
<
AddInformeComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
declarations
:
[
AddInformeComponent
]
})
.
compileComponents
();
fixture
=
TestBed
.
createComponent
(
AddInformeComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
src/app/modules/main/pages/Proyectos/Ejecución/informes de avance/add-informe/add-informe.component.ts
0 → 100644
View file @
e0ac78c4
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
FormBuilder
,
FormGroup
,
Validators
}
from
'@angular/forms'
;
import
{
objetivoprograma
}
from
'src/app/modules/main/Models/objetivoPrograma'
;
import
{
Actualiza_datosService
}
from
'src/app/modules/main/services/actualiza_datos/actualiza_datos.service'
;
import
{
Objetivo_programaService
}
from
'src/app/modules/main/services/objetivo_programa/objetivo_programa.service'
;
@
Component
({
selector
:
'vex-add-informe'
,
templateUrl
:
'./add-informe.component.html'
,
styleUrls
:
[
'./add-informe.component.css'
]
})
export
class
AddInformeComponent
implements
OnInit
{
myForm
:
FormGroup
;
showData
:
boolean
=
false
;
ShowDataAdd
:
boolean
=
false
;
ocultar
:
boolean
=
true
;
idRecuperado
:
number
;
//arreglos
objetivosE
:
objetivoprograma
[]
=
[];
constructor
(
private
objetS
:
Objetivo_programaService
,
private
datosCompartidos
:
Actualiza_datosService
,
private
formBuilder
:
FormBuilder
)
{
this
.
myForm
=
this
.
formBuilder
.
group
({
Actividades
:
[
''
,
Validators
.
required
]
});
}
ngOnInit
():
void
{
this
.
idRecuperado
=
parseInt
(
localStorage
.
getItem
(
'proyectoId'
),
10
);
this
.
datosCompartidos
.
datos$
.
subscribe
(()
=>
{
this
.
obtenerRegistros
();
});
this
.
objetS
.
parametrosActualizados
.
subscribe
(()
=>
{
this
.
obtenerRegistros
();
});
}
obtenerRegistros
(){
this
.
objetS
.
registrosRelacionadosConProyecto
(
this
.
idRecuperado
).
subscribe
(
data
=>
{
this
.
objetivosE
=
data
.
filter
(
item
=>
item
.
uzytavobjetivo_programatipo
===
3
);
console
.
log
(
'impresión del arreglo'
,
this
.
objetivosE
)
});
}
AgregarF
(){
}
cancelarF
(){
}
onUpdate
(){
}
}
src/app/modules/main/pages/Proyectos/Ejecución/informes de avance/edit-informe-body/edit-informe-body.component.css
0 → 100644
View file @
e0ac78c4
src/app/modules/main/pages/Proyectos/Ejecución/informes de avance/edit-informe-body/edit-informe-body.component.html
0 → 100644
View file @
e0ac78c4
<p>
edit-informe-body works!
</p>
src/app/modules/main/pages/Proyectos/Ejecución/informes de avance/edit-informe-body/edit-informe-body.component.spec.ts
0 → 100644
View file @
e0ac78c4
import
{
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
EditInformeBodyComponent
}
from
'./edit-informe-body.component'
;
describe
(
'EditInformeBodyComponent'
,
()
=>
{
let
component
:
EditInformeBodyComponent
;
let
fixture
:
ComponentFixture
<
EditInformeBodyComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
declarations
:
[
EditInformeBodyComponent
]
})
.
compileComponents
();
fixture
=
TestBed
.
createComponent
(
EditInformeBodyComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
src/app/modules/main/pages/Proyectos/Ejecución/informes de avance/edit-informe-body/edit-informe-body.component.ts
0 → 100644
View file @
e0ac78c4
import
{
Component
,
OnInit
}
from
'@angular/core'
;
@
Component
({
selector
:
'vex-edit-informe-body'
,
templateUrl
:
'./edit-informe-body.component.html'
,
styleUrls
:
[
'./edit-informe-body.component.css'
]
})
export
class
EditInformeBodyComponent
implements
OnInit
{
constructor
()
{
}
ngOnInit
():
void
{
}
}
src/app/modules/main/pages/Proyectos/Ejecución/informes de avance/list-informe/list-informe.component.html
View file @
e0ac78c4
<div
class=
"container"
#
activitySection
>
<vex-edit-informe
*
ngIf=
"idCompartido.mostrar4"
></vex-edit-informe>
<vex-edit-informe-body
*
ngIf=
"idCompartido.mostrar5"
></vex-edit-informe-body>
</div>
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"div-container"
>
<div
class=
"div-container"
>
<label
class=
"label-negrita"
><strong>
Listado de informes de avance
</strong></label>
<label
class=
"label-negrita"
><strong>
Listado de informes de avance
</strong></label>
...
@@ -15,8 +20,8 @@
...
@@ -15,8 +20,8 @@
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<ng-container
*
ngFor=
"let item of
objetivoEspe
; let i = index"
>
<ng-container
*
ngFor=
"let item of
cabecera
; let i = index"
>
<tr
id=
"fila-{{i}}"
>
<tr
id=
"fila-{{i}}"
>
<td>
<td>
<button
(
click
)="
toggleDiv
(
i
)"
>
<button
(
click
)="
toggleDiv
(
i
)"
>
<mat-icon>
{{ mostrarDiv[i] ? 'keyboard_arrow_down' :
<mat-icon>
{{ mostrarDiv[i] ? 'keyboard_arrow_down' :
...
@@ -26,12 +31,16 @@
...
@@ -26,12 +31,16 @@
<td>
<td>
{{i+1}}
{{i+1}}
</td>
</td>
<td>
{{item.uzytav
objetivo_programaobjetivo_proy
}}
</td>
<td>
{{item.uzytav
actproy_fech_regis
}}
</td>
<td>
{{item.uzytav
objetivo_programaindicador_tipo
}}
</td>
<td>
{{item.uzytav
actproy_observa
}}
</td>
<td>
<td>
<button>
<mat-icon
color=
"primary"
(
click
)="
editarCabecera
(
item
.
uzytavactproy_id
)"
>
edit
</mat-icon>
</button>
<button>
<button>
<mat-icon
color=
"warn"
<mat-icon
color=
"warn"
(
click
)="
eliminar
(
item
.
uzytav
objetivo_programa
_id
)"
>
delete
</mat-icon>
(
click
)="
eliminar
(
item
.
uzytav
actproy
_id
)"
>
delete
</mat-icon>
</button>
</button>
</td>
</td>
</tr>
</tr>
...
@@ -46,24 +55,27 @@
...
@@ -46,24 +55,27 @@
<tr>
<tr>
<th
class=
"Column1 negrita"
>
Nro
</th>
<th
class=
"Column1 negrita"
>
Nro
</th>
<th
class=
"Column1 negrita"
>
Descripción
</th>
<th
class=
"Column1 negrita"
>
Descripción
</th>
<th
class=
"Column1 negrita"
>
Tipo Indicador
</th>
<th
class=
"Column1 negrita"
>
Porcentaje
</th>
<th
class=
"Column1 negrita"
>
Valor Indicador
</th>
<th
class=
"Column1 negrita"
>
Observación
</th>
<th
class=
"Column1 negrita"
>
Descripción Indicador
</th>
<th
class=
"Column1 negrita"
>
Resultados
</th>
<th
class=
"Column1 negrita"
>
Medio de Verificación
</th>
<th
class=
"Column1 negrita"
>
Editar
</th>
<th
class=
"Column1 negrita"
>
Supuestos
</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr
*
ngFor=
"let acti of
objetivoEspe
; let i = index"
>
<tr
*
ngFor=
"let acti of
body
; let i = index"
>
<ng-container
<ng-container
*
ngIf=
"acti.uzytav
objetivo_programa_id_padre === item.uzytavobjetivo_programa
_id"
>
*
ngIf=
"acti.uzytav
actproy_id === item.uzytavactproy
_id"
>
<td>
{{ i+1 }}
</td>
<td>
{{ i+1 }}
</td>
<td>
{{acti.uzytavobjetivo_programaobjetivo_proy}}
</td>
<td>
{{getNombre(acti.uzytavobjetivo_programa_id)}}
</td>
<td>
{{acti.uzytavobjetivo_programaindicador_tipo}}
</td>
<td>
{{acti.uzytavdetactproyporcent}}
</td>
<td>
{{acti.uzytavobjetivo_programaindicador_valor}}
</td>
<td>
{{acti.uzytavdetactproyobserva}}
</td>
<td>
{{acti.uzytavobjetivo_programaindicador}}
</td>
<td>
{{acti.uzytavdetactproyresultado}}
</td>
<td>
{{acti.uzytavobjetivo_programamverifica}}
</td>
<td>
<td>
{{acti.uzytavobjetivo_programasupuestos}}
</td>
<button>
<mat-icon
color=
"primary"
(
click
)="
editarBody
(
acti
.
uzytavdetactproy_id
)"
>
edit
</mat-icon>
</button>
</td>
</ng-container>
</ng-container>
</tr>
</tr>
</tbody>
</tbody>
...
...
src/app/modules/main/pages/Proyectos/Ejecución/informes de avance/list-informe/list-informe.component.ts
View file @
e0ac78c4
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
ElementRef
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
actproy
}
from
'src/app/modules/main/Models/actproy'
;
import
{
detactproy
}
from
'src/app/modules/main/Models/detactproy'
;
import
{
objetivoprograma
}
from
'src/app/modules/main/Models/objetivoPrograma'
;
import
{
objetivoprograma
}
from
'src/app/modules/main/Models/objetivoPrograma'
;
import
{
Actualiza_datosService
}
from
'src/app/modules/main/services/actualiza_datos/actualiza_datos.service'
;
import
{
Compartir_idService
}
from
'src/app/modules/main/services/compartir_id/compartir_id.service'
;
import
{
Informes_avanceService
}
from
'src/app/modules/main/services/informes_avance/informes_avance.service'
;
import
{
MostrarOcultarService
}
from
'src/app/modules/main/services/mostrar-ocultar.service'
;
import
{
Objetivo_programaService
}
from
'src/app/modules/main/services/objetivo_programa/objetivo_programa.service'
;
@
Component
({
@
Component
({
selector
:
'vex-list-informe'
,
selector
:
'vex-list-informe'
,
...
@@ -7,17 +14,67 @@ import { objetivoprograma } from 'src/app/modules/main/Models/objetivoPrograma';
...
@@ -7,17 +14,67 @@ import { objetivoprograma } from 'src/app/modules/main/Models/objetivoPrograma';
styleUrls
:
[
'./list-informe.component.css'
]
styleUrls
:
[
'./list-informe.component.css'
]
})
})
export
class
ListInformeComponent
implements
OnInit
{
export
class
ListInformeComponent
implements
OnInit
{
@
ViewChild
(
'activitySection'
)
activitySection
!
:
ElementRef
;
//para mostrar el div
//para mostrar el div
mostrarDiv
:
boolean
[]
=
[];
mostrarDiv
:
boolean
[]
=
[];
//objetivosEspe
//arreglos
objetivoEspe
:
objetivoprograma
[]
=
[];
cabecera
:
actproy
[]
=
[];
constructor
()
{
}
body
:
detactproy
[]
=
[];
public
objetivo
:
objetivoprograma
[]
=
[];
//variables
idRecuperado
:
number
;
idObjetivo
:
number
constructor
(
private
informeS
:
Informes_avanceService
,
private
objetivoS
:
Objetivo_programaService
,
private
cabeceraM
:
actproy
,
private
bodyM
:
detactproy
,
private
compartirDatos
:
Actualiza_datosService
,
private
mostrarOcultarService
:
MostrarOcultarService
,
public
idCompartido
:
Compartir_idService
)
{
}
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
idRecuperado
=
parseInt
(
localStorage
.
getItem
(
'proyectoId'
),
10
)
setTimeout
(()
=>
{
this
.
compartirDatos
.
datos$
.
subscribe
(()
=>
{
this
.
obtenerRegistros
();
});
this
.
informeS
.
parametrosActualizados
.
subscribe
(()
=>
{
this
.
obtenerRegistros
();
});
});
}
}
//obtenerRegistros
obtenerRegistros
(){
this
.
objetivoS
.
obtenerParametros
().
subscribe
(
data
=>
{
this
.
objetivo
=
data
;
});
this
.
informeS
.
obtenerCabecera
().
subscribe
(
dataCabecera
=>
{
this
.
cabecera
=
dataCabecera
.
filter
(
item
=>
item
.
uzytavproyec_id
===
this
.
idRecuperado
);
});
this
.
informeS
.
obtenerCuerpo
().
subscribe
(
dataBody
=>
{
this
.
body
=
dataBody
;
});
}
//obtener el nombre
getNombre
(
id
:
number
):
string
{
const
busca
=
this
.
objetivo
.
find
(
i
=>
i
.
uzytavobjetivo_programa_id
===
id
)
if
(
busca
){
const
nombre
=
busca
.
uzytavobjetivo_programaobjetivo_proy
return
nombre
;
}
return
''
;
}
//toggle div para desplegar
//toggle div para desplegar
toggleDiv
(
i
:
number
){
toggleDiv
(
i
:
number
){
...
@@ -26,6 +83,31 @@ export class ListInformeComponent implements OnInit {
...
@@ -26,6 +83,31 @@ export class ListInformeComponent implements OnInit {
//acciones para eliminar
//acciones para eliminar
eliminar
(
id
:
number
){
eliminar
(
id
:
number
){
console
.
log
(
'registro eliminado'
,
id
)
}
editarCabecera
(
id
:
number
){
this
.
idCompartido
.
mostrarFormulario4
();
const
registroSeleccionado
=
this
.
cabecera
.
find
(
item
=>
item
.
uzytavactproy_id
===
id
);
this
.
idCompartido
.
setCabe
(
id
);
this
.
mostrarOcultarService
.
editCabecera
=
registroSeleccionado
;
console
.
log
(
'prueba para observar'
,
id
)
}
editarBody
(
id
:
number
){
this
.
idCompartido
.
mostrarFormulario5
();
const
registroSeleccionado
=
this
.
body
.
find
(
item
=>
item
.
uzytavdetactproy_id
===
id
);
this
.
idCompartido
.
setCabe
(
id
);
this
.
mostrarOcultarService
.
editBody
=
registroSeleccionado
;
}
scrollIntoView
()
{
if
(
this
.
activitySection
&&
this
.
activitySection
.
nativeElement
)
{
this
.
activitySection
.
nativeElement
.
scrollIntoView
({
behavior
:
'smooth'
});
}
}
}
}
}
src/app/modules/main/pages/Proyectos/Proyectos/edit-proyecto/edit-proyecto.component.html
View file @
e0ac78c4
...
@@ -543,7 +543,7 @@
...
@@ -543,7 +543,7 @@
1.- Informes de avance
1.- Informes de avance
</mat-panel-title>
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel-header>
<vex-
edit-informe></vex-edit
-informe>
<vex-
add-informe></vex-add
-informe>
<vex-list-informe></vex-list-informe>
<vex-list-informe></vex-list-informe>
<!--fin-->
<!--fin-->
</mat-expansion-panel>
</mat-expansion-panel>
...
...
src/app/modules/main/services/compartir_id/compartir_id.service.ts
View file @
e0ac78c4
...
@@ -11,6 +11,8 @@ export class Compartir_idService {
...
@@ -11,6 +11,8 @@ export class Compartir_idService {
private
_mostrarFormulario
:
boolean
=
false
;
private
_mostrarFormulario
:
boolean
=
false
;
private
_mostrarFormulario2
:
boolean
=
false
;
private
_mostrarFormulario2
:
boolean
=
false
;
private
_mostrarFormulario3
:
boolean
=
false
;
private
_mostrarFormulario3
:
boolean
=
false
;
private
_mostrarFormulario4
:
boolean
=
false
;
private
_mostrarFormulario5
:
boolean
=
false
;
private
provincia
:
string
;
private
provincia
:
string
;
private
canton
:
string
;
private
canton
:
string
;
private
parroquia
:
string
;
private
parroquia
:
string
;
...
@@ -25,9 +27,32 @@ export class Compartir_idService {
...
@@ -25,9 +27,32 @@ export class Compartir_idService {
private
nombreDepartamento
:
string
;
private
nombreDepartamento
:
string
;
private
idObje
:
number
;
private
idObje
:
number
;
private
id_insti
:
number
;
private
id_insti
:
number
;
private
id_cabe
:
number
;
private
id_body
:
number
;
constructor
()
{
}
constructor
()
{
}
/*cabecera */
getCabe
(){
return
this
.
id_cabe
}
setCabe
(
id
:
number
){
this
.
id_cabe
=
id
;
}
/*body */
getBody
(){
return
this
.
id_body
}
setBody
(
id
:
number
){
this
.
id_body
=
id
;
}
getIdInst
(){
getIdInst
(){
return
this
.
id_insti
return
this
.
id_insti
}
}
...
@@ -138,6 +163,30 @@ export class Compartir_idService {
...
@@ -138,6 +163,30 @@ export class Compartir_idService {
return
this
.
_mostrarFormulario3
;
return
this
.
_mostrarFormulario3
;
}
}
mostrarFormulario4
():
void
{
this
.
_mostrarFormulario4
=
true
;
}
ocultarFormulario4
():
void
{
this
.
_mostrarFormulario4
=
false
;
}
get
mostrar4
():
boolean
{
return
this
.
_mostrarFormulario4
;
}
mostrarFormulario5
():
void
{
this
.
_mostrarFormulario5
=
true
;
}
ocultarFormulario5
():
void
{
this
.
_mostrarFormulario5
=
false
;
}
get
mostrar5
():
boolean
{
return
this
.
_mostrarFormulario5
;
}
setIdZonaDetalle
(
id
:
number
)
{
setIdZonaDetalle
(
id
:
number
)
{
this
.
idZonaDetalle
=
id
;
this
.
idZonaDetalle
=
id
;
}
}
...
...
src/app/modules/main/services/informes_avance/informes_avance.service.spec.ts
0 → 100644
View file @
e0ac78c4
/* tslint:disable:no-unused-variable */
import
{
TestBed
,
async
,
inject
}
from
'@angular/core/testing'
;
import
{
Informes_avanceService
}
from
'./informes_avance.service'
;
describe
(
'Service: Informes_avance'
,
()
=>
{
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({
providers
:
[
Informes_avanceService
]
});
});
it
(
'should ...'
,
inject
([
Informes_avanceService
],
(
service
:
Informes_avanceService
)
=>
{
expect
(
service
).
toBeTruthy
();
}));
});
src/app/modules/main/services/informes_avance/informes_avance.service.ts
0 → 100644
View file @
e0ac78c4
import
{
HttpClient
}
from
'@angular/common/http'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
environment
}
from
'src/environments/environment'
;
import
{
Observable
,
Subject
}
from
'rxjs'
;
import
{
delay
,
tap
}
from
'rxjs/operators'
;
import
{
actproy
}
from
'../../Models/actproy'
;
import
{
detactproy
}
from
'../../Models/detactproy'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
Informes_avanceService
{
parametrosActualizados
:
Subject
<
void
>
=
new
Subject
<
void
>
();
//URL cuerpo
private
readonly
URL1
=
environment
.
appApiUrl
+
'/detactproy'
;
//Url Cabecera
private
readonly
URL2
=
environment
.
appApiUrl
+
'/actproy'
;
//variables
private
idGuardado
:
number
;
constructor
(
private
httpClient
:
HttpClient
)
{
}
//Read
obtenerCabecera
():
Observable
<
actproy
[]
>
{
return
this
.
httpClient
.
get
<
actproy
[]
>
(
`
${
this
.
URL2
}
/getAll`
).
pipe
(
delay
(
-
1
));
}
obtenerCuerpo
():
Observable
<
detactproy
[]
>
{
return
this
.
httpClient
.
get
<
detactproy
[]
>
(
`
${
this
.
URL1
}
/getAll`
).
pipe
(
delay
(
-
1
));
}
//create
guardarCabecera
(
parametros
:
actproy
):
Observable
<
any
>
{
return
this
.
httpClient
.
post
(
`
${
this
.
URL2
}
/guardar`
,
parametros
).
pipe
(
tap
((
response
:
any
)
=>
{
this
.
idGuardado
=
response
.
uzytavactproy_id
;
})
);
}
obtenerIdCabe
():
number
{
return
this
.
idGuardado
;
}
//create body
guardarParametros
(
parametros
:
detactproy
){
return
this
.
httpClient
.
post
(
this
.
URL1
+
'/guardar'
,
parametros
);
}
//eliminar cabecera
eliminarParametrosCabecera
(
id
:
number
):
Observable
<
any
>
{
return
this
.
httpClient
.
delete
(
`
${
this
.
URL2
}
/eliminar/
${
id
}
`
,
{
responseType
:
'text'
});
}
//eliminar body
eliminarParametrosBody
(
id
:
number
):
Observable
<
any
>
{
return
this
.
httpClient
.
delete
(
`
${
this
.
URL1
}
/eliminar/
${
id
}
`
,
{
responseType
:
'text'
});
}
//edit parametros
modificarParametrosCabecera
(
id
:
number
,
parametros
:
actproy
):
Observable
<
any
>
{
return
this
.
httpClient
.
put
<
any
>
(
`
${
this
.
URL2
}
/editar/
${
id
}
`
,
parametros
);
}
modificarParametrosBody
(
id
:
number
,
parametros
:
detactproy
):
Observable
<
any
>
{
return
this
.
httpClient
.
put
<
any
>
(
`
${
this
.
URL2
}
/editar/
${
id
}
`
,
parametros
);
}
}
src/app/modules/main/services/mostrar-ocultar.service.ts
View file @
e0ac78c4
...
@@ -25,6 +25,8 @@ import { Parroquia } from '../Models/Ubicaciones/parroquia';
...
@@ -25,6 +25,8 @@ import { Parroquia } from '../Models/Ubicaciones/parroquia';
import
{
PresupuestoPartidas
}
from
'../Models/presupuesto-partidas'
;
import
{
PresupuestoPartidas
}
from
'../Models/presupuesto-partidas'
;
import
{
instproy
}
from
'../Models/instproy'
;
import
{
instproy
}
from
'../Models/instproy'
;
import
{
objetivoprograma
}
from
'../Models/objetivoPrograma'
;
import
{
objetivoprograma
}
from
'../Models/objetivoPrograma'
;
import
{
actproy
}
from
'../Models/actproy'
;
import
{
detactproy
}
from
'../Models/detactproy'
;
@
Injectable
({
@
Injectable
({
providedIn
:
'root'
providedIn
:
'root'
...
@@ -59,5 +61,7 @@ export class MostrarOcultarService {
...
@@ -59,5 +61,7 @@ export class MostrarOcultarService {
parroquiaEditado
:
Parroquia
;
parroquiaEditado
:
Parroquia
;
presupuestoEditado
:
PresupuestoPartidas
;
presupuestoEditado
:
PresupuestoPartidas
;
editInst
:
instproy
;
editInst
:
instproy
;
editObje
:
objetivoprograma
editObje
:
objetivoprograma
;
editCabecera
:
actproy
;
editBody
:
detactproy
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment