This commit is contained in:
2023-08-31 19:20:31 +00:00
parent 85991cf674
commit a2c075fa83
10 changed files with 208 additions and 226 deletions

View File

@@ -242,114 +242,114 @@
</div>
<!-- refresh -->
<div class="table-responsive">
<table class="table table-hover table-striped table-bordered table-sm">
<thead class="thead-dark">
<tr>
<th scope="col"
class="text-center align-middle px-2 d-flex align-items-center justify-content-center">
<button @click="store.registros.invertir" class="btn btn-light btn-sm text-primary mr-3"
v-if="store.registros.relevant.length > 1">
<i class="ing-cambiar ing-rotate-90"></i>
</button>
<span style="white-space: nowrap;">Fecha</span>
</th>
<div class="table-responsive">
<table class="table table-hover table-striped table-bordered table-sm">
<thead class="thead-dark">
<tr>
<th scope="col"
class="text-center align-middle px-2 d-flex align-items-center justify-content-center">
<button @click="store.registros.invertir" class="btn btn-light btn-sm text-primary mr-3"
v-if="store.registros.relevant.length > 1">
<i class="ing-cambiar ing-rotate-90"></i>
</button>
<span style="white-space: nowrap;">Fecha</span>
</th>
<th scope="col" class="text-center align-middle px-2" width="10%">Salón</th>
<th scope="col" class="text-center align-middle px-2">Profesor</th>
<th scope="col" class="text-center align-middle px-2" width="10%">Salón</th>
<th scope="col" class="text-center align-middle px-2">Profesor</th>
<th scope="col" class="text-center align-middle px-2" width="7%">Horario</th>
<th scope="col" class="text-center align-middle px-2">Registro</th>
<th scope="col" class="text-center align-middle px-2">Supervisor</th>
<? if ($user->acceso == 'w') { ?>
<th scope="col" class="text-center align-middle px-2" width="10%">Justificar</th>
<? } ?>
</tr>
</thead>
<tbody>
<tr v-if="store.registros.relevant.length == 0">
<td colspan="7" class="text-center">No hay clases en este horario</td>
</tr>
<tr v-for="registro in store.registros.relevant?.slice((store.current.page - 1) * store.current.perPage, store.current.page * store.current.perPage)"
:key="`${registro.registro_id}-${registro.registro_fecha_ideal}-${registro.horario_id}-${registro.profesor_id}-${registro.salon_id}`">
<td class="text-center align-middle px-2">{{ registro.registro_fecha_ideal }}
</td>
<td class="text-center align-middle px-2">{{ registro.salon }}</td>
<td class="align-middle px-2">
<strong>{{ registro.profesor_clave }}</strong>
{{ registro.profesor_nombre }}
<button type="button" class="ml-3 btn btn-sm btn-outline-primary"
@click="store.current.clase_vista = registro" data-toggle="modal"
data-target="#ver-detalle">
<i class="ing-ojo"></i>
Ver detalle
</button>
</td>
<th scope="col" class="text-center align-middle px-2" width="7%">Horario</th>
<th scope="col" class="text-center align-middle px-2">Registro</th>
<th scope="col" class="text-center align-middle px-2">Supervisor</th>
<? if ($user->acceso == 'w') { ?>
<th scope="col" class="text-center align-middle px-2" width="10%">Justificar</th>
<? } ?>
</tr>
</thead>
<tbody>
<tr v-if="store.registros.relevant.length == 0">
<td colspan="7" class="text-center">No hay clases en este horario</td>
</tr>
<tr v-for="registro in store.registros.relevant?.slice((store.current.page - 1) * store.current.perPage, store.current.page * store.current.perPage)"
:key="`${registro.registro_id}-${registro.registro_fecha_ideal}-${registro.horario_id}-${registro.profesor_id}-${registro.salon_id}`">
<td class="text-center align-middle px-2">{{ registro.registro_fecha_ideal }}
</td>
<td class="text-center align-middle px-2">{{ registro.salon }}</td>
<td class="align-middle px-2">
<strong>{{ registro.profesor_clave }}</strong>
{{ registro.profesor_nombre }}
<button type="button" class="ml-3 btn btn-sm btn-outline-primary"
@click="store.current.clase_vista = registro" data-toggle="modal"
data-target="#ver-detalle">
<i class="ing-ojo"></i>
Ver detalle
</button>
</td>
<td class="text-center align-middle px-2">{{ registro.horario_hora?.slice(0,5) }} -
{{registro.horario_fin?.slice(0,5) }}</td>
<!-- -->
<td class="text-center align-middle px-2">
<div v-if="registro.registro_fecha">
<div class="col-12">
Registro <small>{{ registro.registro_fecha?.slice(11,19) }}</small>
</div>
</div>
<div v-else>
<strong>
<div class="col-12">
<span class="text-dark ing-2x"><i class="ing-cancelar"></i></span>
</div>
</strong>
</div>
</td>
<!-- Sí checó supervisor -->
<td class="text-center align-middle px-2">
<td class="text-center align-middle px-2">{{ registro.horario_hora?.slice(0,5) }} -
{{registro.horario_fin?.slice(0,5) }}</td>
<!-- -->
<td class="text-center align-middle px-2">
<div v-if="registro.registro_fecha">
<div class="col-12">
<div class="row">
<div class="col-12">
<span class="mr-2" :class="`text-${registro.estado_color}`">
<i :class="`${registro.estado_icon} ing-2x`"></i>
</span>
<strong v-if="registro.usuario_nombre">{{ registro.usuario_nombre
}}</strong>
</div>
<div class="col-12" v-if="registro.registro_fecha_supervisor">
Hora
<small>{{ registro.registro_fecha_supervisor?.slice(11,19) }}</small>
</div>
Registro <small>{{ registro.registro_fecha?.slice(11,19) }}</small>
</div>
</div>
<div v-else>
<strong>
<div class="col-12">
<span class="text-dark ing-2x"><i class="ing-cancelar"></i></span>
</div>
<div class="col-12 "
@click="store.registros.mostrarComentario(registro.registro_id)"
v-if="registro.comentario" style="cursor: pointer;">
<strong class="badge border border-primary">Observaciones:</strong>
<small
class="text-truncate">{{registro.comentario?.slice(0,25)}}{{registro.comentario.length
> 10 ? '...' : ''}}</small>
</strong>
</div>
</td>
<!-- Sí checó supervisor -->
<td class="text-center align-middle px-2">
<div class="col-12">
<div class="row">
<div class="col-12">
<span class="mr-2" :class="`text-${registro.estado_color}`">
<i :class="`${registro.estado_icon} ing-2x`"></i>
</span>
<strong v-if="registro.usuario_nombre">{{ registro.usuario_nombre
}}</strong>
</div>
<div class="col-12" v-if="registro.registro_fecha_supervisor">
Hora
<small>{{ registro.registro_fecha_supervisor?.slice(11,19) }}</small>
</div>
</div>
<div class="col-12 "
@click="store.registros.mostrarComentario(registro.registro_id)"
v-if="registro.comentario" style="cursor: pointer;">
<strong class="badge border border-primary">Observaciones:</strong>
<small
class="text-truncate">{{registro.comentario?.slice(0,25)}}{{registro.comentario.length
> 10 ? '...' : ''}}</small>
</div>
</div>
</td>
<? if ($user->acceso == 'w') { ?>
<td class="text-center align-middle px-2">
<div class="col-auto">
<button class="btn btn-link text-center mx-2 btn-sm" data-toggle="modal"
:class="`text-${registro.registro_justificada ? 'success' : 'primary'}`"
data-target="#justificar" :class="{ 'active': registro.comentario }"
@click="set_justificar(registro.horario_id, registro.profesor_id, registro.registro_fecha_ideal)">
<i :class="`ing-${registro.registro_justificada ? 'finalistas' : 'reporte-resultados'}`"
style="font-size: 2rem;"></i>
<span class="sr-only">{{ registro.registro_justificada ? 'Justificada' :
'Justificar' }}</span>
</button>
</div>
</td>
<? if ($user->acceso == 'w') { ?>
<td class="text-center align-middle px-2">
<div class="col-auto">
<button class="btn btn-link text-center mx-2 btn-sm" data-toggle="modal"
:class="`text-${registro.registro_justificada ? 'success' : 'primary'}`"
data-target="#justificar" :class="{ 'active': registro.comentario }"
@click="set_justificar(registro.horario_id, registro.profesor_id, registro.registro_fecha_ideal)">
<i :class="`ing-${registro.registro_justificada ? 'finalistas' : 'reporte-resultados'}`"
style="font-size: 2rem;"></i>
<span class="sr-only">{{ registro.registro_justificada ? 'Justificada' :
'Justificar' }}</span>
</button>
</div>
</td>
<? } ?>
</tr>
</tbody>
</table>
</div>
<? } ?>
</tr>
</tbody>
</table>
</div>
<!-- page -->
<nav v-if="store.registros.relevant.length > 0" class="mt-3 col-12">
@@ -579,32 +579,37 @@
<div class="container">
<h2 class="text-center">¿Desea justificar la asistencia?</h2>
<br>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input form-control-lg my-auto"
id="está-justificada" v-model="store.current.justificada.registro_justificada"
@click="store.current.justificada.justificacion = ''">
<label class="custom-control-label" for="está-justificada">Justificar
<strong v-if="store.current.justificada.estado_supervisor_id"
<div class="row">
<div class="col-12 text-center">
Justificar <strong v-if="store.current.justificada.estado_supervisor_id"
:class="`text-${store.current.justificada.estado_color}`"
class="text-uppercase">
{{store.current.justificada.nombre.toUpperCase()}}
</strong>
del día
<span class="text-muted">{{store.current.justificada.registro_fecha_ideal}}</span>
a las
<span
{{store.current.justificada.nombre.toUpperCase()}}</strong> del día <span
class="text-muted">{{store.current.justificada.registro_fecha_ideal}}</span> a
las <span
class="text-muted">{{store.current.justificada.horario_hora?.slice(0,5)}}</span>
para el profesor
<span class="text-muted">{{store.current.justificada.profesor_nombre}}</span>
</label>
para el profesor <span
class="text-muted">{{store.current.justificada.profesor_nombre}}</span>
</div>
</div>
<hr v-if="store.current.justificada.registro_justificada">
<div class="input-group" v-if="store.current.justificada.registro_justificada">
<div class="row mt-3">
<div class="col-12">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="observaciones" v-model="store.current.observaciones">
<label class="form-check-label" for="observaciones">
¿Deseas añadir observaciones?
</label>
</div>
</div>
</div>
<hr v-if="store.current.observaciones">
<div class="input-group" v-if="store.current.observaciones">
<div class="input-group-prepend">
<span class="input-group-text text-white bg-primary">Observación</span>
<span class="input-group-text text-white bg-primary">Observaciones</span>
</div>
<textarea class="form-control" aria-label="Observación"
placeholder="Puedes justificar sin observación" rows="2"
placeholder="Puedes justificar sin observaciones" rows="2"
v-model="store.current.justificada.justificacion"></textarea>
</div>
</div>
@@ -617,7 +622,7 @@
Cancelar
</button>
<button type="button" class="btn btn-primary" data-dismiss="modal" @click="store.justificar">
Aceptar
Justificar
</button>
</div>
</div>