diff --git a/phronCare.UIBlazor/Pages/Sales/Products.razor b/phronCare.UIBlazor/Pages/Sales/Products.razor index 8d8260c..fd3f570 100644 --- a/phronCare.UIBlazor/Pages/Sales/Products.razor +++ b/phronCare.UIBlazor/Pages/Sales/Products.razor @@ -27,17 +27,17 @@
-
+
@if (TablaProductos != null && TablaProductos.Any()) { + Data="TablaProductos" + SelectionField="Id" + RowsPerPage=SearchParams.PageSize + RenderButtons="true" Buttons="botones" + ShowPageButtons="false" + ShowQuickSearch="false" + RenderSelect="false" /> } else { @@ -108,6 +108,7 @@ private async Task CargarProductos() { + SearchParams.PageSize = 8; PagedResult = await productService.SearchProductsAsync(SearchParams); if (PagedResult?.Items is not null) { diff --git a/phronCare.UIBlazor/Pages/Sales/Quotes/Quotes.razor b/phronCare.UIBlazor/Pages/Sales/Quotes/Quotes.razor index 30b10ab..a77ed94 100644 --- a/phronCare.UIBlazor/Pages/Sales/Quotes/Quotes.razor +++ b/phronCare.UIBlazor/Pages/Sales/Quotes/Quotes.razor @@ -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
@@ -17,7 +17,7 @@
- +
@@ -47,7 +47,6 @@
-
@@ -83,7 +82,7 @@ Médico Hospital Paciente - Unidad Negocio + Unidad Moneda Total Estado @@ -121,7 +120,6 @@ {
-
@@ -129,23 +127,6 @@
Detalle Presupuesto @SelectedQuote?.Quotenumber
- -@* - *@ -
} - } else if (IsLoading) { @@ -266,7 +246,6 @@ {

No hay resultados.

} -
@@ -300,25 +279,17 @@
-
@code { private QuoteSearchParams Filters = new(); private PagedResult? PagedQuotes; + private QuoteDto? SelectedQuote { get; set; } private bool IsLoading; private int PaginaDeseada = 1; - private QuoteDto? SelectedQuote { get; set; } - // private List? SelectedQuoteItems => SelectedQuote?.Items; - // private List? 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; } - } }