diff --git a/DM_Weight/ViewModels/ApplyInStockWindowViewModel.cs b/DM_Weight/ViewModels/ApplyInStockWindowViewModel.cs index 5d42cd5..aafcec0 100644 --- a/DM_Weight/ViewModels/ApplyInStockWindowViewModel.cs +++ b/DM_Weight/ViewModels/ApplyInStockWindowViewModel.cs @@ -330,6 +330,16 @@ namespace DM_Weight.ViewModels { if (SelectDrugPleaseClaim.GetQuantity == 1) { + if(SelectDrugPleaseClaim.DrugManuNo is null) + { + AlertMsg alertMsg = new AlertMsg + { + Message = "药品没有批次效期信息!", + Type = MsgType.ERROR, + }; + _eventAggregator.GetEvent().Publish(alertMsg); + return; + } //请领单里只有一种药 List drugManuInfoList = JsonConvert.DeserializeObject>(SelectDrugPleaseClaim.DrugManuNo); drugManuInfoList.ForEach(dm => dm.DrugId = SelectDrugPleaseClaim.DrugId); diff --git a/DM_Weight/ViewModels/ApplyListWindowViewModel.cs b/DM_Weight/ViewModels/ApplyListWindowViewModel.cs index d3d73fc..f4a7455 100644 --- a/DM_Weight/ViewModels/ApplyListWindowViewModel.cs +++ b/DM_Weight/ViewModels/ApplyListWindowViewModel.cs @@ -143,12 +143,13 @@ namespace DM_Weight.ViewModels CollectDrugLst = SqlSugarHelper.Db.Queryable() .Includes(cd => cd.drugPleaseClaim) .Includes(cd => cd.drugInfo) - .Where(cd => cd.MachineId.Equals(ConfigurationManager.AppSettings["department"] ?? "DM3")) + .InnerJoin((cd,dp)=>cd.DrugPleaseClaimId==dp.PleaseNo) + .Where(cd => cd.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM3")) .WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugId"), (cd) => cd.drugInfo.DrugId.ToString() == SearchValue) .WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugName"), (cd) => cd.drugInfo.DrugName.Contains(SearchValue)) .WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("PyCode"), (cd) => cd.drugInfo.PyCode.Contains(SearchValue)) .WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugBarcode"), (cd) => cd.drugInfo.DrugBarcode.Contains(SearchValue)) - .WhereIF((_DrugPleaseState!=null&& _DrugPleaseState.StateValue>=0),(cd)=>cd.Status==_DrugPleaseState.StateValue) + .WhereIF((_DrugPleaseState!=null&& _DrugPleaseState.StateValue>=0),(cd,dp)=>dp.State==_DrugPleaseState.StateValue) .OrderByDescending(cd => cd.Createdate) .OrderByDescending(cd => cd.DrugId) .ToList(); diff --git a/DM_Weight/Views/ApplyListWindow.xaml b/DM_Weight/Views/ApplyListWindow.xaml index 8243d31..c3687f2 100644 --- a/DM_Weight/Views/ApplyListWindow.xaml +++ b/DM_Weight/Views/ApplyListWindow.xaml @@ -123,6 +123,7 @@ + @@ -169,12 +170,12 @@ Header="数量" IsReadOnly="True" ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/> - -