FruitBankHybridApp/FruitBankHybrid.Shared/Components/Grids/ShippingDocuments/GridShippingDocumentInfoPan...

84 lines
2.7 KiB
Plaintext

@using AyCode.Blazor.Components.Components.Grids
@using DevExpress.Blazor
@using FruitBank.Common.Entities
@using System.IO
@inject IJSRuntime JS
<MgGridInfoPanel>
@* <HeaderTemplate Context="dataItem">
<div class="dxbl-grid-header-panel px-3 py-2 border-bottom d-flex align-items-center">
<span class="me-2">??</span>
<span class="fw-semibold">Szállítólevél részletei</span>
</div>
</HeaderTemplate> *@
@* <BeforeColumnsTemplate Context="dataItem">
@if (dataItem is ShippingDocument doc)
{
<div class="alert alert-info mb-2 py-1 px-2 small">
<strong>Partner:</strong> @doc.Partner?.Name
</div>
}
</BeforeColumnsTemplate> *@
<AfterColumnsTemplate Context="dataItem">
@if (dataItem is ShippingDocument doc)
{
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="white-space: nowrap;">Termék neve</th>
<th style="white-space: nowrap;">Név a dokumentumon</th>
<th style="white-space: nowrap;">Raklapok</th>
<th style="white-space: nowrap;">Mennyiség</th>
<th style="white-space: nowrap;">Net.súly</th>
<th style="white-space: nowrap;">Brt.súly</th>
</tr>
</thead>
<tbody>
@foreach (var shippingItem in doc.ShippingItems)
{
<tr>
<td style="white-space: nowrap;">@shippingItem.ProductName</td>
<td style="white-space: nowrap;">@shippingItem.NameOnDocument</td>
<td style="white-space: nowrap;">@shippingItem.QuantityOnDocument</td>
<td style="white-space: nowrap;">@shippingItem.NetWeightOnDocument</td>
<td style="white-space: nowrap;">@shippingItem.GrossWeightOnDocument</td>
<td style="white-space: nowrap;">@shippingItem.PalletsOnDocument</td>
</tr>
}
</tbody>
</table>
<div id="pdfContainer" style="width: 100%; height: 800px; overflow-y: auto;">
</div>
}
</AfterColumnsTemplate>
@* <FooterTemplate Context="dataItem">
<div class="p-2 border-top d-flex gap-2">
<DxButton Text="Nyomtatás" IconCssClass="dx-icon dx-icon-print" RenderStyle="ButtonRenderStyle.Light" />
<DxButton Text="Export" IconCssClass="dx-icon dx-icon-export" RenderStyle="ButtonRenderStyle.Light" />
</div>
</FooterTemplate> *@
</MgGridInfoPanel>
@code
{
private readonly string[] _pdfFiles = new[]
{
"1_Albaran_AH25007715.pdf",
"2_BANK FRA.pdf",
"3_BP-30M35_20251113_163816.pdf"
};
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
var pdfUrls = _pdfFiles.Select(f => $"_content/FruitBankHybrid.Shared/uploads/{f}").ToArray();
await JS.InvokeVoidAsync("pdfViewer.renderPdfs", "pdfContainer", pdfUrls);
}
}
}