91 lines
2.8 KiB
Plaintext
91 lines
2.8 KiB
Plaintext
|
@page "/stock/list"
|
|||
|
<style>
|
|||
|
.rz-custom-header {
|
|||
|
width: 100%;
|
|||
|
}
|
|||
|
</style>
|
|||
|
|
|||
|
<div class="container-fluid">
|
|||
|
|
|||
|
<RadzenDataGrid @ref="grid"
|
|||
|
IsLoading="@isLoading"
|
|||
|
RowRender="@RowRender"
|
|||
|
EmptyText="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
|||
|
Data="@_forecasts"
|
|||
|
AllowColumnResize="true" AllowAlternatingRows="false"
|
|||
|
SelectionMode="DataGridSelectionMode.Single"
|
|||
|
ExpandMode="DataGridExpandMode.Multiple">
|
|||
|
<HeaderTemplate>
|
|||
|
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
|
|||
|
<RadzenButton Icon="download" Text="<22><><EFBFBD>浼<EFBFBD><E6B5BC>" Variant="Variant.Outlined" />
|
|||
|
<RadzenButton Icon="download" Text="ר<><D7A8><EFBFBD>˲ᵼ<CBB2><E1B5BC>" Variant="Variant.Outlined" />
|
|||
|
</RadzenRow>
|
|||
|
</HeaderTemplate>
|
|||
|
<Template Context="di">
|
|||
|
<RadzenDataGrid Data="@di.Stocks" EmptyText="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>">
|
|||
|
<Columns>
|
|||
|
<RadzenDataGridColumn Title="<22><>λ" Property="DrawerNo">
|
|||
|
<Template Context="s">
|
|||
|
@s.DrawerNo - @s.ColNo
|
|||
|
</Template>
|
|||
|
</RadzenDataGridColumn>
|
|||
|
<RadzenDataGridColumn Title="<22><><EFBFBD><EFBFBD>" Property="Quantity"></RadzenDataGridColumn>
|
|||
|
<RadzenDataGridColumn Title="<22><><EFBFBD><EFBFBD>" Property="ManuNo"></RadzenDataGridColumn>
|
|||
|
<RadzenDataGridColumn Title="Ч<><D0A7>" Property="EffDate"></RadzenDataGridColumn>
|
|||
|
</Columns>
|
|||
|
</RadzenDataGrid>
|
|||
|
</Template>
|
|||
|
<Columns>
|
|||
|
<RadzenDataGridColumn Frozen="true" Width="200px" Title="ҩƷ<D2A9><C6B7><EFBFBD><EFBFBD>" Property="DrugName"></RadzenDataGridColumn>
|
|||
|
<RadzenDataGridColumn Title="<22><><EFBFBD><EFBFBD>" Property="DrugSpec"></RadzenDataGridColumn>
|
|||
|
<RadzenDataGridColumn Title="<22>ܿ<EFBFBD><DCBF><EFBFBD>" Property="StockQuantity"></RadzenDataGridColumn>
|
|||
|
</Columns>
|
|||
|
</RadzenDataGrid>
|
|||
|
</div>
|
|||
|
|
|||
|
@code {
|
|||
|
@inject IDrugInfoDao drugInfoDao;
|
|||
|
@inject DialogService dialogService;
|
|||
|
RadzenDataGrid<DrugInfo> grid;
|
|||
|
bool isLoading;
|
|||
|
int count;
|
|||
|
private IEnumerable<DrugInfo>? _forecasts;
|
|||
|
DateTime start;
|
|||
|
DateTime end;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
protected override async Task OnInitializedAsync()
|
|||
|
{
|
|||
|
await base.OnInitializedAsync();
|
|||
|
isLoading = true;
|
|||
|
|
|||
|
var result = await drugInfoDao.GetAllDrugAndStock();
|
|||
|
// Update the Data property
|
|||
|
_forecasts = result;
|
|||
|
isLoading = false;
|
|||
|
}
|
|||
|
|
|||
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|||
|
{
|
|||
|
base.OnAfterRender(firstRender);
|
|||
|
|
|||
|
if (firstRender)
|
|||
|
{
|
|||
|
await grid.ExpandRows(grid.PagedView.Where(di => di.Stocks.Count > 0));
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
void RowRender(RowRenderEventArgs<DrugInfo> args)
|
|||
|
{
|
|||
|
args.Expandable = args.Data.Stocks.Count > 0;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
}
|