From 0bc354228127638b9cdc542e6e6a4b335d4491cb Mon Sep 17 00:00:00 2001 From: maqiao <625215135@qq.com> Date: Wed, 31 Jul 2024 14:28:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A9=BA=E7=93=B6=E9=94=80?= =?UTF-8?q?=E6=AF=81=E4=B8=BA=E7=A9=BA=E7=93=B6=E5=8F=96=E5=87=BA=EF=BC=8C?= =?UTF-8?q?=E5=8A=A0=E5=BC=80=E6=8A=BD=E5=B1=89=E6=93=8D=E4=BD=9C=20?= =?UTF-8?q?=E5=8A=A0=E6=A0=B9=E6=8D=AE=E5=A4=84=E6=96=B9=E5=8F=96=E8=8D=AF?= =?UTF-8?q?=E5=93=81=EF=BC=8C=E5=8F=96=E5=87=BA=E5=BE=85=E5=8F=96=E5=A4=84?= =?UTF-8?q?=E6=96=B9=E4=B8=8B=E7=9A=84=E6=89=80=E6=9C=89=E8=8D=AF=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DM_Weight/App.xaml.cs | 7 + DM_Weight/Models/ChannelStock.cs | 3 + DM_Weight/Models/OrderDetail.cs | 12 + .../ViewModels/DestoryEmptyDialogViewModel.cs | 113 +++- .../OrderTakeAllDrugDialogViewModel.cs | 636 ++++++++++++++++++ .../OrderTakeDrugNewWindowViewModel.cs | 295 ++++++++ .../ViewModels/OrderTakeNewDialogViewModel.cs | 185 +++++ .../ViewModels/RoleManagerWindowViewModel.cs | 24 +- .../Views/Dialog/DestoryEmptyDialog.xaml | 37 +- .../Views/Dialog/OrderTakeAllDrugDialog.xaml | 150 +++++ .../Dialog/OrderTakeAllDrugDialog.xaml.cs | 28 + .../Views/Dialog/OrderTakeNewDialog.xaml | 178 +++++ .../Views/Dialog/OrderTakeNewDialog.xaml.cs | 28 + DM_Weight/Views/OrderTakeDrugNewWindow.xaml | 152 +++++ .../Views/OrderTakeDrugNewWindow.xaml.cs | 28 + 15 files changed, 1847 insertions(+), 29 deletions(-) create mode 100644 DM_Weight/ViewModels/OrderTakeAllDrugDialogViewModel.cs create mode 100644 DM_Weight/ViewModels/OrderTakeDrugNewWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/OrderTakeNewDialogViewModel.cs create mode 100644 DM_Weight/Views/Dialog/OrderTakeAllDrugDialog.xaml create mode 100644 DM_Weight/Views/Dialog/OrderTakeAllDrugDialog.xaml.cs create mode 100644 DM_Weight/Views/Dialog/OrderTakeNewDialog.xaml create mode 100644 DM_Weight/Views/Dialog/OrderTakeNewDialog.xaml.cs create mode 100644 DM_Weight/Views/OrderTakeDrugNewWindow.xaml create mode 100644 DM_Weight/Views/OrderTakeDrugNewWindow.xaml.cs diff --git a/DM_Weight/App.xaml.cs b/DM_Weight/App.xaml.cs index c8816a3..c432a67 100644 --- a/DM_Weight/App.xaml.cs +++ b/DM_Weight/App.xaml.cs @@ -127,6 +127,13 @@ namespace DM_Weight #region 取药 // 处方取药页面 containerRegistry.RegisterForNavigation(); + + + containerRegistry.RegisterForNavigation(); + containerRegistry.RegisterForNavigation(); + containerRegistry.RegisterForNavigation(); + + // 处方取药模态框 containerRegistry.RegisterDialog(); containerRegistry.RegisterForNavigation(); diff --git a/DM_Weight/Models/ChannelStock.cs b/DM_Weight/Models/ChannelStock.cs index 98690e6..729e9c5 100644 --- a/DM_Weight/Models/ChannelStock.cs +++ b/DM_Weight/Models/ChannelStock.cs @@ -191,5 +191,8 @@ namespace DM_Weight.Models [SugarColumn(IsIgnore = true)] public int? MachineRecordId { get; set; } + [SugarColumn(IsIgnore =true)] + public string OrderNos { get; set; } + } } \ No newline at end of file diff --git a/DM_Weight/Models/OrderDetail.cs b/DM_Weight/Models/OrderDetail.cs index 109654c..007df39 100644 --- a/DM_Weight/Models/OrderDetail.cs +++ b/DM_Weight/Models/OrderDetail.cs @@ -127,5 +127,17 @@ namespace DM_Weight.Models /// [SugarColumn(ColumnName = "use_dosage")] public string UseDosage { get; set; } + + + + //[Navigate(NavigateType.ManyToOne, nameof(OrderNo))] + //public OrderInfo _OrderInfo { get; set; } + + [SugarColumn(IsIgnore =true)] + public string DrawerNo { get; set; } + + + [SugarColumn(IsIgnore =true)] + public string ColNo { get; set; } } } \ No newline at end of file diff --git a/DM_Weight/ViewModels/DestoryEmptyDialogViewModel.cs b/DM_Weight/ViewModels/DestoryEmptyDialogViewModel.cs index 42c43d8..9640260 100644 --- a/DM_Weight/ViewModels/DestoryEmptyDialogViewModel.cs +++ b/DM_Weight/ViewModels/DestoryEmptyDialogViewModel.cs @@ -1,5 +1,6 @@ using DM_Weight.Models; using DM_Weight.msg; +using DM_Weight.Port; using DM_Weight.util; using Prism.Commands; using Prism.Events; @@ -15,6 +16,7 @@ using System.Reflection.PortableExecutable; using System.Text; using System.Threading.Channels; using System.Threading.Tasks; +using System.Windows.Threading; using static Unity.Storage.RegistrationSet; namespace DM_Weight.ViewModels @@ -23,7 +25,7 @@ namespace DM_Weight.ViewModels { public bool KeepAlive => false; - public string Title => "空瓶销毁"; + public string Title => "空瓶取出"; private List _machineRecords = new(); @@ -54,12 +56,66 @@ namespace DM_Weight.ViewModels get => _channelStock; set => SetProperty(ref _channelStock, value); } - IEventAggregator _eventAggregator; - public DestoryEmptyDialogViewModel(IEventAggregator eventAggregator) + + + private IEnumerable> enumerable; + private IEnumerator> enumerator; + + private int _status = 0; + + public int Status { + get => _status; set => SetProperty(ref _status, value); + } + private PortUtil _portUtil; + IEventAggregator _eventAggregator; + public DestoryEmptyDialogViewModel(PortUtil portUtil, IEventAggregator eventAggregator) + { + _portUtil = portUtil; _eventAggregator = eventAggregator; } + void DoMyPrismEvent(DeviceMsg msg) + { + if (msg.WindowName == "DrawerTakeDrugWindow") + { + switch (msg.EventType) + { + // 抽屉打开 + case EventType.DRAWEROPEN: + if (Status == 1) + { + Status = 2; + } + break; + // 抽屉关闭 + case EventType.DRAWERCLOSE: + if (Status == 2) + { + Status = 3; + } + break; + // 数量变化 + case EventType.UPDATEQUANTITY: + if (Status == 2) + { + _ChannelStock.TakeQuantity = msg.Quantitys[_ChannelStock.ColNo - 1]; + } + break; + // 打开失败 + case EventType.OPENERROR: + AlertMsg alertMsg = new AlertMsg + { + Message = msg.Message, + Type = MsgType.ERROR, + }; + _eventAggregator.GetEvent().Publish(alertMsg); + Status = 0; + break; + } + } + + } public event Action RequestClose; public bool CanCloseDialog() @@ -69,11 +125,13 @@ namespace DM_Weight.ViewModels public void OnDialogClosed() { - + // 取消消息订阅 + _eventAggregator.GetEvent().Unsubscribe(DoMyPrismEvent); } public void OnDialogOpened(IDialogParameters parameters) { + _eventAggregator.GetEvent().Subscribe(DoMyPrismEvent); ChannelStock _record = parameters.GetValue("channel"); _ChannelStock = _record; @@ -137,6 +195,39 @@ namespace DM_Weight.ViewModels /// public DelegateCommand DestoryEmptyCommand { + get => new DelegateCommand(() => + { + if (Status == 0) + { + Status = 1; + //_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉"); + + //IEnumerable strDrugName = _MachineRecords.Select(cs => cs.DrugInfo.DrugName); + //string strNames = string.Empty; + //foreach (string name in strDrugName) + //{ + // if (!strNames.Contains(name)) + // { + // strNames += name + ";"; + // } + //} + int sumQuantity = _MachineRecords.FindAll(it => it.IsSelected).Sum(cs => cs.Quantity); + _portUtil.SpeakAsync($"正在打开 {_ChannelStock.DrawerNo} 号抽屉,请取出空瓶 {_ChannelStock.DrugInfo.DrugName} ,数量共计 {sumQuantity}"); + + + _portUtil.WindowName = "DrawerTakeDrugWindow"; + _portUtil.BoardType = _ChannelStock.BoardType; + _portUtil.ColNos=new int[] { _ChannelStock.ColNo }; + _portUtil.DrawerNo = _ChannelStock.DrawerNo; + Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Normal, () => _portUtil.Start()) + ; + } + + }); + } + + + public DelegateCommand TakeFinish { get => new DelegateCommand(() => { List records = _MachineRecords.FindAll(it => it.IsSelected).ToList(); @@ -146,16 +237,18 @@ namespace DM_Weight.ViewModels { for (int i = 0; i < records.Count; i++) { - MachineRecord record= records[i]; + MachineRecord record = records[i]; //修改库存数量 - _ChannelStock.Quantity = _ChannelStock.Quantity - record.Quantity; + _ChannelStock.Quantity = _ChannelStock.Quantity - record.Quantity; SqlSugarHelper.Db.Updateable(_ChannelStock).ExecuteCommand(); + + //修改记录表中状态 SqlSugarHelper.Db.Updateable(record).ReSetValue(mr => { - mr.IsDestroy = 1; + mr.IsDestroy = 1; }).ExecuteCommand(); //记录销毁明细 @@ -179,7 +272,7 @@ namespace DM_Weight.ViewModels RequestData(); AlertMsg alertMsg = new AlertMsg { - Message = "销毁完成", + Message = "取出完成", Type = MsgType.SUCCESS, }; _eventAggregator.GetEvent().Publish(alertMsg); @@ -189,7 +282,7 @@ namespace DM_Weight.ViewModels { AlertMsg alertMsg = new AlertMsg { - Message = "销毁失败!", + Message = "取出失败!", Type = MsgType.ERROR, }; _eventAggregator.GetEvent().Publish(alertMsg); @@ -199,7 +292,7 @@ namespace DM_Weight.ViewModels { AlertMsg alertMsg = new AlertMsg { - Message = "请选择要销毁的数据", + Message = "请选择要取空瓶的数据", Type = MsgType.ERROR, }; _eventAggregator.GetEvent().Publish(alertMsg); diff --git a/DM_Weight/ViewModels/OrderTakeAllDrugDialogViewModel.cs b/DM_Weight/ViewModels/OrderTakeAllDrugDialogViewModel.cs new file mode 100644 index 0000000..68fe70e --- /dev/null +++ b/DM_Weight/ViewModels/OrderTakeAllDrugDialogViewModel.cs @@ -0,0 +1,636 @@ +using DM_Weight.Models; +using DM_Weight.msg; +using DM_Weight.Port; +using DM_Weight.select; +using DM_Weight.util; +using log4net; +using MaterialDesignThemes.Wpf; +using Prism.Commands; +using Prism.Events; +using Prism.Mvvm; +using Prism.Regions; +using Prism.Services.Dialogs; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace DM_Weight.ViewModels +{ + public class OrderTakeAllDrugDialogViewModel : BindableBase, IDialogAware, IRegionMemberLifetime + { + private readonly ILog logger = LogManager.GetLogger(typeof(OrderTakeDialogViewModel)); + public string Title => "处方取药"; + + + public event Action RequestClose; + + private static readonly DateTime Jan1st1970 = new DateTime + (1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + + private PortUtil _portUtil; + IEventAggregator _eventAggregator; + IDialogService _dialogService; + public OrderTakeAllDrugDialogViewModel(PortUtil portUtil, IEventAggregator eventAggregator, IDialogService DialogService) + { + _dialogService = DialogService; + _portUtil = portUtil; + _eventAggregator = eventAggregator; + } + void DoMyPrismEvent(DeviceMsg msg) + { + + if (msg.WindowName == "OrderTakeDrugWindow") + { + IGrouping grouping = enumerator.Current; + int DrawerNo = grouping.Key; + List channelStocks = grouping.ToList(); + + switch (msg.EventType) + { + // 抽屉打开 + case EventType.DRAWEROPEN: + if (Status == 1) + { + if (channelStocks[0].process == 1) + { + channelStocks.ForEach(it => it.process = 2); + } + } + + break; + // 抽屉关闭 + case EventType.DRAWERCLOSE: + if (Status == 1) + { + if (channelStocks[0].process == 2) + { + channelStocks.ForEach(it => it.process = 3); + } + IGrouping groupingBefore = enumerator.Current; + int DrawerNoBefore = groupingBefore.Key; + if (enumerator.MoveNext()) + { + IGrouping groupingAfter = enumerator.Current; + int DrawerNoAfter = groupingAfter.Key; + if (DrawerNoBefore < 9 && DrawerNoAfter > 8) + { + Thread.Sleep(50); + } + OpenOneByOne(); + } + // 已经全部取出 + else + { + Status = 3; + } + } + break; + // 数量变化 + case EventType.UPDATEQUANTITY: + if (Status == 1) + { + logger.Info($"抽屉【{DrawerNo}】库位取药数量【{msg.Quantitys}】"); + } + break; + // 打开失败 + case EventType.OPENERROR: + AlertMsg alertMsg = new AlertMsg + { + Message = msg.Message, + Type = MsgType.ERROR, + }; + _eventAggregator.GetEvent().Publish(alertMsg); + Status = 0; + break; + } + } + + } + + private int _status = 0; + + public int Status + { + get => _status; set => SetProperty(ref _status, value); + } + + private OrderInfo? _orderInfo; + + + public OrderInfo? OrderInfo + { + get => _orderInfo; + set => SetProperty(ref _orderInfo, value); + } + + private List orderDetails { get; set; } + + private List orderInfos { get; set; } + + private List _channelStocks; + + public List ChannelStocks + { + get => _channelStocks; + set => SetProperty(ref _channelStocks, value); + } + + private IEnumerable> enumerable; + private IEnumerator> enumerator; + + + public bool CanCloseDialog() + { + return Status == 0; + } + + public void OnDialogClosed() + { + // 取消消息订阅 + _eventAggregator.GetEvent().Unsubscribe(DoMyPrismEvent); + } + string orderDate; + OrderTakeSelect selectedItem; + string? searchValue; + public void OnDialogOpened(IDialogParameters parameters) + { + _eventAggregator.GetEvent().Subscribe(DoMyPrismEvent); + orderDate = parameters.GetValue("OrderDate"); + selectedItem = parameters.GetValue("SelectedItem"); + searchValue = parameters.GetValue("SearchValue"); + //OrderInfo = o; + RequestData(); + } + public async void RequestData() + { + try + { + orderDetails = SqlSugarHelper.Db.Queryable() + .InnerJoin((od, oi) => oi.DmStatus == 0 && oi.HisDispFlag == 0 && oi.CancelFlag == 0 && od.OrderNo == oi.OrderNo) + .InnerJoin(SqlSugarHelper.Db.Queryable().Where(cs => cs.DrawerType == 1).Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrugId), (od, oi, t) => od.DrugId == t.DrugId) + .WhereIF(orderDate != null, (od, oi) => oi.OrderDate.ToString("yyyy-MM-dd") == orderDate) + .WhereIF(!String.IsNullOrEmpty(searchValue) && selectedItem.Code.Equals("OrderNo"), (od, oi) => oi.OrderNo == searchValue) + .WhereIF(!String.IsNullOrEmpty(searchValue) && selectedItem.Code.Equals("PatientId"), (od, oi) => oi.PatientId == searchValue) + .WhereIF(!String.IsNullOrEmpty(ConfigurationManager.AppSettings["storage"]), (od, oi) => oi.Pharmacy == ConfigurationManager.AppSettings["storage"]) + .Includes(od => od.DrugInfo) + .ToList(); + if (orderDetails == null || orderDetails.Count <= 0) + { + AlertMsg alertMsg = new AlertMsg + { + Message = "没有处方数据", + Type = MsgType.ERROR + }; + _eventAggregator.GetEvent().Publish(alertMsg); + return; + } + IEnumerable> groupOrderDetails = orderDetails.GroupBy(it => it.DrugId); + + + + List channelStocks = new List(); + List msg = new List(); + + foreach (var orderGroup in groupOrderDetails) + { + int quantity = orderGroup.Sum(it => it.Quantity); + foreach (var orderDetail in orderGroup) + { + List HasQChannels = SqlSugarHelper.Db.Queryable() + .Includes(cs => cs.DrugInfo) + .Where(cs => cs.Quantity > 0) + .Where(cs => cs.DrawerType == 1) + .Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM3")) + .WhereIF(!string.IsNullOrEmpty(orderDetail.SetEffDate), cs => cs.EffDate.Equals(orderDetail.SetEffDate)) + .WhereIF(!string.IsNullOrEmpty(orderDetail.SetManuNo), cs => cs.ManuNo.Equals(orderDetail.SetManuNo)) + .Where(cs => cs.DrugId == orderDetail.DrugId) + .OrderBy(cs => cs.EffDate) + .OrderBy(cs => cs.DrawerNo) + .ToList(); + int total = HasQChannels.Sum(it => it.Quantity); + int TakeQ = quantity; + // 说明数量足够 + if (total >= TakeQ) + { + for (int j = 0; TakeQ > 0; j++) + { + ChannelStock stock = HasQChannels[j]; + if (TakeQ > stock.Quantity) + { + stock.TakeQuantity = stock.Quantity; + channelStocks.Add(stock); + TakeQ -= stock.Quantity; + orderDetail.DrawerNo += stock.DrawerNo + ","; + orderDetail.ColNo += stock.ColNo + ","; + orderDetail.SetManuNo += stock.ManuNo + ","; + orderDetail.SetEffDate += stock.EffDate + ","; + } + else + { + stock.TakeQuantity = TakeQ; + channelStocks.Add(stock); + TakeQ = 0; + orderDetail.DrawerNo += stock.DrawerNo + ","; + orderDetail.ColNo += stock.ColNo + ","; + orderDetail.SetManuNo += stock.ManuNo + ","; + orderDetail.SetEffDate += stock.EffDate + ","; + } + } + break; + } + else + { + msg.Add($"药品【{orderDetail.DrugInfo.DrugName}】库存不足,应取【{TakeQ}】库存【{total}】"); + } + + } + } + if (msg.Count > 0) + { + RequestClose?.Invoke(new DialogResult(ButtonResult.Cancel)); + //MessageBox.Show(string.Join("\n", msg)); + DialogParameters dialogParameters = new DialogParameters(); + dialogParameters.Add("msgInfo", msg); + DialogServiceExtensions.ShowDialogHost(_dialogService, "ShowMessageDialog", dialogParameters, "RootDialog"); + + } + else + { + channelStocks.Sort((a, b) => + { + if ((a.DrawerNo - b.DrawerNo) == 0) + { + return a.ColNo - b.ColNo; + } + return a.DrawerNo - b.DrawerNo; + }); + ChannelStocks = channelStocks; + + + } + + } + catch (Exception ex) + { + logger.Info($"处方取药异常:{ex.Message}"); + } + } + public DelegateCommand OpenDrawer + { + get => new DelegateCommand(async () => + { + if (Status == 0) + { + enumerable = ChannelStocks.GroupBy(cs => cs.DrawerNo, cs => cs); + enumerator = enumerable.GetEnumerator(); + enumerator.MoveNext(); + Status = 1; + OpenOneByOne(); + } + + }); + } + + private void OpenOneByOne() + { + IGrouping grouping = enumerator.Current; + int DrawerNo = grouping.Key; + List channelStocks = grouping.ToList(); + channelStocks.ForEach(it => it.process = 1); + + + IEnumerable strDrugName = channelStocks.Select(cs => cs.DrugInfo.DrugName); + string strNames = string.Empty; + foreach (string name in strDrugName) + { + if (!strNames.Contains(name)) + { + strNames += name + ";"; + } + } + int sumQuantity = channelStocks.Sum(cs => cs.TakeQuantity); + _portUtil.SpeakAsync($"正在打开 {DrawerNo} 号抽屉,请取药 {strNames} ,数量共计 {sumQuantity}"); + + + List singleChannels = channelStocks.FindAll(it => it.BoardType != 1); + + // 发送取药数量 + singleChannels.ForEach(it => + { + try + { + + _portUtil.TakeQuantity(DrawerNo, it.ColNo, it.TakeQuantity, it.Quantity - it.TakeQuantity); + } + catch (Exception ex) + { + AlertMsg alertMsg = new AlertMsg + { + Message = $"打开抽屉异常{ex.Message}", + Type = MsgType.ERROR, + }; + _eventAggregator.GetEvent().Publish(alertMsg); + } + }); + + _portUtil.WindowName = "OrderTakeDrugWindow"; + _portUtil.BoardType = singleChannels.Count > 0 ? singleChannels[0].BoardType : 1; + _portUtil.ColNos = singleChannels.Select(it => it.ColNo).ToArray(); + _portUtil.DrawerNo = DrawerNo; + _portUtil.Start(); + } + + private bool _isFinishClick = false; + // 完成按钮 + public DelegateCommand TakeFinish + { + get => new DelegateCommand(() => + { + if (!_isFinishClick) + { + _isFinishClick = true; + + if (orderDetails == null || orderDetails.Count <= 0) + { + AlertMsg alertMsg = new AlertMsg + { + Message = "没有处方数据", + Type = MsgType.ERROR + }; + _eventAggregator.GetEvent().Publish(alertMsg); + return; + } + + IEnumerable> enumerableOrderDetails = orderDetails.GroupBy(it => it.OrderNo); + var f = SqlSugarHelper.Db.UseTran(() => + { + for (int i = 0; i < ChannelStocks.Count; i++) + { + ChannelStock it = ChannelStocks[i]; + // 更新数据 库存信息 + SqlSugarHelper.Db.Updateable(new ChannelStock() + { + Quantity = it.Quantity - it.TakeQuantity, + ManuNo = it.ManuNo, + EffDate = it.EffDate, + Id = it.Id, + }).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate }).ExecuteCommand(); + + } + + foreach (var orderGroup in enumerableOrderDetails) + { + int iQuantity = 0; + foreach (var orderDetail in orderGroup) + { + OrderInfo orderInfo = SqlSugarHelper.Db.Queryable().Where(oi => oi.OrderNo == orderDetail.OrderNo).First(); + SqlSugarHelper.Db.Updateable(new OrderInfo() + { + DmStatus = 1, + OrderNo = orderDetail.OrderNo + }).UpdateColumns(it => new { it.DmStatus }).WhereColumns(it => new { it.OrderNo }).ExecuteCommand(); + + SqlSugarHelper.Db.Insertable(new OrderFinish() + { + OrderNo = orderDetail.OrderNo, + PatientId = orderDetail.PatientId, + Pharmacy = orderInfo.Pharmacy, + State = 1, + Operator = HomeWindowViewModel.Operator?.Nickname, + }); + //查询药品对应库存表的库位及批次、效期信息 + List stockList= ChannelStocks.Where(cs => cs.DrugId == orderDetail.DrugId).OrderBy(cs=>cs.EffDate).ToList(); + int iOrderDetailQuantity = -1; + string manuNo = string.Empty; + string effDate = string.Empty; + int drawerNo = 0; + int colNo = 0; + if (stockList.Count> 1) + { + iOrderDetailQuantity = orderDetail.Quantity; + for (int i = 0; i < stockList.Count; i++) + { + if (iOrderDetailQuantity>0&&stockList[i].Quantity- iOrderDetailQuantity > 0) + { + stockList[i].Quantity = stockList[i].Quantity - iOrderDetailQuantity; + break; + } + else + { + iOrderDetailQuantity = iOrderDetailQuantity - stockList[i].Quantity; + stockList[i].Quantity = 0; + if(iOrderDetailQuantity==0) + { + manuNo = stockList[i].ManuNo; + effDate = stockList[i].EffDate; + drawerNo = stockList[i].DrawerNo; + colNo= stockList[i].ColNo; + break; + } + } + } + } + ChannelStock cs = null; + if (iOrderDetailQuantity==0) + { + cs = ChannelStocks.Where(cs => cs.DrugId == orderDetail.DrugId && cs.ManuNo == manuNo&&cs.EffDate==effDate&&cs.DrawerNo==drawerNo&&cs.ColNo==colNo).OrderBy(cs => cs.EffDate).FirstOrDefault(); + } + else + { + cs = ChannelStocks.Where(cs => cs.DrugId == orderDetail.DrugId && cs.Quantity > 0).OrderBy(cs => cs.EffDate).FirstOrDefault(); + } + + if (cs != null) + { + + SqlSugarHelper.Db.Insertable(new MachineRecord() + { + MachineId = ConfigurationManager.AppSettings["machineId"].ToString(), + DrawerNo = cs.DrawerNo, + ColNo = cs.ColNo, + DrugId = cs.DrugId, + ManuNo = cs.ManuNo, + EffDate = !String.IsNullOrEmpty(cs.EffDate) ? DateTime.ParseExact(cs.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null, + Operator = HomeWindowViewModel.Operator?.Id, + Reviewer = HomeWindowViewModel.Reviewer?.Id, + OperationTime = DateTime.Now, + Quantity = orderDetail.Quantity, + Type = 2, + InvoiceId = orderDetail.OrderNo + //, StockQuantity = nowChannels.Sum(it => it.Quantity) + }).ExecuteCommand(); + } + //保存账册 + int iInsertResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() + { + DrugId = Convert.ToInt32(orderDetail.DrugId), + Type = 2, + Department = orderInfo.DeptName, + OrderNo = orderDetail.OrderNo, + ManuNo = cs.ManuNo, + EffDate = cs.EffDate, + OutQuantity = orderDetail.Quantity, + UserId1 = HomeWindowViewModel.Operator?.Id, + UserId2 = HomeWindowViewModel.Reviewer?.Id, + MachineId = ConfigurationManager.AppSettings["machineId"].ToString(), + CreateDate = DateTime.Now.ToString("yyyy-MM-dd"), + CreateTime = DateTime.Now, + InvoiceNo = orderDetail.OrderNo + + }).ExecuteCommand(); + //修改凌晨生成的日结存与总结存数据 + AccountBookG2 accountBookG2Day = SqlSugarHelper.Db.Queryable() + .Where(ab => ab.MachineId.Equals(ConfigurationManager.AppSettings["machineId"].ToString())) + .Where(ab => ab.Type == 3) + .Where(ab => ab.DrugId == Convert.ToInt32(orderDetail.DrugId)) + .Where(ab => ab.ManuNo == cs.ManuNo) + .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); + if (accountBookG2Day != null) + { + accountBookG2Day.ManuStock = accountBookG2Day.ManuStock - orderDetail.Quantity; + SqlSugarHelper.Db.Updateable(accountBookG2Day).ExecuteCommand(); + } + else + { + //生成日结存时可能没有该库位的绑定信息,需要写入日结存 + int iDayResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() + { + DrugId = Convert.ToInt32(orderDetail.DrugId), + Type = 3, + ManuNo = cs.ManuNo, + EffDate = cs.EffDate, + YQuantity = 0, + ManuStock = orderDetail.Quantity, + TotalStock = orderDetail.Quantity, + UserId1 = HomeWindowViewModel.Operator?.Id, + UserId2 = HomeWindowViewModel.Reviewer?.Id, + MachineId = ConfigurationManager.AppSettings["machineId"].ToString(), + CreateDate = DateTime.Now.ToString("yyyy-MM-dd"), + InvoiceNo = "日结存" + }).ExecuteCommand(); + if (iDayResult <= 0) + { + logger.Info($"未写入日结存数据{orderDetail.DrugId}-{cs.ManuNo}-{cs.EffDate}-{cs.Quantity}"); + } + } + //修改凌晨生成的日结存与总结存数据 + AccountBookG2 accountBookG2Total = SqlSugarHelper.Db.Queryable() + .Where(ab => ab.MachineId.Equals(ConfigurationManager.AppSettings["machineId"].ToString())) + .Where(ab => ab.Type == 4) + .Where(ab => ab.DrugId == Convert.ToInt32(orderDetail.DrugId)) + .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First(); + if (accountBookG2Total != null) + { + accountBookG2Total.TotalStock = accountBookG2Total.TotalStock - orderDetail.Quantity; + SqlSugarHelper.Db.Updateable(accountBookG2Total).ExecuteCommand(); + } + else + { + //生成总结存时可能没有该库位的绑定信息,需要写入总结存 + int iTotalResult = SqlSugarHelper.Db.Insertable(new AccountBookG2() + { + DrugId = Convert.ToInt32(orderDetail.DrugId), + Type = 4, + YQuantity = 0, + ManuStock = orderDetail.Quantity, + TotalStock = orderDetail.Quantity, + UserId1 = HomeWindowViewModel.Operator?.Id, + UserId2 = HomeWindowViewModel.Reviewer?.Id, + MachineId = ConfigurationManager.AppSettings["machineId"].ToString(), + CreateDate = DateTime.Now.ToString("yyyy-MM-dd"), + InvoiceNo = "总结存" + }).ExecuteCommand(); + if (iTotalResult <= 0) + { + logger.Info($"未写入总结存数据{orderDetail.DrugId}-{orderDetail.Quantity}"); + } + } + } + } + return true; + }); + if (f.Data) + { + // 更新屏显库存 + List singleChannels = ChannelStocks.FindAll(it => it.BoardType == 5); + if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1) == 5) + { + singleChannels.ForEach(it => + { + _portUtil.WriteQuantity(it.DrawerNo, it.ColNo, it.Quantity - it.TakeQuantity); + }); + } + AlertMsg alertMsg = new AlertMsg + { + Message = "抽屉取药完成,库存已更新", + Type = MsgType.SUCCESS, + }; + _eventAggregator.GetEvent().Publish(alertMsg); + } + if (!f.IsSuccess) + { + AlertMsg alertMsg = new AlertMsg + { + Message = "抽屉取药完成,库存更新失败!", + Type = MsgType.ERROR, + }; + _eventAggregator.GetEvent().Publish(alertMsg); + } + Status = 0; + _isFinishClick = false; + //RequestClose?.Invoke(new DialogResult(ButtonResult.Cancel)); + RequestClose?.Invoke(new DialogResult(ButtonResult.OK)); + } + else + { + _isFinishClick = false; + AlertMsg alertMsg = new AlertMsg + { + Message = "正在操作,请稍后", + Type = MsgType.ERROR + }; + _eventAggregator.GetEvent().Publish(alertMsg); + } + + }); + } + + public long CurrentTimeMillis() + { + return (long)(DateTime.UtcNow - Jan1st1970).TotalMilliseconds; + } + + // 取消按钮 + public DelegateCommand CancleTake + { + get => new DelegateCommand(() => + { + _portUtil.ResetData(); + Status = 0; + }); + } + + public DelegateCommand BtnCloseCommand + { + get => new DelegateCommand(() => + { + if (Status != 0) + { + _portUtil.ResetData(); + Status = 0; + } + //DialogParameters parameters = new DialogParameters(); + //parameters.Add("",); + // 关闭当前窗口 + RequestClose?.Invoke(new DialogResult(ButtonResult.Cancel)); + }); + } + + public bool KeepAlive => false; + } +} diff --git a/DM_Weight/ViewModels/OrderTakeDrugNewWindowViewModel.cs b/DM_Weight/ViewModels/OrderTakeDrugNewWindowViewModel.cs new file mode 100644 index 0000000..65c40c7 --- /dev/null +++ b/DM_Weight/ViewModels/OrderTakeDrugNewWindowViewModel.cs @@ -0,0 +1,295 @@ +using DM_Weight.Models; +using DM_Weight.msg; +using DM_Weight.select; +using DM_Weight.util; +using Prism.Commands; +using Prism.Events; +using Prism.Mvvm; +using Prism.Regions; +using Prism.Services.Dialogs; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DM_Weight.ViewModels +{ + public class OrderTakeDrugNewWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime + { + 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 _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); + } + } + + + IDialogService _dialogService; + IEventAggregator _eventAggregator; + + private DelegateCommand _rowSelected; + + public DelegateCommand RowSelected => _rowSelected ??= new DelegateCommand(OpenOrderDialog); + + public OrderTakeDrugNewWindowViewModel(IDialogService DialogService, IEventAggregator eventAggregator) + { + _dialogService = DialogService; + _eventAggregator = eventAggregator; + } + + public static List StaticOrderTakeSelects = new() + { + new OrderTakeSelect + { + Code = "OrderNo", + Name = "处方号" + }, + new OrderTakeSelect + { + Code = "PatientId", + Name = "患者编号" + } + }; + + private List _orderTakeSelects = StaticOrderTakeSelects; + + public List OrderTakeSelects + { + get { return _orderTakeSelects; } + set + { + SetProperty(ref _orderTakeSelects, value); + } + } + + private OrderTakeSelect _selectedItem = StaticOrderTakeSelects[0]; + /// + /// 查询条件 查询字段 + /// + public OrderTakeSelect SelectedItem + { + get { return _selectedItem; } + set + { + SetProperty(ref _selectedItem, value); + RequestData(); + } + } + + private OrderInfo? _selectedOrder; + + public OrderInfo? SelectedOrder + { + get { return _selectedOrder; } + set + { + SetProperty(ref _selectedOrder, value); + + //OpenOrderDialog(); + } + } + + + private string _orderDate = DateTime.Now.ToString("yyyy-MM-dd"); + /// + /// 查询条件 处方日期 + /// + public string OrderDate + { + get { return _orderDate; } + set + { + if (!String.IsNullOrEmpty(value)) + { + SetProperty(ref _orderDate, DateTime.Parse(value).ToString("yyyy-MM-dd")); + } + else + { + SetProperty(ref _orderDate, value); + } + + RequestData(); + } + } + + private string? _searchValue; + + /// + /// 查询条件 查询字段值 + /// + public string? SearchValue + { + get { return _searchValue; } + set + { + SetProperty(ref _searchValue, value); + RequestData(); + } + } + + private List _orderInfos = new(); + + public List OrderInfos { get { return _orderInfos; } set { SetProperty(ref _orderInfos, value); } } + + public bool KeepAlive => false; + + public async void OpenOrderDialog() + { + if (SelectedOrder != null && SelectedOrder.DmStatus == 0 && SelectedOrder.CancelFlag == 0 && SelectedOrder.HisDispFlag == 0) + { + // 此处延时1毫秒,等待页面渲染 + await Task.Delay(TimeSpan.FromMilliseconds(1)); + DialogParameters dialogParameters = new DialogParameters(); + dialogParameters.Add("orderInfo", SelectedOrder); + DialogServiceExtensions.ShowDialogHost(_dialogService, "OrderTakeNewDialog", dialogParameters, DoDialogResult, "RootDialog"); + + } + + } + + + private void DoDialogResult(IDialogResult dialogResult) + { + // 委托 被动执行 被子窗口执行 + // dialogResult 第一方面可以拿到任意参数 第二方面 可判断关闭状态 + //if(dialogResult.Result == ButtonResult.OK) + //{ + SelectedOrder = null; + RequestData(); + //} + //MessageBox.Show("返回值:" + dialogResult.Result.ToString()); + } + + + //这个方法用于拦截请求,continuationCallback(true)就是不拦截,continuationCallback(false)拦截本次操作 + public void ConfirmNavigationRequest(NavigationContext navigationContext, Action continuationCallback) + { + continuationCallback(true); + } + + public DelegateCommand QueryCommand + { + get => new DelegateCommand(() => + { + RequestData(); + }); + } + //取药按钮事件 + public DelegateCommand TakeDrug + { + get => new DelegateCommand(() => { + if(OrderInfos is null|| OrderInfos.Count<=0) + { + AlertMsg alertMsg = new AlertMsg + { + Message = "没有处方数据", + Type = MsgType.ERROR + }; + _eventAggregator.GetEvent().Publish(alertMsg); + return; + } + DialogParameters dialogParameters = new DialogParameters(); + dialogParameters.Add("OrderDate", OrderDate); + dialogParameters.Add("SelectedItem", SelectedItem); + dialogParameters.Add("SearchValue", SearchValue); + DialogServiceExtensions.ShowDialogHost(_dialogService, "OrderTakeAllDrugDialog", dialogParameters, DoDialogResult, "RootDialog"); + + }); + } + + public void RequestData() + { + OrderInfos.Clear(); + int totalCount = 0; + //string SearchValue = null; + //if (SearchValue != null) + //{ + // strSearchValue = SearchValue.Trim().Replace("\r", ""); + //} + List queryData = SqlSugarHelper.Db.Queryable() + .InnerJoin((oi, od) => oi.OrderNo == od.OrderNo) + .InnerJoin(SqlSugarHelper.Db.Queryable().Where(cs => cs.DrawerType == 1).Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrugId), (oi, od, t) => od.DrugId == t.DrugId) + .WhereIF(OrderDate != null, oi => oi.OrderDate.ToString("yyyy-MM-dd") == OrderDate) + .WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("OrderNo"), oi => oi.OrderNo == SearchValue) + .WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("PatientId"), oi => oi.PatientId == SearchValue) + .WhereIF(!String.IsNullOrEmpty(ConfigurationManager.AppSettings["storage"]), oi => oi.Pharmacy == ConfigurationManager.AppSettings["storage"]) + .Where(oi => oi.DmStatus == 0) + .Where(oi => oi.HisDispFlag == 0) + .Where(oi => oi.CancelFlag == 0) + .Where(oi => oi.Pharmacy.Equals(ConfigurationManager.AppSettings["storage"] ?? "")) + .GroupBy(oi => oi.OrderDate) + .Select(oi => oi) + .ToPageList(PageNum, PageSize, ref totalCount); + //.ToList(); + OrderInfos = queryData; + TotalCount = totalCount; + PageCount = (int)Math.Ceiling((double)TotalCount / PageSize); + } + + //接收导航传过来的参数 现在是在此处初始化了表格数据 + public void OnNavigatedTo(NavigationContext navigationContext) + { + _eventAggregator.GetEvent().Subscribe(DoMyPrismEvent); + RequestData(); + } + + //每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建 + public bool IsNavigationTarget(NavigationContext navigationContext) + { + return true; + } + + //这个方法用于拦截请求 + public void OnNavigatedFrom(NavigationContext navigationContext) + { + + // 取消消息订阅 + _eventAggregator.GetEvent().Unsubscribe(DoMyPrismEvent); + } + + void DoMyPrismEvent(DeviceMsg msg) + { + if (msg.EventType == EventType.CODESCAN) + { + SearchValue = msg.Code; + } + + } + } +} diff --git a/DM_Weight/ViewModels/OrderTakeNewDialogViewModel.cs b/DM_Weight/ViewModels/OrderTakeNewDialogViewModel.cs new file mode 100644 index 0000000..dcc661e --- /dev/null +++ b/DM_Weight/ViewModels/OrderTakeNewDialogViewModel.cs @@ -0,0 +1,185 @@ +using DM_Weight.Models; +using DM_Weight.msg; +using DM_Weight.Port; +using DM_Weight.util; +using log4net; +using Prism.Commands; +using Prism.Events; +using Prism.Mvvm; +using Prism.Regions; +using Prism.Services.Dialogs; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace DM_Weight.ViewModels +{ + public class OrderTakeNewDialogViewModel : BindableBase, IDialogAware, IRegionMemberLifetime + { + private readonly ILog logger = LogManager.GetLogger(typeof(OrderTakeDialogViewModel)); + public string Title => "处方取药"; + + + public event Action RequestClose; + + private static readonly DateTime Jan1st1970 = new DateTime + (1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + + IDialogService _dialogService; + public OrderTakeNewDialogViewModel(IDialogService DialogService) + { + _dialogService = DialogService; + } + + private int _status = 0; + + public int Status + { + get => _status; set => SetProperty(ref _status, value); + } + + private OrderInfo? _orderInfo; + + + public OrderInfo? OrderInfo + { + get => _orderInfo; + set => SetProperty(ref _orderInfo, value); + } + + private List orderDetails { get; set; } + + private List _channelStocks; + + public List ChannelStocks + { + get => _channelStocks; + set => SetProperty(ref _channelStocks, value); + } + + private IEnumerable> enumerable; + private IEnumerator> enumerator; + + + public bool CanCloseDialog() + { + return Status == 0; + } + + public void OnDialogClosed() + { + } + + public void OnDialogOpened(IDialogParameters parameters) + { + OrderInfo o = parameters.GetValue("orderInfo"); + OrderInfo = o; + RequestData(); + } + public async void RequestData() + { + orderDetails = SqlSugarHelper.Db.Queryable() + .Includes(od => od.DrugInfo) + .InnerJoin(SqlSugarHelper.Db.Queryable().Where(cs => cs.DrawerType == 1).Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM3")).GroupBy(cs => cs.DrugId), (od, t) => od.DrugId == t.DrugId) + .Where(od => od.OrderNo == OrderInfo.OrderNo) + .ToList(); + + List channelStocks = new List(); + List msg = new List(); + for (int i = 0; i < orderDetails.Count; i++) + { + OrderDetail orderDetail = orderDetails[i]; + + List HasQChannels = SqlSugarHelper.Db.Queryable() + .Includes(cs => cs.DrugInfo) + .Where(cs => cs.Quantity > 0) + .Where(cs => cs.DrawerType == 1) + .Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM3")) + .WhereIF(!string.IsNullOrEmpty(orderDetail.SetEffDate), cs => cs.EffDate.Equals(orderDetail.SetEffDate)) + .WhereIF(!string.IsNullOrEmpty(orderDetail.SetManuNo), cs => cs.ManuNo.Equals(orderDetail.SetManuNo)) + .Where(cs => cs.DrugId == orderDetail.DrugId) + .OrderBy(cs => cs.EffDate) + .OrderBy(cs => cs.DrawerNo) + .ToList(); + int total = HasQChannels.Sum(it => it.Quantity); + int TakeQ = orderDetail.Quantity; + // 说明数量足够 + if (total >= TakeQ) + { + for (int j = 0; TakeQ > 0; j++) + { + ChannelStock stock = HasQChannels[j]; + if (TakeQ > stock.Quantity) + { + stock.TakeQuantity = stock.Quantity; + channelStocks.Add(stock); + TakeQ -= stock.Quantity; + } + else + { + stock.TakeQuantity = TakeQ; + channelStocks.Add(stock); + TakeQ = 0; + } + } + } + else + { + msg.Add($"药品【{orderDetail.DrugInfo.DrugName}】库存不足,应取【{TakeQ}】库存【{total}】"); + } + } + if (msg.Count > 0) + { + RequestClose?.Invoke(new DialogResult(ButtonResult.Cancel)); + //MessageBox.Show(string.Join("\n", msg)); + DialogParameters dialogParameters = new DialogParameters(); + dialogParameters.Add("msgInfo", msg); + DialogServiceExtensions.ShowDialogHost(_dialogService, "ShowMessageDialog", dialogParameters, "RootDialog"); + + } + else + { + channelStocks.Sort((a, b) => + { + if ((a.DrawerNo - b.DrawerNo) == 0) + { + return a.ColNo - b.ColNo; + } + return a.DrawerNo - b.DrawerNo; + }); + ChannelStocks = channelStocks; + + + } + } + private bool _isFinishClick = false; + + public long CurrentTimeMillis() + { + return (long)(DateTime.UtcNow - Jan1st1970).TotalMilliseconds; + } + + + + public DelegateCommand BtnCloseCommand + { + get => new DelegateCommand(() => + { + if (Status != 0) + { + Status = 0; + } + //DialogParameters parameters = new DialogParameters(); + //parameters.Add("",); + // 关闭当前窗口 + RequestClose?.Invoke(new DialogResult(ButtonResult.Cancel)); + }); + } + + public bool KeepAlive => false; + } +} diff --git a/DM_Weight/ViewModels/RoleManagerWindowViewModel.cs b/DM_Weight/ViewModels/RoleManagerWindowViewModel.cs index 91e55f3..0d709ab 100644 --- a/DM_Weight/ViewModels/RoleManagerWindowViewModel.cs +++ b/DM_Weight/ViewModels/RoleManagerWindowViewModel.cs @@ -165,11 +165,17 @@ namespace DM_Weight.ViewModels PremissionImage = "/Images/TbQyao.png", }; ObservableCollection quyaoChild = new ObservableCollection(); + //PremissionDm quyao1 = new PremissionDm + //{ + // Id = 11, + // PremissionName = "处方取药", + // PremissionPath = "OrderTakeDrugWindow", + //}; PremissionDm quyao1 = new PremissionDm { Id = 11, PremissionName = "处方取药", - PremissionPath = "OrderTakeDrugWindow", + PremissionPath = "OrderTakeDrugNewWindow", }; PremissionDm quyao2 = new PremissionDm { @@ -306,18 +312,18 @@ namespace DM_Weight.ViewModels PremissionName = "归还药品", PremissionPath = "ReturnDrugWindow2", }; - PremissionDm huanyao2 = new PremissionDm - { - Id = 32, - PremissionName = "归还空瓶", - PremissionPath = "ReturnEmptyWindow", - }; //PremissionDm huanyao2 = new PremissionDm //{ // Id = 32, - // PremissionName = "空瓶销毁", - // PremissionPath = "ReturnEmptyDestoryWindow", + // PremissionName = "归还空瓶", + // PremissionPath = "ReturnEmptyWindow", //}; + PremissionDm huanyao2 = new PremissionDm + { + Id = 32, + PremissionName = "空瓶取出", + PremissionPath = "ReturnEmptyDestoryWindow", + }; PremissionDm huanyao3 = new PremissionDm { Id = 33, diff --git a/DM_Weight/Views/Dialog/DestoryEmptyDialog.xaml b/DM_Weight/Views/Dialog/DestoryEmptyDialog.xaml index b7cce61..4e48bb6 100644 --- a/DM_Weight/Views/Dialog/DestoryEmptyDialog.xaml +++ b/DM_Weight/Views/Dialog/DestoryEmptyDialog.xaml @@ -9,8 +9,11 @@ xmlns:convert="clr-namespace:DM_Weight.Converter" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" - mc:Ignorable="d" - d:DesignHeight="450" d:DesignWidth="800"> + mc:Ignorable="d" + MinWidth="880" + MaxHeight="500" + Width="Auto" + Height="Auto"> @@ -33,7 +36,7 @@ - + @@ -108,7 +111,7 @@ VerticalAlignment="Center" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignBody2TextBlock}" - Text="可销毁空瓶数:" /> + Text="可取空瓶数:" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DM_Weight/Views/Dialog/OrderTakeNewDialog.xaml.cs b/DM_Weight/Views/Dialog/OrderTakeNewDialog.xaml.cs new file mode 100644 index 0000000..d7a7dff --- /dev/null +++ b/DM_Weight/Views/Dialog/OrderTakeNewDialog.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace DM_Weight.Views.Dialog +{ + /// + /// OrderTakeNewDialog.xaml 的交互逻辑 + /// + public partial class OrderTakeNewDialog : UserControl + { + public OrderTakeNewDialog() + { + InitializeComponent(); + } + } +} diff --git a/DM_Weight/Views/OrderTakeDrugNewWindow.xaml b/DM_Weight/Views/OrderTakeDrugNewWindow.xaml new file mode 100644 index 0000000..5c722b6 --- /dev/null +++ b/DM_Weight/Views/OrderTakeDrugNewWindow.xaml @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DM_Weight/Views/OrderTakeDrugNewWindow.xaml.cs b/DM_Weight/Views/OrderTakeDrugNewWindow.xaml.cs new file mode 100644 index 0000000..52d24be --- /dev/null +++ b/DM_Weight/Views/OrderTakeDrugNewWindow.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace DM_Weight.Views +{ + /// + /// OrderTakeDrugNewWindow.xaml 的交互逻辑 + /// + public partial class OrderTakeDrugNewWindow : UserControl + { + public OrderTakeDrugNewWindow() + { + InitializeComponent(); + } + } +}