2025-04-18 11:01:56 +08:00
|
|
|
|
@page "/stock/list"
|
|
|
|
|
<style>
|
2025-06-24 08:55:34 +08:00
|
|
|
|
@@keyframes shake {
|
|
|
|
|
0% { opacity:1;color:red; }
|
|
|
|
|
25%{opacity:1;color:orange;}
|
|
|
|
|
50% { opacity:0;color:yellow;}
|
|
|
|
|
75%{opacity:1;color:crimson;}
|
|
|
|
|
100% { opacity:1;color:red; }
|
|
|
|
|
}
|
2025-04-18 11:01:56 +08:00
|
|
|
|
.rz-custom-header {
|
2025-06-24 08:55:34 +08:00
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
.shaky-text {
|
|
|
|
|
animation: shake 2s infinite ease-in-out;
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>Ը<EFBFBD><D4B8><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><C4B3><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
transition:color 0.5s linear,opacity 0.5s linear;
|
2025-04-18 11:01:56 +08:00
|
|
|
|
}
|
2025-06-24 08:55:34 +08:00
|
|
|
|
|
2025-04-18 11:01:56 +08:00
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<div class="container-fluid">
|
|
|
|
|
|
|
|
|
|
<RadzenDataGrid @ref="grid"
|
2025-06-24 08:55:34 +08:00
|
|
|
|
IsLoading="@isLoading"
|
|
|
|
|
RowRender="@RowRender"
|
|
|
|
|
EmptyText="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
|
|
|
|
Data="@_forecasts"
|
|
|
|
|
AllowColumnResize="true" AllowAlternatingRows="false"
|
|
|
|
|
SelectionMode="DataGridSelectionMode.Single"
|
|
|
|
|
ExpandMode="DataGridExpandMode.Multiple">
|
2025-04-18 11:01:56 +08:00
|
|
|
|
<HeaderTemplate>
|
|
|
|
|
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
|
2025-06-24 08:55:34 +08:00
|
|
|
|
<RadzenButton Icon="download" Text="<22><><EFBFBD>浼<EFBFBD><E6B5BC>" Variant="Variant.Outlined" Click="StockExport" />
|
|
|
|
|
<RadzenButton Icon="download" Text="ר<><D7A8><EFBFBD>˲ᵼ<CBB2><E1B5BC>" Variant="Variant.Outlined" Click="AccountBookExport" />
|
2025-04-18 11:01:56 +08:00
|
|
|
|
</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>
|
2025-06-24 08:55:34 +08:00
|
|
|
|
<RadzenDataGridColumn Title="<22><><EFBFBD><EFBFBD>" Property="Quantity">
|
|
|
|
|
</RadzenDataGridColumn>
|
2025-04-18 11:01:56 +08:00
|
|
|
|
<RadzenDataGridColumn Title="<22><><EFBFBD><EFBFBD>" Property="ManuNo"></RadzenDataGridColumn>
|
2025-06-24 08:55:34 +08:00
|
|
|
|
<RadzenDataGridColumn Title="Ч<><D0A7>" Property="EffDate">
|
|
|
|
|
<Template Context="s">
|
|
|
|
|
@{
|
|
|
|
|
DateTime dateTime;
|
|
|
|
|
bool success = DateTime.TryParse(s.EffDate, out dateTime);
|
|
|
|
|
if(success&&dateTime<=DateTime.Now.AddMonths(3))
|
|
|
|
|
{
|
|
|
|
|
@s.EffDate<p class="shaky-text"><3E><>Ч<EFBFBD><D0A7>ҩƷ<D2A9><C6B7></p>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
@s.EffDate
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</Template>
|
|
|
|
|
</RadzenDataGridColumn>
|
2025-04-18 11:01:56 +08:00
|
|
|
|
</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>
|
2025-06-24 08:55:34 +08:00
|
|
|
|
<RadzenDataGridColumn Title="<22>ܿ<EFBFBD><DCBF><EFBFBD>" Property="StockQuantity">
|
|
|
|
|
<Template Context="s">
|
|
|
|
|
@if(s.StockQuantity<10)
|
|
|
|
|
{
|
|
|
|
|
@s.StockQuantity<p class="shaky-text"><3E><><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD></p>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
@s.StockQuantity
|
|
|
|
|
}
|
|
|
|
|
</Template>
|
|
|
|
|
</RadzenDataGridColumn>
|
|
|
|
|
|
2025-04-18 11:01:56 +08:00
|
|
|
|
</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;
|
|
|
|
|
|
2025-06-24 08:55:34 +08:00
|
|
|
|
|
2025-04-18 11:01:56 +08:00
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-06-24 08:55:34 +08:00
|
|
|
|
async void StockExport()
|
|
|
|
|
{
|
2025-04-18 11:01:56 +08:00
|
|
|
|
|
2025-06-24 08:55:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async void AccountBookExport()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2025-04-18 11:01:56 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|