@page "/Box/OrderImport" @using MasaBlazorApp3.Pojo.Config @using MasaBlazorApp3.Report @using Microsoft.Extensions.Options @using Radzen.Blazor.Rendering @using log4net;
@* *@ @* *@ @* *@ @* *@ @* @((context as DrugManuNo)?.ManuNo) @if ((context as DrugManuNo).EffDate != null && (context as DrugManuNo).EffDate.ToString().Length > 10) { @((context as DrugManuNo).EffDate.ToString().Substring(0, 10)) } else { @((context as DrugManuNo)?.EffDate) } *@ @* *@
@code { private readonly ILog logger = LogManager.GetLogger(typeof(CheckOrder)); @inject IOrderInfoDao orderInfoDao; @inject DialogService dialogService; @inject Microsoft.Extensions.Options.IOptions setting; @inject NotificationService _message; @inject IReportDataDao reportDataDao; @inject IOptions setting; [Parameter] public BoxModel boxModel { get; set; } bool allowRowSelectOnRowClick = true; IEnumerable orderInfos; IList selectedOrderInfos = new List(); RadzenDataGrid grid; //麻醉师集合 List NamesList = new List(); Anaesthetist NameInfo; Anaesthetist BoxColor; //药盒集合 List BoxList = new List(); //药盒颜色集合 List BoxColorList = new List(); BoxModel BoxNum; bool isLoading; int count; int[] DrawerNos = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 }; int status = 0; string OrderNo; string PatientName; DateTime OrderDate = DateTime.Now; DateTime PortOrderDate = DateTime.Now; Popup popup; RadzenButton button; //第一次加载不执行LoadData方法 // int firstLod = 1; void OnCheckSeleced(object dete) { if (orderInfos != null) { orderInfos.ToList().ForEach(it => it.ItemIsChecked = true); } } void OnCurrentDateChanged(DateTime args) { OrderDate = new DateTime(args.Year, args.Month, args.Day); } void OnCellClick(DataGridCellMouseEventArgs args) { if (args.Data.DetailInfo.SetManuNo != null) { args.Data.DetailInfo.drugManuNo = args.Data.DetailInfo.Drug.Manus.Where(m => m.ManuNo == args.Data.DetailInfo.SetManuNo).FirstOrDefault(); } if (args.Data.DetailInfo.drugManuNo == null) { args.Data.DetailInfo.drugManuNo = args.Data.DetailInfo.Drug.Manus.FirstOrDefault(); } args.Data.ItemIsChecked = !args.Data.ItemIsChecked; grid.EditRow(args.Data); } //确认 async Task Confirm() { if (selectedOrderInfos == null || selectedOrderInfos.Count<=0) { _message.Notify( new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择处方", Duration = 4000 } ); return; } // 关闭弹窗selectedOrderInfos dialogService.Close(selectedOrderInfos); } PageData result; protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); } async Task LoadData(LoadDataArgs args) { // if (firstLod == 1) if (boxModel != null && boxModel.BoxName > 0) { //查询除本药箱外的处方信息 result = await orderInfoDao.GetAllOrderInfoForImport(PatientName, OrderNo, OrderDate, boxModel, args.Top, args.Skip); orderInfos = result.Desserts; selectedOrderInfos = orderInfos.ToList(); count = result.TotalDesserts; isLoading = true; } isLoading = false; } }