HKC_Blazor/MasaBlazorApp3/Pages/BoxAddBox.razor

150 lines
4.4 KiB
Plaintext
Raw Normal View History

2025-06-24 08:55:34 +08:00
@page "/Box/BoxAddBox"
<style>
@@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;
}
}
.rz-custom-header {
width: 100%;
}
.shaky-text {
animation: shake 2s infinite ease-in-out;
/* 你可以根据需要调整动画的持续时间和迭代次数 */
transition: color 0.5s linear,opacity 0.5s linear;
}
</style>
<div class="container-fluid">
<RadzenDataGrid @ref="grid" RowSelect="@OnRowSelect" TItem="ChannelList"
RowRender="@RowRender"
EmptyText="无数据"
Data="@_forecasts" @bind-Value=@selectedChannelLists
AllowColumnResize="true" AllowAlternatingRows="false"
2025-06-27 09:54:42 +08:00
SelectionMode="DataGridSelectionMode.Single" LoadData="@LoadData" IsLoading="@isLoading"
Count="@count" AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据"
2025-06-24 08:55:34 +08:00
ExpandMode="DataGridExpandMode.Multiple">
<Template Context="cs">
<RadzenDataGrid Data="@cs.ChannelStocks" EmptyText="无数据">
<Columns>
<RadzenDataGridColumn Title="药品名称" Property="Drug.DrugName">
</RadzenDataGridColumn>
<RadzenDataGridColumn Title="规格" Property="Drug.DrugSpec">
</RadzenDataGridColumn>
<RadzenDataGridColumn Title="厂家" Property="Drug.Manufactory">
</RadzenDataGridColumn>
@* <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
<RadzenDataGridColumn Title="效期" Property="EffDate">
</RadzenDataGridColumn> *@
<RadzenDataGridColumn Title="基数" Property="BaseQuantity">
</RadzenDataGridColumn>
<RadzenDataGridColumn Title="需补药数" Property="NeedQuantity">
</RadzenDataGridColumn>
</Columns>
</RadzenDataGrid>
</Template>
<Columns>
<RadzenDataGridColumn Frozen="true" Width="200px" Title="药箱号" Property="DrawerNo">
<Template Context="DrawerNo">
@DrawerNo.DrawerNo 号药箱
</Template>
</RadzenDataGridColumn>
<RadzenDataGridColumn Title="总库存" Property="TotalQuantity"></RadzenDataGridColumn>
</Columns>
</RadzenDataGrid>
</div>
@code {
@inject IChannelListDao channelStockDao;
@inject DialogService dialogService;
RadzenDataGrid<ChannelList> grid;
bool isLoading;
int count;
private IEnumerable<ChannelList>? _forecasts;
DateTime start;
DateTime end;
IList<ChannelList> selectedChannelLists;
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
2025-06-27 09:54:42 +08:00
}
async Task LoadData(LoadDataArgs args)
{
2025-06-24 08:55:34 +08:00
isLoading = true;
2025-06-27 09:54:42 +08:00
var result = await channelStockDao.GetBoxWaitInfo(args.Top, args.Skip);
2025-06-24 08:55:34 +08:00
// Update the Data property
_forecasts = result.Desserts;
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<ChannelList> args)
{
args.Expandable = args.Data.ChannelStocks.Count > 0;
}
async void OnRowSelect(ChannelList cl)
{
var b = await dialogService.OpenAsync<BoxAddBoxDetailDialog>(
2025-07-05 10:07:33 +08:00
$"{cl.DrawerNo}号药箱药品入库",
2025-06-24 08:55:34 +08:00
new Dictionary<string, object>() { { "boxChannelList", cl } },
new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
);
if (b)
{
await grid.Reload();
}
}
async void StockExport()
{
}
async void AccountBookExport()
{
}
}