user_list表添加Box_Num字段。ALTER TABLE channel_list MODIFY COLUMN drawer_state INT DEFAULT 1;update channel_list setdrawer_state=1 where machine_id='DM5'
This commit is contained in:
		
							parent
							
								
									157f88d629
								
							
						
					
					
						commit
						443bd58414
					
				| 
						 | 
					@ -325,6 +325,12 @@ namespace DM_Weight
 | 
				
			||||||
            containerRegistry.RegisterDialog<DatetimeDialog>();
 | 
					            containerRegistry.RegisterDialog<DatetimeDialog>();
 | 
				
			||||||
            containerRegistry.RegisterForNavigation<DatetimeDialog, DatetimeDialogViewModel>();
 | 
					            containerRegistry.RegisterForNavigation<DatetimeDialog, DatetimeDialogViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            containerRegistry.RegisterDialog<SelectOperationTypeDialog>();
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<SelectOperationTypeDialog, SelectOperationTypeDialogViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<CheckSelfOrderForAdmin, CheckSelfOrderForAdminViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            logger.Info("结束APP-RegisterTypes");
 | 
					            logger.Info("结束APP-RegisterTypes");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,50 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Converter
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    internal class TakeReturnConverter : IValueConverter
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            int status = int.Parse(value.ToString());
 | 
				
			||||||
 | 
					            //取药箱
 | 
				
			||||||
 | 
					            if (parameter.ToString().Equals("TakeBox"))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (status == 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return Visibility.Visible;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return Visibility.Collapsed;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            //还药箱
 | 
				
			||||||
 | 
					            if (parameter.ToString().Equals("ReturnBox"))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (status == 1)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return Visibility.Visible;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return Visibility.Collapsed;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            return Visibility.Collapsed;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            throw new NotImplementedException();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -73,7 +73,7 @@ namespace DM_Weight.Models
 | 
				
			||||||
        [SugarColumn(ColumnName = "eff_date")]
 | 
					        [SugarColumn(ColumnName = "eff_date")]
 | 
				
			||||||
        public DateTime? EffDate { get; set; }
 | 
					        public DateTime? EffDate { get; set; }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 出库入库类型(1入库2出库31还药32还空瓶,21药箱移出移入,69药箱替换,55绑定药品操作(绑定、解绑、修改基数)) 
 | 
					        /// 出库入库类型(1入库2出库31还药32还空瓶,21药箱移出移入,69药箱替换,55绑定药品操作(绑定、解绑、修改基数)) 70取出药箱、71还回药箱
 | 
				
			||||||
        ///</summary>
 | 
					        ///</summary>
 | 
				
			||||||
        [SugarColumn(ColumnName = "type")]
 | 
					        [SugarColumn(ColumnName = "type")]
 | 
				
			||||||
        public int Type { get; set; }
 | 
					        public int Type { get; set; }
 | 
				
			||||||
| 
						 | 
					@ -103,10 +103,10 @@ namespace DM_Weight.Models
 | 
				
			||||||
        [SugarColumn(ColumnName = "department_id")]
 | 
					        [SugarColumn(ColumnName = "department_id")]
 | 
				
			||||||
        public string DepartmentId { get; set; }
 | 
					        public string DepartmentId { get; set; }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 是否已经退药(0:没有1:还了部分2:完成) 
 | 
					        /// 是否已经退药(0:没有1:还了部分2:完成)   取出药箱70还回药箱71
 | 
				
			||||||
        /// 默认值: 0
 | 
					        /// 默认值: 0
 | 
				
			||||||
        ///</summary>
 | 
					        ///</summary>
 | 
				
			||||||
        [SugarColumn(ColumnName = "status", IsOnlyIgnoreInsert = true)]
 | 
					        [SugarColumn(ColumnName = "status")]
 | 
				
			||||||
        public int Status { get; set; }
 | 
					        public int Status { get; set; }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 退药量 
 | 
					        /// 退药量 
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -73,5 +73,8 @@ namespace DM_Weight.Models
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return "userList = [UserName:" + Nickname + ", UserId:" + UserName + "]";
 | 
					            return "userList = [UserName:" + Nickname + ", UserId:" + UserName + "]";
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        //保存用户已取药箱的药箱号
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "Box_Num")]
 | 
				
			||||||
 | 
					        public string BoxNumber { get; set; }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -397,7 +397,7 @@ namespace DM_Weight.Report
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                SQL += " AND ab.drug_id='" + drug_id + "' ";
 | 
					                SQL += " AND ab.drug_id='" + drug_id + "' ";
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            SQL += " ORDER BY ab.type,ab.drug_id,ab.Manu_No,ab.id ";
 | 
					            SQL += " ORDER BY ab.create_time,ab.drug_id,ab.Manu_No,ab.id ";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Report.DetailGrid.Recordset.QuerySQL = SQL;
 | 
					            Report.DetailGrid.Recordset.QuerySQL = SQL;
 | 
				
			||||||
            Report.PrintPreview(true);
 | 
					            Report.PrintPreview(true);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| 
						 | 
					@ -9,10 +9,12 @@ using Prism.Events;
 | 
				
			||||||
using Prism.Mvvm;
 | 
					using Prism.Mvvm;
 | 
				
			||||||
using Prism.Regions;
 | 
					using Prism.Regions;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Buffers;
 | 
				
			||||||
using System.Collections;
 | 
					using System.Collections;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Configuration;
 | 
					using System.Configuration;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Reflection.Emit;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
using System.Threading;
 | 
					using System.Threading;
 | 
				
			||||||
using System.Threading.Tasks;
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
| 
						 | 
					@ -589,12 +591,13 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                SurgicalResidualList = SqlSugarHelper.Db.Queryable<SurgicalResidual>()
 | 
					                SurgicalResidualList = SqlSugarHelper.Db.Queryable<SurgicalResidual>()
 | 
				
			||||||
                    .Includes(sr => sr.DrugInfo)
 | 
					                    .Includes(sr => sr.DrugInfo)
 | 
				
			||||||
                    .WhereIF(OrderDate != null, sr => sr.CreateTime.ToString("yyyy-MM-dd") == OrderDate)
 | 
					                    .WhereIF(OrderDate != null, sr => sr.CreateTime.ToString("yyyy-MM-dd") == OrderDate)
 | 
				
			||||||
                    .Where(sr => sr.SendNo == DrawerNo.ToString() && sr.DmStatus == 0 && sr.DoctorCode == currentDrawerUser)
 | 
					                    //.Where(sr => sr.SendNo == DrawerNo.ToString() && sr.DmStatus == 0 && sr.DoctorCode == currentDrawerUser)
 | 
				
			||||||
 | 
					                    .Where(sr => sr.DmStatus == 0 && sr.DoctorCode == currentDrawerUser)
 | 
				
			||||||
                    .OrderBy(sr => sr.OrderNo)
 | 
					                    .OrderBy(sr => sr.OrderNo)
 | 
				
			||||||
                    .ToPageList(PageNum, PageSize, ref totalCount);
 | 
					                    .ToPageList(PageNum, PageSize, ref totalCount);
 | 
				
			||||||
                if (SurgicalResidualList != null && SurgicalResidualList.Count > 0)
 | 
					                if (SurgicalResidualList != null && SurgicalResidualList.Count > 0)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    SurgicalResidualList.ForEach(sr => sr.ItemIsChecked = true);
 | 
					                    SurgicalResidualList.Where(sr => sr.SendNo == DrawerNo.ToString()).ToList()?.ForEach(sr => sr.ItemIsChecked = true);
 | 
				
			||||||
                    TotalDrugList = SurgicalResidualList.Where(sr => sr.ItemIsChecked)
 | 
					                    TotalDrugList = SurgicalResidualList.Where(sr => sr.ItemIsChecked)
 | 
				
			||||||
                        // .Select(OrderDetailList => OrderDetailList._OrderDetail)
 | 
					                        // .Select(OrderDetailList => OrderDetailList._OrderDetail)
 | 
				
			||||||
                        .GroupBy(item => item.DrugInfo.DrugName)
 | 
					                        .GroupBy(item => item.DrugInfo.DrugName)
 | 
				
			||||||
| 
						 | 
					@ -717,7 +720,7 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
            machineRecord.Operator = HomeWindowViewModel.Operator?.Id;
 | 
					            machineRecord.Operator = HomeWindowViewModel.Operator?.Id;
 | 
				
			||||||
            machineRecord.OperationTime = DateTime.Now;
 | 
					            machineRecord.OperationTime = DateTime.Now;
 | 
				
			||||||
            machineRecord.Type = 55;
 | 
					            machineRecord.Type = 55;
 | 
				
			||||||
            machineRecord.InvoiceId = $"麻醉师核对单,打开{DrawerNo}号手术间";
 | 
					            machineRecord.InvoiceId = $"麻醉师,打开{DrawerNo}号手术间";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (DrawerNo > 0)
 | 
					            if (DrawerNo > 0)
 | 
				
			||||||
| 
						 | 
					@ -767,26 +770,7 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                    channelList.EffDate = DateTime.Now.ToString();
 | 
					                    channelList.EffDate = DateTime.Now.ToString();
 | 
				
			||||||
                    SqlSugarHelper.Db.Updateable(channelList).UpdateColumns(it => new { it.EffDate }).ExecuteCommand();
 | 
					                    SqlSugarHelper.Db.Updateable(channelList).UpdateColumns(it => new { it.EffDate }).ExecuteCommand();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                //Task.Factory.StartNew(async () =>
 | 
					                
 | 
				
			||||||
                //{
 | 
					 | 
				
			||||||
                //    bool loop = true;
 | 
					 | 
				
			||||||
                //    while (loop)
 | 
					 | 
				
			||||||
                //    {
 | 
					 | 
				
			||||||
                //        await Task.Delay(1000);
 | 
					 | 
				
			||||||
                //        bool[] boolsl = ModbusHelper.GetInstance().GetAllBoxState();
 | 
					 | 
				
			||||||
                //        bool state = Array.TrueForAll(boolsl, b => b == false);
 | 
					 | 
				
			||||||
                //        if (state)
 | 
					 | 
				
			||||||
                //        {
 | 
					 | 
				
			||||||
                //            loop = false;
 | 
					 | 
				
			||||||
                //            ModbusHelper.BoxOperate = false;
 | 
					 | 
				
			||||||
                //        }
 | 
					 | 
				
			||||||
                //        else
 | 
					 | 
				
			||||||
                //        {
 | 
					 | 
				
			||||||
                //            ModbusHelper.BoxOperate = true;
 | 
					 | 
				
			||||||
                //            //ModbusHelper.SpeakAsync("药箱已打开,请及时关闭");
 | 
					 | 
				
			||||||
                //        }
 | 
					 | 
				
			||||||
                //    }
 | 
					 | 
				
			||||||
                //});
 | 
					 | 
				
			||||||
                Thread.Sleep(200);
 | 
					                Thread.Sleep(200);
 | 
				
			||||||
                int iException = 0;
 | 
					                int iException = 0;
 | 
				
			||||||
                new PromiseUtil<int>().taskAsyncLoop(500, 0, async (options, next, stop) =>
 | 
					                new PromiseUtil<int>().taskAsyncLoop(500, 0, async (options, next, stop) =>
 | 
				
			||||||
| 
						 | 
					@ -844,84 +828,7 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            //if (DrawerType == 1) //公共药箱
 | 
					 | 
				
			||||||
            //{
 | 
					 | 
				
			||||||
            //    if (listDrawerState == 0)
 | 
					 | 
				
			||||||
            //    {
 | 
					 | 
				
			||||||
            //        SelfContent = "还公共药箱";
 | 
					 | 
				
			||||||
            //    }
 | 
					 | 
				
			||||||
            //    else
 | 
					 | 
				
			||||||
            //    {
 | 
					 | 
				
			||||||
            //        SelfContent = "取公共药箱";
 | 
					 | 
				
			||||||
            //    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            //}
 | 
					 | 
				
			||||||
            //else
 | 
					 | 
				
			||||||
            //{
 | 
					 | 
				
			||||||
            //    if (listDrawerState == 0)
 | 
					 | 
				
			||||||
            //    {
 | 
					 | 
				
			||||||
            //        SelfContent = "还名下药箱";
 | 
					 | 
				
			||||||
            //    }
 | 
					 | 
				
			||||||
            //    else
 | 
					 | 
				
			||||||
            //    {
 | 
					 | 
				
			||||||
            //        SelfContent = "取名下药箱";
 | 
					 | 
				
			||||||
            //    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            //}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        //public DelegateCommand<string> OpenBoxDelegate
 | 
					 | 
				
			||||||
        //{
 | 
					 | 
				
			||||||
        //    get => new DelegateCommand<string>((DrawerType) =>
 | 
					 | 
				
			||||||
        //    {
 | 
					 | 
				
			||||||
        //        SearchBox();
 | 
					 | 
				
			||||||
        //    }
 | 
					 | 
				
			||||||
        //    );
 | 
					 | 
				
			||||||
        //}
 | 
					 | 
				
			||||||
        //private void SearchBox()
 | 
					 | 
				
			||||||
        //{
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //    SetAllBtnEnableFalse();
 | 
					 | 
				
			||||||
        //    iList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5" && cl.DrawerType == this.DrawerType)
 | 
					 | 
				
			||||||
        //        .WhereIF(this.DrawerType == 0, cl => cl.BelongUser == HomeWindowViewModel.Operator.UserBarcode).ToList();
 | 
					 | 
				
			||||||
        //    // .Select(cl => cl.DrawerNo).ToList();
 | 
					 | 
				
			||||||
        //    if (iList.Count > 0)
 | 
					 | 
				
			||||||
        //    {
 | 
					 | 
				
			||||||
        //        //_portUtil.SpeakAsync("正在打开药箱");
 | 
					 | 
				
			||||||
        //        //_portUtil.DrawerNo = iList[iNumber];
 | 
					 | 
				
			||||||
        //        //iNumber++;
 | 
					 | 
				
			||||||
        //        //_portUtil.OpenBox();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //        for (int i = 0; i < iList.Count; i++)
 | 
					 | 
				
			||||||
        //        {
 | 
					 | 
				
			||||||
        //            ChannelList channelList = iList[i];
 | 
					 | 
				
			||||||
        //            //记录开药箱日志
 | 
					 | 
				
			||||||
        //            SqlSugarHelper.Db.Insertable(new MachineRecord()
 | 
					 | 
				
			||||||
        //            {
 | 
					 | 
				
			||||||
        //                MachineId = "DM5",
 | 
					 | 
				
			||||||
        //                DrawerNo = channelList.DrawerNo,
 | 
					 | 
				
			||||||
        //                Operator = HomeWindowViewModel.Operator?.Id,
 | 
					 | 
				
			||||||
        //                OperationTime = DateTime.Now,
 | 
					 | 
				
			||||||
        //                Type = 55,
 | 
					 | 
				
			||||||
        //                InvoiceId = $"打开{iList[i].DrawerNo}号药箱",
 | 
					 | 
				
			||||||
        //                OptionType = SelfContent.Substring(0, 1) == "取" ? 0 : 1
 | 
					 | 
				
			||||||
        //            }).ExecuteCommand();
 | 
					 | 
				
			||||||
        //            //记录药箱打开时间
 | 
					 | 
				
			||||||
        //            channelList.EffDate = DateTime.Now.ToString();
 | 
					 | 
				
			||||||
        //            channelList.DrawerState = SelfContent.Substring(0, 1) == "取" ? 0 : 1;
 | 
					 | 
				
			||||||
        //            SqlSugarHelper.Db.Updateable(channelList).UpdateColumns(it => new { it.EffDate, it.DrawerState }).ExecuteCommand();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //            _portUtil.SpeakAsync($"正在打开{channelList.DrawerNo}号药箱");
 | 
					 | 
				
			||||||
        //            logger.Info($"正在打开{channelList.DrawerNo}号药箱");
 | 
					 | 
				
			||||||
        //            ModbusHelper.GetInstance().OpenBoxDoor(channelList.DrawerNo - 1);
 | 
					 | 
				
			||||||
        //        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //        SelfStatus = 0;
 | 
					 | 
				
			||||||
        //        PublicEnable = true;
 | 
					 | 
				
			||||||
        //        //SelfEnable = true;
 | 
					 | 
				
			||||||
        //        DrawerType = -1;
 | 
					 | 
				
			||||||
        //    }
 | 
					 | 
				
			||||||
        //}
 | 
					 | 
				
			||||||
        public DelegateCommand RowSelected
 | 
					        public DelegateCommand RowSelected
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get => new DelegateCommand(() =>
 | 
					            get => new DelegateCommand(() =>
 | 
				
			||||||
| 
						 | 
					@ -1070,6 +977,7 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
        private void GetUseBox()
 | 
					        private void GetUseBox()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            List<ChannelList> chlList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5").ToList();//.Select(cl => cl.BelongUser).First();
 | 
					            List<ChannelList> chlList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5").ToList();//.Select(cl => cl.BelongUser).First();
 | 
				
			||||||
 | 
					            chlList = chlList.GroupBy(cl => cl.DrawerNo).Select(cl => cl.FirstOrDefault()).ToList();
 | 
				
			||||||
            if (chlList != null && chlList.Count > 0)
 | 
					            if (chlList != null && chlList.Count > 0)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                for (int i = 0; i < chlList.Count; i++)
 | 
					                for (int i = 0; i < chlList.Count; i++)
 | 
				
			||||||
| 
						 | 
					@ -1113,5 +1021,29 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
            // 取消消息订阅
 | 
					            // 取消消息订阅
 | 
				
			||||||
            //_eventAggregator.GetEvent<PortUtilEvent>().Unsubscribe(DoMyPrismEvent);
 | 
					            //_eventAggregator.GetEvent<PortUtilEvent>().Unsubscribe(DoMyPrismEvent);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 点击取药箱按钮
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        public DelegateCommand TakeBoxCommand
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new DelegateCommand(TakeBoxMethod);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public void TakeBoxMethod()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 点击还药箱按钮
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        public DelegateCommand ReturnBoxCommand
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new DelegateCommand(ReturnBoxMethod);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public void ReturnBoxMethod()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,6 +8,7 @@ using Prism.Commands;
 | 
				
			||||||
using Prism.Events;
 | 
					using Prism.Events;
 | 
				
			||||||
using Prism.Mvvm;
 | 
					using Prism.Mvvm;
 | 
				
			||||||
using Prism.Regions;
 | 
					using Prism.Regions;
 | 
				
			||||||
 | 
					using Prism.Services.Dialogs;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections;
 | 
					using System.Collections;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
| 
						 | 
					@ -32,6 +33,14 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
            get => _drawerType;
 | 
					            get => _drawerType;
 | 
				
			||||||
            set => SetProperty(ref _drawerType, value);
 | 
					            set => SetProperty(ref _drawerType, value);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        //1取药箱;0还药箱
 | 
				
			||||||
 | 
					        private int _operationType = -1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public int OperationType
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _operationType;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _operationType, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        public bool KeepAlive => false;
 | 
					        public bool KeepAlive => false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private int _pageNum = 1;
 | 
					        private int _pageNum = 1;
 | 
				
			||||||
| 
						 | 
					@ -543,12 +552,14 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
        IEventAggregator _eventAggregator;
 | 
					        IEventAggregator _eventAggregator;
 | 
				
			||||||
        //private PortUtil _portUtil;
 | 
					        //private PortUtil _portUtil;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        IDialogService _dialogService;
 | 
				
			||||||
        SocketHelper _socketHelper;
 | 
					        SocketHelper _socketHelper;
 | 
				
			||||||
        public CheckSelfOrderWindowViewModel(IEventAggregator eventAggregator, SocketHelper socketHelper)
 | 
					        public CheckSelfOrderWindowViewModel(IEventAggregator eventAggregator, SocketHelper socketHelper, IDialogService dialogService)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //_portUtil = portUtil;
 | 
					            //_portUtil = portUtil;
 | 
				
			||||||
            _eventAggregator = eventAggregator;
 | 
					            _eventAggregator = eventAggregator;
 | 
				
			||||||
            _socketHelper = socketHelper;
 | 
					            _socketHelper = socketHelper;
 | 
				
			||||||
 | 
					            _dialogService = dialogService;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        private string? _searchValue;
 | 
					        private string? _searchValue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -586,9 +597,9 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                               .Where(oi => oi.HisDispFlag == 0)
 | 
					                               .Where(oi => oi.HisDispFlag == 0)
 | 
				
			||||||
                               .Where(oi => oi.CancelFlag == 0)
 | 
					                               .Where(oi => oi.CancelFlag == 0)
 | 
				
			||||||
                               .Where(oi => oi.DoctorCode == currentDrawerUser)
 | 
					                               .Where(oi => oi.DoctorCode == currentDrawerUser)
 | 
				
			||||||
                               .Where(oi => oi._OrderDetail.SetManuNo != null&&oi._OrderDetail.SetManuNo!="null")
 | 
					                               .Where(oi => oi._OrderDetail.SetManuNo != null && oi._OrderDetail.SetManuNo != "null")
 | 
				
			||||||
                               .Where(oi=>oi._OrderDetail.Quantity>0)
 | 
					                               .Where(oi => oi._OrderDetail.Quantity > 0)
 | 
				
			||||||
                               .Where(oi=>oi._OrderDetail.surgicalResidual.SendNo== DrawerNo.ToString())
 | 
					                               //.Where(oi => oi._OrderDetail.surgicalResidual.SendNo == DrawerNo.ToString())
 | 
				
			||||||
                               .OrderBy(oi => oi.OrderId)
 | 
					                               .OrderBy(oi => oi.OrderId)
 | 
				
			||||||
                               .ToPageList(PageNum, PageSize, ref totalCount);
 | 
					                               .ToPageList(PageNum, PageSize, ref totalCount);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -609,8 +620,8 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (OrderInfoList != null && OrderInfoList.Count() > 0)
 | 
					                if (OrderInfoList != null && OrderInfoList.Count() > 0)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    OrderInfoList.ForEach(oi => oi.ItemIsChecked = true);
 | 
					 | 
				
			||||||
                    OrderInfoList.ForEach(oi => oi._OrderDetail.DrugInfo = oi._OrderDetail.DrugInfo ?? new DrugInfo());
 | 
					                    OrderInfoList.ForEach(oi => oi._OrderDetail.DrugInfo = oi._OrderDetail.DrugInfo ?? new DrugInfo());
 | 
				
			||||||
 | 
					                    OrderInfoList.Where(oi=>oi._OrderDetail.surgicalResidual?.SendNo==DrawerNo.ToString()).ToList()?.ForEach(oi => oi.ItemIsChecked = true);
 | 
				
			||||||
                    //TotalDrugList = OrderInfoList.Where(oi => oi.ItemIsChecked).GroupBy(oi => oi.OrderDetailList.DrugInfo.DrugName).Select(oi => new TotalDrug { DrugName = oi.Key, TotalCount = oi.Sum(item => item.OrderDetailList.Quantity) }).ToList();
 | 
					                    //TotalDrugList = OrderInfoList.Where(oi => oi.ItemIsChecked).GroupBy(oi => oi.OrderDetailList.DrugInfo.DrugName).Select(oi => new TotalDrug { DrugName = oi.Key, TotalCount = oi.Sum(item => item.OrderDetailList.Quantity) }).ToList();
 | 
				
			||||||
                    TotalDrugList = OrderInfoList.Where(oi => oi.ItemIsChecked).Select(OrderDetailList => OrderDetailList._OrderDetail).GroupBy(item => item.DrugInfo.DrugName).Select(group => new TotalDrug { DrugName = group.Key, TotalCount = group.Sum(item => item.Quantity) }).ToList();
 | 
					                    TotalDrugList = OrderInfoList.Where(oi => oi.ItemIsChecked).Select(OrderDetailList => OrderDetailList._OrderDetail).GroupBy(item => item.DrugInfo.DrugName).Select(group => new TotalDrug { DrugName = group.Key, TotalCount = group.Sum(item => item.Quantity) }).ToList();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
| 
						 | 
					@ -784,12 +795,11 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
            machineRecord.Operator = HomeWindowViewModel.Operator?.Id;
 | 
					            machineRecord.Operator = HomeWindowViewModel.Operator?.Id;
 | 
				
			||||||
            machineRecord.OperationTime = DateTime.Now;
 | 
					            machineRecord.OperationTime = DateTime.Now;
 | 
				
			||||||
            machineRecord.Type = 55;
 | 
					            machineRecord.Type = 55;
 | 
				
			||||||
            machineRecord.InvoiceId = $"麻醉师核对单,打开{DrawerNo}号手术间";
 | 
					            machineRecord.InvoiceId = $"麻醉师,打开{DrawerNo}号手术间";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (DrawerNo > 0)
 | 
					            if (DrawerNo > 0)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                RequestData();
 | 
					 | 
				
			||||||
                Status = 1;
 | 
					                Status = 1;
 | 
				
			||||||
                _socketHelper.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					                _socketHelper.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
                _socketHelper.speechSynthesizer.Resume();
 | 
					                _socketHelper.speechSynthesizer.Resume();
 | 
				
			||||||
| 
						 | 
					@ -815,45 +825,72 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                    return;
 | 
					                    return;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                _socketHelper.OpenStatus = true;
 | 
					                _socketHelper.OpenStatus = true;
 | 
				
			||||||
                //SetBtnEnable(DrawerNo, false);
 | 
					 | 
				
			||||||
                //if (CheckBoxStatusTimer is null)
 | 
					 | 
				
			||||||
                //{
 | 
					 | 
				
			||||||
                //    CheckBoxStatusTimer = new System.Timers.Timer();
 | 
					 | 
				
			||||||
                //}
 | 
					 | 
				
			||||||
                //if (!CheckBoxStatusTimer.Enabled)
 | 
					 | 
				
			||||||
                //{
 | 
					 | 
				
			||||||
                //    CheckBoxStatusTimer.Elapsed += new System.Timers.ElapsedEventHandler(GetAllBoxState);
 | 
					 | 
				
			||||||
                //    CheckBoxStatusTimer.Interval = 3000;
 | 
					 | 
				
			||||||
                //    CheckBoxStatusTimer.Start();
 | 
					 | 
				
			||||||
                //}
 | 
					 | 
				
			||||||
                //记录药箱打开时间
 | 
					                //记录药箱打开时间
 | 
				
			||||||
                ChannelList channelList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5" && cl.DrawerNo == DrawerNo).First();
 | 
					                //ChannelList channelList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5" && cl.DrawerNo == DrawerNo).First();
 | 
				
			||||||
                if (channelList != null && (channelList.EffDate is null || Convert.ToDateTime(channelList.EffDate).ToString("yyyy-MM-dd") != DateTime.Now.ToString("yyyy-MM-dd")))
 | 
					                //if (channelList != null && (channelList.EffDate is null || Convert.ToDateTime(channelList.EffDate).ToString("yyyy-MM-dd") != DateTime.Now.ToString("yyyy-MM-dd")))
 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    channelList.EffDate = DateTime.Now.ToString();
 | 
					 | 
				
			||||||
                    SqlSugarHelper.Db.Updateable(channelList).UpdateColumns(it => new { it.EffDate }).ExecuteCommand();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                //Task.Factory.StartNew(async () =>
 | 
					 | 
				
			||||||
                //{
 | 
					                //{
 | 
				
			||||||
                //    bool loop = true;
 | 
					                    //channelList.DrawerState = 0;
 | 
				
			||||||
                //    while (loop)
 | 
					                    //channelList.EffDate = DateTime.Now.ToString();
 | 
				
			||||||
                //    {
 | 
					                    //SqlSugarHelper.Db.Updateable(channelList).UpdateColumns(it => new { it.EffDate,it.DrawerState }).ExecuteCommand();
 | 
				
			||||||
                //        await Task.Delay(1000);
 | 
					                //    SqlSugarHelper.Db.Updateable<ChannelList>().SetColumns(it=>it.EffDate== DateTime.Now.ToString()).SetColumns(it => it.DrawerState == 0)
 | 
				
			||||||
                //        bool[] boolsl = ModbusHelper.GetInstance().GetAllBoxState();
 | 
					                //        .Where(it => it.MachineId == "DM5" && it.DrawerNo == DrawerNo).ExecuteCommand();
 | 
				
			||||||
                //        bool state = Array.TrueForAll(boolsl, b => b == false);
 | 
					                //}
 | 
				
			||||||
                //        if (state)
 | 
					                if (OperationType == 1)
 | 
				
			||||||
                //        {
 | 
					                {
 | 
				
			||||||
                //            loop = false;
 | 
					                    //取药箱,将当前药箱号记录到当前登录人身上
 | 
				
			||||||
                //            ModbusHelper.BoxOperate = false;
 | 
					                    if (!string.IsNullOrEmpty(HomeWindowViewModel.Operator.BoxNumber))
 | 
				
			||||||
                //        }
 | 
					                    {
 | 
				
			||||||
                //        else
 | 
					                        HomeWindowViewModel.Operator.BoxNumber += $",{DrawerNo.ToString()}";
 | 
				
			||||||
                //        {
 | 
					                        SqlSugarHelper.Db.Updateable(HomeWindowViewModel.Operator).UpdateColumns(it => new { it.BoxNumber }).ExecuteCommand();
 | 
				
			||||||
                //            ModbusHelper.BoxOperate = true;
 | 
					                    }
 | 
				
			||||||
                //            //ModbusHelper.SpeakAsync("药箱已打开,请及时关闭");
 | 
					                    else
 | 
				
			||||||
                //        }
 | 
					                    {
 | 
				
			||||||
                //    }
 | 
					                        HomeWindowViewModel.Operator.BoxNumber = $",{DrawerNo.ToString()}";
 | 
				
			||||||
                //});
 | 
					                        SqlSugarHelper.Db.Updateable(HomeWindowViewModel.Operator).UpdateColumns(it => new { it.BoxNumber }).ExecuteCommand();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    SqlSugarHelper.Db.Updateable<ChannelList>().SetColumns(it => it.EffDate == DateTime.Now.ToString()).SetColumns(it => it.DrawerState == 0)
 | 
				
			||||||
 | 
					                      .Where(it => it.MachineId == "DM5" && it.DrawerNo == DrawerNo).ExecuteCommand();
 | 
				
			||||||
 | 
					                    //记录取药箱信息
 | 
				
			||||||
 | 
					                    SqlSugarHelper.Db.Insertable(new MachineRecord()
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
 | 
				
			||||||
 | 
					                        DrawerNo = DrawerNo,   
 | 
				
			||||||
 | 
					                        Operator = HomeWindowViewModel.Operator?.Id,
 | 
				
			||||||
 | 
					                        Reviewer = HomeWindowViewModel.Reviewer?.Id,
 | 
				
			||||||
 | 
					                        OperationTime = DateTime.Now,
 | 
				
			||||||
 | 
					                        Type = 70,
 | 
				
			||||||
 | 
					                        Status= 70,
 | 
				
			||||||
 | 
					                        InvoiceId = $"{DateTime.Now} 取出药箱"
 | 
				
			||||||
 | 
					                    }).ExecuteCommand();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else if (OperationType == 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    RequestData();
 | 
				
			||||||
 | 
					                    //还药箱,将当前药箱号从当前登录人身上删除
 | 
				
			||||||
 | 
					                    if (HomeWindowViewModel.Operator.BoxNumber == $",{DrawerNo.ToString()}")
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        HomeWindowViewModel.Operator.BoxNumber = string.Empty;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        HomeWindowViewModel.Operator.BoxNumber = HomeWindowViewModel.Operator.BoxNumber.Replace($",{DrawerNo.ToString()},", ",");
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    SqlSugarHelper.Db.Updateable(HomeWindowViewModel.Operator).UpdateColumns(it => new { it.BoxNumber }).ExecuteCommand();
 | 
				
			||||||
 | 
					                    SqlSugarHelper.Db.Updateable<ChannelList>().SetColumns(it => it.EffDate ==null).SetColumns(it => it.DrawerState == 1)
 | 
				
			||||||
 | 
					                        .Where(it => it.MachineId == "DM5" && it.DrawerNo == DrawerNo).ExecuteCommand();
 | 
				
			||||||
 | 
					                    //记录还药箱时间
 | 
				
			||||||
 | 
					                    MachineRecord returnRecord = SqlSugarHelper.Db.Queryable<MachineRecord>().Where(mc => mc.MachineId == "DM5" && mc.DrawerNo == DrawerNo&&mc.Type==70&&mc.Operator==HomeWindowViewModel.Operator.Id).First();
 | 
				
			||||||
 | 
					                    if(returnRecord!=null)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        returnRecord.EffDate = DateTime.Now;
 | 
				
			||||||
 | 
					                        returnRecord.Status = 71;
 | 
				
			||||||
 | 
					                        returnRecord.Type = 71;
 | 
				
			||||||
 | 
					                        returnRecord.InvoiceId += $";{DateTime.Now} 还回药箱";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        SqlSugarHelper.Db.Updateable(returnRecord).UpdateColumns(it => new { it.EffDate,it.Status,it.Type,it.InvoiceId }).ExecuteCommand();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					             
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
                Thread.Sleep(200);
 | 
					                Thread.Sleep(200);
 | 
				
			||||||
                int iException = 0;
 | 
					                int iException = 0;
 | 
				
			||||||
                new PromiseUtil<int>().taskAsyncLoop(500, 0, async (options, next, stop) =>
 | 
					                new PromiseUtil<int>().taskAsyncLoop(500, 0, async (options, next, stop) =>
 | 
				
			||||||
| 
						 | 
					@ -911,84 +948,7 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            //if (DrawerType == 1) //公共药箱
 | 
					 | 
				
			||||||
            //{
 | 
					 | 
				
			||||||
            //    if (listDrawerState == 0)
 | 
					 | 
				
			||||||
            //    {
 | 
					 | 
				
			||||||
            //        SelfContent = "还公共药箱";
 | 
					 | 
				
			||||||
            //    }
 | 
					 | 
				
			||||||
            //    else
 | 
					 | 
				
			||||||
            //    {
 | 
					 | 
				
			||||||
            //        SelfContent = "取公共药箱";
 | 
					 | 
				
			||||||
            //    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            //}
 | 
					 | 
				
			||||||
            //else
 | 
					 | 
				
			||||||
            //{
 | 
					 | 
				
			||||||
            //    if (listDrawerState == 0)
 | 
					 | 
				
			||||||
            //    {
 | 
					 | 
				
			||||||
            //        SelfContent = "还名下药箱";
 | 
					 | 
				
			||||||
            //    }
 | 
					 | 
				
			||||||
            //    else
 | 
					 | 
				
			||||||
            //    {
 | 
					 | 
				
			||||||
            //        SelfContent = "取名下药箱";
 | 
					 | 
				
			||||||
            //    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            //}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        //public DelegateCommand<string> OpenBoxDelegate
 | 
					 | 
				
			||||||
        //{
 | 
					 | 
				
			||||||
        //    get => new DelegateCommand<string>((DrawerType) =>
 | 
					 | 
				
			||||||
        //    {
 | 
					 | 
				
			||||||
        //        SearchBox();
 | 
					 | 
				
			||||||
        //    }
 | 
					 | 
				
			||||||
        //    );
 | 
					 | 
				
			||||||
        //}
 | 
					 | 
				
			||||||
        //private void SearchBox()
 | 
					 | 
				
			||||||
        //{
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //    SetAllBtnEnableFalse();
 | 
					 | 
				
			||||||
        //    iList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5" && cl.DrawerType == this.DrawerType)
 | 
					 | 
				
			||||||
        //        .WhereIF(this.DrawerType == 0, cl => cl.BelongUser == HomeWindowViewModel.Operator.UserBarcode).ToList();
 | 
					 | 
				
			||||||
        //    // .Select(cl => cl.DrawerNo).ToList();
 | 
					 | 
				
			||||||
        //    if (iList.Count > 0)
 | 
					 | 
				
			||||||
        //    {
 | 
					 | 
				
			||||||
        //        //_portUtil.SpeakAsync("正在打开药箱");
 | 
					 | 
				
			||||||
        //        //_portUtil.DrawerNo = iList[iNumber];
 | 
					 | 
				
			||||||
        //        //iNumber++;
 | 
					 | 
				
			||||||
        //        //_portUtil.OpenBox();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //        for (int i = 0; i < iList.Count; i++)
 | 
					 | 
				
			||||||
        //        {
 | 
					 | 
				
			||||||
        //            ChannelList channelList = iList[i];
 | 
					 | 
				
			||||||
        //            //记录开药箱日志
 | 
					 | 
				
			||||||
        //            SqlSugarHelper.Db.Insertable(new MachineRecord()
 | 
					 | 
				
			||||||
        //            {
 | 
					 | 
				
			||||||
        //                MachineId = "DM5",
 | 
					 | 
				
			||||||
        //                DrawerNo = channelList.DrawerNo,
 | 
					 | 
				
			||||||
        //                Operator = HomeWindowViewModel.Operator?.Id,
 | 
					 | 
				
			||||||
        //                OperationTime = DateTime.Now,
 | 
					 | 
				
			||||||
        //                Type = 55,
 | 
					 | 
				
			||||||
        //                InvoiceId = $"打开{iList[i].DrawerNo}号药箱",
 | 
					 | 
				
			||||||
        //                OptionType = SelfContent.Substring(0, 1) == "取" ? 0 : 1
 | 
					 | 
				
			||||||
        //            }).ExecuteCommand();
 | 
					 | 
				
			||||||
        //            //记录药箱打开时间
 | 
					 | 
				
			||||||
        //            channelList.EffDate = DateTime.Now.ToString();
 | 
					 | 
				
			||||||
        //            channelList.DrawerState = SelfContent.Substring(0, 1) == "取" ? 0 : 1;
 | 
					 | 
				
			||||||
        //            SqlSugarHelper.Db.Updateable(channelList).UpdateColumns(it => new { it.EffDate, it.DrawerState }).ExecuteCommand();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //            _portUtil.SpeakAsync($"正在打开{channelList.DrawerNo}号药箱");
 | 
					 | 
				
			||||||
        //            logger.Info($"正在打开{channelList.DrawerNo}号药箱");
 | 
					 | 
				
			||||||
        //            ModbusHelper.GetInstance().OpenBoxDoor(channelList.DrawerNo - 1);
 | 
					 | 
				
			||||||
        //        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //        SelfStatus = 0;
 | 
					 | 
				
			||||||
        //        PublicEnable = true;
 | 
					 | 
				
			||||||
        //        //SelfEnable = true;
 | 
					 | 
				
			||||||
        //        DrawerType = -1;
 | 
					 | 
				
			||||||
        //    }
 | 
					 | 
				
			||||||
        //}
 | 
					 | 
				
			||||||
        public DelegateCommand RowSelected
 | 
					        public DelegateCommand RowSelected
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get => new DelegateCommand(() =>
 | 
					            get => new DelegateCommand(() =>
 | 
				
			||||||
| 
						 | 
					@ -1026,7 +986,7 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get => new DelegateCommand(() =>
 | 
					            get => new DelegateCommand(() =>
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                if(DrawerNo==-1)
 | 
					                if (DrawerNo == -1)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    AlertMsg alertMsg = new AlertMsg
 | 
					                    AlertMsg alertMsg = new AlertMsg
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
| 
						 | 
					@ -1060,7 +1020,7 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                        if (oi.DmStatus == 0)
 | 
					                        if (oi.DmStatus == 0)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            //查询该药箱是否有该批次的药品,没有则无法确认(避免管理进行确认时确认不过去)
 | 
					                            //查询该药箱是否有该批次的药品,没有则无法确认(避免管理进行确认时确认不过去)
 | 
				
			||||||
                            if(oi._OrderDetail != null)
 | 
					                            if (oi._OrderDetail != null)
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                //for (int j = 0; j < oi.OrderDetailList.Count; j++)
 | 
					                                //for (int j = 0; j < oi.OrderDetailList.Count; j++)
 | 
				
			||||||
                                //{
 | 
					                                //{
 | 
				
			||||||
| 
						 | 
					@ -1103,171 +1063,6 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                            }).ExecuteCommand();
 | 
					                            }).ExecuteCommand();
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        #region 麻醉师确认只修改单子状态为1,不减库存,等管理员操作时减库存
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        //for (int j = 0; j < oi.OrderDetailList.Count; j++)
 | 
					 | 
				
			||||||
                        //{
 | 
					 | 
				
			||||||
                        //    oi._OrderDetail = oi.OrderDetailList[j];
 | 
					 | 
				
			||||||
                        //    int drawerNo = DrawerNo + 1;
 | 
					 | 
				
			||||||
                        //    ChannelStock cs = SqlSugarHelper.Db.Queryable<ChannelStock>()
 | 
					 | 
				
			||||||
                        //                     .Where(cs => cs.DrugId == oi._OrderDetail.DrugId
 | 
					 | 
				
			||||||
                        //                            && cs.ManuNo == oi._OrderDetail.SetManuNo
 | 
					 | 
				
			||||||
                        //                            && cs.EffDate == oi._OrderDetail.SetEffDate
 | 
					 | 
				
			||||||
                        //                            && cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM5")
 | 
					 | 
				
			||||||
                        //                            && cs.DrawerNo == drawerNo).First();
 | 
					 | 
				
			||||||
                        //    if (cs == null)
 | 
					 | 
				
			||||||
                        //    {
 | 
					 | 
				
			||||||
                        //        empChannelStock += $"{oi.OrderNo},{oi._OrderDetail.DrugId},{oi._OrderDetail.SetManuNo},{oi._OrderDetail.SetEffDate};";
 | 
					 | 
				
			||||||
                        //        continue;
 | 
					 | 
				
			||||||
                        //    }
 | 
					 | 
				
			||||||
                        //    cs.Quantity = cs.Quantity - oi._OrderDetail.Quantity;
 | 
					 | 
				
			||||||
                        //    // 更新数据 库存信息
 | 
					 | 
				
			||||||
                        //    SqlSugarHelper.Db.Updateable(cs).UpdateColumns(it => new { it.Quantity }).ExecuteCommand();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        //    if (cs != null)
 | 
					 | 
				
			||||||
                        //    {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        //        SqlSugarHelper.Db.Insertable(new MachineRecord()
 | 
					 | 
				
			||||||
                        //        {
 | 
					 | 
				
			||||||
                        //            MachineId = ConfigurationManager.AppSettings["dm_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 = oi._OrderDetail.Quantity,
 | 
					 | 
				
			||||||
                        //            Type = 2,
 | 
					 | 
				
			||||||
                        //            InvoiceId = oi.OrderNo
 | 
					 | 
				
			||||||
                        //            //, StockQuantity = nowChannels.Sum(it => it.Quantity)
 | 
					 | 
				
			||||||
                        //        }).ExecuteCommand();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        //        #region 记录 注射剂使用与交接记录报表
 | 
					 | 
				
			||||||
                        //        //查询发药时间
 | 
					 | 
				
			||||||
                        //        //MachineRecord SendMachineRecord = SqlSugarHelper.Db.Queryable<MachineRecord>().Where(mr => mr.DrawerNo == cs.DrawerNo && mr.Type == 2)
 | 
					 | 
				
			||||||
                        //        //.OrderByDescending(mr => mr.OperationTime)
 | 
					 | 
				
			||||||
                        //        //.First();
 | 
					 | 
				
			||||||
                        //        //string retUser = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == (ConfigurationManager.AppSettings["machineId"] ?? "DM5") && cl.DrawerNo == cs.DrawerNo)
 | 
					 | 
				
			||||||
                        //        //.Select(cl => cl.BelongUser).First();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        //        RejectionReport rejectionReport = SqlSugarHelper.Db.Queryable<RejectionReport>().Where(rp => rp.DrugId == cs.DrugId && rp.DrawerNo == cs.DrawerNo).OrderByDescending(rp => rp.SendDate).First();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        //        //发药信息
 | 
					 | 
				
			||||||
                        //        //RejectionReport rejectionReport = new RejectionReport();
 | 
					 | 
				
			||||||
                        //        //rejectionReport.SendDate = SendMachineRecord.OperationTime;
 | 
					 | 
				
			||||||
                        //        //rejectionReport.SendUser = SendMachineRecord.Operator.ToString();
 | 
					 | 
				
			||||||
                        //        //rejectionReport.ReceiveUser = retUser;
 | 
					 | 
				
			||||||
                        //        rejectionReport.RealNum = cs.BaseQuantity;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        //        //还药信息
 | 
					 | 
				
			||||||
                        //        rejectionReport.InfactNum = cs.BaseQuantity - oi._OrderDetail.Quantity;
 | 
					 | 
				
			||||||
                        //        rejectionReport.EmptyNum = oi._OrderDetail.Quantity;
 | 
					 | 
				
			||||||
                        //        rejectionReport.ReturnTime = DateTime.Now.ToString();
 | 
					 | 
				
			||||||
                        //        rejectionReport.ReturnUser = rejectionReport.SendUser;
 | 
					 | 
				
			||||||
                        //        rejectionReport.ReturnReceiveUser = rejectionReport.ReceiveUser;// SendMachineRecord.Operator.ToString();
 | 
					 | 
				
			||||||
                        //        rejectionReport.DrugId = oi._OrderDetail.DrugId;
 | 
					 | 
				
			||||||
                        //        rejectionReport.DrugName = oi._OrderDetail.DrugInfo.DrugName;
 | 
					 | 
				
			||||||
                        //        rejectionReport.DrugSpec = oi._OrderDetail.DrugInfo.DrugSpec;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        //        rejectionReport.OperationTime = DateTime.Now;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        //        int iRejectionReport = SqlSugarHelper.Db.Updateable(rejectionReport).ExecuteCommand();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        //        #endregion
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        //    }
 | 
					 | 
				
			||||||
                        //    //保存账册
 | 
					 | 
				
			||||||
                        //    int iInsertResult = SqlSugarHelper.Db.Insertable(new AccountBookG2()
 | 
					 | 
				
			||||||
                        //    {
 | 
					 | 
				
			||||||
                        //        DrugId = oi._OrderDetail.DrugId,
 | 
					 | 
				
			||||||
                        //        Type = 2,
 | 
					 | 
				
			||||||
                        //        Department = oi.DeptName,
 | 
					 | 
				
			||||||
                        //        OrderNo = oi.OrderNo,
 | 
					 | 
				
			||||||
                        //        ManuNo = cs.ManuNo,
 | 
					 | 
				
			||||||
                        //        EffDate = cs.EffDate,
 | 
					 | 
				
			||||||
                        //        OutQuantity = oi._OrderDetail.Quantity,
 | 
					 | 
				
			||||||
                        //        UserId1 = HomeWindowViewModel.Operator?.Id,
 | 
					 | 
				
			||||||
                        //        UserId2 = HomeWindowViewModel.Reviewer?.Id,
 | 
					 | 
				
			||||||
                        //        MachineId = ConfigurationManager.AppSettings["dm_machineId"].ToString(),
 | 
					 | 
				
			||||||
                        //        CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
 | 
					 | 
				
			||||||
                        //        CreateTime = DateTime.Now,
 | 
					 | 
				
			||||||
                        //        InvoiceNo = oi.OrderNo
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        //    }).ExecuteCommand();
 | 
					 | 
				
			||||||
                        //    //修改凌晨生成的日结存与总结存数据
 | 
					 | 
				
			||||||
                        //    AccountBookG2 accountBookG2Day = SqlSugarHelper.Db.Queryable<AccountBookG2>()
 | 
					 | 
				
			||||||
                        //    .Where(ab => ab.MachineId.Equals(ConfigurationManager.AppSettings["dm_machineId"].ToString()))
 | 
					 | 
				
			||||||
                        //    .Where(ab => ab.Type == 3)
 | 
					 | 
				
			||||||
                        //    .Where(ab => ab.DrugId == oi._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 - oi._OrderDetail.Quantity;
 | 
					 | 
				
			||||||
                        //        SqlSugarHelper.Db.Updateable(accountBookG2Day).ExecuteCommand();
 | 
					 | 
				
			||||||
                        //    }
 | 
					 | 
				
			||||||
                        //    else
 | 
					 | 
				
			||||||
                        //    {
 | 
					 | 
				
			||||||
                        //        //生成日结存时可能没有该库位的绑定信息,需要写入日结存
 | 
					 | 
				
			||||||
                        //        int iDayResult = SqlSugarHelper.Db.Insertable(new AccountBookG2()
 | 
					 | 
				
			||||||
                        //        {
 | 
					 | 
				
			||||||
                        //            DrugId = oi._OrderDetail.DrugId,
 | 
					 | 
				
			||||||
                        //            Type = 3,
 | 
					 | 
				
			||||||
                        //            ManuNo = cs.ManuNo,
 | 
					 | 
				
			||||||
                        //            EffDate = cs.EffDate,
 | 
					 | 
				
			||||||
                        //            YQuantity = 0,
 | 
					 | 
				
			||||||
                        //            ManuStock = oi._OrderDetail.Quantity,
 | 
					 | 
				
			||||||
                        //            TotalStock = oi._OrderDetail.Quantity,
 | 
					 | 
				
			||||||
                        //            UserId1 = HomeWindowViewModel.Operator?.Id,
 | 
					 | 
				
			||||||
                        //            UserId2 = HomeWindowViewModel.Reviewer?.Id,
 | 
					 | 
				
			||||||
                        //            MachineId = ConfigurationManager.AppSettings["dm_machineId"].ToString(),
 | 
					 | 
				
			||||||
                        //            CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
 | 
					 | 
				
			||||||
                        //            InvoiceNo = "日结存"
 | 
					 | 
				
			||||||
                        //        }).ExecuteCommand();
 | 
					 | 
				
			||||||
                        //        if (iDayResult <= 0)
 | 
					 | 
				
			||||||
                        //        {
 | 
					 | 
				
			||||||
                        //            logger.Info($"未写入日结存数据{oi._OrderDetail.DrugId}-{cs.ManuNo}-{cs.EffDate}-{cs.Quantity}");
 | 
					 | 
				
			||||||
                        //        }
 | 
					 | 
				
			||||||
                        //    }
 | 
					 | 
				
			||||||
                        //    //修改凌晨生成的日结存与总结存数据
 | 
					 | 
				
			||||||
                        //    AccountBookG2 accountBookG2Total = SqlSugarHelper.Db.Queryable<AccountBookG2>()
 | 
					 | 
				
			||||||
                        //    .Where(ab => ab.MachineId.Equals(ConfigurationManager.AppSettings["dm_machineId"].ToString()))
 | 
					 | 
				
			||||||
                        //    .Where(ab => ab.Type == 4)
 | 
					 | 
				
			||||||
                        //    .Where(ab => ab.DrugId == oi._OrderDetail.DrugId)
 | 
					 | 
				
			||||||
                        //    .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First();
 | 
					 | 
				
			||||||
                        //    if (accountBookG2Total != null)
 | 
					 | 
				
			||||||
                        //    {
 | 
					 | 
				
			||||||
                        //        accountBookG2Total.TotalStock = accountBookG2Total.TotalStock - oi._OrderDetail.Quantity;
 | 
					 | 
				
			||||||
                        //        SqlSugarHelper.Db.Updateable(accountBookG2Total).ExecuteCommand();
 | 
					 | 
				
			||||||
                        //    }
 | 
					 | 
				
			||||||
                        //    else
 | 
					 | 
				
			||||||
                        //    {
 | 
					 | 
				
			||||||
                        //        //生成总结存时可能没有该库位的绑定信息,需要写入总结存
 | 
					 | 
				
			||||||
                        //        int iTotalResult = SqlSugarHelper.Db.Insertable(new AccountBookG2()
 | 
					 | 
				
			||||||
                        //        {
 | 
					 | 
				
			||||||
                        //            DrugId = oi._OrderDetail.DrugId,
 | 
					 | 
				
			||||||
                        //            Type = 4,
 | 
					 | 
				
			||||||
                        //            YQuantity = 0,
 | 
					 | 
				
			||||||
                        //            ManuStock = oi._OrderDetail.Quantity,
 | 
					 | 
				
			||||||
                        //            TotalStock = oi._OrderDetail.Quantity,
 | 
					 | 
				
			||||||
                        //            UserId1 = HomeWindowViewModel.Operator?.Id,
 | 
					 | 
				
			||||||
                        //            UserId2 = HomeWindowViewModel.Reviewer?.Id,
 | 
					 | 
				
			||||||
                        //            MachineId = ConfigurationManager.AppSettings["dm_machineId"].ToString(),
 | 
					 | 
				
			||||||
                        //            CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
 | 
					 | 
				
			||||||
                        //            InvoiceNo = "总结存"
 | 
					 | 
				
			||||||
                        //        }).ExecuteCommand();
 | 
					 | 
				
			||||||
                        //        if (iTotalResult <= 0)
 | 
					 | 
				
			||||||
                        //        {
 | 
					 | 
				
			||||||
                        //            logger.Info($"未写入总结存数据{oi._OrderDetail.DrugId}-{oi._OrderDetail.Quantity}");
 | 
					 | 
				
			||||||
                        //        }
 | 
					 | 
				
			||||||
                        //    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        //}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        #endregion
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    //if (!string.IsNullOrEmpty(empChannelStock))
 | 
					                    //if (!string.IsNullOrEmpty(empChannelStock))
 | 
				
			||||||
                    //{
 | 
					                    //{
 | 
				
			||||||
| 
						 | 
					@ -1328,6 +1123,7 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
        private void GetUseBox()
 | 
					        private void GetUseBox()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            List<ChannelList> chlList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5").ToList();//.Select(cl => cl.BelongUser).First();
 | 
					            List<ChannelList> chlList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5").ToList();//.Select(cl => cl.BelongUser).First();
 | 
				
			||||||
 | 
					            chlList = chlList.GroupBy(cl => cl.DrawerNo).Select(cl => cl.FirstOrDefault()).ToList();
 | 
				
			||||||
            if (chlList != null && chlList.Count > 0)
 | 
					            if (chlList != null && chlList.Count > 0)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                for (int i = 0; i < chlList.Count; i++)
 | 
					                for (int i = 0; i < chlList.Count; i++)
 | 
				
			||||||
| 
						 | 
					@ -1340,9 +1136,34 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    //DrawerType== 1为公共药箱
 | 
					                    //DrawerType== 1为公共药箱
 | 
				
			||||||
                    if (chl.DrawerType == 1)
 | 
					                    if (chl.DrawerType == 1)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        if (OperationType == 1)
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            //取药箱,在库则可取,不在则不可取
 | 
				
			||||||
 | 
					                            if (chl.DrawerState == 1)
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                SetBtnEnable(chl.DrawerNo, true);
 | 
					                                SetBtnEnable(chl.DrawerNo, true);
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
 | 
					                            else
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                SetBtnEnable(chl.DrawerNo, false);
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                        else
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            //还药箱,只能还自己取过的药箱
 | 
				
			||||||
 | 
					                            //查询用户取过哪些药箱
 | 
				
			||||||
 | 
					                            string[] BoxNumber = HomeWindowViewModel.Operator.BoxNumber.Split(',');
 | 
				
			||||||
 | 
					                            if (BoxNumber != null && BoxNumber.Contains(chl.DrawerNo.ToString()))
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                SetBtnEnable(chl.DrawerNo, true);
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                            else
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                SetBtnEnable(chl.DrawerNo, false);
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
                    if (!string.IsNullOrEmpty(chl.BelongUser) && chl.BelongUser == HomeWindowViewModel.Operator.UserBarcode)
 | 
					                    if (!string.IsNullOrEmpty(chl.BelongUser) && chl.BelongUser == HomeWindowViewModel.Operator.UserBarcode)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        if (DrawerType == -1)
 | 
					                        if (DrawerType == -1)
 | 
				
			||||||
| 
						 | 
					@ -1354,98 +1175,39 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public void OnNavigatedTo(NavigationContext navigationContext)
 | 
					        public void OnNavigatedTo(NavigationContext navigationContext)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            logger.Info("进入OnNavigatedTo");
 | 
					            logger.Info("进入OnNavigatedTo");
 | 
				
			||||||
            RequestData();
 | 
					            OpenOrderDialog();
 | 
				
			||||||
 | 
					            //RequestData();
 | 
				
			||||||
            logger.Info("结束RequestData");
 | 
					            logger.Info("结束RequestData");
 | 
				
			||||||
            //if(ModbusHelper.BoxOperate)
 | 
					 | 
				
			||||||
            //{
 | 
					 | 
				
			||||||
            //    Task.Factory.StartNew(() => { ModbusHelper.SpeakAsync("请关闭药箱后再打开"); });
 | 
					 | 
				
			||||||
            //    return;
 | 
					 | 
				
			||||||
            //}
 | 
					 | 
				
			||||||
            ////查询当前药师的第一个药箱号并打开该药箱
 | 
					 | 
				
			||||||
            //int drawerNo = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5" && cl.BelongUser == HomeWindowViewModel.Operator.UserBarcode).Select(cl => cl.DrawerNo).First();
 | 
					 | 
				
			||||||
            //if (drawerNo > 0)
 | 
					 | 
				
			||||||
            //{
 | 
					 | 
				
			||||||
            //SetAllBtnEnableFalse();
 | 
					 | 
				
			||||||
            //DrawerNo = drawerNo;
 | 
					 | 
				
			||||||
            ////进入页面打开当前用户的第一个药箱
 | 
					 | 
				
			||||||
            ////记录开药箱日志
 | 
					 | 
				
			||||||
            //SqlSugarHelper.Db.Insertable(new MachineRecord()
 | 
					 | 
				
			||||||
            //{
 | 
					 | 
				
			||||||
            //    MachineId = "DM5",
 | 
					 | 
				
			||||||
            //    DrawerNo = drawerNo,
 | 
					 | 
				
			||||||
            //    Operator = HomeWindowViewModel.Operator?.Id,
 | 
					 | 
				
			||||||
            //    OperationTime = DateTime.Now,
 | 
					 | 
				
			||||||
            //    Type = 55,
 | 
					 | 
				
			||||||
            //    InvoiceId = $"打开{drawerNo}号药箱",
 | 
					 | 
				
			||||||
            //    //OptionType = SelfContent.Substring(0, 1) == "取" ? 0 : 1
 | 
					 | 
				
			||||||
            //}).ExecuteCommand();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            //ModbusHelper.SpeakAsync($"正在打开{drawerNo}号药箱");
 | 
					 | 
				
			||||||
            //logger.Info($"正在打开{drawerNo}号药箱");
 | 
					 | 
				
			||||||
            //ModbusHelper.GetInstance().OpenBoxDoor(drawerNo - 1);
 | 
					 | 
				
			||||||
            //SetBtnEnable(drawerNo, false);
 | 
					 | 
				
			||||||
            //if (CheckBoxStatusTimer is null)
 | 
					 | 
				
			||||||
            //{
 | 
					 | 
				
			||||||
            //    CheckBoxStatusTimer = new System.Timers.Timer();
 | 
					 | 
				
			||||||
            //}
 | 
					 | 
				
			||||||
            //if (!CheckBoxStatusTimer.Enabled)
 | 
					 | 
				
			||||||
            //{
 | 
					 | 
				
			||||||
            //    CheckBoxStatusTimer.Elapsed += new System.Timers.ElapsedEventHandler(GetAllBoxState);
 | 
					 | 
				
			||||||
            //    CheckBoxStatusTimer.Interval = 3000;
 | 
					 | 
				
			||||||
            //    CheckBoxStatusTimer.Start();
 | 
					 | 
				
			||||||
            //}
 | 
					 | 
				
			||||||
            //记录药箱打开时间
 | 
					 | 
				
			||||||
            //ChannelList channelList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5" && cl.DrawerNo == drawerNo).First();
 | 
					 | 
				
			||||||
            //if (channelList != null && (channelList.EffDate is null || Convert.ToDateTime(channelList.EffDate).ToString("yyyy-MM-dd") != DateTime.Now.ToString("yyyy-MM-dd")))
 | 
					 | 
				
			||||||
            //{
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            //    channelList.EffDate = DateTime.Now.ToString();
 | 
					 | 
				
			||||||
            //    SqlSugarHelper.Db.Updateable(channelList).UpdateColumns(it => new { it.EffDate }).ExecuteCommand();
 | 
					 | 
				
			||||||
            //}
 | 
					 | 
				
			||||||
            //Task.Factory.StartNew(async () =>
 | 
					 | 
				
			||||||
            //{
 | 
					 | 
				
			||||||
            //    bool loop = true;
 | 
					 | 
				
			||||||
            //    while (loop)
 | 
					 | 
				
			||||||
            //    {
 | 
					 | 
				
			||||||
            //        await Task.Delay(4000);
 | 
					 | 
				
			||||||
            //        bool[] boolsl = ModbusHelper.GetInstance().GetAllBoxState();
 | 
					 | 
				
			||||||
            //        bool state = Array.TrueForAll(boolsl, b => b == false);
 | 
					 | 
				
			||||||
            //        if (state)
 | 
					 | 
				
			||||||
            //        {
 | 
					 | 
				
			||||||
            //            loop = false;
 | 
					 | 
				
			||||||
            //            ModbusHelper.BoxOperate = false;
 | 
					 | 
				
			||||||
            //        }
 | 
					 | 
				
			||||||
            //        else
 | 
					 | 
				
			||||||
            //        {
 | 
					 | 
				
			||||||
            //            ModbusHelper.BoxOperate = true;
 | 
					 | 
				
			||||||
            //            //ModbusHelper.SpeakAsync("药箱已打开,请及时关闭");
 | 
					 | 
				
			||||||
            //        }
 | 
					 | 
				
			||||||
            //    }
 | 
					 | 
				
			||||||
            //});
 | 
					 | 
				
			||||||
            //}
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        //private void GetAllBoxState(object sender, ElapsedEventArgs e)
 | 
					        public async Task OpenOrderDialog()
 | 
				
			||||||
        //{
 | 
					        {
 | 
				
			||||||
        //    //查询药箱是否关闭,如果已经关闭则按钮可用,可继续开该编号的药箱
 | 
					            // 此处延时1毫秒,等待页面渲染
 | 
				
			||||||
        //    if (DrawerNo >= 0)
 | 
					            await Task.Delay(TimeSpan.FromMilliseconds(1));
 | 
				
			||||||
        //    {
 | 
					            DialogServiceExtensions.ShowDialogHost(_dialogService, "SelectOperationTypeDialog", null, DoDialogResult, "RootDialog");
 | 
				
			||||||
        //        bool[] boolArrs = ModbusHelper.GetInstance().GetAllBoxState();
 | 
					 | 
				
			||||||
        //        bool allFalse = Array.TrueForAll(boolArrs, b => b == false);
 | 
					 | 
				
			||||||
        //        if (allFalse)
 | 
					 | 
				
			||||||
        //        {
 | 
					 | 
				
			||||||
        //            if (CheckBoxStatusTimer.Enabled)
 | 
					 | 
				
			||||||
        //            {
 | 
					 | 
				
			||||||
        //                CheckBoxStatusTimer.Stop();
 | 
					 | 
				
			||||||
        //            }
 | 
					 | 
				
			||||||
        //        }
 | 
					 | 
				
			||||||
        //        //设置对应药箱按钮可用状态
 | 
					 | 
				
			||||||
        //        SetBtnEnable(DrawerNo, !boolArrs[DrawerNo]);
 | 
					 | 
				
			||||||
        //    }
 | 
					 | 
				
			||||||
        //}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private void DoDialogResult(IDialogResult dialogResult)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            // 委托   被动执行     被子窗口执行
 | 
				
			||||||
 | 
					            // dialogResult  第一方面可以拿到任意参数   第二方面   可判断关闭状态
 | 
				
			||||||
 | 
					            if (dialogResult.Result == ButtonResult.OK)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                //取药箱,只能取在库存的药箱
 | 
				
			||||||
 | 
					                OperationType = 1;
 | 
				
			||||||
 | 
					                GetUseBox();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                //还药箱,只能点自己取过的药箱
 | 
				
			||||||
 | 
					                OperationType = 0;
 | 
				
			||||||
 | 
					                RequestData();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            //MessageBox.Show("返回值:" + dialogResult.Result.ToString());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        public bool IsNavigationTarget(NavigationContext navigationContext)
 | 
					        public bool IsNavigationTarget(NavigationContext navigationContext)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
| 
						 | 
					@ -1456,5 +1218,31 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
            // 取消消息订阅
 | 
					            // 取消消息订阅
 | 
				
			||||||
            //_eventAggregator.GetEvent<PortUtilEvent>().Unsubscribe(DoMyPrismEvent);
 | 
					            //_eventAggregator.GetEvent<PortUtilEvent>().Unsubscribe(DoMyPrismEvent);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 点击取药箱按钮
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        public DelegateCommand TakeBoxCommand
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new DelegateCommand(TakeBoxMethod);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public void TakeBoxMethod()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            OperationType = 1; 
 | 
				
			||||||
 | 
					            GetUseBox();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 点击还药箱按钮
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        public DelegateCommand ReturnBoxCommand
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new DelegateCommand(ReturnBoxMethod);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public void ReturnBoxMethod()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            OperationType = 0;
 | 
				
			||||||
 | 
					            GetUseBox();
 | 
				
			||||||
 | 
					            RequestData();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -192,6 +192,161 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                                //    Id = it.Chnguid
 | 
					                                //    Id = it.Chnguid
 | 
				
			||||||
                                //}).UpdateColumns(cl => new { cl.State }).ExecuteCommand();
 | 
					                                //}).UpdateColumns(cl => new { cl.State }).ExecuteCommand();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                //盘点改库存记录账册,多了则记录入库、少了记录出库
 | 
				
			||||||
 | 
					                                if(it.CheckQuantity!=it.Quantity)
 | 
				
			||||||
 | 
					                                {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                    //查询上一条账册中的空瓶数
 | 
				
			||||||
 | 
					                                    AccountBookG2 accountBookEmpty = SqlSugarHelper.Db.Queryable<AccountBookG2>()
 | 
				
			||||||
 | 
					                                    .Where(ab => ab.MachineId.Equals(ConfigurationManager.AppSettings["dm_machineId"].ToString()))
 | 
				
			||||||
 | 
					                                    .Where(ab => ab.Type == 1 || ab.Type == 2)
 | 
				
			||||||
 | 
					                                    .Where(ab => ab.DrugId == it.DrugId)
 | 
				
			||||||
 | 
					                                    .Where(ab => ab.ManuNo == it.ManuNo).OrderByDescending(ab => ab.Id).First();
 | 
				
			||||||
 | 
					                                    //修改凌晨生成的日结存与总结存数据
 | 
				
			||||||
 | 
					                                    AccountBookG2 accountBookG2Day = SqlSugarHelper.Db.Queryable<AccountBookG2>()
 | 
				
			||||||
 | 
					                                    .Where(ab => ab.MachineId.Equals(ConfigurationManager.AppSettings["dm_machineId"].ToString()))
 | 
				
			||||||
 | 
					                                    .Where(ab => ab.Type == 3)
 | 
				
			||||||
 | 
					                                    .Where(ab => ab.DrugId == it.DrugId)
 | 
				
			||||||
 | 
					                                    .Where(ab => ab.ManuNo == it.ManuNo)
 | 
				
			||||||
 | 
					                                    .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First();
 | 
				
			||||||
 | 
					                                    // 获取更新完库存后的药品库存
 | 
				
			||||||
 | 
					                                    List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>()
 | 
				
			||||||
 | 
					                                        .Where(cs => (cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"]) && cs.DrawerType == 1) || cs.MachineId.Equals(ConfigurationManager.AppSettings["jj_machineId"]))
 | 
				
			||||||
 | 
					                                        .Where(cs => cs.DrugId.Equals(it.DrugId))
 | 
				
			||||||
 | 
					                                        .Where(cs => cs.ManuNo.Equals(it.ManuNo))
 | 
				
			||||||
 | 
					                                        //.Where(cs => cs.DrawerType == 1)
 | 
				
			||||||
 | 
					                                        .ToList();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                    int manuStock = 0;
 | 
				
			||||||
 | 
					                                    if (it.CheckQuantity-it.Quantity>0)
 | 
				
			||||||
 | 
					                                    {
 | 
				
			||||||
 | 
					                                        //盘多了,记录入库
 | 
				
			||||||
 | 
					                                        if (accountBookG2Day != null)
 | 
				
			||||||
 | 
					                                        {
 | 
				
			||||||
 | 
					                                            accountBookG2Day.ManuStock = accountBookG2Day.ManuStock + (it.CheckQuantity - it.Quantity);
 | 
				
			||||||
 | 
					                                            accountBookG2Day.AddQuantity = accountBookG2Day.AddQuantity + (it.CheckQuantity - it.Quantity);
 | 
				
			||||||
 | 
					                                            //负数直接记0
 | 
				
			||||||
 | 
					                                            accountBookG2Day.TotalStock = (accountBookEmpty != null ? (accountBookEmpty.TotalStock > 0 && accountBookEmpty.TotalStock > (it.CheckQuantity - it.Quantity) ? accountBookEmpty.TotalStock - (it.CheckQuantity - it.Quantity) : 0) : 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                            SqlSugarHelper.Db.Updateable(accountBookG2Day).ExecuteCommand();
 | 
				
			||||||
 | 
					                                            manuStock = accountBookG2Day.ManuStock;
 | 
				
			||||||
 | 
					                                        }
 | 
				
			||||||
 | 
					                                        else
 | 
				
			||||||
 | 
					                                        {
 | 
				
			||||||
 | 
					                                            //生成日结存时可能没有该库位的绑定信息,需要写入日结存
 | 
				
			||||||
 | 
					                                            int iDayResult = SqlSugarHelper.Db.Insertable(new AccountBookG2()
 | 
				
			||||||
 | 
					                                            {
 | 
				
			||||||
 | 
					                                                DrugId = it.DrugId,
 | 
				
			||||||
 | 
					                                                Type = 3,
 | 
				
			||||||
 | 
					                                                ManuNo = it.ManuNo,
 | 
				
			||||||
 | 
					                                                EffDate = it.EffDate,
 | 
				
			||||||
 | 
					                                                YQuantity = 0,
 | 
				
			||||||
 | 
					                                                ManuStock = (it.CheckQuantity - it.Quantity),
 | 
				
			||||||
 | 
					                                                TotalStock = (it.CheckQuantity - it.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 = "日结存",
 | 
				
			||||||
 | 
					                                                AddQuantity = (it.CheckQuantity - it.Quantity)
 | 
				
			||||||
 | 
					                                            }).ExecuteCommand();
 | 
				
			||||||
 | 
					                                            if (iDayResult <= 0)
 | 
				
			||||||
 | 
					                                            {
 | 
				
			||||||
 | 
					                                                logger.Info($"未写入日结存数据{it.DrugId}-{it.ManuNo}-{it.EffDate}-{it.CheckQuantity - it.Quantity}");
 | 
				
			||||||
 | 
					                                            }
 | 
				
			||||||
 | 
					                                        }
 | 
				
			||||||
 | 
					                                        //保存账册
 | 
				
			||||||
 | 
					                                        SqlSugarHelper.Db.Insertable(new AccountBookG2()
 | 
				
			||||||
 | 
					                                        {
 | 
				
			||||||
 | 
					                                            DrugId = it.DrugId,
 | 
				
			||||||
 | 
					                                            Type = 1,
 | 
				
			||||||
 | 
					                                            Department = ConfigurationManager.AppSettings["department"].ToString(),
 | 
				
			||||||
 | 
					                                            InvoiceNo = InvoiceId,
 | 
				
			||||||
 | 
					                                            ManuNo = it.ManuNo,
 | 
				
			||||||
 | 
					                                            EffDate = it.EffDate,
 | 
				
			||||||
 | 
					                                            AddQuantity = it.CheckQuantity - it.Quantity,
 | 
				
			||||||
 | 
					                                            UserId1 = HomeWindowViewModel.Operator?.Id,
 | 
				
			||||||
 | 
					                                            UserId2 = HomeWindowViewModel.Reviewer?.Id,
 | 
				
			||||||
 | 
					                                            MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
 | 
				
			||||||
 | 
					                                            CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
 | 
				
			||||||
 | 
					                                            CreateTime = DateTime.Now,
 | 
				
			||||||
 | 
					                                            ManuStock = manuStock > 0 ? manuStock : nowChannels.Sum(it => it.Quantity),
 | 
				
			||||||
 | 
					                                            TotalStock = (accountBookEmpty != null ? (accountBookEmpty.TotalStock > 0 && accountBookEmpty.TotalStock > (it.CheckQuantity - it.Quantity) ? accountBookEmpty.TotalStock - (it.CheckQuantity - it.Quantity) : 0) : 0)  //负数直接记0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                        }).ExecuteCommand();
 | 
				
			||||||
 | 
					                                    }
 | 
				
			||||||
 | 
					                                    else
 | 
				
			||||||
 | 
					                                    {
 | 
				
			||||||
 | 
					                                        //盘少了,记录出库
 | 
				
			||||||
 | 
					                                        if (accountBookG2Day != null)
 | 
				
			||||||
 | 
					                                        {
 | 
				
			||||||
 | 
					                                            accountBookG2Day.ManuStock = accountBookG2Day.ManuStock - (it.Quantity-it.CheckQuantity);
 | 
				
			||||||
 | 
					                                            accountBookG2Day.OutQuantity = accountBookG2Day.OutQuantity + (it.Quantity - it.CheckQuantity);
 | 
				
			||||||
 | 
					                                            SqlSugarHelper.Db.Updateable(accountBookG2Day).ExecuteCommand();
 | 
				
			||||||
 | 
					                                            //accountBookG2Day.UseDose = (Convert.ToInt32(accountBookG2Day.UseDose) + Convert.ToInt32(oi._OrderDetail.surgicalResidual.UseDose)).ToString();//盘点减的库存没有使用剂量
 | 
				
			||||||
 | 
					                                            //accountBookG2Day.ResidualDose = (Convert.ToInt32(accountBookG2Day.ResidualDose) + Convert.ToInt32(oi._OrderDetail.surgicalResidual.ResidualDose)).ToString();//盘点减的库存没有剩余剂量
 | 
				
			||||||
 | 
					                                            accountBookG2Day.TotalStock = (accountBookEmpty != null ? (accountBookEmpty.TotalStock > 0 ? accountBookEmpty.TotalStock : 0) : 0) + (it.Quantity - it.CheckQuantity);
 | 
				
			||||||
 | 
					                                            manuStock = accountBookG2Day.ManuStock;
 | 
				
			||||||
 | 
					                                        }
 | 
				
			||||||
 | 
					                                        else
 | 
				
			||||||
 | 
					                                        {
 | 
				
			||||||
 | 
					                                            //生成日结存时可能没有该库位的绑定信息,需要写入日结存
 | 
				
			||||||
 | 
					                                            int iDayResult = SqlSugarHelper.Db.Insertable(new AccountBookG2()
 | 
				
			||||||
 | 
					                                            {
 | 
				
			||||||
 | 
					                                                DrugId =it.DrugId,
 | 
				
			||||||
 | 
					                                                Type = 3,
 | 
				
			||||||
 | 
					                                                ManuNo = it.ManuNo,
 | 
				
			||||||
 | 
					                                                EffDate = it.EffDate,
 | 
				
			||||||
 | 
					                                                YQuantity = 0,
 | 
				
			||||||
 | 
					                                                ManuStock = nowChannels.Sum(it => it.Quantity), //oi._OrderDetail.Quantity,
 | 
				
			||||||
 | 
					                                                TotalStock = it.Quantity - it.CheckQuantity,
 | 
				
			||||||
 | 
					                                                UserId1 = HomeWindowViewModel.Operator?.Id,
 | 
				
			||||||
 | 
					                                                UserId2 = HomeWindowViewModel.Reviewer?.Id,
 | 
				
			||||||
 | 
					                                                MachineId = ConfigurationManager.AppSettings["dm_machineId"].ToString(),
 | 
				
			||||||
 | 
					                                                CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
 | 
				
			||||||
 | 
					                                                CreateTime = DateTime.Now,
 | 
				
			||||||
 | 
					                                                InvoiceNo = "日结存",
 | 
				
			||||||
 | 
					                                                OutQuantity = (it.Quantity - it.CheckQuantity),
 | 
				
			||||||
 | 
					                                                //UseDose = oi._OrderDetail.surgicalResidual.UseDose,
 | 
				
			||||||
 | 
					                                                //ResidualDose = oi._OrderDetail.surgicalResidual.ResidualDose
 | 
				
			||||||
 | 
					                                            }).ExecuteCommand();
 | 
				
			||||||
 | 
					                                            if (iDayResult <= 0)
 | 
				
			||||||
 | 
					                                            {
 | 
				
			||||||
 | 
					                                                logger.Info($"未写入日结存数据{it.DrugId}-{it.ManuNo}-{it.EffDate}-{it.Quantity-it.CheckQuantity}");
 | 
				
			||||||
 | 
					                                            }
 | 
				
			||||||
 | 
					                                        }
 | 
				
			||||||
 | 
					                                        //查询上一条账册中的空瓶数
 | 
				
			||||||
 | 
					                                        //AccountBookG2 accountBookEmpty = SqlSugarHelper.Db.Queryable<AccountBookG2>()
 | 
				
			||||||
 | 
					                                        //.Where(ab => ab.MachineId.Equals(ConfigurationManager.AppSettings["dm_machineId"].ToString()))
 | 
				
			||||||
 | 
					                                        //.Where(ab => ab.Type == 1 || ab.Type == 2)
 | 
				
			||||||
 | 
					                                        //.Where(ab => ab.DrugId == oi._OrderDetail.DrugId)
 | 
				
			||||||
 | 
					                                        //.Where(ab => ab.ManuNo == cs.ManuNo).OrderByDescending(ab => ab.Id).First();
 | 
				
			||||||
 | 
					                                        //保存账册
 | 
				
			||||||
 | 
					                                        int iInsertResult = SqlSugarHelper.Db.Insertable(new AccountBookG2()
 | 
				
			||||||
 | 
					                                        {
 | 
				
			||||||
 | 
					                                            DrugId = it.DrugId,
 | 
				
			||||||
 | 
					                                            Type = 2,
 | 
				
			||||||
 | 
					                                            //Department = oi.DeptName,
 | 
				
			||||||
 | 
					                                            OrderNo = $"checkStock_{it.DrawerNo}_{it.ColNo}_{it.Quantity}_{it.CheckQuantity}_{DateTime.Now}",
 | 
				
			||||||
 | 
					                                            ManuNo = it.ManuNo,
 | 
				
			||||||
 | 
					                                            EffDate = it.EffDate,
 | 
				
			||||||
 | 
					                                            OutQuantity = it.Quantity-it.CheckQuantity,
 | 
				
			||||||
 | 
					                                            UserId1 = HomeWindowViewModel.Operator?.Id,
 | 
				
			||||||
 | 
					                                            UserId2 = HomeWindowViewModel.Reviewer?.Id,
 | 
				
			||||||
 | 
					                                            MachineId = ConfigurationManager.AppSettings["dm_machineId"].ToString(),
 | 
				
			||||||
 | 
					                                            CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
 | 
				
			||||||
 | 
					                                            CreateTime = DateTime.Now,
 | 
				
			||||||
 | 
					                                            InvoiceNo = $"checkStock_{it.DrawerNo}_{it.ColNo}_{it.Quantity}_{it.CheckQuantity}_{DateTime.Now}",
 | 
				
			||||||
 | 
					                                            ManuStock = manuStock > 0 ? manuStock : nowChannels.Sum(it => it.Quantity),
 | 
				
			||||||
 | 
					                                            TotalStock = (accountBookEmpty != null ? (accountBookEmpty.TotalStock > 0 ? accountBookEmpty.TotalStock : 0) : 0) + (it.Quantity - it.CheckQuantity),
 | 
				
			||||||
 | 
					                                            //ShoushuJian = drawerNo.ToString()
 | 
				
			||||||
 | 
					                                        }).ExecuteCommand();
 | 
				
			||||||
 | 
					                                        //修改凌晨生成的日结存与总结存数据
 | 
				
			||||||
 | 
					                                     
 | 
				
			||||||
 | 
					                                    }
 | 
				
			||||||
 | 
					                                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                // 保存数据 盘点记录
 | 
					                                // 保存数据 盘点记录
 | 
				
			||||||
                                SqlSugarHelper.Db.Insertable(new MachineRecord()
 | 
					                                SqlSugarHelper.Db.Insertable(new MachineRecord()
 | 
				
			||||||
                                {
 | 
					                                {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -589,7 +589,7 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
            PremissionDmList = premissions;
 | 
					            PremissionDmList = premissions;
 | 
				
			||||||
            SelectedMenu = premissions[0];
 | 
					            SelectedMenu = premissions[0];
 | 
				
			||||||
            SelectedChildMenu = premissions[0].Children[0];
 | 
					            SelectedChildMenu = premissions[0].Children[0];
 | 
				
			||||||
            _regionManager.RequestNavigate("ContentRegion", premissions[0].Children[0].PremissionPath);
 | 
					            //_regionManager.RequestNavigate("ContentRegion", premissions[0].Children[0].PremissionPath);
 | 
				
			||||||
            //FindDrawerCount();
 | 
					            //FindDrawerCount();
 | 
				
			||||||
            int autoExit = Convert.ToInt32(ConfigurationManager.AppSettings["autoExit"] ?? "0");
 | 
					            int autoExit = Convert.ToInt32(ConfigurationManager.AppSettings["autoExit"] ?? "0");
 | 
				
			||||||
            if (autoExit > 0)
 | 
					            if (autoExit > 0)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -220,18 +220,14 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                PremissionPath = "AdditionWindow",
 | 
					                PremissionPath = "AdditionWindow",
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            //PremissionDm quyao1 = new PremissionDm
 | 
					            //管理做麻醉师核对处方的操作
 | 
				
			||||||
            //{
 | 
					            PremissionDm adminCheck = new PremissionDm
 | 
				
			||||||
            //    Id = 11,
 | 
					            {
 | 
				
			||||||
            //    PremissionName = "交接柜补药",
 | 
					                Id = 13,
 | 
				
			||||||
            //    PremissionPath = "AddToJiaoJieWindow",
 | 
					                PremissionName = "管理员操作手术间",
 | 
				
			||||||
            //};
 | 
					                //PremissionPath = "CheckOrderWindow",
 | 
				
			||||||
            //PremissionDm quyao2 = new PremissionDm
 | 
					                PremissionPath = "CheckSelfOrderForAdminViewModel",
 | 
				
			||||||
            //{
 | 
					            };
 | 
				
			||||||
            //    Id = 12,
 | 
					 | 
				
			||||||
            //    PremissionName = "调拨出库",
 | 
					 | 
				
			||||||
            //    PremissionPath = "InvoiceOutWindow",
 | 
					 | 
				
			||||||
            //};
 | 
					 | 
				
			||||||
            PremissionDm quyao3 = new PremissionDm
 | 
					            PremissionDm quyao3 = new PremissionDm
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 13,
 | 
					                Id = 13,
 | 
				
			||||||
| 
						 | 
					@ -270,6 +266,7 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
            //quyaoChild.Add(openBox);
 | 
					            //quyaoChild.Add(openBox);
 | 
				
			||||||
            quyaoChild.Add(checkOrder);
 | 
					            quyaoChild.Add(checkOrder);
 | 
				
			||||||
            quyaoChild.Add(addition);
 | 
					            quyaoChild.Add(addition);
 | 
				
			||||||
 | 
					            quyaoChild.Add(adminCheck);
 | 
				
			||||||
            quyaoChild.Add(openBoxWithOrder);
 | 
					            quyaoChild.Add(openBoxWithOrder);
 | 
				
			||||||
            quyao.Children = quyaoChild;
 | 
					            quyao.Children = quyaoChild;
 | 
				
			||||||
            defaultAll.Add(quyao);
 | 
					            defaultAll.Add(quyao);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,51 @@
 | 
				
			||||||
 | 
					using Prism.Commands;
 | 
				
			||||||
 | 
					using Prism.Mvvm;
 | 
				
			||||||
 | 
					using Prism.Regions;
 | 
				
			||||||
 | 
					using Prism.Services.Dialogs;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.ViewModels
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class SelectOperationTypeDialogViewModel : BindableBase, IDialogAware, IRegionMemberLifetime
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public string Title => "请选择操作类型";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool KeepAlive =>false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public event Action<IDialogResult> RequestClose;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool CanCloseDialog()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return true;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void OnDialogClosed()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void OnDialogOpened(IDialogParameters parameters)
 | 
				
			||||||
 | 
					        { 
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public DelegateCommand CancelCommand
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new DelegateCommand(() =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                // 关闭当前窗口
 | 
				
			||||||
 | 
					                RequestClose?.Invoke(new DialogResult(ButtonResult.Cancel));
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public DelegateCommand ConfirmCommand
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new DelegateCommand(() =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                //确认
 | 
				
			||||||
 | 
					                RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,232 @@
 | 
				
			||||||
 | 
					<UserControl x:Class="DM_Weight.Views.CheckSelfOrderForAdmin"
 | 
				
			||||||
 | 
					             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 | 
				
			||||||
 | 
					             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 | 
				
			||||||
 | 
					             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
 | 
				
			||||||
 | 
					             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"   
 | 
				
			||||||
 | 
					             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" 
 | 
				
			||||||
 | 
					             prism:ViewModelLocator.AutoWireViewModel="True"
 | 
				
			||||||
 | 
					             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
 | 
				
			||||||
 | 
					             xmlns:pagination="clr-namespace:DM_Weight.Components.pagination"
 | 
				
			||||||
 | 
					             xmlns:local="clr-namespace:DM_Weight.Views"
 | 
				
			||||||
 | 
					             mc:Ignorable="d" 
 | 
				
			||||||
 | 
					             xmlns:convert="clr-namespace:DM_Weight.Converter"
 | 
				
			||||||
 | 
					             xmlns:prism="http://prismlibrary.com/">
 | 
				
			||||||
 | 
					    <UserControl.Resources>
 | 
				
			||||||
 | 
					        <convert:OrderStatusConverter x:Key="OrderStatusConverter" />
 | 
				
			||||||
 | 
					        <convert:DrawerSelectConverter x:Key="DrawerSelectConverter" />
 | 
				
			||||||
 | 
					        <convert:BoxNumConverter x:Key="BoxNumConverter" />
 | 
				
			||||||
 | 
					        <convert:StatusConverter x:Key="StatusConverter" />
 | 
				
			||||||
 | 
					        <Style x:Key="st" TargetType="GridViewColumnHeader">
 | 
				
			||||||
 | 
					            <Style.Setters>
 | 
				
			||||||
 | 
					                <Setter Property="Height">
 | 
				
			||||||
 | 
					                    <Setter.Value>55</Setter.Value>
 | 
				
			||||||
 | 
					                </Setter>
 | 
				
			||||||
 | 
					                <Setter Property="Background">
 | 
				
			||||||
 | 
					                    <Setter.Value>#31ccec</Setter.Value>
 | 
				
			||||||
 | 
					                </Setter>
 | 
				
			||||||
 | 
					                <Setter Property="Foreground">
 | 
				
			||||||
 | 
					                    <Setter.Value>white</Setter.Value>
 | 
				
			||||||
 | 
					                </Setter>
 | 
				
			||||||
 | 
					            </Style.Setters>
 | 
				
			||||||
 | 
					        </Style>
 | 
				
			||||||
 | 
					    </UserControl.Resources>
 | 
				
			||||||
 | 
					    <Grid>
 | 
				
			||||||
 | 
					        <Grid.ColumnDefinitions>
 | 
				
			||||||
 | 
					            <ColumnDefinition Width="Auto"/>
 | 
				
			||||||
 | 
					            <ColumnDefinition Width="*"/>
 | 
				
			||||||
 | 
					        </Grid.ColumnDefinitions>
 | 
				
			||||||
 | 
					        <Grid  Margin="6" Grid.Column="0">
 | 
				
			||||||
 | 
					            <Grid.Resources>
 | 
				
			||||||
 | 
					                <Style TargetType="{x:Type Button}" BasedOn="{StaticResource MaterialDesignPaperLightButton}">
 | 
				
			||||||
 | 
					                    <Setter Property="Foreground" Value="#00a0ea" />
 | 
				
			||||||
 | 
					                    <Setter Property="BorderBrush" Value="#00a0ea" />
 | 
				
			||||||
 | 
					                    <Style.Triggers>
 | 
				
			||||||
 | 
					                        <Trigger Property="IsMouseOver" Value="True">
 | 
				
			||||||
 | 
					                            <Setter Property="Background" Value="#d1e7f5" />
 | 
				
			||||||
 | 
					                            <Setter Property="BorderBrush" Value="#d1e7f5" />
 | 
				
			||||||
 | 
					                        </Trigger>
 | 
				
			||||||
 | 
					                        <DataTrigger Value="True">
 | 
				
			||||||
 | 
					                            <DataTrigger.Binding>
 | 
				
			||||||
 | 
					                                <MultiBinding Converter="{StaticResource DrawerSelectConverter}">
 | 
				
			||||||
 | 
					                                    <Binding RelativeSource="{ RelativeSource Mode=Self }" Path="Content" />
 | 
				
			||||||
 | 
					                                    <Binding Path="DrawerNo" />
 | 
				
			||||||
 | 
					                                    <Binding Path="CurrentDrawerNo"/>
 | 
				
			||||||
 | 
					                                </MultiBinding>
 | 
				
			||||||
 | 
					                            </DataTrigger.Binding>
 | 
				
			||||||
 | 
					                            <Setter Property="Background" Value="#d1e7f5" />
 | 
				
			||||||
 | 
					                            <Setter Property="BorderBrush" Value="#d1e7f5" />
 | 
				
			||||||
 | 
					                        </DataTrigger>
 | 
				
			||||||
 | 
					                    </Style.Triggers>
 | 
				
			||||||
 | 
					                </Style>
 | 
				
			||||||
 | 
					            </Grid.Resources>
 | 
				
			||||||
 | 
					            <Grid.RowDefinitions>
 | 
				
			||||||
 | 
					                <RowDefinition />
 | 
				
			||||||
 | 
					                <RowDefinition />
 | 
				
			||||||
 | 
					                <RowDefinition />
 | 
				
			||||||
 | 
					                <RowDefinition />
 | 
				
			||||||
 | 
					                <RowDefinition />
 | 
				
			||||||
 | 
					                <RowDefinition />
 | 
				
			||||||
 | 
					                <RowDefinition />
 | 
				
			||||||
 | 
					                <RowDefinition />
 | 
				
			||||||
 | 
					                <RowDefinition />
 | 
				
			||||||
 | 
					                <!--<RowDefinition />-->
 | 
				
			||||||
 | 
					            </Grid.RowDefinitions>
 | 
				
			||||||
 | 
					            <Grid.ColumnDefinitions>
 | 
				
			||||||
 | 
					                <ColumnDefinition />
 | 
				
			||||||
 | 
					                <ColumnDefinition />
 | 
				
			||||||
 | 
					            </Grid.ColumnDefinitions>
 | 
				
			||||||
 | 
					            <Button Margin="0 0  3 0" Grid.Row="0" Grid.Column="0" Width="120" Content="一号手术间" Background="{Binding Button1Color}" Command="{Binding UpdateDrawerNo,ConverterParameter=1}" CommandParameter="1" IsEnabled="{Binding Button1Enable}"/>
 | 
				
			||||||
 | 
					            <Button Margin="0 0  3 0" Grid.Row="1" Grid.Column="0" Width="120" Content="二号手术间" Background="{Binding Button2Color}"  Command="{Binding UpdateDrawerNo}" CommandParameter="2" IsEnabled="{Binding Button2Enable}"/>
 | 
				
			||||||
 | 
					            <Button Margin="0 0  3 0" Grid.Row="2" Grid.Column="0" Width="120" Content="三号手术间"  Background="{Binding Button3Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="3" IsEnabled="{Binding Button3Enable}"/>
 | 
				
			||||||
 | 
					            <Button Margin="0 0  3 0" Grid.Row="3" Grid.Column="0" Width="120" Content="四号手术间"  Background="{Binding Button4Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="4" IsEnabled="{Binding Button4Enable}"/>
 | 
				
			||||||
 | 
					            <Button Margin="0 0  3 0" Grid.Row="4" Grid.Column="0" Width="120" Content="五号手术间"  Background="{Binding Button5Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="5" IsEnabled="{Binding Button5Enable}"/>
 | 
				
			||||||
 | 
					            <Button Margin="0 0  3 0" Grid.Row="5" Grid.Column="0" Width="120" Content="六号手术间"  Background="{Binding Button6Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="6" IsEnabled="{Binding Button6Enable}"/>
 | 
				
			||||||
 | 
					            <Button Margin="0 0  3 0" Grid.Row="6" Grid.Column="0" Width="120" Content="七号手术间"  Background="{Binding Button7Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="7" IsEnabled="{Binding Button7Enable}"/>
 | 
				
			||||||
 | 
					            <Button Margin="0 0  3 0" Grid.Row="7" Grid.Column="0" Width="120" Content="八号手术间"  Background="{Binding Button8Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="8" IsEnabled="{Binding Button8Enable}"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            <Button Margin="0 0  3 0" Grid.Row="8" Grid.Column="0" Width="120" Content="九号手术间"  Background="{Binding Button9Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="9"   IsEnabled="{Binding Button9Enable}"/>
 | 
				
			||||||
 | 
					            <Button Margin="0 0  3 0" Grid.Row="0" Grid.Column="1" Width="120" Content="十号手术间" Background="{Binding Button10Color}"  Command="{Binding UpdateDrawerNo}" CommandParameter="10" IsEnabled="{Binding Button10Enable}"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            <Button Grid.Row="1" Grid.Column="1" Width="120" Content="十一号手术间"  Background="{Binding Button11Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="11" IsEnabled="{Binding Button11Enable}"/>
 | 
				
			||||||
 | 
					            <Button Grid.Row="2" Grid.Column="1" Width="120" Content="十二号手术间"  Background="{Binding Button12Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="12" IsEnabled="{Binding Button12Enable}"/>
 | 
				
			||||||
 | 
					            <Button Grid.Row="3" Grid.Column="1" Width="120" Content="十三号手术间"  Background="{Binding Button13Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="13" IsEnabled="{Binding Button13Enable}"/>
 | 
				
			||||||
 | 
					            <Button Grid.Row="4" Grid.Column="1" Width="120" Content="十四号手术间"  Background="{Binding Button14Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="14" IsEnabled="{Binding Button14Enable}"/>
 | 
				
			||||||
 | 
					            <Button Grid.Row="5" Grid.Column="1" Width="120" Content="十五号手术间"  Background="{Binding Button15Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="15" IsEnabled="{Binding Button15Enable}"/>
 | 
				
			||||||
 | 
					            <Button Grid.Row="6" Grid.Column="1" Width="120" Content="十六号手术间"  Background="{Binding Button16Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="16" IsEnabled="{Binding Button16Enable}"/>
 | 
				
			||||||
 | 
					            <Button Grid.Row="7" Grid.Column="1" Width="120" Content="十七号手术间"  Background="{Binding Button17Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="17" IsEnabled="{Binding Button17Enable}"/>
 | 
				
			||||||
 | 
					            <Button Grid.Row="8" Grid.Column="1" Width="120" Content="十八号手术间"  Background="{Binding Button18Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="18" IsEnabled="{Binding Button18Enable}"/>
 | 
				
			||||||
 | 
					            <!--<Button Grid.Row="8" Grid.Column="1" Width="120" Content="19号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="19" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=19}"/>
 | 
				
			||||||
 | 
					           <Button Grid.Row="9" Grid.Column="1" Width="120" Content="20号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="20" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=20}"/>-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        </Grid>
 | 
				
			||||||
 | 
					        <Grid Grid.Column="1" Margin="6">
 | 
				
			||||||
 | 
					            <Grid.ColumnDefinitions>
 | 
				
			||||||
 | 
					                <ColumnDefinition Width="7*"/>
 | 
				
			||||||
 | 
					                <ColumnDefinition Width="3*"/>
 | 
				
			||||||
 | 
					            </Grid.ColumnDefinitions>
 | 
				
			||||||
 | 
					            <Grid.RowDefinitions>
 | 
				
			||||||
 | 
					                <RowDefinition Height="Auto"/>
 | 
				
			||||||
 | 
					                <RowDefinition Height="Auto"/>
 | 
				
			||||||
 | 
					                <RowDefinition Height="Auto"/>
 | 
				
			||||||
 | 
					            </Grid.RowDefinitions>
 | 
				
			||||||
 | 
					            <Grid Margin="0 6 0 6" Grid.Row="0" Grid.ColumnSpan="2">
 | 
				
			||||||
 | 
					                <Grid.ColumnDefinitions>
 | 
				
			||||||
 | 
					                    <ColumnDefinition Width="3*" />
 | 
				
			||||||
 | 
					                    <ColumnDefinition Width="3*" />
 | 
				
			||||||
 | 
					                    <ColumnDefinition Width="3*" />
 | 
				
			||||||
 | 
					                </Grid.ColumnDefinitions>
 | 
				
			||||||
 | 
					                <DatePicker
 | 
				
			||||||
 | 
					               Grid.Column="0"
 | 
				
			||||||
 | 
					               SelectedDate="{Binding OrderDate, StringFormat=yyyy-MM-dd, TargetNullValue='',UpdateSourceTrigger=PropertyChanged}"
 | 
				
			||||||
 | 
					               SelectedDateFormat="Short"
 | 
				
			||||||
 | 
					               Margin="6 0 0 0"
 | 
				
			||||||
 | 
					               materialDesign:HintAssist.Hint="开单日期"
 | 
				
			||||||
 | 
					               Style="{StaticResource MaterialDesignOutlinedDatePicker}" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                <StackPanel Grid.Column="1" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right">
 | 
				
			||||||
 | 
					                    <Button
 | 
				
			||||||
 | 
					                       Margin="0 0 6 0"
 | 
				
			||||||
 | 
					                       VerticalAlignment="Center" Command="{Binding CheckOrder}"
 | 
				
			||||||
 | 
					                       Content="确认"
 | 
				
			||||||
 | 
					                       Style="{StaticResource MaterialDesignOutlinedLightButton}">
 | 
				
			||||||
 | 
					                    </Button>
 | 
				
			||||||
 | 
					                    <Button
 | 
				
			||||||
 | 
					                           Margin="2"
 | 
				
			||||||
 | 
					                           Style="{StaticResource MaterialDesignOutlinedLightButton}"
 | 
				
			||||||
 | 
					                           Content="取消"
 | 
				
			||||||
 | 
					                           Command="{Binding CancleTake}" Cursor="Hand" />
 | 
				
			||||||
 | 
					                    <Button
 | 
				
			||||||
 | 
					                       Margin="0 0 6 0"
 | 
				
			||||||
 | 
					                       VerticalAlignment="Center"
 | 
				
			||||||
 | 
					                       Style="{StaticResource MaterialDesignOutlinedLightButton}"
 | 
				
			||||||
 | 
					                       ToolTip="刷新" Command="{Binding Query}">
 | 
				
			||||||
 | 
					                        <materialDesign:PackIcon Kind="Refresh" />
 | 
				
			||||||
 | 
					                    </Button>
 | 
				
			||||||
 | 
					                </StackPanel>
 | 
				
			||||||
 | 
					            </Grid>
 | 
				
			||||||
 | 
					            <!--<Grid Grid.Row="1" Grid.Column="0" Margin="0 0 -100 0">-->
 | 
				
			||||||
 | 
					            <ListView Grid.Row="1" Grid.Column="0"  Margin="0" 
 | 
				
			||||||
 | 
					           ItemsSource="{Binding SurgicalResidualList, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
 | 
				
			||||||
 | 
					           SelectedItem="{Binding surgicalResidual}"
 | 
				
			||||||
 | 
					           materialDesign:ListViewAssist.HeaderRowBackground="#31ccec"
 | 
				
			||||||
 | 
					           materialDesign:ListViewAssist.ListViewItemPadding="0 15 0 0">
 | 
				
			||||||
 | 
					                <ListView.Resources>
 | 
				
			||||||
 | 
					                    <Style TargetType="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource {x:Type GridViewColumnHeader}}">
 | 
				
			||||||
 | 
					                        <Setter Property="Foreground" Value="White" />
 | 
				
			||||||
 | 
					                    </Style>
 | 
				
			||||||
 | 
					                </ListView.Resources>
 | 
				
			||||||
 | 
					                <i:Interaction.Triggers>
 | 
				
			||||||
 | 
					                    <i:EventTrigger EventName="SelectionChanged">
 | 
				
			||||||
 | 
					                        <i:InvokeCommandAction Command="{Binding RowSelected}" />
 | 
				
			||||||
 | 
					                    </i:EventTrigger>
 | 
				
			||||||
 | 
					                </i:Interaction.Triggers>
 | 
				
			||||||
 | 
					                <ListView.View>
 | 
				
			||||||
 | 
					                    <GridView ColumnHeaderContainerStyle="{StaticResource st}">
 | 
				
			||||||
 | 
					                        <GridViewColumn Header="选择" Width="30">
 | 
				
			||||||
 | 
					                            <GridViewColumn.CellTemplate>
 | 
				
			||||||
 | 
					                                <DataTemplate>
 | 
				
			||||||
 | 
					                                    <CheckBox IsChecked="{Binding ItemIsChecked}" />
 | 
				
			||||||
 | 
					                                </DataTemplate>
 | 
				
			||||||
 | 
					                            </GridViewColumn.CellTemplate>
 | 
				
			||||||
 | 
					                        </GridViewColumn>
 | 
				
			||||||
 | 
					                        <GridViewColumn Width="80"
 | 
				
			||||||
 | 
					                       Header="姓名"
 | 
				
			||||||
 | 
					                       DisplayMemberBinding="{Binding PName}" />
 | 
				
			||||||
 | 
					                        <GridViewColumn Width="30"
 | 
				
			||||||
 | 
					                       DisplayMemberBinding="{Binding Sex}"
 | 
				
			||||||
 | 
					                       Header="性别"/>
 | 
				
			||||||
 | 
					                        <GridViewColumn  Width="150"
 | 
				
			||||||
 | 
					                       DisplayMemberBinding="{Binding OrderNo}"
 | 
				
			||||||
 | 
					                       Header="单号"/>
 | 
				
			||||||
 | 
					                        <GridViewColumn Width="180"
 | 
				
			||||||
 | 
					                       DisplayMemberBinding="{Binding DrugInfo.DrugName}"
 | 
				
			||||||
 | 
					                       Header="药品名称"/>
 | 
				
			||||||
 | 
					                        <GridViewColumn Width="130"
 | 
				
			||||||
 | 
					                       DisplayMemberBinding="{Binding  ManuNo}"
 | 
				
			||||||
 | 
					                       Header="药品批次"/>
 | 
				
			||||||
 | 
					                        <GridViewColumn Width="30"
 | 
				
			||||||
 | 
					                       DisplayMemberBinding="{Binding Quantity}"
 | 
				
			||||||
 | 
					                       Header="数量"/>
 | 
				
			||||||
 | 
					                        <GridViewColumn Width="80"
 | 
				
			||||||
 | 
					                       DisplayMemberBinding="{Binding UseDoseInfo}"
 | 
				
			||||||
 | 
					                       Header="使用量"/>
 | 
				
			||||||
 | 
					                        <GridViewColumn Width="80"
 | 
				
			||||||
 | 
					                       DisplayMemberBinding="{Binding ResidualDoseInfo}"
 | 
				
			||||||
 | 
					                       Header="剩余量"/>
 | 
				
			||||||
 | 
					                        <GridViewColumn Width="160"
 | 
				
			||||||
 | 
					                       DisplayMemberBinding="{Binding DisposalTime}"
 | 
				
			||||||
 | 
					                       Header="余液处置时间"/>
 | 
				
			||||||
 | 
					                    </GridView>
 | 
				
			||||||
 | 
					                </ListView.View>
 | 
				
			||||||
 | 
					            </ListView>
 | 
				
			||||||
 | 
					            <ListView Grid.Column="1" Grid.Row="1" Margin="0 0 3 0"
 | 
				
			||||||
 | 
					                         ItemsSource="{Binding TotalDrugList,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
 | 
				
			||||||
 | 
					                         materialDesign:ListViewAssist.HeaderRowBackground="#31ccec"
 | 
				
			||||||
 | 
					                         materialDesign:ListViewAssist.ListViewItemPadding="0 16 0 15">
 | 
				
			||||||
 | 
					                <ListView.Resources>
 | 
				
			||||||
 | 
					                    <Style TargetType="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource {x:Type GridViewColumnHeader}}">
 | 
				
			||||||
 | 
					                        <Setter Property="Foreground" Value="White" />
 | 
				
			||||||
 | 
					                    </Style>
 | 
				
			||||||
 | 
					                </ListView.Resources>
 | 
				
			||||||
 | 
					                <ListView.View>
 | 
				
			||||||
 | 
					                    <GridView ColumnHeaderContainerStyle="{StaticResource st}">
 | 
				
			||||||
 | 
					                        <GridViewColumn Width="180"
 | 
				
			||||||
 | 
					                               DisplayMemberBinding="{Binding DrugName}"
 | 
				
			||||||
 | 
					                               Header="药品名称"/>
 | 
				
			||||||
 | 
					                        <GridViewColumn Width="40"
 | 
				
			||||||
 | 
					                               DisplayMemberBinding="{Binding TotalCount}"
 | 
				
			||||||
 | 
					                               Header="合计"/>
 | 
				
			||||||
 | 
					                    </GridView>
 | 
				
			||||||
 | 
					                </ListView.View>
 | 
				
			||||||
 | 
					            </ListView>
 | 
				
			||||||
 | 
					            <!--</Grid>-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            <pagination:Pagination Grid.Row="2"  Grid.ColumnSpan="2"
 | 
				
			||||||
 | 
					                                  CurrentPage="{Binding PageNum}"
 | 
				
			||||||
 | 
					                                  PageSize="{Binding PageSize}"
 | 
				
			||||||
 | 
					                                  TotalPages="{Binding TotalCount}"
 | 
				
			||||||
 | 
					                                  InfoTextIsEnabel="True"
 | 
				
			||||||
 | 
					                               />
 | 
				
			||||||
 | 
					        </Grid>
 | 
				
			||||||
 | 
					    </Grid>
 | 
				
			||||||
 | 
					</UserControl>
 | 
				
			||||||
| 
						 | 
					@ -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
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /// <summary>
 | 
				
			||||||
 | 
					    /// CheckSelfOrderForAdmin.xaml 的交互逻辑
 | 
				
			||||||
 | 
					    /// </summary>
 | 
				
			||||||
 | 
					    public partial class CheckSelfOrderForAdmin : UserControl
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public CheckSelfOrderForAdmin()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            InitializeComponent();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -15,7 +15,7 @@
 | 
				
			||||||
        <convert:OrderStatusConverter x:Key="OrderStatusConverter" />
 | 
					        <convert:OrderStatusConverter x:Key="OrderStatusConverter" />
 | 
				
			||||||
        <convert:DrawerSelectConverter x:Key="DrawerSelectConverter" />
 | 
					        <convert:DrawerSelectConverter x:Key="DrawerSelectConverter" />
 | 
				
			||||||
        <convert:BoxNumConverter x:Key="BoxNumConverter" />
 | 
					        <convert:BoxNumConverter x:Key="BoxNumConverter" />
 | 
				
			||||||
        <convert:StatusConverter x:Key="StatusConverter" />
 | 
					        <convert:TakeReturnConverter x:Key="TakeReturnConverter" />
 | 
				
			||||||
        <Style x:Key="st" TargetType="GridViewColumnHeader">
 | 
					        <Style x:Key="st" TargetType="GridViewColumnHeader">
 | 
				
			||||||
            <Style.Setters>
 | 
					            <Style.Setters>
 | 
				
			||||||
                <Setter Property="Height">
 | 
					                <Setter Property="Height">
 | 
				
			||||||
| 
						 | 
					@ -115,7 +115,7 @@
 | 
				
			||||||
                    <ColumnDefinition Width="3*" />
 | 
					                    <ColumnDefinition Width="3*" />
 | 
				
			||||||
                    <ColumnDefinition Width="3*" />
 | 
					                    <ColumnDefinition Width="3*" />
 | 
				
			||||||
                </Grid.ColumnDefinitions>
 | 
					                </Grid.ColumnDefinitions>
 | 
				
			||||||
                <DatePicker
 | 
					                <DatePicker Visibility="{Binding OperationType,Converter={StaticResource TakeReturnConverter},ConverterParameter=TakeBox}" 
 | 
				
			||||||
                Grid.Column="0"
 | 
					                Grid.Column="0"
 | 
				
			||||||
                SelectedDate="{Binding OrderDate, StringFormat=yyyy-MM-dd, TargetNullValue='',UpdateSourceTrigger=PropertyChanged}"
 | 
					                SelectedDate="{Binding OrderDate, StringFormat=yyyy-MM-dd, TargetNullValue='',UpdateSourceTrigger=PropertyChanged}"
 | 
				
			||||||
                SelectedDateFormat="Short"
 | 
					                SelectedDateFormat="Short"
 | 
				
			||||||
| 
						 | 
					@ -130,19 +130,20 @@
 | 
				
			||||||
                    materialDesign:ButtonProgressAssist.IsIndicatorVisible="{Binding SelfStatus, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
 | 
					                    materialDesign:ButtonProgressAssist.IsIndicatorVisible="{Binding SelfStatus, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
 | 
				
			||||||
                    materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding SelfStatus, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
 | 
					                    materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding SelfStatus, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
 | 
				
			||||||
                    Style="{StaticResource MaterialDesignOutlinedLightButton}"/>-->
 | 
					                    Style="{StaticResource MaterialDesignOutlinedLightButton}"/>-->
 | 
				
			||||||
 | 
					                    <Button Margin="0 0 6 0" VerticalAlignment="Center" Command="{Binding TakeBoxCommand}" Content="取药箱" Visibility="{Binding OperationType,Converter={StaticResource TakeReturnConverter},ConverterParameter=TakeBox}" Style="{StaticResource MaterialDesignOutlinedLightButton}"></Button>
 | 
				
			||||||
                    <Button
 | 
					                    <Button Margin="0 0 6 0" VerticalAlignment="Center" Command="{Binding ReturnBoxCommand}" Content="还药箱" Visibility="{Binding OperationType,Converter={StaticResource TakeReturnConverter},ConverterParameter=ReturnBox}"  Style="{StaticResource MaterialDesignOutlinedLightButton}"> </Button>
 | 
				
			||||||
 | 
					                    <Button  Visibility="{Binding OperationType,Converter={StaticResource TakeReturnConverter},ConverterParameter=TakeBox}" 
 | 
				
			||||||
                        Margin="0 0 6 0"
 | 
					                        Margin="0 0 6 0"
 | 
				
			||||||
                        VerticalAlignment="Center" Command="{Binding CheckOrder}"
 | 
					                        VerticalAlignment="Center" Command="{Binding CheckOrder}"
 | 
				
			||||||
                        Content="确认"
 | 
					                        Content="确认"
 | 
				
			||||||
                        Style="{StaticResource MaterialDesignOutlinedLightButton}">
 | 
					                        Style="{StaticResource MaterialDesignOutlinedLightButton}">
 | 
				
			||||||
                    </Button>
 | 
					                    </Button>
 | 
				
			||||||
                    <Button
 | 
					                    <Button  Visibility="{Binding OperationType,Converter={StaticResource TakeReturnConverter},ConverterParameter=TakeBox}" 
 | 
				
			||||||
                            Margin="2"
 | 
					                            Margin="2"
 | 
				
			||||||
                            Style="{StaticResource MaterialDesignOutlinedLightButton}"
 | 
					                            Style="{StaticResource MaterialDesignOutlinedLightButton}"
 | 
				
			||||||
                            Content="取消"
 | 
					                            Content="取消"
 | 
				
			||||||
                            Command="{Binding CancleTake}" Cursor="Hand" />
 | 
					                            Command="{Binding CancleTake}" Cursor="Hand" />
 | 
				
			||||||
                    <Button
 | 
					                    <Button  Visibility="{Binding OperationType,Converter={StaticResource TakeReturnConverter},ConverterParameter=TakeBox}" 
 | 
				
			||||||
                        Margin="0 0 6 0"
 | 
					                        Margin="0 0 6 0"
 | 
				
			||||||
                        VerticalAlignment="Center"
 | 
					                        VerticalAlignment="Center"
 | 
				
			||||||
                        Style="{StaticResource MaterialDesignOutlinedLightButton}"
 | 
					                        Style="{StaticResource MaterialDesignOutlinedLightButton}"
 | 
				
			||||||
| 
						 | 
					@ -152,7 +153,7 @@
 | 
				
			||||||
                </StackPanel>
 | 
					                </StackPanel>
 | 
				
			||||||
            </Grid>
 | 
					            </Grid>
 | 
				
			||||||
            <!--<Grid Grid.Row="1" Grid.Column="0" Margin="0 0 -100 0">-->
 | 
					            <!--<Grid Grid.Row="1" Grid.Column="0" Margin="0 0 -100 0">-->
 | 
				
			||||||
            <ListView Grid.Row="1" Grid.Column="0"  Margin="0" 
 | 
					            <ListView Grid.Row="1" Grid.Column="0"  Margin="0" Visibility="{Binding OperationType,Converter={StaticResource TakeReturnConverter},ConverterParameter=TakeBox}" 
 | 
				
			||||||
            ItemsSource="{Binding OrderInfoList, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
 | 
					            ItemsSource="{Binding OrderInfoList, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
 | 
				
			||||||
            SelectedItem="{Binding selectOrderInfo}"
 | 
					            SelectedItem="{Binding selectOrderInfo}"
 | 
				
			||||||
            materialDesign:ListViewAssist.HeaderRowBackground="#31ccec"
 | 
					            materialDesign:ListViewAssist.HeaderRowBackground="#31ccec"
 | 
				
			||||||
| 
						 | 
					@ -273,7 +274,7 @@
 | 
				
			||||||
            </ListView>
 | 
					            </ListView>
 | 
				
			||||||
            <!--</Grid>-->
 | 
					            <!--</Grid>-->
 | 
				
			||||||
            <!--<Grid Grid.Column="1" Grid.Row="1" Margin="0 0 0 0" HorizontalAlignment="Right">-->
 | 
					            <!--<Grid Grid.Column="1" Grid.Row="1" Margin="0 0 0 0" HorizontalAlignment="Right">-->
 | 
				
			||||||
            <ListView Grid.Column="1" Grid.Row="1" Margin="0 0 3 0"
 | 
					            <ListView Grid.Column="1" Grid.Row="1" Margin="0 0 3 0" Visibility="{Binding OperationType,Converter={StaticResource TakeReturnConverter},ConverterParameter=TakeBox}" 
 | 
				
			||||||
                          ItemsSource="{Binding TotalDrugList,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
 | 
					                          ItemsSource="{Binding TotalDrugList,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
 | 
				
			||||||
                          materialDesign:ListViewAssist.HeaderRowBackground="#31ccec"
 | 
					                          materialDesign:ListViewAssist.HeaderRowBackground="#31ccec"
 | 
				
			||||||
                          materialDesign:ListViewAssist.ListViewItemPadding="0 16 0 15">
 | 
					                          materialDesign:ListViewAssist.ListViewItemPadding="0 16 0 15">
 | 
				
			||||||
| 
						 | 
					@ -295,7 +296,7 @@
 | 
				
			||||||
            </ListView>
 | 
					            </ListView>
 | 
				
			||||||
            <!--</Grid>-->
 | 
					            <!--</Grid>-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <pagination:Pagination Grid.Row="2"  Grid.ColumnSpan="2"
 | 
					            <pagination:Pagination Grid.Row="2"  Grid.ColumnSpan="2" Visibility="{Binding OperationType,Converter={StaticResource TakeReturnConverter},ConverterParameter=TakeBox}" 
 | 
				
			||||||
                                   CurrentPage="{Binding PageNum}"
 | 
					                                   CurrentPage="{Binding PageNum}"
 | 
				
			||||||
                                   PageSize="{Binding PageSize}"
 | 
					                                   PageSize="{Binding PageSize}"
 | 
				
			||||||
                                   TotalPages="{Binding TotalCount}"
 | 
					                                   TotalPages="{Binding TotalCount}"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,40 @@
 | 
				
			||||||
 | 
					<UserControl x:Class="DM_Weight.Views.Dialog.SelectOperationTypeDialog"
 | 
				
			||||||
 | 
					             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 | 
				
			||||||
 | 
					             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 | 
				
			||||||
 | 
					             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
 | 
				
			||||||
 | 
					             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
 | 
				
			||||||
 | 
					             xmlns:local="clr-namespace:DM_Weight.Views.Dialog"
 | 
				
			||||||
 | 
					             xmlns:prism="http://prismlibrary.com/"
 | 
				
			||||||
 | 
					             prism:ViewModelLocator.AutoWireViewModel="True"
 | 
				
			||||||
 | 
					             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
 | 
				
			||||||
 | 
					             xmlns:convert="clr-namespace:DM_Weight.Converter"
 | 
				
			||||||
 | 
					             mc:Ignorable="d" MinHeight="615" MinWidth="880"
 | 
				
			||||||
 | 
					             Width="Auto"
 | 
				
			||||||
 | 
					             Height="Auto">
 | 
				
			||||||
 | 
					    <materialDesign:Card Padding="0">
 | 
				
			||||||
 | 
					        <Grid>
 | 
				
			||||||
 | 
					            <Grid.RowDefinitions>
 | 
				
			||||||
 | 
					                <RowDefinition Height="Auto" />
 | 
				
			||||||
 | 
					                <RowDefinition Height="200" />
 | 
				
			||||||
 | 
					                <RowDefinition Height="Auto" />
 | 
				
			||||||
 | 
					                <RowDefinition Height="200" />
 | 
				
			||||||
 | 
					            </Grid.RowDefinitions>
 | 
				
			||||||
 | 
					            <Grid.ColumnDefinitions>
 | 
				
			||||||
 | 
					                <ColumnDefinition Width="5*" />
 | 
				
			||||||
 | 
					                <ColumnDefinition Width="5*" />
 | 
				
			||||||
 | 
					            </Grid.ColumnDefinitions>
 | 
				
			||||||
 | 
					            <Grid Background="#03a9f4" Grid.Row="0" Grid.ColumnSpan="2">
 | 
				
			||||||
 | 
					                <TextBlock VerticalAlignment="Center" Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}" Margin="16 4 16 4" Style="{StaticResource MaterialDesignHeadline5TextBlock}" Text="{Binding Title}" />
 | 
				
			||||||
 | 
					               
 | 
				
			||||||
 | 
					            </Grid>
 | 
				
			||||||
 | 
					            <Grid Grid.Row="1" Margin="0 4 0 4">
 | 
				
			||||||
 | 
					                <!--<TextBlock VerticalAlignment="Center" FontSize="14" FontFamily="YouYuan" FontWeight="Bold" Margin="16 4 16 4" Style="{StaticResource MaterialDesignHeadline5TextBlock}" Text="{Binding ConfirmInfo,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />-->
 | 
				
			||||||
 | 
					            </Grid>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            <!--<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center">-->
 | 
				
			||||||
 | 
					                <Button  Grid.Row="2"  Grid.Column="0" Content="取药箱"  Command="{Binding ConfirmCommand}"  Width="130px" Height="50px" Style="{StaticResource MaterialDesignRaisedAccentButton}"/>
 | 
				
			||||||
 | 
					            <Button  Grid.Row="2"  Grid.Column="1"  Content="还药箱"  Command="{Binding CancelCommand}"  Width="130px" Height="50px"  Style="{StaticResource MaterialDesignRaisedAccentButton}" Background="Orange" BorderBrush="Orange"/>
 | 
				
			||||||
 | 
					            <!--</StackPanel>-->
 | 
				
			||||||
 | 
					        </Grid>
 | 
				
			||||||
 | 
					    </materialDesign:Card>
 | 
				
			||||||
 | 
					</UserControl>
 | 
				
			||||||
| 
						 | 
					@ -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
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /// <summary>
 | 
				
			||||||
 | 
					    /// SelectOperationTypeDialog.xaml 的交互逻辑
 | 
				
			||||||
 | 
					    /// </summary>
 | 
				
			||||||
 | 
					    public partial class SelectOperationTypeDialog : UserControl
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public SelectOperationTypeDialog()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            InitializeComponent();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -87,7 +87,7 @@
 | 
				
			||||||
                    <GridViewColumn  Width="100"
 | 
					                    <GridViewColumn  Width="100"
 | 
				
			||||||
                        DisplayMemberBinding="{Binding DrawerNo}"
 | 
					                        DisplayMemberBinding="{Binding DrawerNo}"
 | 
				
			||||||
                        Header="手术间药箱号"/>
 | 
					                        Header="手术间药箱号"/>
 | 
				
			||||||
                    <GridViewColumn  Width="180"
 | 
					                    <GridViewColumn  Width="580"
 | 
				
			||||||
                        DisplayMemberBinding="{Binding InvoiceId}"
 | 
					                        DisplayMemberBinding="{Binding InvoiceId}"
 | 
				
			||||||
                        Header="操作内容"/>
 | 
					                        Header="操作内容"/>
 | 
				
			||||||
                </GridView>
 | 
					                </GridView>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue