@page "/Box/BoxStock" @using MasaBlazorApp3.Pojo.Config
@foreach (int i in DrawerNos) { }
@* *@ @* *@
@code { @inject IOrderInfoDao orderInfoDao; @inject IChannelListDao channelListDao; @inject DialogService dialogService; @inject Microsoft.Extensions.Options.IOptions setting; @inject NotificationService _message private IEnumerable? _forecasts; bool allowRowSelectOnRowClick = true; // IEnumerable drugManuNos; // IList selectedDrugManuNos; RadzenDataList grid; // RadzenDataGrid gridManuNo; bool isLoading; int count; int[] DrawerNos = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 }; int status = 0; int drawerNo = 1; string OrderNo; DateTime OrderDate; void SelectDrawer(int drawerNo) { this.drawerNo = drawerNo; grid.Reload(); } // void OnCurrentDateChanged(DateTime args) // { // OrderDate = new DateTime(args.Year, args.Month, args.Day); // } //重置 async Task reloadGrid() { OrderNo = ""; OrderDate = DateTime.MinValue; await grid.Reload(); } //确认 async Task Confirm() { // orderInfoDao.CheckOrderInfo(selectedOrderInfos, drawerNo); } async Task LoadData(LoadDataArgs args) { isLoading = true; var result = await channelListDao.GetBoxDrugInfo(drawerNo, args.Top, args.Skip); // Update the Data property _forecasts = result.Desserts; // Update the count count = result.TotalDesserts; isLoading = false; DrawerNos = await orderInfoDao.GetDrawerNum(setting.Value.boxMachineId); } //替换按钮 async Task replaceClick(ChannelStock cs) { if (cs.Quantity > 0) { var b = await dialogService.OpenAsync( $"{cs.DrawerNo}号药箱替换药品详情", new Dictionary() { { "channelStock", cs } }, new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false } ); if (b) { await reloadGrid(); } } else { //库存为0无法操作 _message.Notify( new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"库存为0无法替换", Duration = 4000 } ); } } //移除按钮 async Task removeClick(ChannelStock cs) { if (cs.Quantity > 0) { var b = await dialogService.OpenAsync( $"{cs.DrawerNo}号药箱替换药品详情", new Dictionary() { { "channelStock", cs } }, new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false } ); if (b) { await reloadGrid(); } } else { //库存为0无法操作 _message.Notify( new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"库存为0,没有要移出的药品", Duration = 4000 } ); } } }