Refactoring
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 21m21s
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 21m21s
This commit is contained in:
parent
474c90423c
commit
c9bfaca76d
@ -27,7 +27,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<hr />
|
||||
<div>
|
||||
<div style="zoom:.9;">
|
||||
@if (TablaProductos != null && TablaProductos.Any())
|
||||
{
|
||||
<PhTable Columns="TableColumns"
|
||||
@ -108,6 +108,7 @@
|
||||
|
||||
private async Task CargarProductos()
|
||||
{
|
||||
SearchParams.PageSize = 8;
|
||||
PagedResult = await productService.SearchProductsAsync(SearchParams);
|
||||
if (PagedResult?.Items is not null)
|
||||
{
|
||||
|
||||
@ -3,9 +3,9 @@
|
||||
@using Core.Dtos
|
||||
@using Domain.Generics
|
||||
@using phronCare.UIBlazor.Services.Sales.Quotes
|
||||
@inject IToastService toastService
|
||||
@inject NavigationManager Navigation
|
||||
@inject QuoteService quoteService
|
||||
@inject IToastService toastService
|
||||
|
||||
<div class="card" style="zoom:80%">
|
||||
<div class="card-header d-flex justify-content-center align-items-center">
|
||||
@ -17,7 +17,7 @@
|
||||
<div class="mb-3 row g-2 align-items-end">
|
||||
<div class="col-sm">
|
||||
<label for="quotenumber">Presupuesto</label>
|
||||
<input id="quotenumber" @bind="Filters.QuoteNumber" class="form-control form-control-sm" placeholder="Q-00000001" />
|
||||
<input id="quotenumber" @bind="Filters.QuoteNumber" class="form-control form-control-sm" placeholder="Q-0000000X" />
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<label for="customer">Cliente</label>
|
||||
@ -47,7 +47,6 @@
|
||||
<option value="Cerrado">Cerrado</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-sm">
|
||||
<label for="datefrom">Desde</label>
|
||||
<InputDate id="datefrom" @bind-Value="Filters.IssueDateFrom" class="form-control form-control-sm" />
|
||||
@ -83,7 +82,7 @@
|
||||
<th>Médico</th>
|
||||
<th>Hospital</th>
|
||||
<th>Paciente</th>
|
||||
<th>Unidad Negocio</th>
|
||||
<th>Unidad</th>
|
||||
<th>Moneda</th>
|
||||
<th>Total</th>
|
||||
<th>Estado</th>
|
||||
@ -121,7 +120,6 @@
|
||||
{
|
||||
<!-- BACKDROP semitransparente -->
|
||||
<div class="position-fixed top-0 start-0 w-100 h-100" style="background: rgba(0,0,0,0.4);"></div>
|
||||
|
||||
<!-- DRAWER LATERAL -->
|
||||
<div class="position-fixed top-0 end-0 h-100 bg-white shadow" style="width: 45%; z-index:1050;">
|
||||
<!-- CABECERA -->
|
||||
@ -129,23 +127,6 @@
|
||||
<h5 class="m-0">Detalle Presupuesto @SelectedQuote?.Quotenumber</h5>
|
||||
<button class="btn-close" @onclick="() => SelectedQuote = null"></button>
|
||||
</div>
|
||||
|
||||
@* <!-- TABS -->
|
||||
<ul class="nav nav-tabs px-3 mt-2" role="tablist">
|
||||
<li class="nav-item">
|
||||
<button class="nav-link @((activeTab == "Datos") ? "active" : "")"
|
||||
@onclick='() => activeTab = "Datos"'>
|
||||
Datos
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link @(activeTab == "Items" ? "active" : "")"
|
||||
@onclick='() => activeTab = "Items"'>
|
||||
Items
|
||||
</button>
|
||||
</li>
|
||||
</ul> *@
|
||||
|
||||
<!-- CONTENIDO -->
|
||||
<div class="p-3">
|
||||
<ul class="nav nav-tabs mb-3" role="tablist">
|
||||
@ -256,7 +237,6 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
}
|
||||
else if (IsLoading)
|
||||
{
|
||||
@ -266,7 +246,6 @@
|
||||
{
|
||||
<p>No hay resultados.</p>
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
<!-- FOOTER: PAGINACIÓN -->
|
||||
@ -300,25 +279,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private QuoteSearchParams Filters = new();
|
||||
private PagedResult<QuoteDto>? PagedQuotes;
|
||||
private QuoteDto? SelectedQuote { get; set; }
|
||||
private bool IsLoading;
|
||||
private int PaginaDeseada = 1;
|
||||
|
||||
private QuoteDto? SelectedQuote { get; set; }
|
||||
// private List<QuoteItemDto>? SelectedQuoteItems => SelectedQuote?.Items;
|
||||
// private List<QuoteTaxDto>? SelectedQuoteTaxes => SelectedQuote?.Taxes;
|
||||
private string activeTab = "Datos";
|
||||
|
||||
// protected override async Task OnInitializedAsync()
|
||||
// {
|
||||
// await Search();
|
||||
// }
|
||||
|
||||
private async Task Search()
|
||||
{
|
||||
try
|
||||
@ -332,7 +303,6 @@
|
||||
Filters.PatientId, Filters.PatientText, Filters.Status,
|
||||
Filters.IssueDateFrom, Filters.IssueDateTo,
|
||||
Filters.Page, Filters.PageSize);
|
||||
|
||||
PaginaDeseada = Filters.Page;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -381,6 +351,12 @@
|
||||
toastService.ShowWarning("Número de página fuera de rango.");
|
||||
}
|
||||
}
|
||||
|
||||
private bool PuedeRetroceder => PagedQuotes != null && Filters.Page > 1;
|
||||
private bool PuedeAvanzar => PagedQuotes != null && Filters.Page < TotalPaginas;
|
||||
private int TotalPaginas => PagedQuotes is null ? 1 :
|
||||
(int)Math.Ceiling((double)(PagedQuotes.TotalItems) / Filters.PageSize);
|
||||
|
||||
private void Create()
|
||||
{
|
||||
Navigation.NavigateTo("/quote/create/");
|
||||
@ -391,12 +367,6 @@
|
||||
PagedQuotes = null;
|
||||
PaginaDeseada = 1;
|
||||
}
|
||||
|
||||
private bool PuedeRetroceder => PagedQuotes != null && Filters.Page > 1;
|
||||
private bool PuedeAvanzar => PagedQuotes != null && Filters.Page < TotalPaginas;
|
||||
private int TotalPaginas => PagedQuotes is null ? 1 :
|
||||
(int)Math.Ceiling((double)(PagedQuotes.TotalItems) / Filters.PageSize);
|
||||
|
||||
private string GetStatusBadge(string status) => status switch
|
||||
{
|
||||
"Emitido" => "bg-primary text-white",
|
||||
@ -412,20 +382,4 @@
|
||||
{
|
||||
// lógica de impresión...
|
||||
}
|
||||
|
||||
public class QuoteSearchParams : PagedRequest
|
||||
{
|
||||
public int? CustomerId { get; set; }
|
||||
public string? CustomerText { get; set; }
|
||||
public string? QuoteNumber { get; set; }
|
||||
public int? ProfessionalId { get; set; }
|
||||
public string? ProfessionalText { get; set; }
|
||||
public int? InstitutionId { get; set; }
|
||||
public string? InstitutionText { get; set; }
|
||||
public int? PatientId { get; set; }
|
||||
public string? PatientText { get; set; }
|
||||
public DateTime? IssueDateFrom { get; set; }
|
||||
public DateTime? IssueDateTo { get; set; }
|
||||
public string? Status { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user