cambios finales de cierre

parent 65f34774
export class seguim {
uzytavseguim_id?: number;
uzytavproyec_id?: number;
uzytavseguim_descrip?: string;
uzytavobjetivo_programa_id?: number;
uzytavseguim_fecha_logro?: Date;
uzytavseguim_logro?: string;
}
...@@ -210,6 +210,16 @@ import { ListarActaConsejoDepartamentoComponent } from './pages/Proyectos/Acta d ...@@ -210,6 +210,16 @@ import { ListarActaConsejoDepartamentoComponent } from './pages/Proyectos/Acta d
import { PdfComponent } from './pages/Proyectos/pdf/pdf.component'; import { PdfComponent } from './pages/Proyectos/pdf/pdf.component';
import { ListObjetivosEjecComponent } from './pages/Proyectos/Cierre/objetivos ejecutados/list-objetivos-ejec/list-objetivos-ejec.component'; import { ListObjetivosEjecComponent } from './pages/Proyectos/Cierre/objetivos ejecutados/list-objetivos-ejec/list-objetivos-ejec.component';
import { EditObjetivosEjecComponent } from './pages/Proyectos/Cierre/objetivos ejecutados/edit-objetivos-ejec/edit-objetivos-ejec.component'; import { EditObjetivosEjecComponent } from './pages/Proyectos/Cierre/objetivos ejecutados/edit-objetivos-ejec/edit-objetivos-ejec.component';
import { ListInformeComponent } from './pages/Proyectos/Ejecución/informes de avance/list-informe/list-informe.component';
import { EditInformeComponent } from './pages/Proyectos/Ejecución/informes de avance/edit-informe/edit-informe.component';
import { ListEntidadComponent } from './pages/Proyectos/Presupuesto Detallado/list-entidad/list-entidad.component';
import { ListComunidadComponent } from './pages/Proyectos/Presupuesto Detallado/list-comunidad/list-comunidad.component';
import { AporteComEjecComponent } from './pages/Proyectos/Cierre/presupuesto ejecutado/aporte-com-ejec/aporte-com-ejec.component';
import { AporteEntEjecComponent } from './pages/Proyectos/Cierre/presupuesto ejecutado/aporte-ent-ejec/aporte-ent-ejec.component';
import { AporteUniEjecComponent } from './pages/Proyectos/Cierre/presupuesto ejecutado/aporte-uni-ejec/aporte-uni-ejec.component';
import { ErrorTextoComponent } from './pages/Proyectos/errores/error-texto/error-texto.component';
import { seguim } from './Models/hito';
import { ComisionAsigComponent } from './pages/asignar comision/comision-asig/comision-asig.component';
@NgModule({ @NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA], schemas: [CUSTOM_ELEMENTS_SCHEMA],
declarations: [ declarations: [
...@@ -373,6 +383,15 @@ import { EditObjetivosEjecComponent } from './pages/Proyectos/Cierre/objetivos e ...@@ -373,6 +383,15 @@ import { EditObjetivosEjecComponent } from './pages/Proyectos/Cierre/objetivos e
PdfComponent, PdfComponent,
ListObjetivosEjecComponent, ListObjetivosEjecComponent,
EditObjetivosEjecComponent, EditObjetivosEjecComponent,
ListInformeComponent,
EditInformeComponent,
ListEntidadComponent,
ListComunidadComponent,
AporteComEjecComponent,
AporteEntEjecComponent,
AporteUniEjecComponent,
ErrorTextoComponent,
ComisionAsigComponent
], ],
imports: [ imports: [
MatTreeModule, MatTreeModule,
...@@ -407,6 +426,7 @@ import { EditObjetivosEjecComponent } from './pages/Proyectos/Cierre/objetivos e ...@@ -407,6 +426,7 @@ import { EditObjetivosEjecComponent } from './pages/Proyectos/Cierre/objetivos e
MatRadioModule MatRadioModule
], ],
providers: [ providers: [
seguim,
instproy, instproy,
objetivoprograma, objetivoprograma,
proObjeEstra, proObjeEstra,
......
.principal {
text-align: center;
margin-bottom: 2%;
}
.grid-container {
display: grid;
grid-template-columns: 5% 10% 45% 10% 5% 10% 15%;
border: 1px solid #ccc;
}
.titulo{
text-align: center;
margin: 3px;
font-weight: bold;
}
#cabecera {
background: linear-gradient(135deg,
var(--background-base) 22px,
var(--background-hover) 22px,
var(--background-hover) 24px,
transparent 24px,
transparent 67px,
var(--background-hover) 67px,
var(--background-hover) 69px,
transparent 69px),
linear-gradient(225deg,
var(--background-base) 22px,
var(--background-hover) 22px,
var(--background-hover) 24px,
transparent 24px,
transparent 67px,
var(--background-hover) 67px,
var(--background-hover) 69px,
transparent 69px) 0 64px;
background-color: var(--background-base);
background-size: 64px 128px;
}
.Column {
padding-left: 0px;
padding-right: 0px;
width: 100px;
white-space: inherit;
/* overflow: visible;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis; */
}
.Column1 {
padding-left: 0px;
padding-right: 0px;
width: 10px;
white-space: normal;
overflow: visible;
}
.Column2 {
width: 25px;
padding-left: 0px;
padding-right: 0px;
}
.volver{
position: absolute;
top: 50%;
right: 10px;
transform: translateY(-50%);
border-radius: 50%;
background-color: white;
display: flex;
color: rgb(71, 127, 75);
align-items: center;
justify-content: center;
padding: 0;
width: 32px;
height: 32px;
border: none;
outline: none;
cursor: pointer;
}
.grid-item {
font-weight: bold;
}
.grid-opciones {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
}
.titulo {
display: flex;
align-items: center;
justify-content: center;
}
.titulo-texto {
font-weight: bold;
font-size: 18px;
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
margin-right: 10px;
}
.componente {
justify-content: center;
align-items: center;
}
.card {
background-color: rgb(252, 252, 251)
}
.colorEditar {
color: blue;
}
.colorEditar svg {
fill: blue;
}
.contenedorP {
width: 96%;
margin-left: 2%;
margin-right: 2%;
margin: 10px auto;
border-radius: 10px;
text-align: center;
margin-top: 10%;
background-color: white;
}
.contenedor:not(:last-child) {
margin-bottom: 2px;
}
.separador{
margin-top: 5%;
}
.contenedor {
width: 96%;
margin-left: 2%;
margin-right: 2%;
padding-bottom: 2%;
border-radius: 10px;
background-color: white;
position: relative;
z-index: 1;
}
.sobremontado {
position: relative;
align-items: center;
justify-content: center;
padding: 10px;
width: 96%;
top: -20px;
left: 2%;
background-color: rgb(71, 127, 75);
color: #fff;
text-align: center;
padding: 10px;
box-sizing: border-box;
margin-bottom: -50px;
z-index: 2;
border-radius: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
.sobremontado span {
display: flex;
align-items: center;
justify-content: center;
margin: 0;
}
.sobremontado mat-icon {
margin-right: 5px;
}
.icono-instituciones {
display: flex;
align-items: center;
justify-content: center;
margin-right: 5px;
font-size: 20px;
cursor: pointer;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
font-family: 'Roboto', sans-serif;
color: #333;
}
table th,
table td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #e0e0e0;
}
table th {
background-color: rgb(248, 249, 250);
font-weight: bold;
text-transform: uppercase;
}
table td {
position: relative;
}
table td::after {
content: "";
position: absolute;
bottom: -1px;
left: 0;
width: 100%;
height: 1px;
background-color: #e0e0e0;
}
input[type="text"] {
width: 200px;
padding: 8px;
border: 1px solid #ccc;
border-radius: 5px;
margin-left: 10px;
}
.area-busqueda {
padding: 20px;
margin-top: 30px;
text-align: right;
}
@media (max-width: 600px) {
table {
font-size: 14px;
}
table th,
table td {
padding: 8px;
}
}
.btn-observar {
border-radius: 50%;
width: 36px;
height: 36px;
}
.colorsito{
background-color: rgb(248, 249, 250);
}
.rounder{
border-radius: 50%;
background-color: rgb(71, 127, 75);
display: flex;
align-items: center;
justify-content: center;
padding: 0;
width: 15%;
height: 40px;
border: none;
outline: none;
cursor: pointer;
}
.rounder mat-icon {
font-size: 24px;
color: #fff;
}
@media (max-width: 768px) {
.rounder {
width: 30%;
}
}
@media (max-width: 480px) {
.rounder {
width: 40%;
}
}
.margen{
margin: 10px;
padding: 10px;
margin-bottom: 10px;
}
.bordes {
border-collapse: collapse;
width: 100%;
}
.bordes th,
.bordes td {
border: 1px solid black;
padding: 8px;
}
.bordes th {
background-color: #f5f5f5;
font-weight: bold;
}
.bordes td {
background-color: #ffffff;
}
.bordes tr:nth-child(even) {
background-color: #f9f9f9;
}
.bordes tr:hover {
background-color: #eaeaea;
}
.bordes th:last-child,
.bordes td:last-child {
border-bottom: none;
}
.rounder-nuevo {
border-radius: 50%;
background-color: rgb(71, 127, 75);
display: flex;
align-items: center;
justify-content: center;
padding: 0;
width: 36px;
height: 36px;
border: none;
outline: none;
cursor: pointer;
margin-left: 5px;
}
.white-icon {
color: white;
}
.btn{
padding: 0 2% 0 2%;
}
.azul {
color: blue;
}
.institution {
display: flex;
align-items: center;
}
.institution-name {
font-size: 20px;
/* Tamaño de fuente deseado */
font-weight: bold;
/* Opcional, para hacerlo más destacado */
margin-right: 30px;
/* Espacio entre el icono y el nombre */
}
.formulario {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
max-width: 96%;
margin: 0 auto;
background-color: white;
}
/* Estilos para la columna izquierda */
.columna {
display: flex;
justify-content: center; /* Center content horizontally */
align-items: center; /* Center content vertically */
padding-right: 2%;
text-align: center;
}
.form-field {
width: 100%;
}
.container{
margin: 10px;
}
.input-container {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
margin-left: 2%; /* Center content horizontally within the input container */
}
.add-icon {
display: flex;
align-items: center;
justify-content: center;
width: 25px;
height: 25px;
border-radius: 50%;
background-color: white;
color: black;
font-size: 25px;
}
\ No newline at end of file
<form [formGroup]="dynamicForm" (ngSubmit)="guardarCambios()">
<div class="container">
<div class="save-button">
<button mat-raised-button color="primary" *ngIf="!cambio" (click)="cambiar()">Editar</button>
<button mat-raised-button color="primary" *ngIf="cambio">Guardar</button>
<span class="separator"></span>
<button mat-raised-button color="warn" *ngIf="cambio" (click)="cancelado()">Cancelar</button>
</div>
<mat-label class="titulo">Aporte de la Comunidad Beneficiaria</mat-label>
<div class="mat-elevation-z8">
<table mat-table [dataSource]="dataSource" matSort>
<!-- Nro Column -->
<ng-container matColumnDef="Nro" class="Column1">
<th class="Column1 negrita" mat-header-cell *matHeaderCellDef mat-sort-header> Nro </th>
<td class="Column1" mat-cell *matCellDef="let i = index"> {{ i+1 }}
</td>
</ng-container>
<ng-container matColumnDef="bien" class="Column">
<th class="Column" mat-header-cell *matHeaderCellDef mat-sort-header>
Bien y/o Servicio</th>
<td class="Column" mat-cell *matCellDef="let dato">
{{dato.uzytavpresup_bien_servicio}}
</td>
</ng-container>
<ng-container matColumnDef="descripcion" class="Column">
<th class="Column" mat-header-cell *matHeaderCellDef mat-sort-header>
Descripción</th>
<td class="Column" mat-cell *matCellDef="let dato">
{{dato.uzytavpresup_esptecnic}}
</td>
</ng-container>
<ng-container matColumnDef="total" class="Column">
<th class="Column" mat-header-cell *matHeaderCellDef mat-sort-header>
Valor Planificado USD
</th>
<td class="Column" mat-cell *matCellDef="let dato">
{{ (dato.uzytavpresup_valor * dato.uzytavpresup_cantidad) | number:'1.2-2' }}
</td>
</ng-container>
<ng-container matColumnDef="totalEjecutado" class="Column">
<th class="Column" mat-header-cell *matHeaderCellDef mat-sort-header>
Valor Ejecutado USD
</th>
<td class="Column" mat-cell *matCellDef="let dato; let i = index">
<input matInput type="number" [formControlName]="'totalEjecCom_' + dato.uzytavpresup_id"
required min="0" pattern="[0-9]+">
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<div class="columna">
<div class="input-container" style="font-weight: bold; color:black;">
<mat-form-field class="form-field" style="font-weight: bold;">
<mat-label>Total Planificado </mat-label>
<input matInput [disabled]="true" required pattern="\d+(\.\d+)?" [value]="totalSuma">
</mat-form-field>
</div>
</div>
<div class="columna">
<div class="input-container" style="font-weight: bold; color:black;">
<mat-form-field class="form-field" style="font-weight: bold;">
<mat-label>Total Ejecutado </mat-label>
<input matInput [disabled]="true" required pattern="\d+(\.\d+)?" [value]="totalSumaEjecutado">
</mat-form-field>
</div>
</div>
</div>
</div>
</form>
\ No newline at end of file
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { AporteComEjecComponent } from './aporte-com-ejec.component';
describe('AporteComEjecComponent', () => {
let component: AporteComEjecComponent;
let fixture: ComponentFixture<AporteComEjecComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AporteComEjecComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AporteComEjecComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { MatTable, MatTableDataSource } from '@angular/material/table';
import { CatalogoPP } from 'src/app/modules/main/Models/catalogo-partidas-presupuestarias';
import { PartidasPresupuestarias } from 'src/app/modules/main/Models/partidas-presupuestarias';
import { PresupuestoPartidas } from 'src/app/modules/main/Models/presupuesto-partidas';
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 { EnvioFormularioComponent } from '../../../../programa/opciones/envio-formulario/envio-formulario.component';
import { PresupuestoPartidasService } from 'src/app/modules/main/services/presupuesto-partidas/presupuesto-partidas.service';
@Component({
selector: 'app-aporte-com-ejec',
templateUrl: './aporte-com-ejec.component.html',
styleUrls: ['./aporte-com-ejec.component.css']
})
export class AporteComEjecComponent implements OnInit {
idRecuperado: number;
totalSuma: number = 0;
//Para Mostrar la información
dataSource: MatTableDataSource<PresupuestoPartidas>;
claPre: PartidasPresupuestarias;
partida!: CatalogoPP[];
nombrePartida: string;
formularioEnviado: boolean;
@Output() formularioGuardado = new EventEmitter<void>();
cambio: boolean = false;
dynamicForm: FormGroup; // Declare a FormGroup
presupuesto: PresupuestoPartidas;
totalSumaEjecutado: number = 0;
politicas: any[] = [];
objetivos: any[] = [];
presupuestoPartidas!: PresupuestoPartidas[];
displayedColumns: string[] = [
'Nro',
'bien',
'descripcion',
'total',
'totalEjecutado'
];
@ViewChild(MatTable) table: MatTable<any>;
constructor(
private presupuestoPartidasService: PresupuestoPartidasService,
private id_Compartido: Compartir_idService,
private dialog: MatDialog,
private formBuilder: FormBuilder,
private datosCompartidos: Actualiza_datosService,
) {
this.claPre = new PartidasPresupuestarias();
this.dataSource = new MatTableDataSource<PresupuestoPartidas>([]);
this.presupuesto = new PresupuestoPartidas()
}
ngOnInit(): void {
this.initializeForm()
this.idRecuperado = parseInt(localStorage.getItem('proyectoId'),10);
this.datosCompartidos.datos$.subscribe(() => {
this.obtenerRegistros();
});
this.presupuestoPartidasService.parametrosActualizados.subscribe(() => {
this.obtenerRegistros();
});
}
initializeForm() {
this.dynamicForm = this.formBuilder.group({});
this.dynamicForm.disable(); // Disable all form controls
}
guardarCambios() {
// Iterate through the array and save the changes
this.presupuestoPartidas.forEach(partida => {
const controlName = 'totalEjecCom_' + partida.uzytavpresup_id;
const value = this.dynamicForm.get(controlName).value;
console.log("valor recuperado xxxx ", value)
this.presupuesto.uzytavpresup_total_ejec = value;
// Send the updated data to the API for this record
this.presupuestoPartidasService.modificarParametros(partida.uzytavpresup_id, this.presupuesto).subscribe(
(response) => {
console.log('Cambios guardados exitosamente para la partida', partida.uzytavpresup_id);
//this.openModal();
this.dynamicForm.disable()
this.cambio = false; // Disable editing mode
this.obtenerRegistros()
},
(error) => {
console.log('Error al guardar los cambios para la partida', partida.uzytavpresup_id, error);
}
);
});
}
openModal() {
const dialogRef = this.dialog.open(EnvioFormularioComponent, {
disableClose: true
});
dialogRef.afterClosed().subscribe(result => {
console.log('La ventana modal se ha cerrado');
this.formularioEnviado = true;
});
}
getSubgrupo3(item: any): string {
return (
item.uzytclasificador_presup_id +
'. ' +
(item.uzytclasificador_presup_nombre || '')
);
}
createDynamicFormControls(partida: PresupuestoPartidas) {
this.dynamicForm.addControl('totalEjecCom_' + partida.uzytavpresup_id,
this.formBuilder.control({ value : partida.uzytavpresup_total_ejec,disabled: true },
[Validators.required, Validators.min(0), Validators.pattern('[0-9]+')]));
this.dynamicForm.disable();
}
obtenerRegistros() {
if (this.idRecuperado !== undefined) {
this.presupuestoPartidasService.obtenerRegistrosRelacionadosComunidadProyecto(this.idRecuperado).subscribe(data => {
if (data !== undefined) {
this.presupuestoPartidas = data.map(partida => {
// Create dynamic form control
this.createDynamicFormControls(partida);
return partida
});
this.dataSource.data = this.presupuestoPartidas;
// Calcular los totales
this.calcularTotales();
this.calcularTotalesEjecutados()
}
});
}
}
calcularTotales() {
this.totalSuma = this.presupuestoPartidas.reduce((total, dato) => {
return total + dato.uzytavpresup_valor * dato.uzytavpresup_cantidad;
}, 0);
this.totalSuma = parseFloat(this.totalSuma.toFixed(2));
}
calcularTotalesEjecutados() {
this.totalSumaEjecutado = this.presupuestoPartidas.reduce((total, dato) => {
return total + dato.uzytavpresup_total_ejec;
}, 0);
this.totalSumaEjecutado = parseFloat(this.totalSumaEjecutado.toFixed(2));
}
cambiar() {
this.cambio = true;
this.dynamicForm.enable();
}
cancelado() {
this.cambio = false;
this.dynamicForm.disable();
}
guardar() {
this.cambio = false;
this.dynamicForm.disable();
}
}
.principal {
text-align: center;
margin-bottom: 2%;
}
.grid-container {
display: grid;
grid-template-columns: 5% 10% 45% 10% 5% 10% 15%;
border: 1px solid #ccc;
}
.titulo{
text-align: center;
margin: 3px;
font-weight: bold;
}
#cabecera {
background: linear-gradient(135deg,
var(--background-base) 22px,
var(--background-hover) 22px,
var(--background-hover) 24px,
transparent 24px,
transparent 67px,
var(--background-hover) 67px,
var(--background-hover) 69px,
transparent 69px),
linear-gradient(225deg,
var(--background-base) 22px,
var(--background-hover) 22px,
var(--background-hover) 24px,
transparent 24px,
transparent 67px,
var(--background-hover) 67px,
var(--background-hover) 69px,
transparent 69px) 0 64px;
background-color: var(--background-base);
background-size: 64px 128px;
}
.Column {
padding-left: 0px;
padding-right: 0px;
width: 100px;
white-space: inherit;
/* overflow: visible;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis; */
}
.Column1 {
padding-left: 0px;
padding-right: 0px;
width: 10px;
white-space: normal;
overflow: visible;
}
.Column2 {
width: 25px;
padding-left: 0px;
padding-right: 0px;
}
.volver{
position: absolute;
top: 50%;
right: 10px;
transform: translateY(-50%);
border-radius: 50%;
background-color: white;
display: flex;
color: rgb(71, 127, 75);
align-items: center;
justify-content: center;
padding: 0;
width: 32px;
height: 32px;
border: none;
outline: none;
cursor: pointer;
}
.grid-item {
font-weight: bold;
}
.grid-opciones {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
}
.titulo {
display: flex;
align-items: center;
justify-content: center;
}
.titulo-texto {
font-weight: bold;
font-size: 18px;
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
margin-right: 10px;
}
.componente {
justify-content: center;
align-items: center;
}
.card {
background-color: rgb(252, 252, 251)
}
.colorEditar {
color: blue;
}
.colorEditar svg {
fill: blue;
}
.contenedorP {
width: 96%;
margin-left: 2%;
margin-right: 2%;
margin: 10px auto;
border-radius: 10px;
text-align: center;
margin-top: 10%;
background-color: white;
}
.contenedor:not(:last-child) {
margin-bottom: 2px;
}
.separador{
margin-top: 5%;
}
.contenedor {
width: 96%;
margin-left: 2%;
margin-right: 2%;
padding-bottom: 2%;
border-radius: 10px;
background-color: white;
position: relative;
z-index: 1;
}
.sobremontado {
position: relative;
align-items: center;
justify-content: center;
padding: 10px;
width: 96%;
top: -20px;
left: 2%;
background-color: rgb(71, 127, 75);
color: #fff;
text-align: center;
padding: 10px;
box-sizing: border-box;
margin-bottom: -50px;
z-index: 2;
border-radius: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
.sobremontado span {
display: flex;
align-items: center;
justify-content: center;
margin: 0;
}
.sobremontado mat-icon {
margin-right: 5px;
}
.icono-instituciones {
display: flex;
align-items: center;
justify-content: center;
margin-right: 5px;
font-size: 20px;
cursor: pointer;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
font-family: 'Roboto', sans-serif;
color: #333;
}
table th,
table td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #e0e0e0;
}
table th {
background-color: rgb(248, 249, 250);
font-weight: bold;
text-transform: uppercase;
}
table td {
position: relative;
}
table td::after {
content: "";
position: absolute;
bottom: -1px;
left: 0;
width: 100%;
height: 1px;
background-color: #e0e0e0;
}
input[type="text"] {
width: 200px;
padding: 8px;
border: 1px solid #ccc;
border-radius: 5px;
margin-left: 10px;
}
.area-busqueda {
padding: 20px;
margin-top: 30px;
text-align: right;
}
@media (max-width: 600px) {
table {
font-size: 14px;
}
table th,
table td {
padding: 8px;
}
}
.btn-observar {
border-radius: 50%;
width: 36px;
height: 36px;
}
.colorsito{
background-color: rgb(248, 249, 250);
}
.rounder{
border-radius: 50%;
background-color: rgb(71, 127, 75);
display: flex;
align-items: center;
justify-content: center;
padding: 0;
width: 15%;
height: 40px;
border: none;
outline: none;
cursor: pointer;
}
.rounder mat-icon {
font-size: 24px;
color: #fff;
}
@media (max-width: 768px) {
.rounder {
width: 30%;
}
}
@media (max-width: 480px) {
.rounder {
width: 40%;
}
}
.margen{
margin: 10px;
padding: 10px;
margin-bottom: 10px;
}
.bordes {
border-collapse: collapse;
width: 100%;
}
.bordes th,
.bordes td {
border: 1px solid black;
padding: 8px;
}
.bordes th {
background-color: #f5f5f5;
font-weight: bold;
}
.bordes td {
background-color: #ffffff;
}
.bordes tr:nth-child(even) {
background-color: #f9f9f9;
}
.bordes tr:hover {
background-color: #eaeaea;
}
.bordes th:last-child,
.bordes td:last-child {
border-bottom: none;
}
.rounder-nuevo {
border-radius: 50%;
background-color: rgb(71, 127, 75);
display: flex;
align-items: center;
justify-content: center;
padding: 0;
width: 36px;
height: 36px;
border: none;
outline: none;
cursor: pointer;
margin-left: 5px;
}
.white-icon {
color: white;
}
.btn{
padding: 0 2% 0 2%;
}
.azul {
color: blue;
}
.institution {
display: flex;
align-items: center;
}
.institution-name {
font-size: 20px;
/* Tamaño de fuente deseado */
font-weight: bold;
/* Opcional, para hacerlo más destacado */
margin-right: 30px;
/* Espacio entre el icono y el nombre */
}
.formulario {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
max-width: 96%;
margin: 0 auto;
background-color: white;
}
/* Estilos para la columna izquierda */
.columna {
display: flex;
justify-content: center; /* Center content horizontally */
align-items: center; /* Center content vertically */
padding-right: 2%;
text-align: center;
}
.form-field {
width: 100%;
}
.container{
margin: 10px;
}
.input-container {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
margin-left: 2%; /* Center content horizontally within the input container */
}
.add-icon {
display: flex;
align-items: center;
justify-content: center;
width: 25px;
height: 25px;
border-radius: 50%;
background-color: white;
color: black;
font-size: 25px;
}
\ No newline at end of file
<form [formGroup]="dynamicForm" (ngSubmit)="guardarCambios()">
<div class="container">
<div class="save-button">
<button mat-raised-button color="primary" *ngIf="!cambio" (click)="cambiar()">Editar</button>
<button mat-raised-button color="primary" *ngIf="cambio">Guardar</button>
<span class="separator"></span>
<button mat-raised-button color="warn" *ngIf="cambio" (click)="cancelado()">Cancelar</button>
</div>
<mat-label class="titulo">Aporte de la Comunidad Beneficiaria</mat-label>
<div class="mat-elevation-z8">
<table mat-table [dataSource]="dataSource" matSort>
<!-- Nro Column -->
<ng-container matColumnDef="Nro" class="Column1">
<th class="Column1 negrita" mat-header-cell *matHeaderCellDef mat-sort-header> Nro </th>
<td class="Column1" mat-cell *matCellDef="let i = index"> {{ i+1 }}
</td>
</ng-container>
<ng-container matColumnDef="bien" class="Column">
<th class="Column" mat-header-cell *matHeaderCellDef mat-sort-header>
Bien y/o Servicio</th>
<td class="Column" mat-cell *matCellDef="let dato">
{{dato.uzytavpresup_bien_servicio}}
</td>
</ng-container>
<ng-container matColumnDef="descripcion" class="Column">
<th class="Column" mat-header-cell *matHeaderCellDef mat-sort-header>
Descripción</th>
<td class="Column" mat-cell *matCellDef="let dato">
{{dato.uzytavpresup_esptecnic}}
</td>
</ng-container>
<ng-container matColumnDef="total" class="Column">
<th class="Column" mat-header-cell *matHeaderCellDef mat-sort-header>
Valor Planificado USD
</th>
<td class="Column" mat-cell *matCellDef="let dato">
{{ (dato.uzytavpresup_valor * dato.uzytavpresup_cantidad) | number:'1.2-2' }}
</td>
</ng-container>
<ng-container matColumnDef="totalEjecutado" class="Column">
<th class="Column" mat-header-cell *matHeaderCellDef mat-sort-header>
Valor Ejecutado USD
</th>
<td class="Column" mat-cell *matCellDef="let dato; let i = index">
<input matInput type="number" [formControlName]="'totalEjecEnt_' + dato.uzytavpresup_id"
required min="0" pattern="[0-9]+">
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<div class="columna">
<div class="input-container" style="font-weight: bold; color:black;">
<mat-form-field class="form-field" style="font-weight: bold;">
<mat-label>Total Planificado </mat-label>
<input matInput [disabled]="true" required pattern="\d+(\.\d+)?" [value]="totalSuma">
</mat-form-field>
</div>
</div>
<div class="columna">
<div class="input-container" style="font-weight: bold; color:black;">
<mat-form-field class="form-field" style="font-weight: bold;">
<mat-label>Total Ejecutado </mat-label>
<input matInput [disabled]="true" required pattern="\d+(\.\d+)?" [value]="totalSumaEjecutado">
</mat-form-field>
</div>
</div>
</div>
</div>
</form>
\ No newline at end of file
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { AporteEntEjecComponent } from './aporte-ent-ejec.component';
describe('AporteEntEjecComponent', () => {
let component: AporteEntEjecComponent;
let fixture: ComponentFixture<AporteEntEjecComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AporteEntEjecComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AporteEntEjecComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { MatTable, MatTableDataSource } from '@angular/material/table';
import { CatalogoPP } from 'src/app/modules/main/Models/catalogo-partidas-presupuestarias';
import { PartidasPresupuestarias } from 'src/app/modules/main/Models/partidas-presupuestarias';
import { PresupuestoPartidas } from 'src/app/modules/main/Models/presupuesto-partidas';
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 { PresupuestoPartidasService } from 'src/app/modules/main/services/presupuesto-partidas/presupuesto-partidas.service';
import { EnvioFormularioComponent } from '../../../../programa/opciones/envio-formulario/envio-formulario.component';
@Component({
selector: 'app-aporte-ent-ejec',
templateUrl: './aporte-ent-ejec.component.html',
styleUrls: ['./aporte-ent-ejec.component.css']
})
export class AporteEntEjecComponent implements OnInit {
idRecuperado: number;
totalSuma: number = 0;
//Para Mostrar la información
dataSource: MatTableDataSource<PresupuestoPartidas>;
claPre: PartidasPresupuestarias;
partida!: CatalogoPP[];
nombrePartida: string;
formularioEnviado: boolean;
@Output() formularioGuardado = new EventEmitter<void>();
cambio: boolean = false;
dynamicForm: FormGroup; // Declare a FormGroup
presupuesto: PresupuestoPartidas;
totalSumaEjecutado: number = 0;
politicas: any[] = [];
objetivos: any[] = [];
presupuestoPartidas!: PresupuestoPartidas[];
displayedColumns: string[] = [
'Nro',
'bien',
'descripcion',
'total',
'totalEjecutado'
];
@ViewChild(MatTable) table: MatTable<any>;
constructor(
private presupuestoPartidasService: PresupuestoPartidasService,
private id_Compartido: Compartir_idService,
private dialog: MatDialog,
private formBuilder: FormBuilder,
private datosCompartidos: Actualiza_datosService,
) {
this.claPre = new PartidasPresupuestarias();
this.dataSource = new MatTableDataSource<PresupuestoPartidas>([]);
this.presupuesto = new PresupuestoPartidas()
}
ngOnInit(): void {
this.initializeForm()
this.idRecuperado = parseInt(localStorage.getItem('proyectoId'),10);
this.datosCompartidos.datos$.subscribe(() => {
this.obtenerRegistros();
});
this.presupuestoPartidasService.parametrosActualizados.subscribe(() => {
this.obtenerRegistros();
});
}
initializeForm() {
this.dynamicForm = this.formBuilder.group({});
this.dynamicForm.disable(); // Disable all form controls
}
guardarCambios() {
// Iterate through the array and save the changes
this.presupuestoPartidas.forEach(partida => {
const controlName = 'totalEjecEnt_' + partida.uzytavpresup_id;
const value = this.dynamicForm.get(controlName).value;
console.log("valor recuperado xxxx ", value)
this.presupuesto.uzytavpresup_total_ejec = value;
// Send the updated data to the API for this record
this.presupuestoPartidasService.modificarParametros(partida.uzytavpresup_id, this.presupuesto).subscribe(
(response) => {
console.log('Cambios guardados exitosamente para la partida', partida.uzytavpresup_id);
//this.openModal();
this.dynamicForm.disable()
this.cambio = false; // Disable editing mode
this.obtenerRegistros()
},
(error) => {
console.log('Error al guardar los cambios para la partida', partida.uzytavpresup_id, error);
}
);
});
}
openModal() {
const dialogRef = this.dialog.open(EnvioFormularioComponent, {
disableClose: true
});
dialogRef.afterClosed().subscribe(result => {
console.log('La ventana modal se ha cerrado');
this.formularioEnviado = true;
});
}
getSubgrupo3(item: any): string {
return (
item.uzytclasificador_presup_id +
'. ' +
(item.uzytclasificador_presup_nombre || '')
);
}
createDynamicFormControls(partida: PresupuestoPartidas) {
console.log("este es el total actual",partida.uzytavpresup_total_ejec)
this.dynamicForm.addControl('totalEjecEnt_' + partida.uzytavpresup_id,
this.formBuilder.control({ value : partida.uzytavpresup_total_ejec, disabled: true },
[Validators.required, Validators.min(0), Validators.pattern('[0-9]+')]));
this.dynamicForm.disable();
}
obtenerRegistros() {
if (this.idRecuperado !== undefined) {
this.presupuestoPartidasService.obtenerRegistrosRelacionadosEntidadProyecto(this.idRecuperado).subscribe(data => {
if (data !== undefined) {
this.presupuestoPartidas = data.map(partida => {
// Create dynamic form control
this.createDynamicFormControls(partida);
return partida
});
this.dataSource.data = this.presupuestoPartidas;
// Calcular los totales
this.calcularTotales();
this.calcularTotalesEjecutados()
}
});
}
}
calcularTotales() {
this.totalSuma = this.presupuestoPartidas.reduce((total, dato) => {
return total + dato.uzytavpresup_valor * dato.uzytavpresup_cantidad;
}, 0);
this.totalSuma = parseFloat(this.totalSuma.toFixed(2));
}
calcularTotalesEjecutados() {
this.totalSumaEjecutado = this.presupuestoPartidas.reduce((total, dato) => {
return total + dato.uzytavpresup_total_ejec;
}, 0);
this.totalSumaEjecutado = parseFloat(this.totalSumaEjecutado.toFixed(2));
}
cambiar() {
this.cambio = true;
this.dynamicForm.enable();
}
cancelado() {
this.cambio = false;
this.dynamicForm.disable();
}
guardar() {
this.cambio = false;
this.dynamicForm.disable();
}
}
.principal {
text-align: center;
margin-bottom: 2%;
}
.grid-container {
display: grid;
grid-template-columns: 5% 10% 45% 10% 5% 10% 15%;
border: 1px solid #ccc;
}
.titulo{
text-align: center;
margin: 3px;
font-weight: bold;
}
#cabecera {
background: linear-gradient(135deg,
var(--background-base) 22px,
var(--background-hover) 22px,
var(--background-hover) 24px,
transparent 24px,
transparent 67px,
var(--background-hover) 67px,
var(--background-hover) 69px,
transparent 69px),
linear-gradient(225deg,
var(--background-base) 22px,
var(--background-hover) 22px,
var(--background-hover) 24px,
transparent 24px,
transparent 67px,
var(--background-hover) 67px,
var(--background-hover) 69px,
transparent 69px) 0 64px;
background-color: var(--background-base);
background-size: 64px 128px;
}
.Column {
padding-left: 0px;
padding-right: 0px;
width: 100px;
white-space: inherit;
/* overflow: visible;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis; */
}
.Column1 {
padding-left: 0px;
padding-right: 0px;
width: 10px;
white-space: normal;
overflow: visible;
}
.Column2 {
width: 25px;
padding-left: 0px;
padding-right: 0px;
}
.volver{
position: absolute;
top: 50%;
right: 10px;
transform: translateY(-50%);
border-radius: 50%;
background-color: white;
display: flex;
color: rgb(71, 127, 75);
align-items: center;
justify-content: center;
padding: 0;
width: 32px;
height: 32px;
border: none;
outline: none;
cursor: pointer;
}
.grid-item {
font-weight: bold;
}
.grid-opciones {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
}
.titulo {
display: flex;
align-items: center;
justify-content: center;
}
.titulo-texto {
font-weight: bold;
font-size: 18px;
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
margin-right: 10px;
}
.componente {
justify-content: center;
align-items: center;
}
.card {
background-color: rgb(252, 252, 251)
}
.colorEditar {
color: blue;
}
.colorEditar svg {
fill: blue;
}
.contenedorP {
width: 96%;
margin-left: 2%;
margin-right: 2%;
margin: 10px auto;
border-radius: 10px;
text-align: center;
margin-top: 10%;
background-color: white;
}
.contenedor:not(:last-child) {
margin-bottom: 2px;
}
.separador{
margin-top: 5%;
}
.contenedor {
width: 96%;
margin-left: 2%;
margin-right: 2%;
padding-bottom: 2%;
border-radius: 10px;
background-color: white;
position: relative;
z-index: 1;
}
.sobremontado {
position: relative;
align-items: center;
justify-content: center;
padding: 10px;
width: 96%;
top: -20px;
left: 2%;
background-color: rgb(71, 127, 75);
color: #fff;
text-align: center;
padding: 10px;
box-sizing: border-box;
margin-bottom: -50px;
z-index: 2;
border-radius: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
.sobremontado span {
display: flex;
align-items: center;
justify-content: center;
margin: 0;
}
.sobremontado mat-icon {
margin-right: 5px;
}
.icono-instituciones {
display: flex;
align-items: center;
justify-content: center;
margin-right: 5px;
font-size: 20px;
cursor: pointer;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
font-family: 'Roboto', sans-serif;
color: #333;
}
table th,
table td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #e0e0e0;
}
table th {
background-color: rgb(248, 249, 250);
font-weight: bold;
text-transform: uppercase;
}
table td {
position: relative;
}
table td::after {
content: "";
position: absolute;
bottom: -1px;
left: 0;
width: 100%;
height: 1px;
background-color: #e0e0e0;
}
input[type="text"] {
width: 200px;
padding: 8px;
border: 1px solid #ccc;
border-radius: 5px;
margin-left: 10px;
}
.area-busqueda {
padding: 20px;
margin-top: 30px;
text-align: right;
}
@media (max-width: 600px) {
table {
font-size: 14px;
}
table th,
table td {
padding: 8px;
}
}
.btn-observar {
border-radius: 50%;
width: 36px;
height: 36px;
}
.colorsito{
background-color: rgb(248, 249, 250);
}
.rounder{
border-radius: 50%;
background-color: rgb(71, 127, 75);
display: flex;
align-items: center;
justify-content: center;
padding: 0;
width: 15%;
height: 40px;
border: none;
outline: none;
cursor: pointer;
}
.rounder mat-icon {
font-size: 24px;
color: #fff;
}
@media (max-width: 768px) {
.rounder {
width: 30%;
}
}
@media (max-width: 480px) {
.rounder {
width: 40%;
}
}
.margen{
margin: 10px;
padding: 10px;
margin-bottom: 10px;
}
.bordes {
border-collapse: collapse;
width: 100%;
}
.bordes th,
.bordes td {
border: 1px solid black;
padding: 8px;
}
.bordes th {
background-color: #f5f5f5;
font-weight: bold;
}
.bordes td {
background-color: #ffffff;
}
.bordes tr:nth-child(even) {
background-color: #f9f9f9;
}
.bordes tr:hover {
background-color: #eaeaea;
}
.bordes th:last-child,
.bordes td:last-child {
border-bottom: none;
}
.rounder-nuevo {
border-radius: 50%;
background-color: rgb(71, 127, 75);
display: flex;
align-items: center;
justify-content: center;
padding: 0;
width: 36px;
height: 36px;
border: none;
outline: none;
cursor: pointer;
margin-left: 5px;
}
.white-icon {
color: white;
}
.btn{
padding: 0 2% 0 2%;
}
.azul {
color: blue;
}
.institution {
display: flex;
align-items: center;
}
.institution-name {
font-size: 20px;
/* Tamaño de fuente deseado */
font-weight: bold;
/* Opcional, para hacerlo más destacado */
margin-right: 30px;
/* Espacio entre el icono y el nombre */
}
.formulario {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
max-width: 96%;
margin: 0 auto;
background-color: white;
}
/* Estilos para la columna izquierda */
.columna{
width: 32%;
padding-right: 2%;
}
.form-field {
width: 100%;
}
.container{
margin: 10px;
}
.input-container {
width: 100%;
display: flex;
flex-direction: column;
}
.add-icon {
display: flex;
align-items: center;
justify-content: center;
width: 25px;
/* Ancho del círculo */
height: 25px;
/* Altura del círculo */
border-radius: 50%;
/* Para crear la forma de círculo */
background-color: white;
/* Color de fondo del círculo */
color: black;
/* Color del signo "+" en el círculo */
font-size: 25px;
/* Tamaño del signo "+" */
}
\ No newline at end of file
<form [formGroup]="dynamicForm" (ngSubmit)="guardarCambios()">
<div class="container">
<div class="save-button">
<button mat-raised-button color="primary" *ngIf="!cambio" (click)="cambiar()">Editar</button>
<button mat-raised-button color="primary" *ngIf="cambio">Guardar</button>
<span class="separator"></span>
<button mat-raised-button color="warn" *ngIf="cambio" (click)="cancelado()">Cancelar</button>
</div>
<mat-label class="titulo">Aporte de la Universidad</mat-label>
<div class="mat-elevation-z8">
<table mat-table [dataSource]="dataSource" matSort>
<!-- Nro Column -->
<ng-container matColumnDef="Nro" class="Column1">
<th class="Column1 negrita" mat-header-cell *matHeaderCellDef mat-sort-header> Nro </th>
<td class="Column1" mat-cell *matCellDef="let i = index"> {{ i+1 }}
</td>
</ng-container>
<!-- Nombre Institución Column -->
<ng-container matColumnDef="partida" class="Column">
<th class="Column" mat-header-cell *matHeaderCellDef mat-sort-header> Partida Presupuestaria</th>
<td class="Column" mat-cell *matCellDef="let dato">
{{dato.partida$ | async }} </td>
</ng-container>
<ng-container matColumnDef="descripcion" class="Column">
<th class="Column" mat-header-cell *matHeaderCellDef mat-sort-header>
Descripción</th>
<td class="Column" mat-cell *matCellDef="let dato">
{{dato.uzytavpresup_esptecnic}}
</td>
</ng-container>
<ng-container matColumnDef="gasto" class="Column">
<th class="Column" mat-header-cell *matHeaderCellDef mat-sort-header> Tipo de Gasto </th>
<td class="Column" mat-cell *matCellDef="let dato">
<ng-container [ngSwitch]="dato.uzytavpresup_tipogasto">
<span *ngSwitchCase="'C'">Permanente</span>
<span *ngSwitchCase="'I'">No Permanente</span>
</ng-container>
</td>
</ng-container>
<ng-container matColumnDef="total" class="Column">
<th class="Column" mat-header-cell *matHeaderCellDef mat-sort-header>
Valor Planificado USD
</th>
<td class="Column" mat-cell *matCellDef="let dato">
{{ (dato.uzytavpresup_valor * dato.uzytavpresup_cantidad) | number:'1.2-2' }}
</td>
</ng-container>
<!-- Total Ejecutado Column -->
<ng-container matColumnDef="totalEjecutado" class="Column">
<th class="Column" mat-header-cell *matHeaderCellDef mat-sort-header>
Valor Ejecutado USD
</th>
<td class="Column" mat-cell *matCellDef="let dato; let i = index">
<input matInput type="number" [formControlName]="'totalEjec_' + dato.uzytavpresup_id"
required min="0" pattern="[0-9]+" [value]="dato.uzytavpresup_total_ejec">
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<div class="formulario">
<div class="columna">
<div class="input-container">
<mat-form-field class="form-field" style="font-weight: bold; color:black;">
<mat-label>Sumatoria de Permanentes</mat-label>
<input matInput [disabled]="true" required pattern="\d+(\.\d+)?" [value]="totalPermanente">
</mat-form-field>
</div>
</div>
<div class="columna">
<div class="input-container">
<mat-form-field class="form-field" style="font-weight: bold; color:black;">
<mat-label>Sumatoria de No Permanentes</mat-label>
<input matInput [disabled]="true" required pattern="\d+(\.\d+)?" [value]="totalNoPermanente">
</mat-form-field>
</div>
</div>
<div class="columna">
<div class="input-container" style="font-weight: bold; color:black;">
<mat-form-field class="form-field" style="font-weight: bold;">
<mat-label>Total (Permanente + No Permanente)</mat-label>
<input matInput [disabled]="true" required pattern="\d+(\.\d+)?" [value]="totalSuma">
</mat-form-field>
</div>
</div>
<div class="columna">
<div class="input-container">
<mat-form-field class="form-field" style="font-weight: bold; color:black;">
<mat-label>Sumatoria Permanente Ejecutado</mat-label>
<input matInput [disabled]="true" required pattern="\d+(\.\d+)?" [value]="totalPermanenteEjecutado">
</mat-form-field>
</div>
</div>
<div class="columna">
<div class="input-container">
<mat-form-field class="form-field" style="font-weight: bold; color:black;">
<mat-label>Sumatoria No Permanente Ejecutado</mat-label>
<input matInput [disabled]="true" required pattern="\d+(\.\d+)?" [value]="totalNoPermanenteEjecutado">
</mat-form-field>
</div>
</div>
<div class="columna">
<div class="input-container" style="font-weight: bold; color:black;">
<mat-form-field class="form-field" style="font-weight: bold;">
<mat-label>Total Ejecutado (P+ NP)</mat-label>
<input matInput [disabled]="true" required pattern="\d+(\.\d+)?" [value]="totalSumaEjecutado">
</mat-form-field>
</div>
</div>
</div>
</div>
</div>
</form>
\ No newline at end of file
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { AporteUniEjecComponent } from './aporte-uni-ejec.component';
describe('AporteUniEjecComponent', () => {
let component: AporteUniEjecComponent;
let fixture: ComponentFixture<AporteUniEjecComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AporteUniEjecComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AporteUniEjecComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { MatTable, MatTableDataSource } from '@angular/material/table';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { CatalogoPP } from 'src/app/modules/main/Models/catalogo-partidas-presupuestarias';
import { PartidasPresupuestarias } from 'src/app/modules/main/Models/partidas-presupuestarias';
import { PresupuestoPartidas } from 'src/app/modules/main/Models/presupuesto-partidas';
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 { PartidasPresupuestariasService } from 'src/app/modules/main/services/partidas-presupuestarias/partidas-presupuestarias.service';
import { PresupuestoPartidasService } from 'src/app/modules/main/services/presupuesto-partidas/presupuesto-partidas.service';
import { EnvioFormularioComponent } from '../../../../programa/opciones/envio-formulario/envio-formulario.component';
@Component({
selector: 'app-aporte-uni-ejec',
templateUrl: './aporte-uni-ejec.component.html',
styleUrls: ['./aporte-uni-ejec.component.css']
})
export class AporteUniEjecComponent implements OnInit {
formularioEnviado: boolean;
@Output() formularioGuardado = new EventEmitter<void>();
idRecuperado: number;
totalPermanente: number = 0;
totalNoPermanente: number = 0;
totalSuma: number = 0;
totalPermanenteEjecutado: number = 0;
totalNoPermanenteEjecutado: number = 0;
totalSumaEjecutado: number = 0;
//Para Mostrar la información
dataSource: MatTableDataSource<PresupuestoPartidas>;
claPre: PartidasPresupuestarias;
partida!: CatalogoPP[];
nombrePartida: string;
cambio: boolean = false;
dynamicForm: FormGroup; // Declare a FormGroup
presupuesto: PresupuestoPartidas;
politicas: any[] = [];
objetivos: any[] = [];
presupuestoPartidas!: PresupuestoPartidas[];
displayedColumns: string[] = [
'Nro',
'partida',
'descripcion',
'gasto',
'total',
'totalEjecutado',
];
@ViewChild(MatTable) table: MatTable<any>;
constructor(
private presupuestoPartidasService: PresupuestoPartidasService,
private id_Compartido: Compartir_idService,
private dialog: MatDialog,
private formBuilder: FormBuilder,
private datosCompartidos: Actualiza_datosService,
private partidaS: PartidasPresupuestariasService,
) {
this.claPre = new PartidasPresupuestarias();
this.dataSource = new MatTableDataSource<PresupuestoPartidas>([]);
this.presupuesto = new PresupuestoPartidas()
}
ngOnInit(): void {
this.initializeForm()
this.idRecuperado = parseInt(localStorage.getItem('proyectoId'), 10);
this.datosCompartidos.datos$.subscribe(() => {
this.obtenerRegistros();
});
this.presupuestoPartidasService.parametrosActualizados.subscribe(() => {
this.obtenerRegistros();
});
}
initializeForm() {
this.dynamicForm = this.formBuilder.group({});
this.dynamicForm.disable(); // Disable all form controls
}
openModal() {
const dialogRef = this.dialog.open(EnvioFormularioComponent, {
disableClose: true
});
dialogRef.afterClosed().subscribe(result => {
console.log('La ventana modal se ha cerrado');
this.formularioEnviado = true;
});
}
guardarCambios() {
// Iterate through the array and save the changes
this.presupuestoPartidas.forEach(partida => {
const controlName = 'totalEjec_' + partida.uzytavpresup_id;
const value = this.dynamicForm.get(controlName).value;
console.log("valor recuperado xxxx ", value)
this.presupuesto.uzytavpresup_total_ejec = value;
// Send the updated data to the API for this record
this.presupuestoPartidasService.modificarParametros(partida.uzytavpresup_id, this.presupuesto).subscribe(
(response) => {
console.log('Cambios guardados exitosamente para la partida', partida.uzytavpresup_id);
//this.openModal();
this.dynamicForm.disable()
this.cambio = false; // Disable editing mode
this.obtenerRegistros()
},
(error) => {
console.log('Error al guardar los cambios para la partida', partida.uzytavpresup_id, error);
}
);
});
}
getSubgrupo3(item: any): string {
return (
item.uzytclasificador_presup_id +
'. ' +
(item.uzytclasificador_presup_nombre || '')
);
}
obtenerRegistros() {
this.idRecuperado = this.idRecuperado;
if (this.idRecuperado !== undefined) {
this.presupuestoPartidasService.obtenerRegistrosRelacionadosUniversidadProyecto(this.idRecuperado).subscribe(data => {
if (data !== undefined) {
this.presupuestoPartidas = data.map(partida => {
// Create dynamic form control
this.createDynamicFormControls(partida);
return {
...partida,
partida$: this.obtenerPartidas(partida.uzytavclaspre_id)
};
});
this.dataSource.data = this.presupuestoPartidas;
// Calcular los totales
this.calcularTotales();
this.calcularTotalesEjecutados()
}
});
}
}
createDynamicFormControls(partida: PresupuestoPartidas) {
this.dynamicForm.addControl('totalEjec_' + partida.uzytavpresup_id,
this.formBuilder.control({ value : partida.uzytavpresup_total_ejec,disabled: true },
[Validators.required, Validators.min(0), Validators.pattern('[0-9]+')]));
this.dynamicForm.disable();
}
obtenerPartidas(id: number): Observable<string> {
return this.partidaS.obtenerNombrePartidas(id).pipe(
map(partida => {
const partidaEncontrada = partida.find(c => c.uzytavclaspre_id === id);
return partidaEncontrada ? partidaEncontrada.uzytclasificador_presup_id + ". "
+ partidaEncontrada.uzytclasificador_presup_nombre : 'No encontrado';
})
);
}
calcularTotales() {
this.totalPermanente = this.presupuestoPartidas.reduce((total, dato) => {
if (dato.uzytavpresup_tipogasto == "C") {
return total + dato.uzytavpresup_valor * dato.uzytavpresup_cantidad;
} else {
return total; // Si no es "C", devolver el total sin cambiarlo
}
}, 0);
this.totalNoPermanente = this.presupuestoPartidas.reduce((total, dato) => {
if (dato.uzytavpresup_tipogasto == "I") {
return total + dato.uzytavpresup_valor * dato.uzytavpresup_cantidad;
} else {
return total; // Si no es "I", devolver el total sin cambiarlo
}
}, 0);
this.totalPermanente = parseFloat(this.totalPermanente.toFixed(2));
this.totalNoPermanente = parseFloat(this.totalNoPermanente.toFixed(2));
this.totalSuma = this.totalPermanente + this.totalNoPermanente;
}
calcularTotalesEjecutados() {
this.totalPermanenteEjecutado = this.presupuestoPartidas.reduce((total, dato) => {
if (dato.uzytavpresup_tipogasto == "C") {
return total + dato.uzytavpresup_total_ejec;
} else {
return total; // Si no es "C", devolver el total sin cambiarlo
}
}, 0);
this.totalNoPermanenteEjecutado = this.presupuestoPartidas.reduce((total, dato) => {
if (dato.uzytavpresup_tipogasto == "I") {
return total + dato.uzytavpresup_total_ejec;
} else {
return total; // Si no es "I", devolver el total sin cambiarlo
}
}, 0);
this.totalPermanenteEjecutado = parseFloat(this.totalPermanenteEjecutado.toFixed(2));
this.totalNoPermanenteEjecutado = parseFloat(this.totalNoPermanenteEjecutado.toFixed(2));
this.totalSumaEjecutado = this.totalPermanenteEjecutado + this.totalNoPermanenteEjecutado;
}
cambiar() {
this.cambio = true;
this.dynamicForm.enable();
}
cancelado() {
this.cambio = false;
this.dynamicForm.disable();
}
guardar() {
this.cambio = false;
this.dynamicForm.disable();
}
}
.editor-separator{ .editor-separator{
margin-top: 4%; margin-top: 4%;
} }
.error-message {
color: red;
font-size: 14px;
margin-top: 5px;
}
<div class="container"> <div class="container">
<form class="example-form" [formGroup]="myForm" (ngSubmit)="onSubmit()" > <form class="example-form" [formGroup]="myForm" (ngSubmit)="onSubmit()">
<mat-card> <mat-card>
<mat-card-header> <mat-card-header>
<div class="save-button"> <div class="save-button">
<button mat-raised-button color="primary" *ngIf="!cambio" <button mat-raised-button color="primary" *ngIf="!cambio"
(click)="cambiar()">Editar</button> (click)="cambiar()">Editar</button>
<button mat-raised-button color="primary" *ngIf="cambio" <button mat-raised-button color="primary" *ngIf="cambio"
>Guardar</button> [disabled]="!myForm.valid">Guardar</button>
<span class="separator"></span> <span class="separator"></span>
<button mat-raised-button color="warn" *ngIf="cambio" <button mat-raised-button color="warn" *ngIf="cambio"
(click)="cancelado()">Cancelar</button> (click)="cancelado()">Cancelar</button>
...@@ -15,41 +15,83 @@ ...@@ -15,41 +15,83 @@
<mat-card-content> <mat-card-content>
<div> <div>
<label class="label-negrita"> <strong>Productos y/o servicios generados por el proyecto:</strong> </label> <label class="label-negrita"> <strong>Productos y/o servicios
<ckeditor formControlName="productoCierre" class="custom-ckeditor" [disabled]="!isEditorEnabled" [style.height]="editorHeight" [editor]="Editor"></ckeditor> generados por el proyecto:</strong> </label>
<ckeditor formControlName="productoCierre" class="custom-ckeditor"
[disabled]="!isEditorEnabled" [style.height]="editorHeight"
[editor]="Editor"></ckeditor>
<div *ngIf="myForm.get('productoCierre').hasError('maxlength')"
class="error-message">
El contenido no puede exceder los 500 caracteres.
</div>
</div> </div>
<div class="editor-separator"></div> <div class="editor-separator"></div>
<div> <div>
<label class="label-negrita"> <strong>Bienes a favor de la ESPE:</strong></label> <label class="label-negrita"> <strong>Bienes a favor de la ESPE:</strong></label>
<ckeditor formControlName="bienesCierre" class="custom-ckeditor" [disabled]="!isEditorEnabled" [style.height]="editorHeight" [editor]="Editor"></ckeditor> <ckeditor formControlName="bienesCierre" class="custom-ckeditor"
[disabled]="!isEditorEnabled" [style.height]="editorHeight"
[editor]="Editor"></ckeditor>
<div *ngIf="myForm.get('bienesCierre').hasError('maxlength')"
class="error-message">
El contenido no puede exceder los 500 caracteres.
</div>
</div> </div>
<div class="editor-separator"></div> <div class="editor-separator"></div>
<div> <div>
<label class="label-negrita"> <strong>Resultados del proyecto:</strong></label> <label class="label-negrita"> <strong>Resultados del proyecto:</strong></label>
<ckeditor formControlName="resultadoCierre" class="custom-ckeditor" [disabled]="!isEditorEnabled" [style.height]="editorHeight" [editor]="Editor"></ckeditor> <ckeditor formControlName="resultadoCierre" class="custom-ckeditor"
[disabled]="!isEditorEnabled" [style.height]="editorHeight"
[editor]="Editor"></ckeditor>
<div *ngIf="myForm.get('resultadoCierre').hasError('maxlength')"
class="error-message">
El contenido no puede exceder los 500 caracteres.
</div>
</div> </div>
<div class="editor-separator"></div> <div class="editor-separator"></div>
<div> <div>
<label class="label-negrita"> <strong>Otras aplicaciones del producto y/o servicios:</strong></label> <label class="label-negrita"> <strong>Otras aplicaciones del producto
<ckeditor formControlName="servicioCierre" class="custom-ckeditor" [disabled]="!isEditorEnabled" [style.height]="editorHeight" [editor]="Editor"></ckeditor> y/o servicios:</strong></label>
<ckeditor formControlName="servicioCierre" class="custom-ckeditor"
[disabled]="!isEditorEnabled" [style.height]="editorHeight"
[editor]="Editor"></ckeditor>
<div *ngIf="myForm.get('servicioCierre').hasError('maxlength')"
class="error-message">
El contenido no puede exceder los 500 caracteres.
</div>
</div> </div>
<div class="editor-separator"></div> <div class="editor-separator"></div>
<div> <div>
<label class="label-negrita"> <strong>Impacto futuro del proyecto:</strong></label> <label class="label-negrita"> <strong>Impacto futuro del proyecto:</strong></label>
<ckeditor formControlName="impactoCierre" class="custom-ckeditor" [disabled]="!isEditorEnabled" [style.height]="editorHeight" [editor]="Editor"></ckeditor> <ckeditor formControlName="impactoCierre" class="custom-ckeditor"
[disabled]="!isEditorEnabled" [style.height]="editorHeight"
[editor]="Editor"></ckeditor>
<div *ngIf="myForm.get('impactoCierre').hasError('maxlength')"
class="error-message">
El contenido no puede exceder los 500 caracteres.
</div>
</div> </div>
<div class="editor-separator"></div> <div class="editor-separator"></div>
<div> <div>
<label class="label-negrita"> <strong>Restricciones que limitan el impacto del proyecto:</strong></label> <label class="label-negrita"> <strong>Restricciones que limitan el
<ckeditor formControlName="restricCierre" class="custom-ckeditor" [disabled]="!isEditorEnabled" [style.height]="editorHeight" [editor]="Editor"></ckeditor> impacto del proyecto:</strong></label>
<ckeditor formControlName="restricCierre" class="custom-ckeditor"
[disabled]="!isEditorEnabled" [style.height]="editorHeight"
[editor]="Editor"></ckeditor>
<div *ngIf="myForm.get('restricCierre').hasError('maxlength')" class="error-message">
El contenido no puede exceder los 500 caracteres.
</div>
</div> </div>
<div class="editor-separator"></div> <div class="editor-separator"></div>
<div> <div>
<label class="label-negrita"> <strong>Comentarios Generales:</strong></label> <label class="label-negrita"> <strong>Comentarios Generales:</strong></label>
<ckeditor formControlName="comenCierre" class="custom-ckeditor" [disabled]="!isEditorEnabled" [style.height]="editorHeight" [editor]="Editor"></ckeditor> <ckeditor formControlName="comenCierre" class="custom-ckeditor"
[disabled]="!isEditorEnabled" [style.height]="editorHeight"
[editor]="Editor"></ckeditor>
<div *ngIf="myForm.get('comenCierre').hasError('maxlength')" class="error-message">
El contenido no puede exceder los 500 caracteres.
</div>
</div> </div>
</mat-card-content> </mat-card-content>
......
...@@ -7,6 +7,7 @@ import { ProyectosService } from 'src/app/modules/main/services/proyectos/proyec ...@@ -7,6 +7,7 @@ import { ProyectosService } from 'src/app/modules/main/services/proyectos/proyec
import ClassicEditor from '../../../ckeditor-custom/build/ckeditor'; import ClassicEditor from '../../../ckeditor-custom/build/ckeditor';
import { EnvioFormularioComponent } from '../../../../programa/opciones/envio-formulario/envio-formulario.component'; import { EnvioFormularioComponent } from '../../../../programa/opciones/envio-formulario/envio-formulario.component';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { ErrorTextoComponent } from '../../../errores/error-texto/error-texto.component';
@Component({ @Component({
selector: 'vex-resultados', selector: 'vex-resultados',
templateUrl: './resultados.component.html', templateUrl: './resultados.component.html',
...@@ -45,13 +46,13 @@ export class ResultadosComponent implements OnInit { ...@@ -45,13 +46,13 @@ export class ResultadosComponent implements OnInit {
this.obtenerRegistros(); this.obtenerRegistros();
this.myForm = this.formBuilder.group({ this.myForm = this.formBuilder.group({
productoCierre: [this.proyectos.uzytavproyec_cierre_prod, Validators.required], productoCierre: [this.proyectos.uzytavproyec_cierre_prod, [Validators.required, Validators.maxLength(500)]],
bienesCierre: [this.proyectos.uzytavproyec_cierre_bien, Validators.required], bienesCierre: [this.proyectos.uzytavproyec_cierre_bien, [Validators.required, Validators.maxLength(500)]],
resultadoCierre: [this.proyectos.uzytavproyec_cierre_resul, Validators.required], resultadoCierre: [this.proyectos.uzytavproyec_cierre_resul, [Validators.required, Validators.maxLength(500)]],
servicioCierre: [this.proyectos.uzytavproyec_cierre_aplic, Validators.required], servicioCierre: [this.proyectos.uzytavproyec_cierre_aplic, [Validators.required, Validators.maxLength(500)]],
impactoCierre: [this.proyectos.uzytavproyec_cierre_imp, Validators.required], impactoCierre: [this.proyectos.uzytavproyec_cierre_imp, [Validators.required, Validators.maxLength(500)]],
restricCierre: [this.proyectos.uzytavproyec_cierre_rest, Validators.required], restricCierre: [this.proyectos.uzytavproyec_cierre_rest,[Validators.required, Validators.maxLength(500)]],
comenCierre: [this.proyectos.uzytavproyec_cierre_comen, Validators.required] comenCierre: [this.proyectos.uzytavproyec_cierre_comen, [Validators.required, Validators.maxLength(500)]]
}); });
} }
...@@ -84,6 +85,7 @@ export class ResultadosComponent implements OnInit { ...@@ -84,6 +85,7 @@ export class ResultadosComponent implements OnInit {
this.proyectos.uzytavproyec_cierre_imp = this.myForm.get('impactoCierre').value; this.proyectos.uzytavproyec_cierre_imp = this.myForm.get('impactoCierre').value;
this.proyectos.uzytavproyec_cierre_rest = this.myForm.get('restricCierre').value; this.proyectos.uzytavproyec_cierre_rest = this.myForm.get('restricCierre').value;
this.proyectos.uzytavproyec_cierre_comen = this.myForm.get('comenCierre').value; this.proyectos.uzytavproyec_cierre_comen = this.myForm.get('comenCierre').value;
console.log('observación', this.proyectos.uzytavproyec_cierre_comen)
this.proyectosService.modificarParametros(this.idRecuperado, this.proyectos).subscribe(response => { this.proyectosService.modificarParametros(this.idRecuperado, this.proyectos).subscribe(response => {
this.cambio = false; this.cambio = false;
this.isEditorEnabled = false; this.isEditorEnabled = false;
...@@ -91,7 +93,8 @@ export class ResultadosComponent implements OnInit { ...@@ -91,7 +93,8 @@ export class ResultadosComponent implements OnInit {
}); });
} catch (error) { } catch (error) {
console.error('Error al enviar los datos:', error); console.error(error)
this.openEror();
} }
} }
} }
...@@ -106,4 +109,14 @@ export class ResultadosComponent implements OnInit { ...@@ -106,4 +109,14 @@ export class ResultadosComponent implements OnInit {
this.formularioEnviado = true; this.formularioEnviado = true;
}); });
} }
openEror(){
const dialogRef = this.dialog.open(ErrorTextoComponent, {
disableClose: true
});
dialogRef.afterClosed().subscribe(result => {
this.formularioEnviado = true;
});
}
} }
...@@ -37,6 +37,7 @@ export class ListarCoberturaProyectoComponent implements OnInit { ...@@ -37,6 +37,7 @@ export class ListarCoberturaProyectoComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.idRecuperado = parseInt(localStorage.getItem('proyectoId'),10); this.idRecuperado = parseInt(localStorage.getItem('proyectoId'),10);
console.log('id', this.idRecuperado)
this.datosCompar.datos$.subscribe(() => { this.datosCompar.datos$.subscribe(() => {
this.obtenerRegistros(); this.obtenerRegistros();
this.obtenerProvincias(); this.obtenerProvincias();
......
import { Component, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms'; import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
...@@ -25,6 +25,8 @@ import { UsuariosService } from 'src/app/modules/main/services/usuarios/usuarios ...@@ -25,6 +25,8 @@ import { UsuariosService } from 'src/app/modules/main/services/usuarios/usuarios
styleUrls: ['./edit-datos-generales-proyecto.component.css'] styleUrls: ['./edit-datos-generales-proyecto.component.css']
}) })
export class EditDatosGeneralesProyectoComponent implements OnInit { export class EditDatosGeneralesProyectoComponent implements OnInit {
@Input() id: any;
myForm: FormGroup; myForm: FormGroup;
proyecto: Proyectos; proyecto: Proyectos;
cambio: boolean; cambio: boolean;
...@@ -57,6 +59,7 @@ export class EditDatosGeneralesProyectoComponent implements OnInit { ...@@ -57,6 +59,7 @@ export class EditDatosGeneralesProyectoComponent implements OnInit {
) { ) {
this.proyecto = new Proyectos(); this.proyecto = new Proyectos();
console.log('pru',this.id)
} }
ngOnInit(): void { ngOnInit(): void {
......
.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;
}
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { EditInformeComponent } from './edit-informe.component';
describe('EditInformeComponent', () => {
let component: EditInformeComponent;
let fixture: ComponentFixture<EditInformeComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ EditInformeComponent ]
})
.compileComponents();
fixture = TestBed.createComponent(EditInformeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
@Component({
selector: 'vex-edit-informe',
templateUrl: './edit-informe.component.html',
styleUrls: ['./edit-informe.component.css']
})
export class EditInformeComponent implements OnInit {
idRecuperado: number;
myForm: FormGroup;
constructor(
private formBuilder: FormBuilder
) {
this.myForm = this.formBuilder.group({
fecha: [''],
observacion: [''],
});
}
ngOnInit(): void {
this.idRecuperado = parseInt(localStorage.getItem('proyectoId'),10);
}
}
/* Estilos generales */
.container {
width: 100%;
max-width: 1200px; /* Cambia este valor según tus necesidades */
margin: 0 auto;
padding: 20px;
box-sizing: border-box;
}
/* Estilos de la tabla */
.table-container {
overflow-x: auto;
}
table {
width: 100%;
max-width: 100%;
border-collapse: collapse;
font-family: 'Roboto', sans-serif;
color: #333;
border: 1px solid #e0e0e0;
}
table th,
table td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #e0e0e0;
}
table th {
background-color: rgb(248, 249, 250);
font-weight: bold;
text-transform: uppercase;
}
/* Ajuste de la celda que contiene el componente expandido */
td.expanded-cell {
padding: 0;
}
/* Estilos del botón de expansión */
.button-expand {
padding: 0;
border: none;
background-color: transparent;
cursor: pointer;
}
.button-expand mat-icon {
font-size: 24px;
}
/* Estilos del componente expandido */
.expanded-content {
padding: 10px;
background-color: white;
}
/* Estilos del botón de eliminación */
.button-delete {
border: none;
background-color: transparent;
cursor: pointer;
}
.button-delete mat-icon {
color: red;
}
/* Estilos del contenedor principal */
.contenedorP {
width: 100%;
margin: 10px auto;
border-radius: 10px;
text-align: center;
background-color: white;
}
/* Estilos de los botones redondos */
.rounder {
border-radius: 50%;
background-color: rgb(71, 127, 75);
display: flex;
align-items: center;
justify-content: center;
padding: 0;
width: 36px;
height: 36px;
border: none;
outline: none;
cursor: pointer;
}
.rounder mat-icon {
font-size: 24px;
color: #fff;
}
/* Estilos de los íconos de edición */
.colorEditar {
color: blue;
}
.colorEditar svg {
fill: blue;
}
/* Estilos del encabezado de la tabla */
.colorsito {
background-color: rgb(248, 249, 250);
}
/* Media Queries para pantallas pequeñas */
@media (max-width: 768px) {
table th,
table td {
padding: 8px;
}
}
@media (max-width: 1200px) {
table th,
table td {
padding: 10px;
}
}
<div class="container">
<div class="div-container">
<label class="label-negrita"><strong>Listado de informes de avance</strong></label>
</div>
<div class="mat-elevation-z8">
<table>
<thead>
<tr>
<th class="Column1"></th>
<th class="Column1 negrita">Nro</th>
<th class="Column1 negrita">Fecha</th>
<th class="Column1 negrita">Observación</th>
<th class="Column1 negrita">Acciones</th>
</tr>
</thead>
<tbody>
<ng-container *ngFor="let item of objetivoEspe; let i = index">
<tr id="fila-{{i}}">
<td>
<button (click)="toggleDiv(i)">
<mat-icon>{{ mostrarDiv[i] ? 'keyboard_arrow_down' :
'keyboard_arrow_right' }}</mat-icon>
</button>
</td>
<td>
{{i+1}}
</td>
<td>{{item.uzytavobjetivo_programaobjetivo_proy}}</td>
<td>{{item.uzytavobjetivo_programaindicador_tipo}}</td>
<td>
<button>
<mat-icon color="warn"
(click)="eliminar(item.uzytavobjetivo_programa_id)">delete</mat-icon>
</button>
</td>
</tr>
<!-- tabla interna para cada item -->
<tr *ngIf="mostrarDiv[i]">
<td colspan="8">
<div class="container">
<div class="">
<table>
<thead>
<tr>
<th class="Column1 negrita">Nro</th>
<th class="Column1 negrita">Descripción</th>
<th class="Column1 negrita">Tipo Indicador</th>
<th class="Column1 negrita">Valor Indicador</th>
<th class="Column1 negrita">Descripción Indicador</th>
<th class="Column1 negrita">Medio de Verificación</th>
<th class="Column1 negrita">Supuestos</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let acti of objetivoEspe; let i = index">
<ng-container
*ngIf="acti.uzytavobjetivo_programa_id_padre === item.uzytavobjetivo_programa_id">
<td>{{ i+1 }}</td>
<td>{{acti.uzytavobjetivo_programaobjetivo_proy}}</td>
<td>{{acti.uzytavobjetivo_programaindicador_tipo}}</td>
<td>{{acti.uzytavobjetivo_programaindicador_valor}}</td>
<td>{{acti.uzytavobjetivo_programaindicador}}</td>
<td>{{acti.uzytavobjetivo_programamverifica}}</td>
<td>{{acti.uzytavobjetivo_programasupuestos}}</td>
</ng-container>
</tr>
</tbody>
</table>
</div>
</div>
</td>
</tr>
</ng-container>
</tbody>
</table>
</div>
</div>
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ListInformeComponent } from './list-informe.component';
describe('ListInformeComponent', () => {
let component: ListInformeComponent;
let fixture: ComponentFixture<ListInformeComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ListInformeComponent ]
})
.compileComponents();
fixture = TestBed.createComponent(ListInformeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { objetivoprograma } from 'src/app/modules/main/Models/objetivoPrograma';
@Component({
selector: 'vex-list-informe',
templateUrl: './list-informe.component.html',
styleUrls: ['./list-informe.component.css']
})
export class ListInformeComponent implements OnInit {
//para mostrar el div
mostrarDiv: boolean[] = [];
//objetivosEspe
objetivoEspe: objetivoprograma[] = [];
constructor() { }
ngOnInit(): void {
}
//toggle div para desplegar
toggleDiv(i: number){
this.mostrarDiv[i] = !this.mostrarDiv[i];
}
//acciones para eliminar
eliminar(id: number){
}
}
...@@ -47,7 +47,7 @@ export class AddCronogramaActiComponent implements OnInit { ...@@ -47,7 +47,7 @@ export class AddCronogramaActiComponent implements OnInit {
private objM: objetivoprograma private objM: objetivoprograma
) { ) {
this.myForm = this.formBuilder.group({ this.myForm = this.formBuilder.group({
Actividades: [''], Actividades: ['', Validators.required],
fechaIni: ['', Validators.required], fechaIni: ['', Validators.required],
fechaFin: ['', Validators.required], fechaFin: ['', Validators.required],
horaFin: ['', Validators.required], horaFin: ['', Validators.required],
......
...@@ -17,41 +17,37 @@ ...@@ -17,41 +17,37 @@
<button mat-raised-button color="primary" *ngIf="ocultar" <button mat-raised-button color="primary" *ngIf="ocultar"
(click)="AgregarF()" [disabled]="myForm.get('hitos').invalid">Agregar (click)="AgregarF()" [disabled]="myForm.get('hitos').invalid">Agregar
Fecha</button> Fecha</button>
<button mat-raised-button color="primary" *ngIf="showDataAdd">Guardar</button> <button mat-raised-button color="primary" *ngIf="showDataAdd" (click)="enviarInfo()">Guardar</button>
<span class="separator"></span> <span class="separator"></span>
<button mat-raised-button color="warn" *ngIf="showDataAdd" <button mat-raised-button color="warn" *ngIf="showDataAdd"
(click)="cancelarF()">Cancelar</button> (click)="cancelarF()">Cancelar</button>
</div> </div>
<div class="separator2"></div> <div class="separator2"></div>
<!--fecha de inicio--> <!--fecha de inicio-->
<div *ngIf="showDataAdd"> <div *ngIf="showDataAdd">
<mat-label><strong>Fecha de Inicio:</strong></mat-label>
<mat-form-field class="form-field">
<mat-label>Fecha de inicio</mat-label>
<input matInput [matDatepicker]="pickerInicio" formControlName="fechaIniHitos">
<mat-datepicker-toggle matSuffix [for]="pickerInicio"></mat-datepicker-toggle>
<mat-datepicker #pickerInicio></mat-datepicker>
</mat-form-field>
<!-- Descripcion-->
<mat-form-field class="form-field"> <mat-form-field class="form-field">
<mat-label>Hora de inicio</mat-label> <mat-label>Descripción</mat-label>
<input matInput type="time" formControlName="horaIniHitos"> <input matInput formControlName="descrip">
</mat-form-field> </mat-form-field>
<mat-label><strong>Fecha</strong></mat-label>
<!--fecha de fin-->
<mat-label><strong>Fecha de Fin:</strong></mat-label>
<mat-form-field class="form-field"> <mat-form-field class="form-field">
<mat-label>Fecha Fin:</mat-label> <mat-label>Fecha:</mat-label>
<input matInput [matDatepicker]="pickerFin" formControlName="fechaFinHitos"> <input matInput [matDatepicker]="pickerInicio"
<mat-datepicker-toggle matSuffix [for]="pickerFin"></mat-datepicker-toggle> formControlName="fechaIniHitos">
<mat-datepicker #pickerFin></mat-datepicker> <mat-datepicker-toggle matSuffix [for]="pickerInicio"></mat-datepicker-toggle>
<mat-datepicker #pickerInicio></mat-datepicker>
</mat-form-field> </mat-form-field>
<!--fecha por defecto-->
<mat-form-field class="form-field"> <mat-form-field class="form-field">
<mat-label>Hora de Fin</mat-label> <mat-label>Resultados Esperados</mat-label>
<input matInput type="time" formControlName="horaFinHitos"> <input matInput formControlName="resultados">
</mat-form-field> </mat-form-field>
</div> </div>
</form> </form>
</div> </div>
......
...@@ -3,9 +3,11 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; ...@@ -3,9 +3,11 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { CalendarOptions, EventApi, EventClickArg, EventInput } from '@fullcalendar/core'; import { CalendarOptions, EventApi, EventClickArg, EventInput } from '@fullcalendar/core';
import dayGridPlugin from '@fullcalendar/daygrid'; import dayGridPlugin from '@fullcalendar/daygrid';
import moment from 'moment'; import moment from 'moment';
import { seguim } from 'src/app/modules/main/Models/hito';
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 { 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 { Compartir_idService } from 'src/app/modules/main/services/compartir_id/compartir_id.service';
import { HitosService } from 'src/app/modules/main/services/hitos/hitos.service';
import { Objetivo_programaService } from 'src/app/modules/main/services/objetivo_programa/objetivo_programa.service'; import { Objetivo_programaService } from 'src/app/modules/main/services/objetivo_programa/objetivo_programa.service';
@Component({ @Component({
selector: 'vex-add-hitos', selector: 'vex-add-hitos',
...@@ -34,14 +36,15 @@ export class AddHitosComponent implements OnInit { ...@@ -34,14 +36,15 @@ export class AddHitosComponent implements OnInit {
private idCompartido: Compartir_idService, private idCompartido: Compartir_idService,
private datosCompartidos: Actualiza_datosService, private datosCompartidos: Actualiza_datosService,
private objM: objetivoprograma, private objM: objetivoprograma,
private objPS: Objetivo_programaService private objPS: Objetivo_programaService,
private hitoS: HitosService,
private hitoM: seguim
) { ) {
this.myForm = this.formBuilder.group({ this.myForm = this.formBuilder.group({
hitos: [''], hitos: ['', Validators.required],
fechaIniHitos: ['', Validators.required], fechaIniHitos: ['', Validators.required],
fechaFinHitos: ['', Validators.required], descrip: ['', Validators.required],
horaFinHitos: ['', Validators.required], resultados: ['', Validators.required]
horaIniHitos: ['', Validators.required],
}); });
} }
...@@ -82,6 +85,7 @@ export class AddHitosComponent implements OnInit { ...@@ -82,6 +85,7 @@ export class AddHitosComponent implements OnInit {
const eventoSeleccionado = info.event; const eventoSeleccionado = info.event;
const id = parseInt(eventoSeleccionado.id, 10); const id = parseInt(eventoSeleccionado.id, 10);
this.eliminarFechas(id); this.eliminarFechas(id);
} }
onUpdate(){ onUpdate(){
...@@ -89,21 +93,16 @@ export class AddHitosComponent implements OnInit { ...@@ -89,21 +93,16 @@ export class AddHitosComponent implements OnInit {
const id_recuperado = this.myForm.get('hitos').value; const id_recuperado = this.myForm.get('hitos').value;
try { try {
const fechaIni = moment(this.myForm.get('fechaIniHitos').value).utc().toDate(); const fechaIni = moment(this.myForm.get('fechaIniHitos').value).utc().toDate();
const horaIni = moment(this.myForm.get('horaIniHitos').value, 'HH:mm').utc().toDate();
const fechaHoraIni = new Date(fechaIni); const fechaHoraIni = new Date(fechaIni);
fechaHoraIni.setUTCHours(horaIni.getUTCHours());
fechaHoraIni.setUTCMinutes(horaIni.getUTCMinutes());
fechaHoraIni.setUTCHours(fechaHoraIni.getUTCHours() - 5); fechaHoraIni.setUTCHours(fechaHoraIni.getUTCHours() - 5);
const fechaHoraSecond = new Date(fechaIni);
fechaHoraSecond.setUTCHours(fechaHoraSecond.getUTCHours() - 3)
this.objM.uzytavobjetivo_programafec_ini = fechaHoraIni; this.objM.uzytavobjetivo_programafec_ini = fechaHoraIni;
const fechaFin = moment(this.myForm.get('fechaFinHitos').value).utc().toDate(); this.objM.uzytavobjetivo_programafec_fin = fechaHoraSecond;
const horaFin = moment(this.myForm.get('horaFinHitos').value, 'HH:mm').utc().toDate();
const fechaHoraFin = new Date(fechaFin);
fechaHoraFin.setUTCHours(horaFin.getUTCHours());
fechaHoraFin.setUTCMinutes(horaFin.getUTCMinutes());
fechaHoraFin.setUTCHours(fechaHoraFin.getUTCHours() - 5);
this.objM.uzytavobjetivo_programafec_fin = fechaHoraFin;
this.objPS.modificarParametros(id_recuperado, this.objM).subscribe(response => { this.objPS.modificarParametros(id_recuperado, this.objM).subscribe(response => {
this.showDataAdd = false; this.showDataAdd = false;
this.ocultar = true; this.ocultar = true;
...@@ -117,6 +116,32 @@ export class AddHitosComponent implements OnInit { ...@@ -117,6 +116,32 @@ export class AddHitosComponent implements OnInit {
} }
} }
enviarInfo(){
if (this.myForm.valid) {
const id_recuperado = this.myForm.get('hitos').value;
try {
const fechaIni = moment(this.myForm.get('fechaIniHitos').value).utc().toDate();
const fechaHoraIni = new Date(fechaIni);
fechaHoraIni.setUTCHours(fechaHoraIni.getUTCHours() - 5);
this.hitoM.uzytavseguim_fecha_logro = fechaHoraIni
this.hitoM.uzytavproyec_id = this.idProyecto;
this.hitoM.uzytavobjetivo_programa_id = id_recuperado;
this.hitoM.uzytavseguim_descrip = this.myForm.get('descrip').value;
this.hitoM.uzytavseguim_logro = this.myForm.get('resultados').value;
this.hitoS.guardarParametros(this.hitoM).subscribe(response => {
});
} catch (error) {
console.error('Error al enviar los datos:', error);
}
}
}
AgregarF(){ AgregarF(){
this.showDataAdd = true; this.showDataAdd = true;
this.ocultar = false; this.ocultar = false;
......
table {
width: 100%;
}
/* Estilos generales */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
.sinborder {
text-align: center;
font-weight: bold;
}
.General th {
padding: 10px;
border: 1px solid black;
font-weight: bold;
background-color: #b6b6b6
}
.Duracion th {
padding: 4px;
border: 1px solid black;
font-weight: bold;
background-color: #b6b6b6
}
.encabezado table {
width: 100%;
border-collapse: collapse;
}
.encabezado td {
padding: 10px;
border: 1px solid black;
}
.encabezado .image-cell img {
max-width: 100px;
height: auto;
}
.encabezado .center-cell {
text-align: center;
font-weight: bold;
}
/* Estilos para la tabla de detalles */
.detalle-table {
margin-top: 20px;
width: 100%;
border-collapse: collapse;
}
.detalle-table td {
padding: 5px;
border: 1px solid black;
}
.detalle-table .codigo-cell {
width: 30%;
font-weight: bold;
}
/* Estilos para el pie de página */
.pie {
margin-top: 20px;
text-align: center;
font-size: 12px;
}
.Column {
padding-left: 0px;
padding-right: 0px;
width: 100px;
white-space: inherit;
}
.Column1 negrita {
font-weight: bold;
}
.Column1 {
padding-left: 0px;
padding-right: 0px;
width: 10px;
white-space: normal;
overflow: visible;
}
.Column2 {
width: 25px;
padding-left: 0px;
padding-right: 0px;
}
.label-negrita {
font-weight: bold;
margin-right: 10px;
margin-top: 10px;
}
.div-container {
display: flex;
align-items: center;
padding: 0%;
}
.container {
padding: 0%;
margin: none;
}
.Marco_Lógico tr {
border: 5px;
}
.containerActividades {
padding: 0%;
border-left: 15px;
}
.container tr {
border-top: 3%;
border-width: 3%;
}
.separa {
margin-top: 3%;
}
.grid-container {
display: grid;
grid-template-columns: 5% 10% 45% 10% 5% 10% 15%;
border: 1px solid #ccc;
}
table,
th,
tr,
td {
border: 1px solid black;
border-collapse: collapse;
padding: 5px;
}
.mat-elevation-z8 table {
border-collapse: collapse;
width: 100%;
}
.mat-elevation-z8 th,
.mat-elevation-z8 td {
border: 1px solid black;
text-align: left;
}
.mat-elevation-z8 th {
background-color: #f2f2f2;
}
\ No newline at end of file
<div class="container">
<table>
<tr class="Duracion">
<th colspan="8">Aporte de la Comunidad Beneficiaria </th>
</tr>
</table>
<table>
<tr class="Duracion">
<th class="Column1 negrita">Nro</th>
<th class="Column negrita">Bien y/o Servicio</th>
<th class="Column negrita">Descripción</th>
<th class="Column negrita">Cantidad</th>
<th class="Column negrita">Valor Unitario USD</th>
<th class="Column negrita">Total USD</th>
</tr>
<tr *ngFor="let datoss of presupuestoPartidas; let i = index">
<td class="Column1">{{ i + 1 }}</td>
<td class="Column">{{ datoss.uzytavpresup_bien_servicio }}</td>
<td class="Column">{{ datoss.uzytavpresup_esptecnic }}</td>
<td class="Column">{{ datoss.uzytavpresup_cantidad }}</td>
<td class="Column">{{ datoss.uzytavpresup_valor }}</td>
<td class="Column">{{ (datoss.uzytavpresup_valor * datoss.uzytavpresup_cantidad) | number:'1.2-2' }}</td>
</tr>
<tr >
<th> Total: </th>
<th colspan="5" style="text-align: center;"> {{totalSuma}} </th>
</tr>
</table>
</div>
\ No newline at end of file
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { ListComunidadComponent } from './list-comunidad.component';
describe('ListComunidadComponent', () => {
let component: ListComunidadComponent;
let fixture: ComponentFixture<ListComunidadComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ListComunidadComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ListComunidadComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit, ViewChild } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { MatTable, MatTableDataSource } from '@angular/material/table';
import { CatalogoPP } from 'src/app/modules/main/Models/catalogo-partidas-presupuestarias';
import { PartidasPresupuestarias } from 'src/app/modules/main/Models/partidas-presupuestarias';
import { PresupuestoPartidas } from 'src/app/modules/main/Models/presupuesto-partidas';
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 { PresupuestoPartidasService } from 'src/app/modules/main/services/presupuesto-partidas/presupuesto-partidas.service';
@Component({
selector: 'app-list-comunidad',
templateUrl: './list-comunidad.component.html',
styleUrls: ['./list-comunidad.component.css']
})
export class ListComunidadComponent implements OnInit {
idRecuperado: number;
totalSuma: number = 0;
dataSource: MatTableDataSource<PresupuestoPartidas>;
claPre: PartidasPresupuestarias;
partida!: CatalogoPP[];
nombrePartida: string;
politicas: any[] = [];
objetivos: any[] = [];
presupuestoPartidas!: PresupuestoPartidas[];
constructor(
private presupuestoPartidasService: PresupuestoPartidasService,
private id_Compartido: Compartir_idService,
private dialog: MatDialog,
private datosCompartidos: Actualiza_datosService,
) {
this.claPre = new PartidasPresupuestarias();
this.dataSource = new MatTableDataSource<PresupuestoPartidas>([]);
}
ngOnInit(): void {
this.idRecuperado = parseInt(localStorage.getItem('proyectoId'),10);
this.datosCompartidos.datos$.subscribe(() => {
this.obtenerRegistros();
});
this.presupuestoPartidasService.parametrosActualizados.subscribe(() => {
this.obtenerRegistros();
});
}
getSubgrupo3(item: any): string {
return (
item.uzytclasificador_presup_id +
'. ' +
(item.uzytclasificador_presup_nombre || '')
);
}
obtenerRegistros() {
if (this.idRecuperado !== undefined) {
this.presupuestoPartidasService.obtenerRegistrosRelacionadosComunidadProyecto(this.idRecuperado).subscribe(data => {
if (data !== undefined) {
this.presupuestoPartidas = data;
this.dataSource.data = this.presupuestoPartidas;
// Calcular los totales
this.calcularTotales();
// Fetch the names for the given uzytavclaspre_id
}
});
}
}
calcularTotales() {
this.totalSuma = this.presupuestoPartidas.reduce((total, dato) => {
return total + dato.uzytavpresup_valor * dato.uzytavpresup_cantidad;
}, 0);
this.totalSuma = parseFloat(this.totalSuma.toFixed(2));
}
eliminarParametros(id: number) {
const confirmacion = confirm('¿Desea eliminar el registro?');
if (confirmacion) {
this.presupuestoPartidasService.eliminarParametros(id).subscribe(
(response) => {
console.log('El registro se ha eliminado exitosamente.');
this.obtenerRegistros(); // Refresh the records after successful deletion
},
(error) => {
console.log('Error during the treatment of the record', error);
}
);
}
}
}
table {
width: 100%;
}
/* Estilos generales */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
.sinborder {
text-align: center;
font-weight: bold;
}
.General th {
padding: 10px;
border: 1px solid black;
font-weight: bold;
background-color: #b6b6b6
}
.Duracion th {
padding: 4px;
border: 1px solid black;
font-weight: bold;
background-color: #b6b6b6
}
.encabezado table {
width: 100%;
border-collapse: collapse;
}
.encabezado td {
padding: 10px;
border: 1px solid black;
}
.encabezado .image-cell img {
max-width: 100px;
height: auto;
}
.encabezado .center-cell {
text-align: center;
font-weight: bold;
}
/* Estilos para la tabla de detalles */
.detalle-table {
margin-top: 20px;
width: 100%;
border-collapse: collapse;
}
.detalle-table td {
padding: 5px;
border: 1px solid black;
}
.detalle-table .codigo-cell {
width: 30%;
font-weight: bold;
}
/* Estilos para el pie de página */
.pie {
margin-top: 20px;
text-align: center;
font-size: 12px;
}
.Column {
padding-left: 0px;
padding-right: 0px;
width: 100px;
white-space: inherit;
}
.Column1 negrita {
font-weight: bold;
}
.Column1 {
padding-left: 0px;
padding-right: 0px;
width: 10px;
white-space: normal;
overflow: visible;
}
.Column2 {
width: 25px;
padding-left: 0px;
padding-right: 0px;
}
.label-negrita {
font-weight: bold;
margin-right: 10px;
margin-top: 10px;
}
.div-container {
display: flex;
align-items: center;
padding: 0%;
}
.container {
padding: 0%;
margin: none;
}
.Marco_Lógico tr {
border: 5px;
}
.containerActividades {
padding: 0%;
border-left: 15px;
}
.container tr {
border-top: 3%;
border-width: 3%;
}
.separa {
margin-top: 3%;
}
.grid-container {
display: grid;
grid-template-columns: 5% 10% 45% 10% 5% 10% 15%;
border: 1px solid #ccc;
}
table,
th,
tr,
td {
border: 1px solid black;
border-collapse: collapse;
padding: 5px;
}
.mat-elevation-z8 table {
border-collapse: collapse;
width: 100%;
}
.mat-elevation-z8 th,
.mat-elevation-z8 td {
border: 1px solid black;
text-align: left;
}
.mat-elevation-z8 th {
background-color: #f2f2f2;
}
\ No newline at end of file
<div class="container">
<table>
<tr class="Duracion">
<th colspan="8">Aporte de la Entidad Auspiciante </th>
</tr>
</table>
<table>
<tr class="Duracion">
<th class="Column1 negrita">Nro</th>
<th class="Column negrita">Bien y/o Servicio</th>
<th class="Column negrita">Descripción</th>
<th class="Column negrita">Cantidad</th>
<th class="Column negrita">Valor Unitario USD</th>
<th class="Column negrita">Total USD</th>
</tr>
<!-- Lógica de iteración para llenar la tabla -->
<tr *ngFor="let datos of presupuestoPartidas; let i = index">
<td class="Column1">{{ i + 1 }}</td>
<td class="Column">{{ datos.uzytavpresup_bien_servicio }}</td>
<td class="Column">{{ datos.uzytavpresup_esptecnic }}</td>
<td class="Column">{{ datos.uzytavpresup_cantidad }}</td>
<td class="Column">{{ datos.uzytavpresup_valor }}</td>
<td class="Column">{{ (datos.uzytavpresup_valor * datos.uzytavpresup_cantidad) | number:'1.2-2' }}</td>
</tr>
<tr colspan="4">
<th> Total: </th>
<th colspan="5" style="text-align: center;"> {{totalSuma}} </th>
</tr>
<!-- Fin de la iteración -->
</table>
</div>
\ No newline at end of file
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { ListEntidadComponent } from './list-entidad.component';
describe('ListEntidadComponent', () => {
let component: ListEntidadComponent;
let fixture: ComponentFixture<ListEntidadComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ListEntidadComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ListEntidadComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit, ViewChild } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { MatTable, MatTableDataSource } from '@angular/material/table';
import { CatalogoPP } from 'src/app/modules/main/Models/catalogo-partidas-presupuestarias';
import { PartidasPresupuestarias } from 'src/app/modules/main/Models/partidas-presupuestarias';
import { PresupuestoPartidas } from 'src/app/modules/main/Models/presupuesto-partidas';
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 { PresupuestoPartidasService } from 'src/app/modules/main/services/presupuesto-partidas/presupuesto-partidas.service';
@Component({
selector: 'app-list-entidad',
templateUrl: './list-entidad.component.html',
styleUrls: ['./list-entidad.component.css']
})
export class ListEntidadComponent implements OnInit {
idRecuperado: number;
totalSuma: number = 0;
dataSource: MatTableDataSource<PresupuestoPartidas>;
claPre: PartidasPresupuestarias;
partida!: CatalogoPP[];
nombrePartida: string;
politicas: any[] = [];
objetivos: any[] = [];
presupuestoPartidas!: PresupuestoPartidas[];
@ViewChild(MatTable) table: MatTable<any>;
constructor(
private presupuestoPartidasService: PresupuestoPartidasService,
private id_Compartido: Compartir_idService,
private dialog: MatDialog,
private datosCompartidos: Actualiza_datosService,
) {
this.claPre = new PartidasPresupuestarias();
this.dataSource = new MatTableDataSource<PresupuestoPartidas>([]);
}
ngOnInit(): void {
this.idRecuperado = parseInt(localStorage.getItem('proyectoId'),10);
this.datosCompartidos.datos$.subscribe(() => {
this.obtenerRegistros();
});
this.presupuestoPartidasService.parametrosActualizados.subscribe(() => {
this.obtenerRegistros();
});
}
getSubgrupo3(item: any): string {
return (
item.uzytclasificador_presup_id +
'. ' +
(item.uzytclasificador_presup_nombre || '')
);
}
obtenerRegistros() {
this.idRecuperado = this.idRecuperado;
if (this.idRecuperado !== undefined) {
this.presupuestoPartidasService.obtenerRegistrosRelacionadosEntidadProyecto(this.idRecuperado).subscribe(data => {
if (data !== undefined) {
this.presupuestoPartidas = data;
this.dataSource.data = this.presupuestoPartidas;
// Calcular los totales
this.calcularTotales();
// Fetch the names for the given uzytavclaspre_id
}
});
}
}
calcularTotales() {
this.totalSuma = this.presupuestoPartidas.reduce((total, dato) => {
return total + dato.uzytavpresup_valor * dato.uzytavpresup_cantidad;
}, 0);
this.totalSuma = parseFloat(this.totalSuma.toFixed(2));
}
eliminarParametros(id: number) {
const confirmacion = confirm('¿Desea eliminar el registro?');
if (confirmacion) {
this.presupuestoPartidasService.eliminarParametros(id).subscribe(
(response) => {
console.log('El registro se ha eliminado exitosamente.');
this.obtenerRegistros(); // Refresh the records after successful deletion
},
(error) => {
console.log('Error during the treatment of the record', error);
}
);
}
}
}
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<!--Datos generales internos--> <!--Datos generales internos-->
<app-edit-datos-generales-proyecto></app-edit-datos-generales-proyecto> <app-edit-datos-generales-proyecto [id]="id_d"></app-edit-datos-generales-proyecto>
<!--fin--> <!--fin-->
</mat-expansion-panel> </mat-expansion-panel>
...@@ -447,7 +447,7 @@ ...@@ -447,7 +447,7 @@
Ver y descargar PDF. Ver y descargar PDF.
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<!-- <vex-pdf></vex-pdf> --> <app-pdf></app-pdf>
<!--fin--> <!--fin-->
</mat-expansion-panel> </mat-expansion-panel>
...@@ -543,7 +543,8 @@ ...@@ -543,7 +543,8 @@
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-list-informe></vex-list-informe>
<!--fin--> <!--fin-->
</mat-expansion-panel> </mat-expansion-panel>
...@@ -637,7 +638,9 @@ ...@@ -637,7 +638,9 @@
3.- Presupuesto ejecutado 3.- Presupuesto ejecutado
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<app-aporte-uni-ejec></app-aporte-uni-ejec>
<app-aporte-ent-ejec></app-aporte-ent-ejec>
<app-aporte-com-ejec></app-aporte-com-ejec>
<!--fin--> <!--fin-->
</mat-expansion-panel> </mat-expansion-panel>
......
import { Component, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { Compartir_idService } from 'src/app/modules/main/services/compartir_id/compartir_id.service'; import { Compartir_idService } from 'src/app/modules/main/services/compartir_id/compartir_id.service';
@Component({ @Component({
...@@ -7,7 +7,6 @@ import { Compartir_idService } from 'src/app/modules/main/services/compartir_id/ ...@@ -7,7 +7,6 @@ import { Compartir_idService } from 'src/app/modules/main/services/compartir_id/
styleUrls: ['./edit-proyecto.component.css'] styleUrls: ['./edit-proyecto.component.css']
}) })
export class EditProyectoComponent implements OnInit { export class EditProyectoComponent implements OnInit {
contraccion = false; contraccion = false;
mostraContraccion = false; mostraContraccion = false;
mostrarFormulario: boolean = false; mostrarFormulario: boolean = false;
...@@ -18,7 +17,7 @@ export class EditProyectoComponent implements OnInit { ...@@ -18,7 +17,7 @@ export class EditProyectoComponent implements OnInit {
mostrarPresupuestoDetallado: boolean = false; mostrarPresupuestoDetallado: boolean = false;
mostrarCompro: boolean = false; mostrarCompro: boolean = false;
mostrarEstra: boolean = false; mostrarEstra: boolean = false;
id_d: number = 19;
idRecu: number; idRecu: number;
constructor(private router: Router, constructor(private router: Router,
private idCompartid: Compartir_idService) { private idCompartid: Compartir_idService) {
...@@ -26,7 +25,6 @@ export class EditProyectoComponent implements OnInit { ...@@ -26,7 +25,6 @@ export class EditProyectoComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.idRecu = parseInt(localStorage.getItem('proyectoId'),10); this.idRecu = parseInt(localStorage.getItem('proyectoId'),10);
localStorage.setItem('proyectoId',this.idRecu.toString());
} }
......
.modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}
.modal-content {
background-color: white;
padding: 20px;
border-radius: 4px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
max-width: 400px;
width: 100%;
text-align: center;
position: relative;
}
.success-icon {
font-size: 80px;
color: #006400;
margin-right: 1em;
}
.modal-content p {
margin-bottom: 20px;
}
.modal-content button {
background-color: #2196f3;
color: white;
border: none;
padding: 10px 20px;
border-radius: 4px;
cursor: pointer;
}
.modal-content button:hover {
background-color: #0c7cd5;
}
<div class="modal">
<div class="modal-content">
<p>
La información excede el maximo de caracteres</p>
<button mat-button (click)="closeModal()">Cerrar</button>
</div>
</div>
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ErrorTextoComponent } from './error-texto.component';
describe('ErrorTextoComponent', () => {
let component: ErrorTextoComponent;
let fixture: ComponentFixture<ErrorTextoComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ErrorTextoComponent ]
})
.compileComponents();
fixture = TestBed.createComponent(ErrorTextoComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { MatDialogRef } from '@angular/material/dialog';
@Component({
selector: 'vex-error-texto',
templateUrl: './error-texto.component.html',
styleUrls: ['./error-texto.component.css']
})
export class ErrorTextoComponent implements OnInit {
formularioEnviado = true;
constructor(
private dialogRef: MatDialogRef<ErrorTextoComponent>
) { }
ngOnInit(): void {
}
closeModal() {
this.dialogRef.close();
}
}
...@@ -136,6 +136,7 @@ export class ListaProyectosComponent implements OnInit { ...@@ -136,6 +136,7 @@ export class ListaProyectosComponent implements OnInit {
agregarP() { agregarP() {
this.router.navigate(['main/Proyecto-Inicial']); this.router.navigate(['main/Proyecto-Inicial']);
} }
editar(id: number) { editar(id: number) {
const registroSeleccionado = this.proyectos.find( const registroSeleccionado = this.proyectos.find(
proyectoFind => proyectoFind.uzytavproyec_id === id proyectoFind => proyectoFind.uzytavproyec_id === id
......
table { table {
width: 100%; width: 100%;
} }
/* Estilos generales */ /* Estilos generales */
body { body {
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
.sinborder { .sinborder {
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
} }
.General th { .General th {
padding: 10px; padding: 10px;
border: 1px solid black; border: 1px solid black;
font-weight: bold; font-weight: bold;
background-color: #b6b6b6 background-color: #b6b6b6
} }
.Duracion th { .Duracion th {
padding: 4px; padding: 4px;
border: 1px solid black; border: 1px solid black;
font-weight: bold; font-weight: bold;
background-color: #b6b6b6 background-color: #b6b6b6
} }
.encabezado table { .encabezado table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
} }
.encabezado td { .encabezado td {
padding: 10px; padding: 10px;
border: 1px solid black; border: 1px solid black;
} }
.encabezado .image-cell img { .encabezado .image-cell img {
max-width: 100px; max-width: 100px;
height: auto; height: auto;
} }
.encabezado .center-cell { .encabezado .center-cell {
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
} }
/* Estilos para la tabla de detalles */ /* Estilos para la tabla de detalles */
.detalle-table { .detalle-table {
margin-top: 20px; margin-top: 20px;
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
} }
.detalle-table td { .detalle-table td {
padding: 5px; padding: 5px;
border: 1px solid black; border: 1px solid black;
} }
.detalle-table .codigo-cell { .detalle-table .codigo-cell {
width: 30%; width: 30%;
font-weight: bold; font-weight: bold;
} }
/* Estilos para el pie de página */ /* Estilos para el pie de página */
.pie { .pie {
margin-top: 20px; margin-top: 20px;
text-align: center; text-align: center;
font-size: 12px; font-size: 12px;
} }
.Column { .Column {
padding-left: 0px; padding-left: 0px;
padding-right: 0px; padding-right: 0px;
width: 100px; width: 100px;
white-space: inherit; white-space: inherit;
} }
.Column1 negrita { .Column1 negrita {
font-weight: bold; font-weight: bold;
} }
.Column1 { .Column1 {
padding-left: 0px; padding-left: 0px;
padding-right: 0px; padding-right: 0px;
width: 10px; width: 10px;
white-space: normal; white-space: normal;
overflow: visible; overflow: visible;
} }
.Column2 { .Column2 {
width: 25px; width: 25px;
padding-left: 0px; padding-left: 0px;
padding-right: 0px; padding-right: 0px;
} }
.label-negrita { .label-negrita {
font-weight: bold; font-weight: bold;
margin-right: 10px; margin-right: 10px;
margin-top: 10px; margin-top: 10px;
} }
.div-container { .div-container {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0%; padding: 0%;
} }
.container { .container {
padding: 0%; padding: 0%;
margin: none;
} }
.Marco_Lógico tr { .Marco_Lógico tr {
border: 5px; border: 5px;
} }
.containerActividades { .containerActividades {
padding: 0%; padding: 0%;
border-left: 15px; border-left: 15px;
} }
.container tr { .container tr {
border-top: 3%; border-top: 3%;
border-width: 3%; border-width: 3%;
} }
.separa { .separa {
margin-top: 3%; margin-top: 3%;
} }
.grid-container { .grid-container {
display: grid; display: grid;
grid-template-columns: 5% 10% 45% 10% 5% 10% 15%; grid-template-columns: 5% 10% 45% 10% 5% 10% 15%;
border: 1px solid #ccc; border: 1px solid #ccc;
} }
table, table,
th, th,
tr, tr,
td { td {
border: 1px solid black; border: 1px solid black;
border-collapse: collapse; border-collapse: collapse;
padding: 5px; padding: 5px;
} }
.mat-elevation-z8 table { .mat-elevation-z8 table {
border-collapse: collapse; border-collapse: collapse;
width: 100%; width: 100%;
} }
.mat-elevation-z8 th, .mat-elevation-z8 th,
.mat-elevation-z8 td { .mat-elevation-z8 td {
border: 1px solid black; border: 1px solid black;
text-align: left; text-align: left;
} }
.mat-elevation-z8 th { .mat-elevation-z8 th {
background-color: #f2f2f2; background-color: #f2f2f2;
} }
\ No newline at end of file
<div id="PDF"> <div id="PDF">
<div class="encabezado"> <div class="encabezado">
<table> <table>
<tr> <tr>
<td class="image-cell"> img </td> <td style="max-width: 200px;">
<img style="margin-top: 2px; max-width: 100%; height: auto;" alt="clik aqui"
src="../../../../../assets/img/espe/logo-espe.png">
</td>
<td class="center-cell">VINCULACIÓN CON LA SOCIEDAD DE LA LINEA OPERATIVA DE PROYECTOS SOCIALES</td> <td class="center-cell">VINCULACIÓN CON LA SOCIEDAD DE LA LINEA OPERATIVA DE PROYECTOS SOCIALES</td>
<td class="sinborder" style=" <td class="sinborder" style="
padding: 0px; padding: 0px;
border: 0px;"> border: 0px;">
<tr>
<td colspan="2">Unidad de Gestión de la Vinculación</td>
</tr>
<table>
<tr> <table>
<td>Código de documento:</td> <tr colspan="2">
<td>1</td> <th colspan="2">Unidad de Gestión de la Vinculación</th>
</tr> </tr>
<tr> <tr>
<td>Página</td> <td>Código de documento:</td>
<td>1</td> <td>1</td>
</tr> </tr>
</table> <tr>
</td> <td>Página</td>
<td>1</td>
</tr>
</table>
</td>
</tr> </tr>
</table> </table>
</div> </div>
<br> <br>
<br> <br>
<table> <table>
<tr class="General"> <tr class="General">
<th>1. DATOS GENERALES</th> <th>1. DATOS GENERALES</th>
...@@ -46,7 +47,6 @@ ...@@ -46,7 +47,6 @@
<td>{{ proyecto?.uzytavproyec_nombre }}</td> <td>{{ proyecto?.uzytavproyec_nombre }}</td>
</tr> </tr>
</table> </table>
<br> <br>
<table> <table>
...@@ -54,62 +54,42 @@ ...@@ -54,62 +54,42 @@
<td>{{ tipoCobertura }}</td> <td>{{ tipoCobertura }}</td>
</table> </table>
<br> <br>
<app-listar-cobertura-proyecto></app-listar-cobertura-proyecto> <div>
<!-- <div class="mat-elevation-z8"> <table>
<table mat-table [dataSource]="dataSource" matSort> <thead>
<tr class="Duracion">
<ng-container matColumnDef="Nro" class="Column1"> <th>Nro</th>
<th class="Column1 negrita" mat-header-cell *matHeaderCellDef mat-sort-header> Nro </th> <th>Provincia</th>
<td class="Column1" mat-cell *matCellDef="let i = index"> {{ i+1 }} <th>Cantón</th>
</td> <th>Parroquia</th>
</ng-container> </tr>
</thead>
<ng-container matColumnDef="Provincia" class="Column"> <tbody>
<th class="Column" mat-header-cell *matHeaderCellDef mat-sort-header> <tr *ngFor="let parametro of zonaDM; let i = index">
Provincia </th> <td>{{ i + 1 }}</td>
<td class="Column" mat-cell *matCellDef="let dato"> {{ getProvinciaNombre(dato.uzytprovincia_id)}} </td> <td>{{ getProvinciaNombre(parametro.uzytprovincia_id) }}</td>
</ng-container> <td>{{ getCantonNombre(parametro.uzytcanton_id) }}</td>
<td>{{ getParroquiaNombre(parametro.uzytparroquia_id) }}</td>
<ng-container matColumnDef="Canton" class="Column"> </tr>
<th class="Column" mat-header-cell *matHeaderCellDef mat-sort-header> </tbody>
Cantón </th> </table>
<td class="Column" mat-cell *matCellDef="let dato"> {{ getCantonNombre(dato.uzytcanton_id)}} </td> </div>
</ng-container>
<ng-container matColumnDef="Parroquia" class="Column">
<th class="Column" mat-header-cell *matHeaderCellDef mat-sort-header>
Parroquia </th>
<td class="Column" mat-cell *matCellDef="let dato"> {{getParroquiaNombre(dato.uzytparroquia_id)}} </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</div> -->
<br> <br>
<table> <table>
<tr class="Duracion"> <tr class="Duracion">
<th colspan="3"> Plazo de ejecución </th> <th colspan="3"> Plazo de ejecución </th>
</tr> </tr>
<tr> <tr>
<th>Fecha de inicio planificada</th> <th>Fecha de inicio planificada</th>
<th>Fecha de finalización planificada</th> <th>Fecha de finalización planificada</th>
<th>Duración</th>
</tr> </tr>
<!-- Fila de resultados -->
<tr> <tr>
<td>{{ formatFecha(proyecto?.uzytavproyec_fecha_inicio) }}</td> <td>{{ formatFecha(proyecto?.uzytavproyec_fecha_inicio) }}</td>
<td>{{ formatFecha(proyecto?.uzytavproyec_fecha_finaliza) }}</td> <td>{{ formatFecha(proyecto?.uzytavproyec_fecha_finaliza) }}</td>
<td>{{ duracionProyecto }}</td>
</tr>
</table> </table>
<br> <br>
...@@ -118,12 +98,10 @@ ...@@ -118,12 +98,10 @@
<tr class="Duracion"> <tr class="Duracion">
<th colspan="4"> Director del proyecto </th> <th colspan="4"> Director del proyecto </th>
</tr> </tr>
<tr> <tr>
<th>Nombre y Apellido:</th> <th>Nombre y Apellido:</th>
<td colspan="3">{{ usuario?.uzytusuario_nombres }} {{ usuario?.uzytusuario_apellidos }} </td> <td colspan="3">{{ usuario?.uzytusuario_nombres }} {{ usuario?.uzytusuario_apellidos }} </td>
</tr> </tr>
<!-- Fila de resultados -->
<tr> <tr>
<th>Departamento:</th> <th>Departamento:</th>
<td>{{ usuario?.uzytusuario_departamento }}</td> <td>{{ usuario?.uzytusuario_departamento }}</td>
...@@ -141,23 +119,18 @@ ...@@ -141,23 +119,18 @@
<br> <br>
<table> <table>
<tr class="Duracion"> <tr class="Duracion">
<th colspan="2"> El proyecto social es resultado de </th> <th colspan="2"> El proyecto social es resultado de </th>
</tr> </tr>
<tr *ngFor="let objetivo of objetivoPro"> <tr *ngFor="let objetivo of objetivoPro">
<th>Otro</th> <th>Otro</th>
<td>{{ objetivo.uzytavobjetivo_programaobjetivo_proy }}</td> <td>{{ objetivo.uzytavobjetivo_programaobjetivo_proy }}</td>
</tr> </tr>
</table> </table>
<br> <br>
<table> <table>
<tr class="Duracion"> <tr class="Duracion">
<th colspan="3"> Detalle de entregables del proyecto </th> <th colspan="3"> Detalle de entregables del proyecto </th>
</tr> </tr>
...@@ -166,29 +139,22 @@ ...@@ -166,29 +139,22 @@
<th>Otro</th> <th>Otro</th>
<td>{{ objetivo.uzytavobjetivo_programaobjetivo_proy }}</td> <td>{{ objetivo.uzytavobjetivo_programaobjetivo_proy }}</td>
</tr> </tr>
</table> </table>
<br> <br>
<table> <table>
<tr class="Duracion"> <tr class="Duracion">
<th colspan="2"> El proyecto social es resultado de </th> <th colspan="2"> El proyecto social es resultado de </th>
</tr> </tr>
<tr>
<tr style="text-align: center;">
<th>Tipo</th> <th>Tipo</th>
<th>Descripción</th> <th>Descripción</th>
</tr> </tr>
<tr> <tr>
<th>Otro</th> <th>Otro</th>
<td>Otros posibles impactos que el proyecto podría generar al finalizar la ejecución.</td> <td>Otros posibles impactos que el proyecto podría generar al finalizar la ejecución.</td>
</tr> </tr>
</table> </table>
<br> <br>
...@@ -197,7 +163,6 @@ ...@@ -197,7 +163,6 @@
<tr class="General"> <tr class="General">
<th>2. DIAGNÓSTICO Y PROBLEMA </th> <th>2. DIAGNÓSTICO Y PROBLEMA </th>
</tr> </tr>
<tr> <tr>
<th>Descripción de la situación actual del área de intervención del proyecto: </th> <th>Descripción de la situación actual del área de intervención del proyecto: </th>
</tr> </tr>
...@@ -215,164 +180,146 @@ ...@@ -215,164 +180,146 @@
<td>Ninguna</td> <td>Ninguna</td>
</tr> </tr>
</table> </table>
<br> <br>
<table> <table>
<tr class="General"> <tr class="General">
<th colspan="8">3. MARCO LÓGICO </th> <th colspan="8">3. MARCO LÓGICO </th>
</tr> </tr>
<app-add-matriz-logico></app-add-matriz-logico>
</table> </table>
<br> <br>
<!-- <div class="Marco_Lógico"> <div class="container">
<div>
<table>
<tr class="Duracion">
<th class="Column1 negrita">Tipo</th>
<div class="container"> <th class="Column1 negrita">Descripción</th>
<div class="mat-elevation-z8"> <th class="Column1 negrita">Tipo Indicador</th>
<th class="Column1 negrita">Valor Indicador</th>
<table> <th class="Column1 negrita">Descripción Indicador</th>
<tr> <th class="Column1 negrita">Medio de Verificación</th>
<th class="Column1 negrita"></th> <th class="Column1 negrita">Supuestos</th>
<th class="Column1 negrita">Descripción</th> </tr>
<th class="Column1 negrita">Tipo Indicador</th> <tr *ngIf="objetivoPro.length === 0">
<th class="Column1 negrita">Valor Indicador</th> <td colspan="7" class="Column1">Fin</td>
<th class="Column1 negrita">Descripción Indicador</th> </tr>
<th class="Column1 negrita">Medio de Verificación</th> <tr *ngFor="let item of objetivoPro">
</tr> <td class="Column1">Fin</td>
<tr *ngIf="objetivoPro.length === 0"> <td class="Column1">{{item.uzytavobjetivo_programaobjetivo_proy || ''}}</td>
<td colspan="7" class="Column1">Fin</td> <td class="Column1">{{especificarValor(item.uzytavobjetivo_programaindicador_tipo)
|| ''}}</td>
</tr> <td class="Column1">{{item.uzytavobjetivo_programaindicador_valor || ''}}</td>
<td class="Column1">{{item.uzytavobjetivo_programaindicador || ''}}</td>
<tr *ngFor="let item of objetivoPro"> <td class="Column1">{{item.uzytavobjetivo_programamverifica || ''}}</td>
<td class="Column1">Fin</td> <td class="Column1">{{item.uzytavobjetivo_programasupuestos || ''}}</td>
<td class="Column1">{{item.uzytavobjetivo_programaobjetivo_proy || ''}}</td> </tr>
<td class="Column1">{{especificarValor(item.uzytavobjetivo_programaindicador_tipo) <tr *ngIf="objetivoProObj.length === 0">
|| ''}}</td> <td colspan="7" class="Column1">Proposito(Objetivo General)</td>
<td class="Column1">{{item.uzytavobjetivo_programaindicador_valor || ''}}</td> <td class="Column1">
<td class="Column1">{{item.uzytavobjetivo_programaindicador || ''}}</td>
<td class="Column1">{{item.uzytavobjetivo_programamverifica || ''}}</td>
<td class="Column1">{{item.uzytavobjetivo_programasupuestos || ''}}</td>
</tr> </td>
</tr>
<tr *ngFor="let objG of objetivoProObj">
<td class="Column1">Proposito(Objetivo General)</td>
<td class="Column1">{{ objG.uzytavobjetivo_programaobjetivo_proy || ''}}</td>
<td class="Column1">{{
especificarValor(objG.uzytavobjetivo_programaindicador_tipo) || ''}}</td>
<td class="Column1">{{ objG.uzytavobjetivo_programaindicador_valor || ''}}</td>
<td class="Column1">{{ objG.uzytavobjetivo_programaindicador || ''}}</td>
<td class="Column1">{{ objG.uzytavobjetivo_programamverifica || ''}}</td>
<td class="Column1">{{ objG.uzytavobjetivo_programasupuestos || ''}}</td>
</tr>
</table>
</div>
</div>
<tr *ngIf="objetivoProObj.length === 0"> <br>
<td colspan="7" class="Column1">Proposito(Objetivo General)</td>
<div class="container">
<div>
<table>
<tr class="Duracion">
<th colspan="8">Componentes (objetivos específicos): </th>
</tr>
</table>
<table>
<thead>
<tr class="Duracion">
<th class="Column1 negrita">Nro</th>
<th class="Column1 negrita">Descripción</th>
<th class="Column1 negrita">Tipo Indicador</th>
<th class="Column1 negrita">Valor Indicador</th>
<th class="Column1 negrita">Descripción Indicador</th>
<th class="Column1 negrita">Medio de Verificación</th>
<th class="Column1 negrita">Supuestos</th>
</tr>
</thead>
<tbody>
<ng-container *ngFor="let item of objetivoProEsp; let i = index">
<br>
<tr id="fila-{{i}}">
<td>
{{i+1}}
</td>
<td>{{item.uzytavobjetivo_programaobjetivo_proy}}</td>
<td>{{especificarValor(item.uzytavobjetivo_programaindicador_tipo)}}</td>
<td>{{item.uzytavobjetivo_programaindicador_valor}}</td>
<td>{{item.uzytavobjetivo_programaindicador}}</td>
<td>{{item.uzytavobjetivo_programamverifica}}</td>
<td>{{item.uzytavobjetivo_programasupuestos}}</td>
</tr> </tr>
<tr *ngFor="let objG of objetivoProObj"> <tr>
<td class="Column1">Proposito(Objetivo General)</td> <td colspan="8">
<td class="Column1">{{ objG.uzytavobjetivo_programaobjetivo_proy || ''}}</td> <div class="container">
<td class="Column1">{{ <div>
especificarValor(objG.uzytavobjetivo_programaindicador_tipo) || ''}}</td> <table>
<td class="Column1">{{ objG.uzytavobjetivo_programaindicador_valor || ''}}</td> <tr class="Duracion">
<td class="Column1">{{ objG.uzytavobjetivo_programaindicador || ''}}</td> <th colspan="8">Actividades </th>
<td class="Column1">{{ objG.uzytavobjetivo_programamverifica || ''}}</td> </tr>
<td class="Column1">{{ objG.uzytavobjetivo_programasupuestos || ''}}</td> </table>
<table>
<thead>
<tr class="Duracion">
<th class="Column1 negrita">Nro</th>
<th class="Column1 negrita">Descripción</th>
<th class="Column1 negrita">Tipo Indicador</th>
<th class="Column1 negrita">Valor Indicador</th>
<th class="Column1 negrita">Descripción Indicador</th>
<th class="Column1 negrita">Medio de Verificación</th>
<th class="Column1 negrita">Supuestos</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let acti of objetivoProAct; let i = index">
<ng-container
*ngIf="acti.uzytavobjetivo_programa_id_padre === item.uzytavobjetivo_programa_id">
<td>{{ i+1 }}</td>
<td>{{acti.uzytavobjetivo_programaobjetivo_proy}}</td>
<td>{{especificarValor(acti.uzytavobjetivo_programaindicador_tipo)}}</td>
<td>{{acti.uzytavobjetivo_programaindicador_valor}}</td>
<td>{{acti.uzytavobjetivo_programaindicador}}</td>
<td>{{acti.uzytavobjetivo_programamverifica}}</td>
<td>{{acti.uzytavobjetivo_programasupuestos}}</td>
</ng-container>
</tr>
</tbody>
</table>
</div>
</div>
</td>
</tr> </tr>
</table> </ng-container>
</tbody>
</div> </table>
</div>
<div class="separa"></div>
<div class="container">
<div class="mat-elevation-z8">
<div class="div-container">
<label class="label-negrita">Componentes (objetivos específicos):</label>
</div>
<table>
<thead>
<tr>
<th class="Column1 negrita">Nro</th>
<th class="Column1 negrita">Descripción</th>
<th class="Column1 negrita">Tipo Indicador</th>
<th class="Column1 negrita">Valor Indicador</th>
<th class="Column1 negrita">Descripción Indicador</th>
<th class="Column1 negrita">Medio de Verificación</th>
<th class="Column1 negrita">Supuestos</th>
</tr>
</thead>
<tbody>
<ng-container *ngFor="let item of objetivoProEsp; let i = index">
<tr id="fila-{{i}}">
<td>
{{i+1}}
</td>
<td>{{item.uzytavobjetivo_programaobjetivo_proy}}</td>
<td>{{especificarValor(item.uzytavobjetivo_programaindicador_tipo)}}</td>
<td>{{item.uzytavobjetivo_programaindicador_valor}}</td>
<td>{{item.uzytavobjetivo_programaindicador}}</td>
<td>{{item.uzytavobjetivo_programamverifica}}</td>
<td>{{item.uzytavobjetivo_programasupuestos}}</td>
</tr>
<tr>
<td colspan="8">
<div class="container">
<div class="mat-elevation-z8">
<div class="div-container">
<label class="label-negrita">Actividades: </label>
</div>
<table>
<thead>
<tr>
<th class="Column1 negrita">Nro</th>
<th class="Column1 negrita">Descripción</th>
<th class="Column1 negrita">Tipo Indicador</th>
<th class="Column1 negrita">Valor Indicador</th>
<th class="Column1 negrita">Descripción Indicador</th>
<th class="Column1 negrita">Medio de Verificación</th>
<th class="Column1 negrita">Supuestos</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let acti of objetivoProAct; let i = index">
<ng-container
*ngIf="acti.uzytavobjetivo_programa_id_padre === item.uzytavobjetivo_programa_id">
<td>{{ i+1 }}</td>
<td>{{acti.uzytavobjetivo_programaobjetivo_proy}}</td>
<td>{{especificarValor(acti.uzytavobjetivo_programaindicador_tipo)}}</td>
<td>{{acti.uzytavobjetivo_programaindicador_valor}}</td>
<td>{{acti.uzytavobjetivo_programaindicador}}</td>
<td>{{acti.uzytavobjetivo_programamverifica}}</td>
<td>{{acti.uzytavobjetivo_programasupuestos}}</td>
</ng-container>
</tr>
</tbody>
</table>
</div>
</div>
</td>
</tr>
</ng-container>
</tbody>
</table>
</div>
</div>
</div> </div>
--> </div>
<br> <br>
<table> <table>
<tr class="Duracion"> <tr class="Duracion">
<th colspan="6"> Identificación y caracterización de la población objetivo (beneficiarios y participantes) </th> <th colspan="6"> Identificación y caracterización de la población objetivo (beneficiarios y participantes) </th>
</tr> </tr>
<tr> <tr>
<th>Item</th> <th>Item</th>
<th>Hombres</th> <th>Hombres</th>
...@@ -381,7 +328,6 @@ ...@@ -381,7 +328,6 @@
<th>Personas con discapacidades </th> <th>Personas con discapacidades </th>
<th>Total </th> <th>Total </th>
</tr> </tr>
<tr> <tr>
<th>DIRECTOS</th> <th>DIRECTOS</th>
<td>{{proyecto.uzytavproyec_directos_hombres}}</td> <td>{{proyecto.uzytavproyec_directos_hombres}}</td>
...@@ -390,7 +336,6 @@ ...@@ -390,7 +336,6 @@
<td>{{proyecto.uzytavproyec_directos_discapac}}</td> <td>{{proyecto.uzytavproyec_directos_discapac}}</td>
<td>{{ proyecto.uzytavproyec_directos_ejec}}</td> <td>{{ proyecto.uzytavproyec_directos_ejec}}</td>
</tr> </tr>
<tr> <tr>
<th>INDIRECTOS</th> <th>INDIRECTOS</th>
<td>{{proyecto.uzytavproyec_inidirectos_hombres}}</td> <td>{{proyecto.uzytavproyec_inidirectos_hombres}}</td>
...@@ -399,18 +344,52 @@ ...@@ -399,18 +344,52 @@
<td>{{proyecto.uzytavproyec_inidirectos_discapa }}</td> <td>{{proyecto.uzytavproyec_inidirectos_discapa }}</td>
<td>{{proyecto.uzytavproyec_indirectos }}</td> <td>{{proyecto.uzytavproyec_indirectos }}</td>
</tr> </tr>
</table>
<br>
</table> <div class="container">
<table>
<tr class="Duracion">
<th class="Column1 negrita">Nro</th>
<th class="Column negrita">Carrera</th>
<th class="Column negrita">Estudiantes Participantes</th>
</tr>
<tr *ngFor="let dato of estudianteParticipante; let i = index">
<td class="Column1">{{ i + 1 }}</td>
<td class="Column">{{ dato.carrera$ | async }}</td>
<td class="Column">{{ dato.uzytavestuparti_numero }}</td>
</tr>
<tr>
<td class="Column1 negrita" colspan="2">Total</td>
<td class="Column">{{ totalEstudianteParticipantes }}</td>
</tr>
</table>
</div>
<br> <br>
<table> <div class="container">
<app-listar-docentes-participantes></app-listar-docentes-participantes> <table>
<br> <tr class="Duracion">
<app-listar-estudiantes-participantes></app-listar-estudiantes-participantes> <th class="Column1 negrita">Nro</th>
<br> <th class="Column negrita">Campus</th>
</table> <th class="Column negrita">Departamento</th>
<th class="Column negrita">Docentes Participantes</th>
</tr>
<tr *ngFor="let dato of docenteParticipante; let i = index">
<td class="Column1">{{ i + 1 }}</td>
<td class="Column">{{ dato.campus$ | async }}</td>
<td class="Column">{{ dato.departamento$ | async }}</td>
<td class="Column">{{ dato.uzytavdocparti_numero }}</td>
</tr>
<tr>
<td class="Column1 negrita" colspan="3">Total</td>
<td class="Column">{{ totalDocentesParticipantes }}</td>
</tr>
</table>
</div>
<br>
<table> <table>
<tr class="General"> <tr class="General">
...@@ -420,32 +399,80 @@ ...@@ -420,32 +399,80 @@
<br> <br>
<table> <div class="container">
<app-aporte-universidad></app-aporte-universidad> <table>
<br> <tr class="Duracion">
<app-aporte-entidad></app-aporte-entidad> <th colspan="8">Aporte de la Universidad </th>
<br> </tr>
<app-aporte-comunidad></app-aporte-comunidad> </table>
<br> <table>
</table> <tr class="Duracion">
<th class="Column1 negrita">Nro</th>
<th class="Column negrita">Partida Presupuestaria</th>
<th class="Column negrita">Descripción</th>
<th class="Column negrita">Tipo de Gasto</th>
<th class="Column negrita">Cantidad</th>
<th class="Column negrita">Valor Unitario USD</th>
<th class="Column negrita">Total USD</th>
</tr>
<tr *ngFor="let dato of presupuestoPartidas; let i = index">
<td class="Column1">{{ i + 1 }}</td>
<td class="Column">{{ dato.partida$ | async }}</td>
<td class="Column">{{ dato.uzytavpresup_esptecnic }}</td>
<td class="Column">
<ng-container [ngSwitch]="dato.uzytavpresup_tipogasto">
<span *ngSwitchCase="'C'">Permanente</span>
<span *ngSwitchCase="'I'">No Permanente</span>
</ng-container>
</td>
<td class="Column">{{ dato.uzytavpresup_cantidad }}</td>
<td class="Column">{{ dato.uzytavpresup_valor }}</td>
<td class="Column">{{ (dato.uzytavpresup_valor * dato.uzytavpresup_cantidad) | number:'1.2-2' }}</td>
</tr>
<tr>
<th> Total Permanente: </th>
<th> {{totalPermanente}} </th>
<th> Total No Permanente: </th>
<th> {{totalNoPermanente}} </th>
<th> Total:</th>
<th colspan="2" style="text-align: center;"> {{totalSuma}} </th>
</tr>
</table>
</div>
<br>
<app-list-entidad></app-list-entidad>
<br>
<app-list-comunidad></app-list-comunidad>
<br>
<table> <table>
<tr class="General"> <tr class="General">
<th>5. ALINEAMIENTO DEL PROYECTO </th> <th>5. ALINEAMIENTO DEL PROYECTO </th>
</tr> </tr>
<br>
<tr class="Duracion">
<th colspan="2"> ¿A qué objetivos de desarrollo sostenible 2030 se alinea el proyecto? </th>
</tr>
<vex-list-objetivos-plnbv></vex-list-objetivos-plnbv>
</table> </table>
<br> <br>
<table> <table>
<tr class="Duracion"> <tr class="Duracion">
<th colspan="2"> ¿A qué campos de educación y capacitación (CINE- UNESCO) apunta el Proyecto? </th> <th colspan="2"> ¿A qué objetivos de desarrollo sostenible 2030 se alinea el proyecto? </th>
</tr> </tr>
<ex-list-linea></ex-list-linea> </table>
<table>
<!-- Cabecera de la tabla -->
<thead>
<tr class="Duracion">
<th class="header-cell">Nro</th>
<th class="header-cell">Objetivo PLNBV Descripción</th>
<th class="header-cell">Política Descripción</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let dato of objetiP; let i = index">
<td class="Column1">{{ i + 1 }}</td>
<td class="data-cell">{{ ObtenerNombrePadre(dato.uzytavobjetivo_b_vivir_id)}}</td>
<td class="data-cell">{{ ObtenerNombreHijo(dato.uzytavobjetivo_b_vivir_id) }}</td>
</tr>
</tbody>
</table> </table>
<br> <br>
...@@ -454,14 +481,27 @@ ...@@ -454,14 +481,27 @@
<tr class="Duracion"> <tr class="Duracion">
<th colspan="2"> ¿A qué objetivo u objetivos del Plan de Desarrollo del Ecuador se respalda el Proyecto?: </th> <th colspan="2"> ¿A qué objetivo u objetivos del Plan de Desarrollo del Ecuador se respalda el Proyecto?: </th>
</tr> </tr>
<br>
<app-objetivos-provinciales> </app-objetivos-provinciales>
</table> </table>
<table>
<thead>
<tr class="Duracion">
<th class="header-cell">Nro</th>
<th class="header-cell">Provincia</th>
<th class="header-cell">Cantón</th>
<th class="header-cell">Parroquia</th>
<th class="header-cell">Objetivos</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let dato of zonaDM; let i = index">
<td class="Column1">{{ i + 1 }}</td>
<td class="data-cell">{{ getProvinciaNombre(dato.uzytprovincia_id)}}</td>
<td class="data-cell">{{ getCantonNombre(dato.uzytcanton_id)}}</td>
<td class="data-cell">{{ getParroquiaNombre(dato.uzytparroquia_id)}}</td>
<td class="data-cell">{{ dato.uzytavzona_objetivos}}</td>
</tr>
</tbody>
</table>
<br> <br>
...@@ -469,25 +509,117 @@ ...@@ -469,25 +509,117 @@
<tr class="Duracion"> <tr class="Duracion">
<th colspan="2"> ¿A qué Objetivos Estratégicos Institucionales se alinea el Proyecto?: </th> <th colspan="2"> ¿A qué Objetivos Estratégicos Institucionales se alinea el Proyecto?: </th>
</tr> </tr>
<vex-list-objetivos-estra></vex-list-objetivos-estra> </table>
<table>
<thead>
<tr class="Duracion">
<th class="header-cell">Nro</th>
<th class="header-cell">Perpectiva</th>
<th class="header-cell">Estrategia</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let dato of proObjM; let i = index">
<td class="Column1">{{ i + 1 }}</td>
<td class="data-cell">{{obtenerDescripcionPerspectiva(dato.uzytavobjetivos_ESTRA_INSTI_ID)}}</td>
<td class="data-cell">{{obtenerDescripcionObjetivo(dato.uzytavobjetivos_ESTRA_INSTI_ID) }}</td>
</tr>
</tbody>
</table> </table>
<br> <br>
<table> <table>
<tr class="General"> <tr class="General">
<th> 6. ESTRATEGIA DE EJECUCIÓN-CRONOGRAMA </th> <th> 6. ESTRATEGIA DE EJECUCIÓN-CRONOGRAMA </th>
</tr> </tr>
<vex-add-cronograma-acti></vex-add-cronograma-acti>
</table> </table>
<div class="container">
<div>
<table>
<thead>
<tr class="Duracion">
<th colspan="8">Componente: </th>
</tr>
</thead>
<tbody>
<ng-container *ngFor="let item of actividadesA; let i = index">
<br>
<tr id="fila-{{i}}">
<td>{{item.uzytavobjetivo_programaobjetivo_proy}}</td>
</tr>
<tr>
<td colspan="8">
<div class="container">
<div>
<table>
<tr class="Duracion">
<th colspan="8">Actividades </th>
</tr>
</table>
<table>
<thead>
<tr class="Duracion">
<th class="Column1 negrita">Descripción</th>
<th class="Column1 negrita">Fecha Inicio</th>
<th class="Column1 negrita">Fecha Fin</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let acti of hitosA; let i = index">
<ng-container>
<td>{{acti.uzytavobjetivo_programaobjetivo_proy}}</td>
<td>{{formatFecha(acti.uzytavobjetivo_programafec_ini)}}</td>
<td>{{formatFecha(acti.uzytavobjetivo_programafec_fin)}}</td>
</ng-container>
</tr>
</tbody>
</table>
</div>
</div>
</td>
</tr>
<tr>
<td colspan="8">
<div class="container">
<div>
<table>
<tr class="Duracion">
<th colspan="8">Hitos </th>
</tr>
</table>
<table>
<thead>
<tr class="Duracion">
<th class="Column1 negrita">Entregable</th>
<th class="Column1 negrita">Evidencia</th>
<th class="Column1 negrita">Fecha</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let acti of actividadesA; let i = index">
<ng-container>
<td>{{acti.uzytavobjetivo_programaobjetivo_proy}}</td>
<td>{{acti.uzytavobjetivo_programasupuestos}}</td>
<td>{{formatFecha(acti.uzytavobjetivo_programafec_fin)}}</td>
</ng-container>
</tr>
</tbody>
</table>
</div>
</div>
</td>
</tr>
</ng-container>
</tbody>
</table>
</div>
</div>
<br>
</div> </div>
<br>
<div> <div>
<button class="btn col col-lg-4 btn-danger btn-block ml-4" (click)="downloadPDF()">Download PDF</button> <button class="btn col col-lg-4 btn-danger btn-block ml-4" (click)="downloadPDF()">Download PDF</button>
</div> </div>
import { ComponentFixture, TestBed } from '@angular/core/testing'; /* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { PdfComponent } from './pdf.component'; import { PdfComponent } from './pdf.component';
...@@ -6,12 +9,14 @@ describe('PdfComponent', () => { ...@@ -6,12 +9,14 @@ describe('PdfComponent', () => {
let component: PdfComponent; let component: PdfComponent;
let fixture: ComponentFixture<PdfComponent>; let fixture: ComponentFixture<PdfComponent>;
beforeEach(async () => { beforeEach(async(() => {
await TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [ PdfComponent ] declarations: [ PdfComponent ]
}) })
.compileComponents(); .compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(PdfComponent); fixture = TestBed.createComponent(PdfComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
......
import { Component, OnInit } from '@angular/core'; import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import jsPDF from 'jspdf';
import html2canvas from 'html2canvas';
import { Proyectos } from '../../../Models/proyectos';
import { Usuario } from '../../../Models/usuario'; import { Usuario } from '../../../Models/usuario';
import { objetivoprograma } from '../../../Models/objetivoPrograma';
import { ZonaDetalle } from '../../../Models/zona_detalle';
import { MatTableDataSource } from '@angular/material/table';
import { Parroquia } from '../../../Models/Ubicaciones/parroquia';
import { Canton } from '../../../Models/Ubicaciones/canton';
import { Provincia } from '../../../Models/Ubicaciones/provincia';
import { Observable } from 'rxjs';
import { Carrera } from '../../../Models/carrera';
import { PoblacionProyecto } from '../../../Models/poblacion-proyecto';
import { Poblacion } from '../../../Models/poblacion';
import { Programa } from '../../../Models/programa-v'; import { Programa } from '../../../Models/programa-v';
import { Proyectos } from '../../../Models/proyectos'; import { Poblacion } from '../../../Models/poblacion';
import { PoblacionProyecto } from '../../../Models/poblacion-proyecto';
import { Carrera } from '../../../Models/carrera';
import { Observable, map } from 'rxjs';
import { FormBuilder } from '@angular/forms'; import { FormBuilder } from '@angular/forms';
import { Compartir_idService } from '../../../services/compartir_id/compartir_id.service';
import { ProyectosService } from '../../../services/proyectos/proyectos.service'; import { ProyectosService } from '../../../services/proyectos/proyectos.service';
import { UsuariosService } from '../../../services/usuarios/usuarios.service';
import { MostrarOcultarService } from '../../../services/mostrar-ocultar.service'; import { MostrarOcultarService } from '../../../services/mostrar-ocultar.service';
import { PoblacionService } from '../../../services/población/poblacion.service'; import { UsuariosService } from '../../../services/usuarios/usuarios.service';
import { PoblacionProyectoService } from '../../../services/poblacion-proyecto/poblacion-proyecto.service'; import { PoblacionProyectoService } from '../../../services/poblacion-proyecto/poblacion-proyecto.service';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { DatosEspeService } from '../../../services/APIs Externas/Datos espe/datos-espe.service'; import { DatosEspeService } from '../../../services/APIs Externas/Datos espe/datos-espe.service';
import { ProgramaService } from '../../../services/programa/programa.service'; import { ProgramaService } from '../../../services/programa/programa.service';
import { Provincia } from '../../../Models/Ubicaciones/provincia';
import { Canton } from '../../../Models/Ubicaciones/canton';
import { Parroquia } from '../../../Models/Ubicaciones/parroquia';
import { Zona_detalleService } from '../../../services/zona_detalle/zona_detalle.service'; import { Zona_detalleService } from '../../../services/zona_detalle/zona_detalle.service';
import { UbicacionesService } from '../../../services/Ubicaciones/ubicaciones.service';
import { Actualiza_datosService } from '../../../services/actualiza_datos/actualiza_datos.service'; import { Actualiza_datosService } from '../../../services/actualiza_datos/actualiza_datos.service';
import { Objetivo_programaService } from '../../../services/objetivo_programa/objetivo_programa.service'; import { UbicacionesService } from '../../../services/Ubicaciones/ubicaciones.service';
import { MatTableDataSource } from '@angular/material/table';
import { ZonaDetalle } from '../../../Models/zona_detalle';
import { differenceInCalendarDays, differenceInDays, format } from 'date-fns'; import { differenceInCalendarDays, differenceInDays, format } from 'date-fns';
import jsPDF from 'jspdf'; import { objetivoprograma } from '../../../Models/objetivoPrograma';
import html2canvas from 'html2canvas';
import { DocenteParticipante } from '../../../Models/docente-participante';
import { EstudianteParticipante } from '../../../Models/estudiante-participante';
import { PartidasPresupuestarias } from '../../../Models/partidas-presupuestarias';
import { CatalogoPP } from '../../../Models/catalogo-partidas-presupuestarias';
import { PresupuestoPartidas } from '../../../Models/presupuesto-partidas';
import { objetivosBV } from '../../../Models/objetivoPLNBV';
import { prograObj } from '../../../Models/prograObj';
import { proObjeEstra } from '../../../Models/proObjEstr';
import { objetivosEstraInst } from '../../../Models/objetivoEstraInst';
import { EventInput } from '@fullcalendar/core';
import { Compartir_idService } from '../../../services/compartir_id/compartir_id.service';
import { PoblacionService } from '../../../services/población/poblacion.service';
import { Objetivo_programaService } from '../../../services/objetivo_programa/objetivo_programa.service';
import { DocentesParticipantesService } from '../../../services/docentes-participantes/docentes-participantes.service';
import { EstudiantesParticipantesService } from '../../../services/estudiantes-participantes/estudiantes-participantes.service';
import { PartidasPresupuestariasService } from '../../../services/partidas-presupuestarias/partidas-presupuestarias.service';
import { PresupuestoPartidasService } from '../../../services/presupuesto-partidas/presupuesto-partidas.service';
import { ObjetivosPLNBVService } from '../../../services/objetivosPLNBV/objetivos-plnbv.service';
import { PrograObjService } from '../../../services/prograObj/prograObj.service';
import { Obj_estra_agService } from '../../../services/obj_estra_agre/obj_estra_ag.service';
import { ObjetivosEstraSService } from '../../../services/objetivos_estra_inst/objetivosEstraS.service';
@Component({ @Component({
selector: 'vex-pdf', selector: 'app-pdf',
templateUrl: './pdf.component.html', templateUrl: './pdf.component.html',
styleUrls: ['./pdf.component.css'] styleUrls: ['./pdf.component.css']
}) })
export class PdfComponent implements OnInit { export class PdfComponent implements OnInit {
@ViewChild('activitySection') activitySection!: ElementRef;
proyecto: Proyectos; proyecto: Proyectos;
usuario: Usuario; usuario: Usuario;
selectedProgramaId: number; selectedProgramaId: number;
...@@ -59,17 +95,58 @@ export class PdfComponent implements OnInit { ...@@ -59,17 +95,58 @@ export class PdfComponent implements OnInit {
displayedColumns: string[] = ['Nro', 'Provincia', 'Canton', 'Parroquia']; displayedColumns: string[] = ['Nro', 'Provincia', 'Canton', 'Parroquia'];
tipoCobertura: string = ''; tipoCobertura: string = '';
duracionProyecto: ''; duracionProyecto: '';
presupuesto: PresupuestoPartidas;
idObjeGeneral: number; idObjeGeneral: number;
idObjeGeneralRecu: number; idObjeGeneralRecu: number;
idEspecifico: number; idEspecifico: number;
idObjeEspecifico: number; idObjeEspecifico: number;
objetivoPro: objetivoprograma[] = [];//esto recupera el arreglo para los del fin objetivoPro: objetivoprograma[] = []; //esto recupera el arreglo para los del fin
objetivoProObj: objetivoprograma[] = []; //esto recupera el arreglo para los objetivos generales objetivoProObj: objetivoprograma[] = []; //esto recupera el arreglo para los objetivos generales
objetivoProEsp: objetivoprograma[] = []; // esto recupera el arreglo para los objetivos especificos objetivoProEsp: objetivoprograma[] = []; // esto recupera el arreglo para los objetivos especificos
objetivoProAct: objetivoprograma[] = []; // esto recupera el arreglo para los actividades de cada objetivo objetivoProAct: objetivoprograma[] = []; // esto recupera el arreglo para los actividades de cada objetivo
docenteParticipante: DocenteParticipante[] = [];
totalDocentesParticipantes: number = 0; //total de participantes
estudianteParticipante: EstudianteParticipante[] = [];
totalEstudianteParticipantes: number = 0; // Total de estudiantes
totalPermanente: number = 0;
totalNoPermanente: number = 0;
totalSuma: number = 0;
claPre: PartidasPresupuestarias;
partida!: CatalogoPP[];
nombrePartida: string;
politicas: any[] = [];
objetivos: any[] = [];
presupuestoPartidas!: PresupuestoPartidas[];
dataSource2 = new MatTableDataSource<PresupuestoPartidas>([]);
obj!: objetivosBV[];
dataSourceOb: MatTableDataSource<objetivosBV>;
selectedTipo: string;
filtroGeneral: string = '';
objetiP: prograObj[] = [];
proObjM: proObjeEstra[] = [];
objet: objetivosEstraInst[] = [];
perspectiva: objetivosEstraInst[] = [];
objetivo: objetivosEstraInst[] = [];
estrategia: objetivosEstraInst[] = [];
actividadesA: objetivoprograma[] = [];
actividadesE: objetivoprograma[] = [];
hitosA: objetivoprograma[] = [];
hitosE: objetivoprograma[] = [];
constructor( constructor(
private formBuilder: FormBuilder, private formBuilder: FormBuilder,
private ID_compartido: Compartir_idService, private ID_compartido: Compartir_idService,
...@@ -88,23 +165,137 @@ export class PdfComponent implements OnInit { ...@@ -88,23 +165,137 @@ export class PdfComponent implements OnInit {
private objeProS: Objetivo_programaService, private objeProS: Objetivo_programaService,
private objeProM: objetivoprograma, private objeProM: objetivoprograma,
private datosCompartidos: Actualiza_datosService private datosCompartidos: Actualiza_datosService,
private docentesParticipantesService: DocentesParticipantesService,
private datosEspeService: DatosEspeService,
private estudiantesParticipantesService: EstudiantesParticipantesService,
private partidaS: PartidasPresupuestariasService,
private presupuestoPartidasService: PresupuestoPartidasService,
private presupuestoPartidasService2: PresupuestoPartidasService,
private objetS: ObjetivosPLNBVService,
private objS: ObjetivosPLNBVService,
private objPM: prograObj,
private objPS: PrograObjService,
private proObS: Obj_estra_agService,
private objEstraInS: ObjetivosEstraSService,
private objPS2: Objetivo_programaService,
private objM: objetivoprograma,
) { ) {
this.dataSource = new MatTableDataSource<ZonaDetalle>([]); this.dataSource = new MatTableDataSource<ZonaDetalle>([]);
this.claPre = new PartidasPresupuestarias();
} }
ngOnInit(): void { ngOnInit(): void {
this.idRecuperado = parseInt(localStorage.getItem('proyectoId'),10)
this.idRecuperado = parseInt(localStorage.getItem('proyectoId'), 10);
this.datosCompartidos.datos$.subscribe(() => {
this.obtenerRegistros2();
});
this.objPS2.parametrosActualizados.subscribe(() => {
this.obtenerRegistros2();
});
this.datosCompartidos.datos$.subscribe(() => {
this.obtenerRegistros3();
});
this.objPS2.parametrosActualizados.subscribe(() => {
this.obtenerRegistros3();
});
this.obtenerDatos();
this.datosCompartidos.datos$.subscribe(() => { this.datosCompartidos.datos$.subscribe(() => {
this.obtenerRegistrosEstra();
});
this.proObS.parametrosActualizados.subscribe(() => {
this.obtenerRegistros(); this.obtenerRegistros();
}); });
this.datosCompartidos.datos$.subscribe(() => {
this.obtenerRegistrosOb();
this.obtenerObjetivos();
});
this.objPS.parametrosActualizados.subscribe(() => {
this.obtenerRegistrosOb();
this.obtenerObjetivos();
});
this.datosCompartidos.datos$.subscribe(() => {
/* this.obtenerRegistrosUni();
this.obtenerRegistrosEnti();
this.obtenerRegistrosComu(); */
this.obtenerRegistros();
this.obtenerRegistrosUni()
});
this.presupuestoPartidasService.parametrosActualizados.subscribe(() => {
this.obtenerRegistrosUni();
/* this.obtenerRegistrosComu();
this.obtenerRegistrosEnti(); */
});
this.estudiantesParticipantesService.parametrosActualizados.subscribe(() => {
this.obtenerRegistrosEstu();
});
this.objeProS.parametrosActualizados.subscribe(() => { this.objeProS.parametrosActualizados.subscribe(() => {
this.obtenerRegistros(); this.obtenerRegistros();
}); });
this.datosCompar.datos$.subscribe(() => {
this.obtenerRegistrosEstu();
this.obtenerRegistros();
this.obtenerProvincias();
this.obtenerParroquias();
this.obtenerCantones();
});
this.zonaS.parametrosActualizados.subscribe(() => {
this.obtenerRegistros();
this.obtenerProvincias();
this.obtenerParroquias();
this.obtenerCantones();
});
this.proyecto = this.mostrarOcultarService.editProyecto;
this.obtenerDatosDirector();
this.obtenerRegistrosObjetivos();
this.usuario = new Usuario();
this.obtenerParametrosPoblacion();
this.obtenerPoblacionProyecto();
this.obtenerParametrosPrograma(); // Agrega esta línea
this.datosCompar.datos$.subscribe(() => {
this.obtenerRegistrosDocente();
});
this.docentesParticipantesService.parametrosActualizados.subscribe(() => {
this.obtenerRegistrosDocente();
});
if (this.zonaDM.length === null) { if (this.zonaDM.length === null) {
this.tipoCobertura = 'Internacional'; this.tipoCobertura = 'Internacional';
} else if (this.getProvinciaNombre.length === 0) { } else if (this.getProvinciaNombre.length === 0) {
...@@ -117,35 +308,311 @@ export class PdfComponent implements OnInit { ...@@ -117,35 +308,311 @@ export class PdfComponent implements OnInit {
this.tipoCobertura = 'Parroquial'; this.tipoCobertura = 'Parroquial';
} }
this.proyecto = this.mostrarOcultarService.editProyecto;
this.obtenerDatosDirector(); }
this.obtenerRegistrosObjetivos();
this.usuario = new Usuario();
this.obtenerParametrosPoblacion();
this.obtenerPoblacionProyecto();
this.obtenerParametrosPrograma(); // Agrega esta línea
this.datosCompar.datos$.subscribe(() => { /* FC */
this.obtenerRegistros();
this.obtenerProvincias();
this.obtenerParroquias();
this.obtenerCantones();
//función para llamar las actividades
obtenerRegistros3() {
this.objPS2.obtenerParametros().subscribe(data => {
this.hitosA = data.filter(item => item.uzytavproyec_id === this.idProyecto && item.uzytavobjetivo_programatipo === 4 && item.uzytavobjetivo_programafec_ini === null && item.uzytavobjetivo_programafec_fin === null);
// Limpia el arreglo de eventos antes de actualizarlo
const nuevosEventos: EventInput[] = [];
// Agrega los eventos al arreglo de eventos del calendario
this.hitosA.forEach(actividad => {
const evento: EventInput = {
id: actividad.uzytavobjetivo_programa_id.toString(),
title: actividad.uzytavobjetivo_programaobjetivo_proy,
start: actividad.uzytavobjetivo_programafec_ini,
end: actividad.uzytavobjetivo_programafec_fin,
};
nuevosEventos.push(evento);
});
}); });
}
this.zonaS.parametrosActualizados.subscribe(() => { obtenerRegistros2() {
this.obtenerRegistros(); this.objPS2.obtenerParametros().subscribe(data => {
this.obtenerProvincias(); this.actividadesA = data.filter(item => item.uzytavproyec_id === this.idRecuperado && item.uzytavobjetivo_programatipo === 3 && item.uzytavobjetivo_programafec_ini === null && item.uzytavobjetivo_programafec_fin === null);
this.obtenerParroquias();
this.obtenerCantones();
}); });
}
console.log("objetivoProobj", this.objetivoProObj); mostrarObjetivosPorZona(id: number) {
console.log("objetivoPro", this.objetivoPro); this.idCompartido.mostrarFormulario();
const registroSeleccionado = this.zonaDM.find(
zona => zona.uzytavzona_detalle_id === id);
this.idCompartido.setIdZonaDetalle(id);
this.mostrarOcultarService.coberturaEdit = registroSeleccionado;
}
obtenerRegistrosEstra() {
if (this.idRecuperado !== undefined) {
this.proObS.obtenerParametros().subscribe(data => {
this.proObjM = data.filter(item => item.uzytavproyec_ID === this.idRecuperado);
});
}
}
obtenerDatos() {
this.objEstraInS.obtenerParametros().subscribe(data => {
if (data !== undefined) {
this.objet = data;
}
});
}
obtenerDescripcionEstrategia(id: number): string {
const objetivo = this.objet.find(obj => obj.uzytavobjetivos_ESTRA_INSTI_ID === id);
return objetivo ? objetivo.uzytavobjetivos_ESTRA_INSTI_DESCRIPCION || '' : '';
}
obtenerDescripcionObjetivo(id: number): string {
if (id !== undefined && this.objet && this.objet.length > 0) {
const objetivo = this.objet.find(item => item.uzytavobjetivos_ESTRA_INSTI_ID === id);
return objetivo && objetivo.uzyTavObjetivosEstraInstiPadre
? objetivo.uzyTavObjetivosEstraInstiPadre.uzytavobjetivos_ESTRA_INSTI_DESCRIPCION
: 'N/A';
}
return 'N/A';
}
obtenerDescripcionPerspectiva(id: number): string {
if (id !== undefined && this.objet && this.objet.length > 0) {
const objetivo = this.objet.find(item => item.uzytavobjetivos_ESTRA_INSTI_ID === id);
if (objetivo && objetivo.uzyTavObjetivosEstraInstiPadre) {
return objetivo.uzyTavObjetivosEstraInstiPadre.uzyTavObjetivosEstraInstiPadre
? objetivo.uzyTavObjetivosEstraInstiPadre.uzyTavObjetivosEstraInstiPadre.uzytavobjetivos_ESTRA_INSTI_DESCRIPCION
: 'N/A';
}
}
return 'N/A';
}
obtenerRegistrosOb() {
this.idRecuperado = this.idRecuperado;
if (this.idRecuperado !== undefined) {
this.objPS.obtenerRegistrosRelacionadosProyecto(this.idRecuperado).subscribe(data => {
if (data !== undefined) {
this.objetiP = data;
this.dataSource.data = this.objetiP;
}
});
}
}
ObtenerNombreHijo(id: number): string {
if (id !== undefined && this.obj && this.obj.length > 0) {
const objetivo = this.obj.find(item => item.uzytavobjetivo_b_vivir_id === id);
return objetivo ? objetivo.uzytavobjetivo_b_vivirdescripcion : 'N/A';
} else {
return 'N/A';
}
}
ObtenerNombrePadre(id: number): string {
if (id !== undefined && this.obj && this.obj.length > 0) {
const objetivo = this.obj.find(item => item.uzytavobjetivo_b_vivir_id === id);
return objetivo && objetivo.objetivo_b_vivirPadre
? objetivo.objetivo_b_vivirPadre.uzytavobjetivo_b_vivirdescripcion
: 'N/A';
}
return 'N/A';
}
obtenerObjetivos() {
this.objS.obtenerParametros().subscribe(data => {
if (data !== undefined) {
this.obj = data;
}
});
}
obtenerRegistrosEnti() {
if (this.idRecuperado !== undefined) {
this.presupuestoPartidasService.obtenerRegistrosRelacionadosEntidadProyecto(this.idRecuperado).subscribe(data => {
if (data !== undefined) {
this.presupuestoPartidas = data;
this.calcularTotalesEnti();
}
});
}
}
calcularTotalesEnti() {
this.totalSuma = this.presupuestoPartidas.reduce((total, dato) => {
return total + dato.uzytavpresup_valor * dato.uzytavpresup_cantidad;
}, 0);
this.totalSuma = parseFloat(this.totalSuma.toFixed(2));
}
obtenerRegistrosComu() {
if (this.idRecuperado !== undefined) {
this.presupuestoPartidasService2.obtenerRegistrosRelacionadosComunidadProyecto(this.idRecuperado).subscribe(data => {
if (data !== undefined) {
this.presupuestoPartidas = data;
this.calcularTotalesComu();
}
});
}
}
calcularTotalesComu() {
this.totalSuma = this.presupuestoPartidas.reduce((total, dato) => {
return total + dato.uzytavpresup_valor * dato.uzytavpresup_cantidad;
}, 0);
this.totalSuma = parseFloat(this.totalSuma.toFixed(2));
}
obtenerRegistrosUni() {
if (this.idRecuperado !== undefined) {
this.presupuestoPartidasService.obtenerRegistrosRelacionadosUniversidadProyecto(this.idRecuperado).subscribe(data => {
if (data !== undefined) {
this.presupuestoPartidas = data.map(partida => {
return {
...partida,
partida$: this.obtenerPartidas(partida.uzytavclaspre_id),
};
});
this.dataSource2.data = this.presupuestoPartidas;
// Calcular los totales
this.calcularTotales();
}
});
}
}
obtenerPartidas(id: number): Observable<string> {
return this.partidaS.obtenerNombrePartidas(id).pipe(
map(partida => {
const partidaEncontrada = partida.find(c => c.uzytavclaspre_id === id);
return partidaEncontrada ? partidaEncontrada.uzytclasificador_presup_id + ". " + partidaEncontrada.uzytclasificador_presup_nombre : 'No encontrado';
})
);
}
calcularTotales() {
this.totalPermanente = this.presupuestoPartidas.reduce((total, dato) => {
if (dato.uzytavpresup_tipogasto == "C") {
return total + dato.uzytavpresup_valor * dato.uzytavpresup_cantidad;
} else {
return total; // Si no es "C", devolver el total sin cambiarlo
}
}, 0);
this.totalNoPermanente = this.presupuestoPartidas.reduce((total, dato) => {
if (dato.uzytavpresup_tipogasto == "I") {
return total + dato.uzytavpresup_valor * dato.uzytavpresup_cantidad;
} else {
return total; // Si no es "I", devolver el total sin cambiarlo
}
}, 0);
this.totalPermanente = parseFloat(this.totalPermanente.toFixed(2));
this.totalNoPermanente = parseFloat(this.totalNoPermanente.toFixed(2));
this.totalSuma = this.totalPermanente + this.totalNoPermanente;
}
obtenerRegistrosEstu() {
if (this.idRecuperado !== undefined) {
this.estudiantesParticipantesService.obtenerRegistrosRelacionadosProyecto(this.idRecuperado).subscribe(data => {
this.estudianteParticipante = data.map(carrera => {
return {
...carrera,
carrera$: this.obtenerDatosCarreras(carrera.uzytavmajr_code),
};
});
this.dataSource.data = this.estudianteParticipante;
this.calcularTotalEstudiantesParticipantes();
});
}
} }
calcularTotalEstudiantesParticipantes() {
this.totalEstudianteParticipantes = 0; // Reinicia el total a 0
for (const estudiante of this.estudianteParticipante) {
this.totalEstudianteParticipantes += estudiante.uzytavestuparti_numero;
}
}
obtenerDatosCarreras(codigo: string): Observable<string> {
return this.datosEspeService.obtenerCarreras().pipe(
map(carrera => {
const carreraEncontrada = carrera.find(c => c.codigo_CARRERA === 'PROG_' + codigo);
return carreraEncontrada ? carreraEncontrada.nombre_CARRERA : 'No encontrado';
})
);
}
obtenerRegistrosDocente() {
if (this.idRecuperado !== undefined) {
this.docentesParticipantesService.obtenerRegistrosRelacionadosProyecto(this.idRecuperado).
subscribe(data => {
this.docenteParticipante = data.map(docente => {
return {
...docente,
departamento$: this.obtenerDatosDepartamento(docente.uzytavsubj_code),
campus$: this.obtenerDatosCampus(docente.uzytavcamp_code)
};
});
this.dataSource.data = this.docenteParticipante;
this.calcularTotalDocentesParticipantes(); // Total de docentes
});
}
}
calcularTotalDocentesParticipantes() {
this.totalDocentesParticipantes = 0; // Reinicia el total a 0
for (const docente of this.docenteParticipante) {
this.totalDocentesParticipantes += docente.uzytavdocparti_numero;
}
}
obtenerDatosCampus(codigo: string): Observable<string> {
return this.datosEspeService.obtenerCampus().pipe(
map(campus => {
const campusEncontrado = campus.find(c => c.codigo === codigo);
return campusEncontrado ? campusEncontrado.descripcion : 'No encontrado';
})
);
}
obtenerDatosDepartamento(codigo: string): Observable<string> {
return this.datosEspeService.obtenerDepartamentos().pipe(
map(departamentos => {
const departamentoEncontrado = departamentos.find(c => c.subj === codigo);
return departamentoEncontrado ? departamentoEncontrado.descripcion : 'No encontrado';
})
);
}
especificarValor(tipo: number) { especificarValor(tipo: number) {
if (tipo === 1) { if (tipo === 1) {
return 'Valor'; return 'Valor';
...@@ -154,8 +621,8 @@ export class PdfComponent implements OnInit { ...@@ -154,8 +621,8 @@ export class PdfComponent implements OnInit {
} }
} }
obtenerRegistrosObjetivos() { obtenerRegistrosObjetivos() {
this.idRecuperado = this.idCompartido.getIdGuardado();
if (this.idRecuperado !== undefined) { if (this.idRecuperado !== undefined) {
this.objeProS.registrosRelacionadosConProyecto(this.idRecuperado).subscribe(data => { this.objeProS.registrosRelacionadosConProyecto(this.idRecuperado).subscribe(data => {
if (data !== undefined) { if (data !== undefined) {
...@@ -195,8 +662,8 @@ export class PdfComponent implements OnInit { ...@@ -195,8 +662,8 @@ export class PdfComponent implements OnInit {
} }
obtenerRegistros() { obtenerRegistros() {
this.idRecuperado = this.idCompartido.getIdGuardado();
if (this.idRecuperado !== undefined) { if (this.idRecuperado !== undefined) {
this.zonaS.obtenerRegistrosRelacionadosProyecto(this.idRecuperado).subscribe(data => { this.zonaS.obtenerRegistrosRelacionadosProyecto(this.idRecuperado).subscribe(data => {
this.zonaDM = data; this.zonaDM = data;
...@@ -205,8 +672,6 @@ export class PdfComponent implements OnInit { ...@@ -205,8 +672,6 @@ export class PdfComponent implements OnInit {
} }
} }
obtenerParroquias() { obtenerParroquias() {
this.ubicacionesS.obtenerCant().subscribe(cant => { this.ubicacionesS.obtenerCant().subscribe(cant => {
this.cantones = cant; this.cantones = cant;
...@@ -252,22 +717,6 @@ export class PdfComponent implements OnInit { ...@@ -252,22 +717,6 @@ export class PdfComponent implements OnInit {
return ''; return '';
} }
eliminarParametro(id: number) {
const confirmacion = confirm('¿Desea eliminar el registro?');
if (confirmacion) {
this.zonaS.eliminarParametros(id).subscribe(
() => {
console.log('El registro se ha eliminado');
this.obtenerRegistros();
},
(error) => {
// No mostrar el error en la consola
console.log('Error durante el tratamiento al registro');
}
);
}
}
obtenerParametrosPrograma() { obtenerParametrosPrograma() {
const uzytavprograma_v_id = this.idProyecto; const uzytavprograma_v_id = this.idProyecto;
this.programaService.obtenerParametros().subscribe( this.programaService.obtenerParametros().subscribe(
...@@ -301,7 +750,7 @@ export class PdfComponent implements OnInit { ...@@ -301,7 +750,7 @@ export class PdfComponent implements OnInit {
this.idProyecto = this.proyecto.uzytavproyec_id; this.idProyecto = this.proyecto.uzytavproyec_id;
} else { } else {
this.idProyecto = this.ID_compartido.getIdGuardado(); this.idProyecto = this.idRecuperado;
} }
this.poblacionProyectoService.obtenerParametrosId(this.idProyecto).subscribe( this.poblacionProyectoService.obtenerParametrosId(this.idProyecto).subscribe(
...@@ -317,7 +766,6 @@ export class PdfComponent implements OnInit { ...@@ -317,7 +766,6 @@ export class PdfComponent implements OnInit {
} }
obtenerParametrosPoblacion() { obtenerParametrosPoblacion() {
this.poblacionService.obtenerParametros().subscribe( this.poblacionService.obtenerParametros().subscribe(
poblacion => { poblacion => {
...@@ -330,103 +778,7 @@ export class PdfComponent implements OnInit { ...@@ -330,103 +778,7 @@ export class PdfComponent implements OnInit {
); );
} }
/* public downloadPDF(): void {
const DATA = document.getElementById('PDF');
const doc = new jsPDF('p', 'pt', 'a4');
const options = {
background: 'white',
scale: 3
};
html2canvas(DATA, options).then((canvas) => {
const img = canvas.toDataURL('image/PNG');
// Add image Canvas to PDF
const bufferX = 15;
const bufferY = 15;
const imgProps = (doc as any).getImageProperties(img);
const pdfWidth = doc.internal.pageSize.getWidth() - 2 * bufferX;
const pdfHeight = (imgProps.height * pdfWidth) / imgProps.width;
doc.addImage(img, 'PNG', bufferX, bufferY, pdfWidth, pdfHeight, undefined, 'FAST');
return doc;
}).then((docResult) => {
docResult.save(`${new Date().toISOString()}_Proyecto.pdf`);
});
} */
/* public downloadPDF(): void {
const DATA = document.getElementById('PDF');
const doc = new jsPDF('p', 'pt', 'a4');
const options = {
background: 'white',
scale: 3
};
html2canvas(DATA, options).then((canvas) => {
var imgData = canvas.toDataURL('image/png');
var imgWidth = 200;
var pageHeight = 200;
var imgHeight = canvas.height * imgWidth / canvas.width;
var heightLeft = imgHeight;
var doc = new jsPDF('p', 'mm', 'a4');
var position = 5;
doc.addImage(imgData, 'PNG', 5, position, imgWidth, imgHeight);
heightLeft -= pageHeight;
while (heightLeft >= 200) {
position = 5;
doc.addPage();
doc.addImage(imgData, 'PNG', 5, position, imgWidth, imgHeight);
heightLeft -= pageHeight;
heightLeft = -3;
}
doc.save('file.pdf');
});
}
*/
/* public downloadPDF(): void {
const DATA = document.getElementById('PDF');
const options = {
background: 'white',
scale: 3
};
html2canvas(DATA, options).then((canvas) => {
var imgData = canvas.toDataURL('image/png');
var imgWidth = 200;
var pageHeight = 200;
var imgHeight = (canvas.height * imgWidth) / canvas.width;
var doc = new jsPDF('p', 'mm', 'a4');
var position = 5;
var heightLeft = imgHeight;
while (heightLeft >= 0) {
doc.addImage(imgData, 'PNG', 5, position, imgWidth, imgHeight);
heightLeft = -1;
if (heightLeft > 0) {
doc.addPage();
position = 0;
}
}
doc.save('file.pdf');
});
}
*/
downloadPDF() { downloadPDF() {
var data = document.getElementById('PDF'); var data = document.getElementById('PDF');
...@@ -437,7 +789,7 @@ export class PdfComponent implements OnInit { ...@@ -437,7 +789,7 @@ export class PdfComponent implements OnInit {
var heightLeft = imgHeight; var heightLeft = imgHeight;
const contentDataURL = canvas.toDataURL('image/png', 10) const contentDataURL = canvas.toDataURL('image/png', 10)
var options = { var options = {
size: '70px', size: '100px',
pagesplit: true, pagesplit: true,
}; };
...@@ -456,9 +808,16 @@ export class PdfComponent implements OnInit { ...@@ -456,9 +808,16 @@ export class PdfComponent implements OnInit {
heightLeft -= pageHeight; heightLeft -= pageHeight;
} }
pdf.save('informe.pdf'); // Generated PDF pdf.save(`${this.proyecto.uzytavproyec_nombre}.pdf`); // Usar el valor de la variable en el nombre del archivo
}); });
} }
} }
...@@ -4,26 +4,26 @@ ...@@ -4,26 +4,26 @@
margin: 0; /* Elimina los márgenes para ocupar todo el espacio disponible */ margin: 0; /* Elimina los márgenes para ocupar todo el espacio disponible */
border-collapse: collapse; border-collapse: collapse;
} }
.principal th, .principal th,
.principal td { .principal td {
width: auto; /* Ajusta el ancho de las celdas automáticamente */ width: auto; /* Ajusta el ancho de las celdas automáticamente */
} }
.titulo { .titulo {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.titulo-texto { .titulo-texto {
font-weight: bold; font-weight: bold;
font-size: 15px; font-size: 15px;
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif; font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
margin-right: 10px; margin-right: 10px;
} }
.rounder-nuevo { .rounder-nuevo {
border-radius: 50%; border-radius: 50%;
background-color: rgb(71, 127, 75); background-color: rgb(71, 127, 75);
...@@ -38,28 +38,28 @@ ...@@ -38,28 +38,28 @@
cursor: pointer; cursor: pointer;
margin-left: 5px; margin-left: 5px;
} }
.opciones { .opciones {
margin: 0% 3% 0% 3%; margin: 0% 3% 0% 3%;
min-height: 50px; min-height: 50px;
} }
.grid-item { .grid-item {
font-weight: bold; font-weight: bold;
min-height: 50px; min-height: 50px;
} }
.datos { .datos {
min-height: 50px; min-height: 50px;
} }
.ng-hide { .ng-hide {
display: none; display: none;
} }
#cabecera { #cabecera {
background: linear-gradient(135deg, background: linear-gradient(135deg,
var(--background-base) 22px, var(--background-base) 22px,
...@@ -82,18 +82,18 @@ ...@@ -82,18 +82,18 @@
background-color: var(--background-base); background-color: var(--background-base);
background-size: 64px 128px; background-size: 64px 128px;
} }
.azul svg { .azul svg {
fill: blue; fill: blue;
} }
.card { .card {
background-color: rgb(252, 252, 251) background-color: rgb(252, 252, 251)
} }
.icono-instituciones { .icono-instituciones {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
font-size: 20px; font-size: 20px;
cursor: pointer; cursor: pointer;
} }
table { table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
...@@ -110,23 +110,22 @@ ...@@ -110,23 +110,22 @@
font-family: 'Roboto', sans-serif; font-family: 'Roboto', sans-serif;
color: #333; color: #333;
} }
table th, table th,
table td { table td {
padding: 12px; padding: 12px;
text-align: left; text-align: left;
border-bottom: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0;
} }
table th { table th {
background-color: rgb(248, 249, 250); background-color: rgb(248, 249, 250);
font-weight: bold; font-weight: bold;
text-transform: uppercase; text-transform: uppercase;
} }
table td {
}
table td::after { table td::after {
content: ""; content: "";
bottom: -1px; bottom: -1px;
...@@ -135,9 +134,9 @@ ...@@ -135,9 +134,9 @@
height: 1px; height: 1px;
background-color: #e0e0e0; background-color: #e0e0e0;
} }
input[type="text"] { input[type="text"] {
width: 200px; width: 200px;
padding: 8px; padding: 8px;
...@@ -145,51 +144,50 @@ ...@@ -145,51 +144,50 @@
border-radius: 5px; border-radius: 5px;
margin-left: 10px; margin-left: 10px;
} }
.area-busqueda { .area-busqueda {
padding: 10px; padding: 10px;
margin-top: 3%; margin-top: 3%;
text-align: right; text-align: right;
background-color: rgb(248, 249, 250); background-color: rgb(248, 249, 250);
} }
@media (max-width: 600px) { @media (max-width: 600px) {
table { table {
font-size: 14px; font-size: 14px;
} }
table th, table th,
table td { table td {
padding: 8px; padding: 8px;
} }
} }
.btn-observar { .btn-observar {
border-radius: 50%; border-radius: 50%;
width: 36px; width: 36px;
height: 36px; height: 36px;
} }
.colorsito{ .colorsito{
background-color: rgb(248, 249, 250); background-color: rgb(248, 249, 250);
} }
.white-icon { .white-icon {
color: white; color: white;
} }
.azul{ .azul{
color:blue color:blue
} }
.colorEditar { .colorEditar {
color: blue; color: blue;
} }
.colorEditar svg { .colorEditar svg {
fill: blue; fill: blue;
} }
\ No newline at end of file
.principal {
width: 100%; /* Cambia el ancho al 100% */
margin: 0; /* Elimina los márgenes para ocupar todo el espacio disponible */
border-collapse: collapse;
}
.principal th,
.principal td {
width: auto; /* Ajusta el ancho de las celdas automáticamente */
}
.titulo {
display: flex;
align-items: center;
}
.titulo-texto {
font-weight: bold;
font-size: 15px;
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
margin-right: 10px;
}
.rounder-nuevo {
border-radius: 50%;
background-color: rgb(71, 127, 75);
display: flex;
align-items: center;
justify-content: center;
padding: 0;
width: 30px;
height: 30px;
border: none;
outline: none;
cursor: pointer;
margin-left: 5px;
}
.opciones {
margin: 0% 3% 0% 3%;
min-height: 50px;
}
.grid-item {
font-weight: bold;
min-height: 50px;
}
.datos {
min-height: 50px;
}
.ng-hide {
display: none;
}
#cabecera {
background: linear-gradient(135deg,
var(--background-base) 22px,
var(--background-hover) 22px,
var(--background-hover) 24px,
transparent 24px,
transparent 67px,
var(--background-hover) 67px,
var(--background-hover) 69px,
transparent 69px),
linear-gradient(225deg,
var(--background-base) 22px,
var(--background-hover) 22px,
var(--background-hover) 24px,
transparent 24px,
transparent 67px,
var(--background-hover) 67px,
var(--background-hover) 69px,
transparent 69px) 0 64px;
background-color: var(--background-base);
background-size: 64px 128px;
}
.azul svg {
fill: blue;
}
.card {
background-color: rgb(252, 252, 251)
}
.icono-instituciones {
display: flex;
align-items: center;
justify-content: center;
margin-right: 5px;
font-size: 20px;
cursor: pointer;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
font-family: 'Roboto', sans-serif;
color: #333;
}
table th,
table td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #e0e0e0;
}
table th {
background-color: rgb(248, 249, 250);
font-weight: bold;
text-transform: uppercase;
}
table td::after {
content: "";
bottom: -1px;
left: 0;
width: 100%;
height: 1px;
background-color: #e0e0e0;
}
input[type="text"] {
width: 200px;
padding: 8px;
border: 1px solid #ccc;
border-radius: 5px;
margin-left: 10px;
}
.area-busqueda {
padding: 10px;
margin-top: 3%;
text-align: right;
background-color: rgb(248, 249, 250);
}
@media (max-width: 600px) {
table {
font-size: 14px;
}
table th,
table td {
padding: 8px;
}
}
.btn-observar {
border-radius: 50%;
width: 36px;
height: 36px;
}
.colorsito{
background-color: rgb(248, 249, 250);
}
.white-icon {
color: white;
}
.azul{
color:blue
}
.colorEditar {
color: blue;
}
.colorEditar svg {
fill: blue;
}
<table class="principal">
<thead class="colorsito">
<tr>
<th class="colorsito">Nombres</th>
<th class="colorsito">Apellidos</th>
<th class="colorsito">E-mail</th>
</tr>
</thead>
<tbody>
<ng-container *ngFor="let opciones of integrantesComision; let i = index">
<tr>
<td>{{ usuario[opciones.uzytusuario_id_asignado]?.uzytusuario_nombres }}</td>
<td>{{ usuario[opciones.uzytusuario_id_asignado]?.uzytusuario_apellidos }}</td>
<td>{{ usuario[opciones.uzytusuario_id_asignado]?.uzytusuario_email_institucional }}</td>
</tr>
</ng-container>
</tbody>
</table>
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ComisionAsigComponent } from './comision-asig.component';
describe('ComisionAsigComponent', () => {
let component: ComisionAsigComponent;
let fixture: ComponentFixture<ComisionAsigComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ComisionAsigComponent ]
})
.compileComponents();
fixture = TestBed.createComponent(ComisionAsigComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, Input, OnInit } from '@angular/core';
import { IntegrantesComision } from '../../../Models/Comision de evaluacion/integrantes-comision';
import { Subscription } from 'rxjs';
import { IntegrantesComisionService } from '../../../services/integrantes-comision/integrantes-comision.service';
import { UsuariosService } from '../../../services/usuarios/usuarios.service';
@Component({
selector: 'vex-comision-asig',
templateUrl: './comision-asig.component.html',
styleUrls: ['./comision-asig.component.css']
})
export class ComisionAsigComponent implements OnInit {
@Input() idProp: number;
usuario: any = {};
integrantesComision!: IntegrantesComision[];
parametrosSubscription: Subscription;
constructor(
private integrantesComisionService: IntegrantesComisionService,
private usuariosService: UsuariosService,
) { }
ngOnInit() {
this.obtenerRegistros(this.idProp);
}
obtenerRegistros(id:number) {
this.integrantesComisionService.obtenerDatos(id).subscribe(data => {
this.integrantesComision = data.map(parametro => {
parametro.uzytavdetcomca_fech_crea = new Date(parametro.uzytavdetcomca_fech_crea);
this.obtenerUsuarios(parametro.uzytusuario_id_asignado)
return parametro;
});
});
}
obtenerUsuarios(id: number) {
this.usuariosService.obtenerUsuariosId(id).subscribe(data => {
this.usuario[id] = data;
});
}
}
...@@ -65,4 +65,357 @@ ...@@ -65,4 +65,357 @@
pointer-events: none; pointer-events: none;
} }
.principal {
text-align: center;
margin-bottom: 2%;
}
.grid-container {
display: grid;
grid-template-columns: 5% 10% 45% 10% 5% 10% 15%;
border: 1px solid #ccc;
}
#cabecera {
background: linear-gradient(135deg,
var(--background-base) 22px,
var(--background-hover) 22px,
var(--background-hover) 24px,
transparent 24px,
transparent 67px,
var(--background-hover) 67px,
var(--background-hover) 69px,
transparent 69px),
linear-gradient(225deg,
var(--background-base) 22px,
var(--background-hover) 22px,
var(--background-hover) 24px,
transparent 24px,
transparent 67px,
var(--background-hover) 67px,
var(--background-hover) 69px,
transparent 69px) 0 64px;
background-color: var(--background-base);
background-size: 64px 128px;
}
.volver{
position: absolute;
top: 50%;
right: 10px;
transform: translateY(-50%);
border-radius: 50%;
background-color: white;
display: flex;
color: rgb(71, 127, 75);
align-items: center;
justify-content: center;
padding: 0;
width: 32px;
height: 32px;
border: none;
outline: none;
cursor: pointer;
}
.grid-item {
font-weight: bold;
}
.grid-opciones {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
}
.titulo {
display: flex;
align-items: center;
justify-content: center;
}
.titulo-texto {
font-weight: bold;
font-size: 18px;
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
margin-right: 10px;
}
.componente {
justify-content: center;
align-items: center;
}
.card {
background-color: rgb(252, 252, 251)
}
.colorEditar {
color: blue;
}
.colorEditar svg {
fill: blue;
}
.contenedorP {
width: 96%;
margin-left: 2%;
margin-right: 2%;
margin: 10px auto;
border-radius: 10px;
text-align: center;
margin-top: 10%;
background-color: white;
}
.contenedor:not(:last-child) {
margin-bottom: 2px;
}
.contenedor {
width: 96%;
margin-left: 2%;
margin-right: 2%;
padding-bottom: 2%;
border-radius: 10px;
background-color: white;
position: relative;
z-index: 1;
}
.sobremontado {
position: relative;
align-items: center;
justify-content: center;
padding: 10px;
width: 96%;
top: -20px;
left: 2%;
background-color: rgb(71, 127, 75);
color: #fff;
text-align: center;
padding: 10px;
box-sizing: border-box;
margin-bottom: -50px;
z-index: 2;
border-radius: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
.sobremontado span {
display: flex;
align-items: center;
justify-content: center;
margin: 0;
}
.sobremontado mat-icon {
margin-right: 5px;
}
.icono-instituciones {
display: flex;
align-items: center;
justify-content: center;
margin-right: 5px;
font-size: 20px;
cursor: pointer;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
font-family: 'Roboto', sans-serif;
color: #333;
}
table th,
table td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #e0e0e0;
}
table th {
background-color: rgb(248, 249, 250);
font-weight: bold;
text-transform: uppercase;
}
table td {
position: relative;
}
table td::after {
content: "";
position: absolute;
bottom: -1px;
left: 0;
width: 100%;
height: 1px;
background-color: #e0e0e0;
}
input[type="text"] {
width: 200px;
padding: 8px;
border: 1px solid #ccc;
border-radius: 5px;
margin-left: 10px;
}
.area-busqueda {
padding: 10px;
margin-top: 3%;
text-align: right;
background-color: rgb(248, 249, 250);
}
@media (max-width: 600px) {
table {
font-size: 14px;
}
table th,
table td {
padding: 8px;
}
}
.btn-observar {
border-radius: 50%;
width: 36px;
height: 36px;
}
.white-icon {
color: blue;
}
.colorsito{
background-color: rgb(248, 249, 250);
}
.rounder{
border-radius: 50%;
background-color: rgb(71, 127, 75);
display: flex;
align-items: center;
justify-content: center;
padding: 0;
width: 15%;
height: 40px;
border: none;
outline: none;
cursor: pointer;
}
.rounder mat-icon {
font-size: 24px;
color: #fff;
}
@media (max-width: 768px) {
.rounder {
width: 30%;
}
}
@media (max-width: 480px) {
.rounder {
width: 40%;
}
}
.margen{
margin: 10px;
padding: 10px;
margin-bottom: 10px;
}
.bordes {
border-collapse: collapse;
width: 100%;
}
.bordes th,
.bordes td {
border: 1px solid black;
padding: 8px;
}
.bordes th {
background-color: #f5f5f5;
font-weight: bold;
}
.bordes td {
background-color: #ffffff;
}
.bordes tr:nth-child(even) {
background-color: #f9f9f9;
}
.bordes tr:hover {
background-color: #eaeaea;
}
.bordes th:last-child,
.bordes td:last-child {
border-bottom: none;
}
.rounder-nuevo {
border-radius: 50%;
background-color: rgb(71, 127, 75);
display: flex;
align-items: center;
justify-content: center;
padding: 0;
width: 36px;
height: 36px;
border: none;
outline: none;
cursor: pointer;
margin-left: 5px;
}
.white-icon {
color: white;
}
.conf {
display: flex;
align-items: center;
}
.conf-name {
font-size: 20px; /* Tamaño de fuente deseado */
font-weight: bold; /* Opcional, para hacerlo más destacado */
margin-right: 30px; /* Espacio entre el icono y el nombre */
}
.add-icon {
display: flex;
align-items: center;
justify-content: center;
width: 25px; /* Ancho del círculo */
height: 25px; /* Altura del círculo */
border-radius: 50%; /* Para crear la forma de círculo */
background-color: white; /* Color de fondo del círculo */
color:black; /* Color del signo "+" en el círculo */
font-size: 25px; /* Tamaño del signo "+" */
}
<div class="contenedorP"> <div class="contenedorP" *ngIf="shouldShowDiv">
<div> <div>
<form [formGroup]="myForm" (ngSubmit)="onUpdate()"> <form [formGroup]="myForm" (ngSubmit)="onUpdate()">
<mat-label><strong>Asignar la comisión de Evaluación</strong></mat-label> <mat-label><strong>Asignar la comisión de Evaluación</strong></mat-label>
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
[disabled]="!myForm.valid">Agregar [disabled]="!myForm.valid">Agregar
Fecha</button> Fecha</button>
<span class="separator"></span> <span class="separator"></span>
<button mat-raised-button color="warn"
(click)="cancelarF()">Cancelar</button>
</div> </div>
<div class="separator2"></div> <div class="separator2"></div>
<!--fecha de inicio--> <!--fecha de inicio-->
...@@ -39,38 +37,41 @@ ...@@ -39,38 +37,41 @@
</div> </div>
<div class="container"> <div class="container">
<div class="mat-elevation-z8"> <div>
<mat-card class="card">
<table mat-table [dataSource]="dataSource" matSort> <table>
<thead class="colorsito">
<!-- Nro Column --> <tr>
<ng-container matColumnDef="Nro" class="Column1"> <th class="colorsito"></th>
<th class="Column1 negrita" mat-header-cell *matHeaderCellDef <th class="colorsito">Comsión de Evaluación Asignada para la evalucaión</th>
mat-sort-header> Nro </th> </tr>
<td class="Column1" mat-cell *matCellDef="let i = index"> {{ i+1 }} </thead>
</td> <tbody>
</ng-container> <ng-container *ngFor="let parametro of datos; let i = index">
<tr id="fila-{{ i }}">
<ng-container matColumnDef="cedula" class="Column"> <td>
<th class="Column" mat-header-cell *matHeaderCellDef mat-sort-header> <button (click)="parametro.uzytavcabcomca_id !== null && toggleDiv(i)">
Cedula </th> <mat-icon>{{ mostrarDiv[i] ? 'keyboard_arrow_down' : 'keyboard_arrow_right' }}</mat-icon>
<td class="Column" mat-cell *matCellDef="let dato"> {{dato.uzytavinstproy_dir_discapacidad}} </td> </button>
</ng-container> </td>
<td>
<ng-container matColumnDef="info" class="Column"> <ng-container *ngIf="parametro.uzytavcabcomca_id !== null; else noComision">
<th class="Column" mat-header-cell *matHeaderCellDef mat-sort-header> {{ getNombrePar(parametro.uzytavcabcomca_id) }}
Nombre y Apellidos </th> </ng-container>
<td class="Column" mat-cell *matCellDef="let dato"> {{dato.uzytavinstproy_DIRECTOS}} </td> <ng-template #noComision>
</ng-container> No se ha asignado Comisión de Evaluación
</ng-template>
<ng-container matColumnDef="correo" class="Column"> </td>
<th class="Column" mat-header-cell *matHeaderCellDef mat-sort-header> </tr>
Correo Electronico </th> <tr *ngIf="mostrarDiv[i]">
<td class="Column" mat-cell *matCellDef="let dato"> {{dato.uzytavinstproy_TOTAL}} </td> <div></div>
</ng-container> <td colspan="5">
<vex-comision-asig [idProp]="this.parametro.uzytavcabcomca_id"></vex-comision-asig>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> </td>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> </tr>
</table> </ng-container>
</tbody>
</table>
</mat-card>
</div> </div>
</div> </div>
...@@ -12,6 +12,7 @@ import { Route, Router } from '@angular/router'; ...@@ -12,6 +12,7 @@ import { Route, Router } from '@angular/router';
import { MatTableDataSource } from '@angular/material/table'; import { MatTableDataSource } from '@angular/material/table';
import { IntegrantesComision } from '../../../Models/Comision de evaluacion/integrantes-comision'; import { IntegrantesComision } from '../../../Models/Comision de evaluacion/integrantes-comision';
import { IntegrantesComisionService } from '../../../services/integrantes-comision/integrantes-comision.service'; import { IntegrantesComisionService } from '../../../services/integrantes-comision/integrantes-comision.service';
import { Compartir_idService } from '../../../services/compartir_id/compartir_id.service';
@Component({ @Component({
selector: 'vex-comision-eva', selector: 'vex-comision-eva',
...@@ -24,10 +25,13 @@ export class ComisionEvaComponent implements OnInit { ...@@ -24,10 +25,13 @@ export class ComisionEvaComponent implements OnInit {
comisionA: ComisionEvaluacion[] = []; comisionA: ComisionEvaluacion[] = [];
parametroA: Parametros[] = []; parametroA: Parametros[] = [];
integrantes: IntegrantesComision[] = []; integrantes: IntegrantesComision[] = [];
datos: Proyectos; datos: Proyectos[] = [];
idConv: number;
formularioEnviado: boolean = false; formularioEnviado: boolean = false;
dataSource: MatTableDataSource<IntegrantesComision>; dataSource: MatTableDataSource<IntegrantesComision>;
displayedColumns: string[] = ['Nro','cedula', 'info', 'correo']; displayedColumns: string[] = ['Nro','cedula', 'info', 'correo'];
mostrarSegundoSelect: boolean = false;
shouldShowDiv: boolean = true;
constructor( constructor(
private formBuilder: FormBuilder, private formBuilder: FormBuilder,
private comiS: ComisionEvaluacionService, private comiS: ComisionEvaluacionService,
...@@ -36,8 +40,10 @@ export class ComisionEvaComponent implements OnInit { ...@@ -36,8 +40,10 @@ export class ComisionEvaComponent implements OnInit {
private proyecS: ProyectosService, private proyecS: ProyectosService,
private dialog: MatDialog, private dialog: MatDialog,
private router: Router, private router: Router,
private integranteService: IntegrantesComisionService private integranteService: IntegrantesComisionService,
private idCompar: Compartir_idService
) { ) {
this.myForm = formBuilder.group({ this.myForm = formBuilder.group({
comision: ['', Validators.required], comision: ['', Validators.required],
preguntas: ['', Validators.required] preguntas: ['', Validators.required]
...@@ -47,6 +53,7 @@ export class ComisionEvaComponent implements OnInit { ...@@ -47,6 +53,7 @@ export class ComisionEvaComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.idRecuperado = parseInt(localStorage.getItem('proyectoId'),10); this.idRecuperado = parseInt(localStorage.getItem('proyectoId'),10);
this.obtenerRegistros(); this.obtenerRegistros();
} }
onUpdate(){ onUpdate(){
...@@ -61,7 +68,6 @@ export class ComisionEvaComponent implements OnInit { ...@@ -61,7 +68,6 @@ export class ComisionEvaComponent implements OnInit {
localStorage.setItem('comisionId',idcab.toString()); localStorage.setItem('comisionId',idcab.toString());
localStorage.setItem('parametrosId',idpara.toString()); localStorage.setItem('parametrosId',idpara.toString());
this.router.navigate(['main/Asignar-Comision']); this.router.navigate(['main/Asignar-Comision']);
this.setear();
this.openModal(); this.openModal();
}); });
} catch (error) { } catch (error) {
...@@ -70,16 +76,6 @@ export class ComisionEvaComponent implements OnInit { ...@@ -70,16 +76,6 @@ export class ComisionEvaComponent implements OnInit {
} }
} }
setear(){
this.myForm.patchValue({
comision: [parseInt(localStorage.getItem('comisionId'),10)],
preguntas: [parseInt(localStorage.getItem('parametrosId'),10)]
});
}
cancelarF(){
}
obtenerRegistros(){ obtenerRegistros(){
this.comiS.obtenerParametros().subscribe(data => { this.comiS.obtenerParametros().subscribe(data => {
...@@ -90,19 +86,33 @@ export class ComisionEvaComponent implements OnInit { ...@@ -90,19 +86,33 @@ export class ComisionEvaComponent implements OnInit {
this.parametroA = data; this.parametroA = data;
}); });
this.proyecS.obtenerParametrosRela(this.idRecuperado).subscribe(data => { this.proyecS.obtenerParametros().subscribe(data => {
this.datos = data; this.datos = data.filter(item => item.uzytavproyec_id === this.idRecuperado);
if(this.datos.uzytavcabcomca_id === undefined && this.datos.uzytavconparaeva_id === undefined ){ const tieneComision = this.datos.some(item => item.uzytavcabcomca_id !== null);
console.log('no tiene registro todavia') this.shouldShowDiv = !tieneComision;
}else{
localStorage.setItem('comisionId',this.datos.uzytavcabcomca_id.toString());
localStorage.setItem('parametrosId',this.datos.uzytavconparaeva_id.toString());
}
}); });
this.integranteService.obtenerParametros().subscribe(data=>{
this.integrantes = data; }
});
verificarIDPresente() {
const comisionControl = this.myForm.get('comision');
this.mostrarSegundoSelect = !comisionControl.value; // Cambia esto dependiendo de tu lógica
}
getNombrePar(id: number):string{
const busca = this.comisionA.find(i=> i.uzytavcabcomca_id === id)
if(busca){
const nombre = busca.uzytavcabcomca_decsrip
return nombre;
}
return '';
}
mostrarDiv: boolean[] = [];
toggleDiv(i: number) {
this.mostrarDiv[i] = !this.mostrarDiv[i];
} }
openModal() { openModal() {
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<div class="contenedor-dos"> <div class="contenedor-dos">
<mat-accordion> <mat-accordion>
<!--perfil--> <!--perfil-->
<mat-expansion-panel hideToggle> <mat-expansion-panel hideToggle expanded>
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title> <mat-panel-title>
<strong>Perfil de Proyecto</strong> <strong>Perfil de Proyecto</strong>
...@@ -374,19 +374,53 @@ ...@@ -374,19 +374,53 @@
<!--fin--> <!--fin-->
</mat-expansion-panel> </mat-expansion-panel>
<!--Proyectos Planificados--> <!--Acta de Consejo de Departamento-->
<mat-expansion-panel (opened)="contraccion = true"
(closed)="contraccion = false">
<mat-expansion-panel-header>
<mat-panel-title>
<mat-icon
[ngClass]="{'expanded': contraccion, 'collapsed': !contraccion}">keyboard_arrow_right</mat-icon>
8.- Acta de Consejo de Departamento
</mat-panel-title>
</mat-expansion-panel-header>
<!--Datos generales internos-->
<app-acta-consejo-departamento></app-acta-consejo-departamento>
<app-listar-acta-consejo-departamento></app-listar-acta-consejo-departamento>
<!--fin-->
</mat-expansion-panel>
<!--Acta de Compromiso Director del Proyecto-->
<mat-expansion-panel (opened)="contraccion = true" <mat-expansion-panel (opened)="contraccion = true"
(closed)="contraccion = false"> (closed)="contraccion = false">
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title> <mat-panel-title>
<mat-icon <mat-icon
[ngClass]="{'expanded': contraccion, 'collapsed': !contraccion}">keyboard_arrow_right</mat-icon> [ngClass]="{'expanded': contraccion, 'collapsed': !contraccion}">keyboard_arrow_right</mat-icon>
Proyectos Planificados 9.- Acta de Compromiso Director del Proyecto
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<!--Datos generales internos--> <!--Datos generales internos-->
<app-acta-director-proyecto></app-acta-director-proyecto>
<!--fin-->
</mat-expansion-panel>
<!--Acta de Compromiso de Carreras -->
<mat-expansion-panel (opened)="contraccion = true"
(closed)="contraccion = false">
<mat-expansion-panel-header>
<mat-panel-title>
<mat-icon
[ngClass]="{'expanded': contraccion, 'collapsed': !contraccion}">keyboard_arrow_right</mat-icon>
10.- Acta de Compromiso de Carreras
</mat-panel-title>
</mat-expansion-panel-header>
<!--Datos generales internos-->
<app-acta-compromiso-carreras></app-acta-compromiso-carreras>
<app-listar-acta-compromiso-carreras></app-listar-acta-compromiso-carreras>
<!--fin--> <!--fin-->
</mat-expansion-panel> </mat-expansion-panel>
...@@ -404,8 +438,24 @@ ...@@ -404,8 +438,24 @@
<!--fin--> <!--fin-->
</mat-expansion-panel> </mat-expansion-panel>
<mat-expansion-panel (opened)="contraccion = true"
(closed)="contraccion = false">
<mat-expansion-panel-header>
<mat-panel-title>
<mat-icon
[ngClass]="{'expanded': contraccion, 'collapsed': !contraccion}">keyboard_arrow_right</mat-icon>
Ver y descargar PDF.
</mat-panel-title>
</mat-expansion-panel-header>
<app-pdf></app-pdf>
<!--fin-->
</mat-expansion-panel>
<!--Stepper version dos--> <!--Stepper version dos-->
</mat-expansion-panel> </mat-expansion-panel>
<!--Seguimiento--> <!--Seguimiento-->
<mat-expansion-panel hideToggle expanded> <mat-expansion-panel hideToggle expanded>
<mat-expansion-panel-header> <mat-expansion-panel-header>
......
/* tslint:disable:no-unused-variable */
import { TestBed, async, inject } from '@angular/core/testing';
import { HitosService } from './hitos.service';
describe('Service: Hitos', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [HitosService]
});
});
it('should ...', inject([HitosService], (service: HitosService) => {
expect(service).toBeTruthy();
}));
});
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 { seguim } from '../../Models/hito';
@Injectable({
providedIn: 'root'
})
export class HitosService {
parametrosActualizados: Subject<void> = new Subject<void>();
private readonly URL = environment.appApiUrl + '/seguim';
constructor(private httpClient: HttpClient) { }
obtenerParametros(): Observable<seguim[]> {
return this.httpClient.get<seguim[]>(`${this.URL}/getAll`).pipe(delay(-1));
}
eliminarParametros(id: number): Observable<any> {
return this.httpClient.delete(`${this.URL}/eliminar/${id}`, { responseType: 'text' });
}
guardarParametros(parametros: seguim){
return this.httpClient.post(this.URL + '/guardar', parametros);
}
}
...@@ -16,14 +16,14 @@ export class PresupuestoPartidasService { ...@@ -16,14 +16,14 @@ export class PresupuestoPartidasService {
private readonly URL_RELA_PROYEC_ENTIDAD = environment.appApiUrl + '/tavpresup/obtenerTavPresupPorProyecIDandTipo2'; private readonly URL_RELA_PROYEC_ENTIDAD = environment.appApiUrl + '/tavpresup/obtenerTavPresupPorProyecIDandTipo2';
private readonly URL_RELA_PROYEC_COMUNIDAD = environment.appApiUrl + '/tavpresup/obtenerTavPresupPorProyecIDandTipo3'; private readonly URL_RELA_PROYEC_COMUNIDAD = environment.appApiUrl + '/tavpresup/obtenerTavPresupPorProyecIDandTipo3';
constructor(private httpClient: HttpClient) { } constructor(private httpClient: HttpClient) { }
obtenerParametros(): Observable<PresupuestoPartidas[]> { obtenerParametros(): Observable<PresupuestoPartidas[]> {
return this.httpClient.get<PresupuestoPartidas[]>(`${this.URL}/getAll`); return this.httpClient.get<PresupuestoPartidas[]>(`${this.URL}/getAll`);
} }
eliminarParametros(id: number): Observable<any> { eliminarParametros(id: number): Observable<any> {
return this.httpClient.delete(`${this.URL}/eliminar/${id}`, { responseType: 'text' }); return this.httpClient.delete(`${this.URL}/eliminar/${id}`, { responseType: 'text' });
...@@ -43,5 +43,9 @@ export class PresupuestoPartidasService { ...@@ -43,5 +43,9 @@ export class PresupuestoPartidasService {
obtenerRegistrosRelacionadosComunidadProyecto(id: number): Observable<PresupuestoPartidas[]> { obtenerRegistrosRelacionadosComunidadProyecto(id: number): Observable<PresupuestoPartidas[]> {
return this.httpClient.get<PresupuestoPartidas[]>(`${this.URL_RELA_PROYEC_COMUNIDAD}/${id}`); return this.httpClient.get<PresupuestoPartidas[]>(`${this.URL_RELA_PROYEC_COMUNIDAD}/${id}`);
} }
modificarParametros(id: number, parametros: PresupuestoPartidas): Observable<any> {
return this.httpClient.put<any>(`${this.URL}/editar/${id}`, parametros);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment