@page "/Box/BoxAddBox"
    
        
            
                
                    
                    
                    
                    
                    
                    
                    @*  
                    
                     *@
                    
                    
                    
                    
                
            
        
        
            
                
                    @DrawerNo.DrawerNo 号药箱
                
            
            
        
    
@code {
    @inject IChannelListDao channelStockDao;
    @inject DialogService dialogService;
    RadzenDataGrid grid;
    bool isLoading;
    int count;
    private IEnumerable? _forecasts;
    DateTime start;
    DateTime end;
    IList selectedChannelLists;
    protected override async Task OnInitializedAsync()
    {
        await base.OnInitializedAsync();
       
    }
    async Task LoadData(LoadDataArgs args)
    {
        isLoading = true;
        var result = await channelStockDao.GetBoxWaitInfo(args.Top, args.Skip);
        // 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 args)
    {
        args.Expandable = args.Data.ChannelStocks.Count > 0;
    }
    async void OnRowSelect(ChannelList cl)
    {
        var b = await dialogService.OpenAsync(
               $"{cl.DrawerNo}号药箱药品入库",
             new Dictionary() { { "boxChannelList", cl } },
             new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
       );
        if (b)
        {
            await grid.Reload();
        }
    }
    async void StockExport()
    {
    }
    async void AccountBookExport()
    {
    }
}