diff --git a/DM_Weight/ViewModels/CheckRecordDetailDialogViewModel.cs b/DM_Weight/ViewModels/CheckRecordDetailDialogViewModel.cs index f2add79..d49b1de 100644 --- a/DM_Weight/ViewModels/CheckRecordDetailDialogViewModel.cs +++ b/DM_Weight/ViewModels/CheckRecordDetailDialogViewModel.cs @@ -158,7 +158,10 @@ namespace DM_Weight.ViewModels //strSql += " GROUP BY C.optdate,Drug_id ORDER BY C.OPTDATE DESC"; List checkList = SqlSugarHelper.Db.Queryable() .Includes(cs => cs.DrugInfo) - .Where(cs => cs.optdate == OptDate).OrderByDescending(cs => cs.optdate).ToList(); + .Where(cs => cs.optdate == OptDate).OrderByDescending(cs => cs.optdate) + .WhereIF(App.SingleModel, cs => cs.rowNo <= 2) //单人登录开前2个抽屉,双人登录开后14个抽屉 + .WhereIF(!(App.SingleModel), cs => cs.rowNo > 2) + .ToList(); ICollectionView vw = CollectionViewSource.GetDefaultView(checkList); vw.GroupDescriptions.Add(new PropertyGroupDescription("DrugInfo")); obsCheckRecordStock = new ObservableCollection(checkList); diff --git a/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs b/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs index 339ae3e..c52806b 100644 --- a/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs +++ b/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs @@ -432,7 +432,16 @@ namespace DM_Weight.ViewModels string machine_id = (ConfigurationManager.AppSettings["machineId"] ?? "DM1"); string strSql = $@"SELECT cl.`row_no` AS rowNo,cl.`col_no` AS colNo,cl.`quantity` AS quantity,cl.`manu_no` AS manuNo,cl.`eff_date` AS effDate, di.`drug_name` AS drugName,di.`drug_spec` AS drugSpec,di.`pack_unit` AS packUnit,di.`manufactory` AS manufactory,di.`max_stock` maxStock, - cl.`drug_id` AS drugId,cl.`machine_id` AS MachineId FROM channel_stock cl INNER JOIN drug_info di ON di.`drug_id` = cl.`drug_id` WHERE cl.`machine_id` = '{machine_id}' AND cl.`drawer_type` = 1 ORDER BY cl.`drug_id`"; + cl.`drug_id` AS drugId,cl.`machine_id` AS MachineId FROM channel_stock cl INNER JOIN drug_info di ON di.`drug_id` = cl.`drug_id` WHERE cl.`machine_id` = '{machine_id}' AND cl.`drawer_type` = 1 "; + if(App.SingleModel) + { + strSql += " AND ROW_NO<=2"; + } + else + { + strSql += " AND ROW_NO>2"; + } + strSql += " ORDER BY cl.`drug_id`"; List checkRecordStockList = SqlSugarHelper.Db.SqlQueryable(strSql) .AddParameters(new { @@ -443,6 +452,7 @@ namespace DM_Weight.ViewModels logger.Info("已完成-查询channel_stock关联drug_info表信息查询"); + List insertList = new List(); if (checkRecordStockList != null && checkRecordStockList.Count > 0) diff --git a/DM_Weight/ViewModels/MultiOrderTakeDialogViewModel.cs b/DM_Weight/ViewModels/MultiOrderTakeDialogViewModel.cs index acd1b0c..631bf20 100644 --- a/DM_Weight/ViewModels/MultiOrderTakeDialogViewModel.cs +++ b/DM_Weight/ViewModels/MultiOrderTakeDialogViewModel.cs @@ -251,8 +251,16 @@ namespace DM_Weight.ViewModels } else { - //msg.Add($"药品【{orderDetail.DrugInfo.DrugName}】库存不足,应取【{TakeQ}】库存【{total}】"); - msg.Add($"药品【{HasQChannels[0].DrugInfo.DrugName}】库存不足,应取【{TakeQ}】库存【{total}】"); + if (HasQChannels != null && HasQChannels.Count>0 && HasQChannels[0].DrugInfo != null) + { + //msg.Add($"药品【{orderDetail.DrugInfo.DrugName}】库存不足,应取【{TakeQ}】库存【{total}】"); + msg.Add($"药品【{HasQChannels[0].DrugInfo.DrugName}】库存不足,应取【{TakeQ}】库存【{total}】"); + } + else + { + msg.Add($"药品【{orderDetail.DrugId}】库存不足,应取【{TakeQ}】库存【{total}】"); + + } } } if (msg.Count > 0) diff --git a/DM_Weight/ViewModels/MultiOrderTakeDrugWindowViewModel.cs b/DM_Weight/ViewModels/MultiOrderTakeDrugWindowViewModel.cs index e7d6899..d098d20 100644 --- a/DM_Weight/ViewModels/MultiOrderTakeDrugWindowViewModel.cs +++ b/DM_Weight/ViewModels/MultiOrderTakeDrugWindowViewModel.cs @@ -19,46 +19,46 @@ namespace DM_Weight.ViewModels public class MultiOrderTakeDrugWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime { public static MultiOrderTakeDrugWindowViewModel vm; - private int _pageNum = 1; - public int PageNum - { - get => _pageNum; - set - { - SetProperty(ref _pageNum, value); - RequestData(); - } - } + //private int _pageNum = 1; + //public int PageNum + //{ + // get => _pageNum; + // set + // { + // SetProperty(ref _pageNum, value); + // RequestData(); + // } + //} - private int _pageCount = 1; - public int PageCount - { - get => _pageCount; - set - { - SetProperty(ref _pageCount, value); - } - } + //private int _pageCount = 1; + //public int PageCount + //{ + // get => _pageCount; + // set + // { + // SetProperty(ref _pageCount, value); + // } + //} - private int _pageSize = 8; - public int PageSize - { - get => _pageSize; - set - { - SetProperty(ref _pageSize, value); - } - } + //private int _pageSize = 8; + //public int PageSize + //{ + // get => _pageSize; + // set + // { + // SetProperty(ref _pageSize, value); + // } + //} - private int _totalCount = 0; - public int TotalCount - { - get => _totalCount; - set - { - SetProperty(ref _totalCount, value); - } - } + //private int _totalCount = 0; + //public int TotalCount + //{ + // get => _totalCount; + // set + // { + // SetProperty(ref _totalCount, value); + // } + //} IDialogService _dialogService; @@ -302,7 +302,7 @@ namespace DM_Weight.ViewModels public void RequestData() { OrderInfos.Clear(); - int totalCount = 0; + //int totalCount = 0; //string SearchValue = null; //if (SearchValue != null) //{ @@ -320,8 +320,8 @@ namespace DM_Weight.ViewModels .Where(oi => oi.CancelFlag == 0) .GroupBy(oi => oi.OrderNo) .Select(oi => oi) - .ToPageList(PageNum, PageSize, ref totalCount); - //.ToList(); + //.ToPageList(PageNum, PageSize, ref totalCount); + .ToList(); OrderInfos = new ObservableCollection(queryData); if (OrderDepartments.Where(d => d.DeptName == "全部").ToList().Count <= 0) @@ -341,8 +341,8 @@ namespace DM_Weight.ViewModels OrderDepartments.Add(dept); } } - TotalCount = totalCount; - PageCount = (int)Math.Ceiling((double)TotalCount / PageSize); + //TotalCount = totalCount; + //PageCount = (int)Math.Ceiling((double)TotalCount / PageSize); } diff --git a/DM_Weight/Views/Dialog/MultiOrderTakeDialog.xaml b/DM_Weight/Views/Dialog/MultiOrderTakeDialog.xaml index 65dd796..e1f3cdc 100644 --- a/DM_Weight/Views/Dialog/MultiOrderTakeDialog.xaml +++ b/DM_Weight/Views/Dialog/MultiOrderTakeDialog.xaml @@ -56,13 +56,13 @@ HorizontalAlignment="Left" Style="{StaticResource MaterialDesignBody2TextBlock}" Text="{Binding MultiOrderNo}" /> - + Text="{Binding OrderInfo.OrderNo}" />--> diff --git a/DM_Weight/Views/MultiOrderTakeDrugWindow.xaml b/DM_Weight/Views/MultiOrderTakeDrugWindow.xaml index 360f414..f4c8696 100644 --- a/DM_Weight/Views/MultiOrderTakeDrugWindow.xaml +++ b/DM_Weight/Views/MultiOrderTakeDrugWindow.xaml @@ -5,8 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:pagination="clr-namespace:DM_Weight.Components.pagination" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:convert="clr-namespace:DM_Weight.Converter" mc:Ignorable="d" Loaded="UserControl_Loaded"> @@ -141,11 +140,11 @@ - + />-->