diff --git a/phronCare.UIBlazor/Pages/Stock/LSProduct.razor b/phronCare.UIBlazor/Pages/Stock/LSProduct.razor index 6f14979..bc44b84 100644 --- a/phronCare.UIBlazor/Pages/Stock/LSProduct.razor +++ b/phronCare.UIBlazor/Pages/Stock/LSProduct.razor @@ -80,7 +80,7 @@ - + +
+ +
+ + +
+
+ +@if (PreviewItems != null) +{ +
Vista previa
+ + + + + + + + + + + + + + + + + @foreach (var item in PreviewItems) + { + + + + + + + + + + + + + } + +
C贸d. F谩bricaNombreDescripci贸nTipoTrazabilidadDivisi贸nUnidadPlusC贸d. Ext.Errores
@item.FactoryCode@item.Name@item.Description@item.ProductType@item.TraceabilityType@item.DivisionCode@item.UnitCode@(item.PlusProcess ? "S铆" : "No")@item.ExternalCode@item.ErrorMessage
+ +
+ + +
+} + +@code { + private List? PreviewItems; + protected override void OnInitialized() + { + PreviewItems = new List + { + new() { FactoryCode = "ZIM001", Name = "Clavo tibial largo", Description = "Clavo para tibia", ProductType = 1, TraceabilityType = 3, DivisionCode = "ZIM", UnitCode = "UN", PlusProcess = true, ExternalCode = "EXT001" }, + new() { FactoryCode = "ZIM002", Name = "Tornillo esponjoso", Description = "Tornillo de 6.5mm", ProductType = 1, TraceabilityType = 3, DivisionCode = "ZIM", UnitCode = "UN", PlusProcess = false, ExternalCode = "EXT002" }, + new() { FactoryCode = "ZIM003", Name = "Placa de compresi贸n", Description = "Placa DCP 4.5", ProductType = 1, TraceabilityType = 2, DivisionCode = "ZIM", UnitCode = "UN", PlusProcess = false, ExternalCode = "EXT003" }, + new() { FactoryCode = "ZIM004", Name = "Caja instrumental", Description = "Caja para implantes", ProductType = 2, TraceabilityType = 1, DivisionCode = "ZIM", UnitCode = "CJ", PlusProcess = false, ExternalCode = "EXT004", ErrorMessage = "Unidad no reconocida" }, + new() { FactoryCode = "ZIM005", Name = "Perno cortical", Description = "Perno de fijaci贸n", ProductType = 1, TraceabilityType = 3, DivisionCode = "ZIM", UnitCode = "UN", PlusProcess = true, ExternalCode = "EXT005" } + }; + } + private async Task DownloadTemplate() + { + Navigation.NavigateTo("api/LSProductImport/download-template", forceLoad: true); + } + + private async Task HandleFileSelected(InputFileChangeEventArgs e) + { + // L贸gica futura para parsear y enviar archivo al backend + } + + private async Task SimulateImport() + { + // L贸gica futura para simular importaci贸n + } + + private async Task ConfirmImport() + { + // L贸gica futura para guardar los productos + } + + public class ProductImportPreviewDto + { + public string FactoryCode { get; set; } = string.Empty; + public string Name { get; set; } = string.Empty; + public string Description { get; set; } = string.Empty; + public int ProductType { get; set; } + public int TraceabilityType { get; set; } + public string DivisionCode { get; set; } = string.Empty; + public string UnitCode { get; set; } = string.Empty; + public bool PlusProcess { get; set; } + public string ExternalCode { get; set; } = string.Empty; + public string? ErrorMessage { get; set; } + public bool HasError => !string.IsNullOrWhiteSpace(ErrorMessage); + } +}