This commit is contained in:
2026-02-01 14:28:17 -06:00
parent 700af7ea60
commit 1784131456
109 changed files with 19894 additions and 0 deletions

View File

@@ -0,0 +1,131 @@
@model IEnumerable<Rs_system.Models.Ubicacion>
@{
ViewData["Title"] = "Ubicaciones de Inventario";
}
<div class="d-flex justify-content-between align-items-center mb-4">
<div>
<h4 class="mb-1">Ubicaciones de Inventario</h4>
<p class="text-muted mb-0">Gestión de lugares físicos de almacenamiento</p>
</div>
<a asp-action="Create" class="btn btn-primary-custom">
<i class="bi bi-plus-lg me-1"></i> Nueva Ubicación
</a>
</div>
<div class="card-custom">
<div class="table-responsive">
<table class="table-custom">
<thead>
<tr>
<th>Nombre</th>
<th>Descripción</th>
<th>Responsable</th>
<th class="text-center">Estado</th>
<th class="text-center">Acciones</th>
</tr>
</thead>
<tbody>
@if (!Model.Any())
{
<tr>
<td colspan="5" class="text-center text-muted py-4">
<i class="bi bi-geo-alt fs-1 d-block mb-2"></i>
No hay ubicaciones registradas
</td>
</tr>
}
@foreach (var item in Model)
{
<tr>
<td>
<strong>@item.Nombre</strong>
</td>
<td>
@if (!string.IsNullOrEmpty(item.Descripcion))
{
<span>@item.Descripcion</span>
}
else
{
<span class="text-muted">-</span>
}
</td>
<td>
@if (!string.IsNullOrEmpty(item.Responsable))
{
<div class="d-flex align-items-center">
<i class="bi bi-person-circle me-2 text-muted"></i>
<span>@item.Responsable</span>
</div>
}
else
{
<span class="text-muted">-</span>
}
</td>
<td class="text-center">
@if (item.Activo)
{
<span class="badge bg-success">Activo</span>
}
else
{
<span class="badge bg-secondary">Inactivo</span>
}
</td>
<td class="text-center">
<a asp-action="Edit" asp-route-id="@item.Id" class="btn btn-sm btn-outline-secondary" title="Editar">
<i class="bi bi-pencil"></i>
</a>
<button type="button" class="btn btn-sm btn-outline-danger" onclick="confirmDelete(@item.Id)" title="Eliminar">
<i class="bi bi-trash"></i>
</button>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
<!-- Delete Form -->
<form id="deleteForm" asp-action="Delete" method="post" style="display: none;">
<input type="hidden" name="id" id="deleteId" />
</form>
@section Scripts {
<script>
function confirmDelete(id) {
Swal.fire({
title: '¿Eliminar ubicación?',
text: 'Esta acción archivará la ubicación.',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#d33',
cancelButtonColor: '#6c757d',
confirmButtonText: 'Sí, eliminar',
cancelButtonText: 'Cancelar'
}).then((result) => {
if (result.isConfirmed) {
document.getElementById('deleteId').value = id;
document.getElementById('deleteForm').submit();
}
});
}
// Show success/error messages
@if (TempData["SuccessMessage"] != null)
{
<text>
toastr.success('@TempData["SuccessMessage"]');
</text>
}
@if (TempData["ErrorMessage"] != null)
{
<text>
toastr.error('@TempData["ErrorMessage"]');
</text>
}
</script>
}