mirror of
https://github.com/cheveguerra/Colaborando.git
synced 2026-08-19 00:46:37 +00:00
- Resumen de activos en la esquina inferior izq del resumen
- Correccion en la habilidad de reordenamiento - Se agregaron los activos, penalizacin y potencial al reordenamiento
This commit is contained in:
+188
@@ -391,6 +391,57 @@
|
||||
<!-- Contenido se llenará con JS -->
|
||||
</table>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2>CONTABILIZACIÓN DE ACTIVOS</h2>
|
||||
<table id="tablaConteoActivos" class="summary-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Activo</th>
|
||||
<th>Producidos</th>
|
||||
<th>Recuperados</th>
|
||||
<th>Perdidos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="actPersonalCalificado" style="color:black!important; font-weight: bold; text-align: left;">Personal calificado</td>
|
||||
<td id="conteoProducidosPersonalCalificado">0</td>
|
||||
<td id="conteoRecuperadosPersonalCalificado">0</td>
|
||||
<td id="conteoPerdidosPersonalCalificado">0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="actAnalistas" style="color:black!important; font-weight: bold; text-align: left;">Analistas</td>
|
||||
<td id="conteoProducidosAnalistas">0</td>
|
||||
<td id="conteoRecuperadosAnalistas">0</td>
|
||||
<td id="conteoPerdidosAnalistas">0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="actFlujoDeEfectivo" style="color:black!important; font-weight: bold; text-align: left;">Flujo de efectivo</td>
|
||||
<td id="conteoProducidosFlujoDeEfectivo">0</td>
|
||||
<td id="conteoRecuperadosFlujoDeEfectivo">0</td>
|
||||
<td id="conteoPerdidosFlujoDeEfectivo">0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="actCreditoEInversion" style="font-weight: bold; text-align: left;">Crédito e Inversión</td>
|
||||
<td id="conteoProducidosCreditoEInversion">0</td>
|
||||
<td id="conteoRecuperadosCreditoEInversion">0</td>
|
||||
<td id="conteoPerdidosCreditoEInversion">0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="actTecnologia" style="font-weight: bold; text-align: left;">Tecnología</td>
|
||||
<td id="conteoProducidosTecnologia">0</td>
|
||||
<td id="conteoRecuperadosTecnologia">0</td>
|
||||
<td id="conteoPerdidosTecnologia">0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="actTransporteYMaquinaria" style="font-weight: bold; text-align: left;">Transporte y Maquinaria</td>
|
||||
<td id="conteoProducidosTransporteYMaquinaria">0</td>
|
||||
<td id="conteoRecuperadosTransporteYMaquinaria">0</td>
|
||||
<td id="conteoPerdidosTransporteYMaquinaria">0</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- =================================================================
|
||||
@@ -426,6 +477,11 @@
|
||||
<div style="vertical-align:middle; display:inline-block; font-weight:bold; font-size:16px;" id="capitalCh" class="draggable recurso-item">0</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center; font-size:11px; color:#c9302c; font-weight:bold; height:15px; padding: 0;" class="beneficioTiempoCh"></td>
|
||||
<td style="text-align:center; font-size:11px; color:#c9302c; font-weight:bold; height:15px; padding: 0;" class="beneficioPersonalCh"></td>
|
||||
<td style="text-align:center; font-size:11px; color:#c9302c; font-weight:bold; height:15px; padding: 0;" class="beneficioCapitalCh"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -465,6 +521,11 @@
|
||||
<div style="vertical-align:middle; display:inline-block; font-weight:bold; font-size:16px;" id="capitalCh" class="draggable recurso-item">0</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center; font-size:11px; color:#c9302c; font-weight:bold; height:15px; padding: 0;" class="beneficioTiempoCh"></td>
|
||||
<td style="text-align:center; font-size:11px; color:#c9302c; font-weight:bold; height:15px; padding: 0;" class="beneficioPersonalCh"></td>
|
||||
<td style="text-align:center; font-size:11px; color:#c9302c; font-weight:bold; height:15px; padding: 0;" class="beneficioCapitalCh"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -504,6 +565,11 @@
|
||||
<div style="vertical-align:middle; display:inline-block; font-weight:bold; font-size:16px;" id="capitalCh" class="draggable recurso-item">0</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center; font-size:11px; color:#c9302c; font-weight:bold; height:15px; padding: 0;" class="beneficioTiempoCh"></td>
|
||||
<td style="text-align:center; font-size:11px; color:#c9302c; font-weight:bold; height:15px; padding: 0;" class="beneficioPersonalCh"></td>
|
||||
<td style="text-align:center; font-size:11px; color:#c9302c; font-weight:bold; height:15px; padding: 0;" class="beneficioCapitalCh"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -543,6 +609,11 @@
|
||||
<div style="vertical-align:middle; display:inline-block; font-weight:bold; font-size:16px;" id="capitalCh" class="draggable recurso-item">0</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center; font-size:11px; color:#c9302c; font-weight:bold; height:15px; padding: 0;" class="beneficioTiempoCh"></td>
|
||||
<td style="text-align:center; font-size:11px; color:#c9302c; font-weight:bold; height:15px; padding: 0;" class="beneficioPersonalCh"></td>
|
||||
<td style="text-align:center; font-size:11px; color:#c9302c; font-weight:bold; height:15px; padding: 0;" class="beneficioCapitalCh"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -582,6 +653,11 @@
|
||||
<div style="vertical-align:middle; display:inline-block; font-weight:bold; font-size:16px;" id="capitalCh" class="draggable recurso-item">0</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center; font-size:11px; color:#c9302c; font-weight:bold; height:15px; padding: 0;" class="beneficioTiempoCh"></td>
|
||||
<td style="text-align:center; font-size:11px; color:#c9302c; font-weight:bold; height:15px; padding: 0;" class="beneficioPersonalCh"></td>
|
||||
<td style="text-align:center; font-size:11px; color:#c9302c; font-weight:bold; height:15px; padding: 0;" class="beneficioCapitalCh"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -621,6 +697,11 @@
|
||||
<div style="vertical-align:middle; display:inline-block; font-weight:bold; font-size:16px;" id="capitalCh" class="draggable recurso-item">0</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center; font-size:11px; color:#c9302c; font-weight:bold; height:15px; padding: 0;" class="beneficioTiempoCh"></td>
|
||||
<td style="text-align:center; font-size:11px; color:#c9302c; font-weight:bold; height:15px; padding: 0;" class="beneficioPersonalCh"></td>
|
||||
<td style="text-align:center; font-size:11px; color:#c9302c; font-weight:bold; height:15px; padding: 0;" class="beneficioCapitalCh"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -706,6 +787,32 @@
|
||||
deptoCard.find('#activoCh1').text(findArrayValue(deptoArr, 'activo1'));
|
||||
deptoCard.find('#activoCh2').text(findArrayValue(deptoArr, 'activo2'));
|
||||
|
||||
// Actualizar beneficios de habilidades acreditadas (-1 T, -1 P, -1 C)
|
||||
const habTiempo = findArrayValue(deptoArr, 'habilidadTiempo');
|
||||
const habPersonal = findArrayValue(deptoArr, 'habilidadPersonal');
|
||||
const habCapital = findArrayValue(deptoArr, 'habilidadCapital');
|
||||
|
||||
let txtTiempo = '';
|
||||
let txtPersonal = '';
|
||||
let txtCapital = '';
|
||||
|
||||
if (habTiempo && habTiempo !== 0) {
|
||||
const ben = findArrayValue(arreglosCapacitaciones[habTiempo], 'beneficio');
|
||||
txtTiempo = `${ben} T`;
|
||||
}
|
||||
if (habPersonal && habPersonal !== 0) {
|
||||
const ben = findArrayValue(arreglosCapacitaciones[habPersonal], 'beneficio');
|
||||
txtPersonal = `${ben} P`;
|
||||
}
|
||||
if (habCapital && habCapital !== 0) {
|
||||
const ben = findArrayValue(arreglosCapacitaciones[habCapital], 'beneficio');
|
||||
txtCapital = `${ben} C`;
|
||||
}
|
||||
|
||||
deptoCard.find('.beneficioTiempoCh').text(txtTiempo);
|
||||
deptoCard.find('.beneficioPersonalCh').text(txtPersonal);
|
||||
deptoCard.find('.beneficioCapitalCh').text(txtCapital);
|
||||
|
||||
// Mostrar/Ocultar Habilidad Especial si ya se acreditó
|
||||
const accionEspecial = findArrayValue(deptoArr, 'accionEspecialQuincenal');
|
||||
const rowHE = deptoCard.find('.fila-habilidad-especial');
|
||||
@@ -799,6 +906,87 @@
|
||||
}
|
||||
});
|
||||
|
||||
// --- 2.5 Contabilización de Activos (Producidos, Recuperados y Perdidos) ---
|
||||
const statsActivos = {
|
||||
PersonalCalificado: {
|
||||
producidos: 0,
|
||||
recuperados: 0,
|
||||
perdidos: 0
|
||||
},
|
||||
Analistas: {
|
||||
producidos: 0,
|
||||
recuperados: 0,
|
||||
perdidos: 0
|
||||
},
|
||||
FlujoDeEfectivo: {
|
||||
producidos: 0,
|
||||
recuperados: 0,
|
||||
perdidos: 0
|
||||
},
|
||||
CreditoEInversion: {
|
||||
producidos: 0,
|
||||
recuperados: 0,
|
||||
perdidos: 0
|
||||
},
|
||||
Tecnologia: {
|
||||
producidos: 0,
|
||||
recuperados: 0,
|
||||
perdidos: 0
|
||||
},
|
||||
TransporteYMaquinaria: {
|
||||
producidos: 0,
|
||||
recuperados: 0,
|
||||
perdidos: 0
|
||||
}
|
||||
};
|
||||
|
||||
const mapaColoresActivos = {
|
||||
amarillo: 'PersonalCalificado',
|
||||
naranjas: 'Analistas',
|
||||
verdes: 'FlujoDeEfectivo',
|
||||
azules: 'TransporteYMaquinaria',
|
||||
rojos: 'Tecnologia',
|
||||
morados: 'CreditoEInversion'
|
||||
};
|
||||
const listaColores = ['amarillo', 'naranjas', 'verdes', 'azules', 'rojos', 'morados'];
|
||||
|
||||
proyectos.forEach(p => {
|
||||
if (p.estatus === 'Completado') {
|
||||
const coloresConValores = listaColores
|
||||
.filter(color => p[color] !== null && p[color] > 0)
|
||||
.map(color => ({
|
||||
color,
|
||||
valor: p[color]
|
||||
}));
|
||||
|
||||
coloresConValores.forEach((item, idx) => {
|
||||
const tipoActivo = mapaColoresActivos[item.color];
|
||||
const reqOriginal = item.valor;
|
||||
const asignadoActual = parseInt(p['activoAsignado' + (idx + 1)]) || 0;
|
||||
|
||||
// Producidos
|
||||
statsActivos[tipoActivo].producidos += reqOriginal;
|
||||
|
||||
// Recuperados
|
||||
const recuperados = reqOriginal - asignadoActual;
|
||||
statsActivos[tipoActivo].recuperados += (recuperados > 0 ? recuperados : 0);
|
||||
|
||||
// Perdidos (sólo si pertenece a un trimestre anterior)
|
||||
if (p.trimestreCompletado < trimestreActual) {
|
||||
statsActivos[tipoActivo].perdidos += asignadoActual;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Inyectar datos en la tabla HTML (con prefijo conteo)
|
||||
const tiposActivos = ['PersonalCalificado', 'Analistas', 'FlujoDeEfectivo', 'CreditoEInversion', 'Tecnologia', 'TransporteYMaquinaria'];
|
||||
tiposActivos.forEach(tipo => {
|
||||
$(`#conteoProducidos${tipo}`).text(statsActivos[tipo].producidos);
|
||||
$(`#conteoRecuperados${tipo}`).text(statsActivos[tipo].recuperados);
|
||||
$(`#conteoPerdidos${tipo}`).text(statsActivos[tipo].perdidos);
|
||||
});
|
||||
|
||||
$('#resumen-proyectos').html(`
|
||||
<thead><tr><th></th><th>T1</th><th>T2</th><th>T3</th><th>T4</th></tr></thead>
|
||||
<tbody>
|
||||
|
||||
Reference in New Issue
Block a user